index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/File.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.time.OffsetDateTime; 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) @JsonDeserialize(builder = File.Builder.class) public final class File { private final String object; private final String id; private final String name; private final Optional<FileType> type; private final Optional<String> presignedUrl; private final Optional<String> parentFileId; private final Optional<FileContents> contents; private final FileMetadata metadata; private final OffsetDateTime createdAt; private final OffsetDateTime updatedAt; private final Map<String, Object> additionalProperties; private File( String object, String id, String name, Optional<FileType> type, Optional<String> presignedUrl, Optional<String> parentFileId, Optional<FileContents> contents, FileMetadata metadata, OffsetDateTime createdAt, OffsetDateTime updatedAt, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.name = name; this.type = type; this.presignedUrl = presignedUrl; this.parentFileId = parentFileId; this.contents = contents; this.metadata = metadata; this.createdAt = createdAt; this.updatedAt = updatedAt; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be &quot;file&quot;. */ @JsonProperty("object") public String getObject() { return object; } /** * @return Extend's internal ID for the file. It will always start with <code>&quot;file_&quot;</code>. * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The name of the file * <p>Example: <code>&quot;Invoices.pdf&quot;</code></p> */ @JsonProperty("name") public String getName() { return name; } /** * @return The type of the file */ @JsonProperty("type") public Optional<FileType> getType() { return type; } /** * @return A presigned URL to download the file. Expires after 15 minutes. */ @JsonProperty("presignedUrl") public Optional<String> getPresignedUrl() { return presignedUrl; } /** * @return The ID of the parent file. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow. */ @JsonProperty("parentFileId") public Optional<String> getParentFileId() { return parentFileId; } @JsonProperty("contents") public Optional<FileContents> getContents() { return contents; } @JsonProperty("metadata") public FileMetadata getMetadata() { return metadata; } /** * @return The time (in UTC) at which the file was created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } /** * @return The time (in UTC) at which the file was last updated. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("updatedAt") public OffsetDateTime getUpdatedAt() { return updatedAt; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof File && equalTo((File) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(File other) { return object.equals(other.object) && id.equals(other.id) && name.equals(other.name) && type.equals(other.type) && presignedUrl.equals(other.presignedUrl) && parentFileId.equals(other.parentFileId) && contents.equals(other.contents) && metadata.equals(other.metadata) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt); } @java.lang.Override public int hashCode() { return Objects.hash( this.object, this.id, this.name, this.type, this.presignedUrl, this.parentFileId, this.contents, this.metadata, this.createdAt, this.updatedAt); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be &quot;file&quot;.</p> */ IdStage object(@NotNull String object); Builder from(File other); } public interface IdStage { /** * <p>Extend's internal ID for the file. It will always start with <code>&quot;file_&quot;</code>.</p> * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ NameStage id(@NotNull String id); } public interface NameStage { /** * <p>The name of the file</p> * <p>Example: <code>&quot;Invoices.pdf&quot;</code></p> */ MetadataStage name(@NotNull String name); } public interface MetadataStage { CreatedAtStage metadata(@NotNull FileMetadata metadata); } public interface CreatedAtStage { /** * <p>The time (in UTC) at which the file was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); } public interface UpdatedAtStage { /** * <p>The time (in UTC) at which the file was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); } public interface _FinalStage { File build(); /** * <p>The type of the file</p> */ _FinalStage type(Optional<FileType> type); _FinalStage type(FileType type); /** * <p>A presigned URL to download the file. Expires after 15 minutes.</p> */ _FinalStage presignedUrl(Optional<String> presignedUrl); _FinalStage presignedUrl(String presignedUrl); /** * <p>The ID of the parent file. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.</p> */ _FinalStage parentFileId(Optional<String> parentFileId); _FinalStage parentFileId(String parentFileId); _FinalStage contents(Optional<FileContents> contents); _FinalStage contents(FileContents contents); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, NameStage, MetadataStage, CreatedAtStage, UpdatedAtStage, _FinalStage { private String object; private String id; private String name; private FileMetadata metadata; private OffsetDateTime createdAt; private OffsetDateTime updatedAt; private Optional<FileContents> contents = Optional.empty(); private Optional<String> parentFileId = Optional.empty(); private Optional<String> presignedUrl = Optional.empty(); private Optional<FileType> type = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(File other) { object(other.getObject()); id(other.getId()); name(other.getName()); type(other.getType()); presignedUrl(other.getPresignedUrl()); parentFileId(other.getParentFileId()); contents(other.getContents()); metadata(other.getMetadata()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); return this; } /** * <p>The type of response. In this case, it will always be &quot;file&quot;.</p> * <p>The type of response. In this case, it will always be &quot;file&quot;.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>Extend's internal ID for the file. It will always start with <code>&quot;file_&quot;</code>.</p> * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * <p>Extend's internal ID for the file. It will always start with <code>&quot;file_&quot;</code>.</p> * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The name of the file</p> * <p>Example: <code>&quot;Invoices.pdf&quot;</code></p> * <p>The name of the file</p> * <p>Example: <code>&quot;Invoices.pdf&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public MetadataStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } @java.lang.Override @JsonSetter("metadata") public CreatedAtStage metadata(@NotNull FileMetadata metadata) { this.metadata = Objects.requireNonNull(metadata, "metadata must not be null"); return this; } /** * <p>The time (in UTC) at which the file was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * <p>The time (in UTC) at which the file was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("createdAt") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } /** * <p>The time (in UTC) at which the file was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * <p>The time (in UTC) at which the file was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("updatedAt") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } @java.lang.Override public _FinalStage contents(FileContents contents) { this.contents = Optional.ofNullable(contents); return this; } @java.lang.Override @JsonSetter(value = "contents", nulls = Nulls.SKIP) public _FinalStage contents(Optional<FileContents> contents) { this.contents = contents; return this; } /** * <p>The ID of the parent file. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage parentFileId(String parentFileId) { this.parentFileId = Optional.ofNullable(parentFileId); return this; } /** * <p>The ID of the parent file. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.</p> */ @java.lang.Override @JsonSetter(value = "parentFileId", nulls = Nulls.SKIP) public _FinalStage parentFileId(Optional<String> parentFileId) { this.parentFileId = parentFileId; return this; } /** * <p>A presigned URL to download the file. Expires after 15 minutes.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage presignedUrl(String presignedUrl) { this.presignedUrl = Optional.ofNullable(presignedUrl); return this; } /** * <p>A presigned URL to download the file. Expires after 15 minutes.</p> */ @java.lang.Override @JsonSetter(value = "presignedUrl", nulls = Nulls.SKIP) public _FinalStage presignedUrl(Optional<String> presignedUrl) { this.presignedUrl = presignedUrl; return this; } /** * <p>The type of the file</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage type(FileType type) { this.type = Optional.ofNullable(type); return this; } /** * <p>The type of the file</p> */ @java.lang.Override @JsonSetter(value = "type", nulls = Nulls.SKIP) public _FinalStage type(Optional<FileType> type) { this.type = type; return this; } @java.lang.Override public File build() { return new File( object, id, name, type, presignedUrl, parentFileId, contents, metadata, createdAt, updatedAt, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileContents.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = FileContents.Builder.class) public final class FileContents { private final Optional<String> rawText; private final Optional<String> markdown; private final Optional<List<FileContentsPagesItem>> pages; private final Optional<List<FileContentsSheetsItem>> sheets; private final Map<String, Object> additionalProperties; private FileContents( Optional<String> rawText, Optional<String> markdown, Optional<List<FileContentsPagesItem>> pages, Optional<List<FileContentsSheetsItem>> sheets, Map<String, Object> additionalProperties) { this.rawText = rawText; this.markdown = markdown; this.pages = pages; this.sheets = sheets; this.additionalProperties = additionalProperties; } /** * @return The raw text content of the file. This is included for all file types if the <code>rawText</code> query parameter is set to true in the endpoint request. */ @JsonProperty("rawText") public Optional<String> getRawText() { return rawText; } /** * @return Cleaned and structured markdown content of the entire file. Available for PDF and IMG file types. Only included if the <code>markdown</code> query parameter is set to true in the endpoint request. */ @JsonProperty("markdown") public Optional<String> getMarkdown() { return markdown; } @JsonProperty("pages") public Optional<List<FileContentsPagesItem>> getPages() { return pages; } @JsonProperty("sheets") public Optional<List<FileContentsSheetsItem>> getSheets() { return sheets; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FileContents && equalTo((FileContents) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(FileContents other) { return rawText.equals(other.rawText) && markdown.equals(other.markdown) && pages.equals(other.pages) && sheets.equals(other.sheets); } @java.lang.Override public int hashCode() { return Objects.hash(this.rawText, this.markdown, this.pages, this.sheets); } @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<String> rawText = Optional.empty(); private Optional<String> markdown = Optional.empty(); private Optional<List<FileContentsPagesItem>> pages = Optional.empty(); private Optional<List<FileContentsSheetsItem>> sheets = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(FileContents other) { rawText(other.getRawText()); markdown(other.getMarkdown()); pages(other.getPages()); sheets(other.getSheets()); return this; } /** * <p>The raw text content of the file. This is included for all file types if the <code>rawText</code> query parameter is set to true in the endpoint request.</p> */ @JsonSetter(value = "rawText", nulls = Nulls.SKIP) public Builder rawText(Optional<String> rawText) { this.rawText = rawText; return this; } public Builder rawText(String rawText) { this.rawText = Optional.ofNullable(rawText); return this; } /** * <p>Cleaned and structured markdown content of the entire file. Available for PDF and IMG file types. Only included if the <code>markdown</code> query parameter is set to true in the endpoint request.</p> */ @JsonSetter(value = "markdown", nulls = Nulls.SKIP) public Builder markdown(Optional<String> markdown) { this.markdown = markdown; return this; } public Builder markdown(String markdown) { this.markdown = Optional.ofNullable(markdown); return this; } @JsonSetter(value = "pages", nulls = Nulls.SKIP) public Builder pages(Optional<List<FileContentsPagesItem>> pages) { this.pages = pages; return this; } public Builder pages(List<FileContentsPagesItem> pages) { this.pages = Optional.ofNullable(pages); return this; } @JsonSetter(value = "sheets", nulls = Nulls.SKIP) public Builder sheets(Optional<List<FileContentsSheetsItem>> sheets) { this.sheets = sheets; return this; } public Builder sheets(List<FileContentsSheetsItem> sheets) { this.sheets = Optional.ofNullable(sheets); return this; } public FileContents build() { return new FileContents(rawText, markdown, pages, sheets, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileContentsPagesItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = FileContentsPagesItem.Builder.class) public final class FileContentsPagesItem { private final int pageNumber; private final Optional<Double> pageHeight; private final Optional<Double> pageWidth; private final Optional<String> rawText; private final Optional<String> markdown; private final Optional<String> html; private final Map<String, Object> additionalProperties; private FileContentsPagesItem( int pageNumber, Optional<Double> pageHeight, Optional<Double> pageWidth, Optional<String> rawText, Optional<String> markdown, Optional<String> html, Map<String, Object> additionalProperties) { this.pageNumber = pageNumber; this.pageHeight = pageHeight; this.pageWidth = pageWidth; this.rawText = rawText; this.markdown = markdown; this.html = html; this.additionalProperties = additionalProperties; } /** * @return The page number of this page in the document. */ @JsonProperty("pageNumber") public int getPageNumber() { return pageNumber; } @JsonProperty("pageHeight") public Optional<Double> getPageHeight() { return pageHeight; } @JsonProperty("pageWidth") public Optional<Double> getPageWidth() { return pageWidth; } /** * @return The raw text content extracted from this page. */ @JsonProperty("rawText") public Optional<String> getRawText() { return rawText; } /** * @return Cleaned and structured markdown content of this page. */ @JsonProperty("markdown") public Optional<String> getMarkdown() { return markdown; } /** * @return Cleaned and structured html content of the page. Available for DOCX file types (that were not auto-converted to PDFs). Only included if the <code>html</code> query parameter is set to true in the endpoint request. */ @JsonProperty("html") public Optional<String> getHtml() { return html; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FileContentsPagesItem && equalTo((FileContentsPagesItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(FileContentsPagesItem other) { return pageNumber == other.pageNumber && pageHeight.equals(other.pageHeight) && pageWidth.equals(other.pageWidth) && rawText.equals(other.rawText) && markdown.equals(other.markdown) && html.equals(other.html); } @java.lang.Override public int hashCode() { return Objects.hash(this.pageNumber, this.pageHeight, this.pageWidth, this.rawText, this.markdown, this.html); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static PageNumberStage builder() { return new Builder(); } public interface PageNumberStage { /** * <p>The page number of this page in the document.</p> */ _FinalStage pageNumber(int pageNumber); Builder from(FileContentsPagesItem other); } public interface _FinalStage { FileContentsPagesItem build(); _FinalStage pageHeight(Optional<Double> pageHeight); _FinalStage pageHeight(Double pageHeight); _FinalStage pageWidth(Optional<Double> pageWidth); _FinalStage pageWidth(Double pageWidth); /** * <p>The raw text content extracted from this page.</p> */ _FinalStage rawText(Optional<String> rawText); _FinalStage rawText(String rawText); /** * <p>Cleaned and structured markdown content of this page.</p> */ _FinalStage markdown(Optional<String> markdown); _FinalStage markdown(String markdown); /** * <p>Cleaned and structured html content of the page. Available for DOCX file types (that were not auto-converted to PDFs). Only included if the <code>html</code> query parameter is set to true in the endpoint request.</p> */ _FinalStage html(Optional<String> html); _FinalStage html(String html); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements PageNumberStage, _FinalStage { private int pageNumber; private Optional<String> html = Optional.empty(); private Optional<String> markdown = Optional.empty(); private Optional<String> rawText = Optional.empty(); private Optional<Double> pageWidth = Optional.empty(); private Optional<Double> pageHeight = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(FileContentsPagesItem other) { pageNumber(other.getPageNumber()); pageHeight(other.getPageHeight()); pageWidth(other.getPageWidth()); rawText(other.getRawText()); markdown(other.getMarkdown()); html(other.getHtml()); return this; } /** * <p>The page number of this page in the document.</p> * <p>The page number of this page in the document.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("pageNumber") public _FinalStage pageNumber(int pageNumber) { this.pageNumber = pageNumber; return this; } /** * <p>Cleaned and structured html content of the page. Available for DOCX file types (that were not auto-converted to PDFs). Only included if the <code>html</code> query parameter is set to true in the endpoint request.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage html(String html) { this.html = Optional.ofNullable(html); return this; } /** * <p>Cleaned and structured html content of the page. Available for DOCX file types (that were not auto-converted to PDFs). Only included if the <code>html</code> query parameter is set to true in the endpoint request.</p> */ @java.lang.Override @JsonSetter(value = "html", nulls = Nulls.SKIP) public _FinalStage html(Optional<String> html) { this.html = html; return this; } /** * <p>Cleaned and structured markdown content of this page.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage markdown(String markdown) { this.markdown = Optional.ofNullable(markdown); return this; } /** * <p>Cleaned and structured markdown content of this page.</p> */ @java.lang.Override @JsonSetter(value = "markdown", nulls = Nulls.SKIP) public _FinalStage markdown(Optional<String> markdown) { this.markdown = markdown; return this; } /** * <p>The raw text content extracted from this page.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage rawText(String rawText) { this.rawText = Optional.ofNullable(rawText); return this; } /** * <p>The raw text content extracted from this page.</p> */ @java.lang.Override @JsonSetter(value = "rawText", nulls = Nulls.SKIP) public _FinalStage rawText(Optional<String> rawText) { this.rawText = rawText; return this; } @java.lang.Override public _FinalStage pageWidth(Double pageWidth) { this.pageWidth = Optional.ofNullable(pageWidth); return this; } @java.lang.Override @JsonSetter(value = "pageWidth", nulls = Nulls.SKIP) public _FinalStage pageWidth(Optional<Double> pageWidth) { this.pageWidth = pageWidth; return this; } @java.lang.Override public _FinalStage pageHeight(Double pageHeight) { this.pageHeight = Optional.ofNullable(pageHeight); return this; } @java.lang.Override @JsonSetter(value = "pageHeight", nulls = Nulls.SKIP) public _FinalStage pageHeight(Optional<Double> pageHeight) { this.pageHeight = pageHeight; return this; } @java.lang.Override public FileContentsPagesItem build() { return new FileContentsPagesItem( pageNumber, pageHeight, pageWidth, rawText, markdown, html, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileContentsSheetsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = FileContentsSheetsItem.Builder.class) public final class FileContentsSheetsItem { private final String sheetName; private final Optional<String> rawText; private final Map<String, Object> additionalProperties; private FileContentsSheetsItem( String sheetName, Optional<String> rawText, Map<String, Object> additionalProperties) { this.sheetName = sheetName; this.rawText = rawText; this.additionalProperties = additionalProperties; } /** * @return The name of the sheet. */ @JsonProperty("sheetName") public String getSheetName() { return sheetName; } /** * @return The raw text content of the sheet. */ @JsonProperty("rawText") public Optional<String> getRawText() { return rawText; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FileContentsSheetsItem && equalTo((FileContentsSheetsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(FileContentsSheetsItem other) { return sheetName.equals(other.sheetName) && rawText.equals(other.rawText); } @java.lang.Override public int hashCode() { return Objects.hash(this.sheetName, this.rawText); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static SheetNameStage builder() { return new Builder(); } public interface SheetNameStage { /** * <p>The name of the sheet.</p> */ _FinalStage sheetName(@NotNull String sheetName); Builder from(FileContentsSheetsItem other); } public interface _FinalStage { FileContentsSheetsItem build(); /** * <p>The raw text content of the sheet.</p> */ _FinalStage rawText(Optional<String> rawText); _FinalStage rawText(String rawText); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements SheetNameStage, _FinalStage { private String sheetName; private Optional<String> rawText = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(FileContentsSheetsItem other) { sheetName(other.getSheetName()); rawText(other.getRawText()); return this; } /** * <p>The name of the sheet.</p> * <p>The name of the sheet.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("sheetName") public _FinalStage sheetName(@NotNull String sheetName) { this.sheetName = Objects.requireNonNull(sheetName, "sheetName must not be null"); return this; } /** * <p>The raw text content of the sheet.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage rawText(String rawText) { this.rawText = Optional.ofNullable(rawText); return this; } /** * <p>The raw text content of the sheet.</p> */ @java.lang.Override @JsonSetter(value = "rawText", nulls = Nulls.SKIP) public _FinalStage rawText(Optional<String> rawText) { this.rawText = rawText; return this; } @java.lang.Override public FileContentsSheetsItem build() { return new FileContentsSheetsItem(sheetName, rawText, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileMetadata.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = FileMetadata.Builder.class) public final class FileMetadata { private final Optional<Double> pageCount; private final Optional<FileMetadataParentSplit> parentSplit; private final Map<String, Object> additionalProperties; private FileMetadata( Optional<Double> pageCount, Optional<FileMetadataParentSplit> parentSplit, Map<String, Object> additionalProperties) { this.pageCount = pageCount; this.parentSplit = parentSplit; this.additionalProperties = additionalProperties; } /** * @return The number of pages in the file. This is only set for PDF/DOCX files. */ @JsonProperty("pageCount") public Optional<Double> getPageCount() { return pageCount; } /** * @return The split metadata details. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow. */ @JsonProperty("parentSplit") public Optional<FileMetadataParentSplit> getParentSplit() { return parentSplit; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FileMetadata && equalTo((FileMetadata) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(FileMetadata other) { return pageCount.equals(other.pageCount) && parentSplit.equals(other.parentSplit); } @java.lang.Override public int hashCode() { return Objects.hash(this.pageCount, this.parentSplit); } @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<Double> pageCount = Optional.empty(); private Optional<FileMetadataParentSplit> parentSplit = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(FileMetadata other) { pageCount(other.getPageCount()); parentSplit(other.getParentSplit()); return this; } /** * <p>The number of pages in the file. This is only set for PDF/DOCX files.</p> */ @JsonSetter(value = "pageCount", nulls = Nulls.SKIP) public Builder pageCount(Optional<Double> pageCount) { this.pageCount = pageCount; return this; } public Builder pageCount(Double pageCount) { this.pageCount = Optional.ofNullable(pageCount); return this; } /** * <p>The split metadata details. Only included if this file is a derivative of another file, for instance if it was created via a Splitter in a workflow.</p> */ @JsonSetter(value = "parentSplit", nulls = Nulls.SKIP) public Builder parentSplit(Optional<FileMetadataParentSplit> parentSplit) { this.parentSplit = parentSplit; return this; } public Builder parentSplit(FileMetadataParentSplit parentSplit) { this.parentSplit = Optional.ofNullable(parentSplit); return this; } public FileMetadata build() { return new FileMetadata(pageCount, parentSplit, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileMetadataParentSplit.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = FileMetadataParentSplit.Builder.class) public final class FileMetadataParentSplit { private final String id; private final String type; private final String identifier; private final int startPage; private final int endPage; private final Map<String, Object> additionalProperties; private FileMetadataParentSplit( String id, String type, String identifier, int startPage, int endPage, Map<String, Object> additionalProperties) { this.id = id; this.type = type; this.identifier = identifier; this.startPage = startPage; this.endPage = endPage; this.additionalProperties = additionalProperties; } /** * @return The ID of the split. */ @JsonProperty("id") public String getId() { return id; } /** * @return The type of the split. */ @JsonProperty("type") public String getType() { return type; } /** * @return The identifier of the split. */ @JsonProperty("identifier") public String getIdentifier() { return identifier; } /** * @return The start page of the split. */ @JsonProperty("startPage") public int getStartPage() { return startPage; } /** * @return The end page of the split. */ @JsonProperty("endPage") public int getEndPage() { return endPage; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof FileMetadataParentSplit && equalTo((FileMetadataParentSplit) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(FileMetadataParentSplit other) { return id.equals(other.id) && type.equals(other.type) && identifier.equals(other.identifier) && startPage == other.startPage && endPage == other.endPage; } @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.type, this.identifier, this.startPage, this.endPage); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>The ID of the split.</p> */ TypeStage id(@NotNull String id); Builder from(FileMetadataParentSplit other); } public interface TypeStage { /** * <p>The type of the split.</p> */ IdentifierStage type(@NotNull String type); } public interface IdentifierStage { /** * <p>The identifier of the split.</p> */ StartPageStage identifier(@NotNull String identifier); } public interface StartPageStage { /** * <p>The start page of the split.</p> */ EndPageStage startPage(int startPage); } public interface EndPageStage { /** * <p>The end page of the split.</p> */ _FinalStage endPage(int endPage); } public interface _FinalStage { FileMetadataParentSplit build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, TypeStage, IdentifierStage, StartPageStage, EndPageStage, _FinalStage { private String id; private String type; private String identifier; private int startPage; private int endPage; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(FileMetadataParentSplit other) { id(other.getId()); type(other.getType()); identifier(other.getIdentifier()); startPage(other.getStartPage()); endPage(other.getEndPage()); return this; } /** * <p>The ID of the split.</p> * <p>The ID of the split.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The type of the split.</p> * <p>The type of the split.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public IdentifierStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>The identifier of the split.</p> * <p>The identifier of the split.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("identifier") public StartPageStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } /** * <p>The start page of the split.</p> * <p>The start page of the split.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("startPage") public EndPageStage startPage(int startPage) { this.startPage = startPage; return this; } /** * <p>The end page of the split.</p> * <p>The end page of the split.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("endPage") public _FinalStage endPage(int endPage) { this.endPage = endPage; return this; } @java.lang.Override public FileMetadataParentSplit build() { return new FileMetadataParentSplit(id, type, identifier, startPage, endPage, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/FileType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum FileType { PDF("PDF"), CSV("CSV"), IMG("IMG"), TXT("TXT"), DOCX("DOCX"), EXCEL("EXCEL"), XML("XML"), HTML("HTML"); private final String value; FileType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/IBaseMetrics.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import java.util.Optional; public interface IBaseMetrics { Optional<Double> getNumFiles(); Optional<Double> getNumPages(); Optional<Double> getMeanRunTimeMs(); }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/IError.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import java.util.Optional; public interface IError { Optional<Boolean> getSuccess(); Optional<String> getError(); }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/Insight.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Insight.Builder.class) public final class Insight { private final String content; private final Map<String, Object> additionalProperties; private Insight(String content, Map<String, Object> additionalProperties) { this.content = content; this.additionalProperties = additionalProperties; } /** * @return The type of insight. Will always be <code>&quot;reasoning&quot;</code> for now. */ @JsonProperty("type") public String getType() { return "reasoning"; } /** * @return The content of the reasoning insight. */ @JsonProperty("content") public String getContent() { return content; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Insight && equalTo((Insight) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(Insight other) { return content.equals(other.content); } @java.lang.Override public int hashCode() { return Objects.hash(this.content); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ContentStage builder() { return new Builder(); } public interface ContentStage { /** * <p>The content of the reasoning insight.</p> */ _FinalStage content(@NotNull String content); Builder from(Insight other); } public interface _FinalStage { Insight build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ContentStage, _FinalStage { private String content; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(Insight other) { content(other.getContent()); return this; } /** * <p>The content of the reasoning insight.</p> * <p>The content of the reasoning insight.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("content") public _FinalStage content(@NotNull String content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } @java.lang.Override public Insight build() { return new Insight(content, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/JsonOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.LinkedHashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JsonOutput.Builder.class) public final class JsonOutput { private final Map<String, Object> value; private final Map<String, JsonOutputMetadataValue> metadata; private final Map<String, Object> additionalProperties; private JsonOutput( Map<String, Object> value, Map<String, JsonOutputMetadataValue> metadata, Map<String, Object> additionalProperties) { this.value = value; this.metadata = metadata; this.additionalProperties = additionalProperties; } /** * @return The extracted values conforming to the schema defined in the processor config */ @JsonProperty("value") public Map<String, Object> getValue() { return value; } /** * @return Metadata about the extracted fields */ @JsonProperty("metadata") public Map<String, JsonOutputMetadataValue> getMetadata() { return metadata; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof JsonOutput && equalTo((JsonOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(JsonOutput other) { return value.equals(other.value) && metadata.equals(other.metadata); } @java.lang.Override public int hashCode() { return Objects.hash(this.value, this.metadata); } @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 Map<String, Object> value = new LinkedHashMap<>(); private Map<String, JsonOutputMetadataValue> metadata = new LinkedHashMap<>(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(JsonOutput other) { value(other.getValue()); metadata(other.getMetadata()); return this; } /** * <p>The extracted values conforming to the schema defined in the processor config</p> */ @JsonSetter(value = "value", nulls = Nulls.SKIP) public Builder value(Map<String, Object> value) { this.value.clear(); this.value.putAll(value); return this; } public Builder putAllValue(Map<String, Object> value) { this.value.putAll(value); return this; } public Builder value(String key, Object value) { this.value.put(key, value); return this; } /** * <p>Metadata about the extracted fields</p> */ @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public Builder metadata(Map<String, JsonOutputMetadataValue> metadata) { this.metadata.clear(); this.metadata.putAll(metadata); return this; } public Builder putAllMetadata(Map<String, JsonOutputMetadataValue> metadata) { this.metadata.putAll(metadata); return this; } public Builder metadata(String key, JsonOutputMetadataValue value) { this.metadata.put(key, value); return this; } public JsonOutput build() { return new JsonOutput(value, metadata, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/JsonOutputMetadataValue.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = JsonOutputMetadataValue.Builder.class) public final class JsonOutputMetadataValue { private final Optional<Double> ocrConfidence; private final Optional<Double> logprobsConfidence; private final Optional<List<JsonOutputMetadataValueCitationsItem>> citations; private final Optional<List<JsonOutputMetadataValueInsightsItem>> insights; private final Map<String, Object> additionalProperties; private JsonOutputMetadataValue( Optional<Double> ocrConfidence, Optional<Double> logprobsConfidence, Optional<List<JsonOutputMetadataValueCitationsItem>> citations, Optional<List<JsonOutputMetadataValueInsightsItem>> insights, Map<String, Object> additionalProperties) { this.ocrConfidence = ocrConfidence; this.logprobsConfidence = logprobsConfidence; this.citations = citations; this.insights = insights; this.additionalProperties = additionalProperties; } /** * @return Confidence score from OCR processing, if applicable */ @JsonProperty("ocrConfidence") public Optional<Double> getOcrConfidence() { return ocrConfidence; } /** * @return Confidence score based on model logprobs */ @JsonProperty("logprobsConfidence") public Optional<Double> getLogprobsConfidence() { return logprobsConfidence; } @JsonProperty("citations") public Optional<List<JsonOutputMetadataValueCitationsItem>> getCitations() { return citations; } @JsonProperty("insights") public Optional<List<JsonOutputMetadataValueInsightsItem>> getInsights() { return insights; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof JsonOutputMetadataValue && equalTo((JsonOutputMetadataValue) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(JsonOutputMetadataValue other) { return ocrConfidence.equals(other.ocrConfidence) && logprobsConfidence.equals(other.logprobsConfidence) && citations.equals(other.citations) && insights.equals(other.insights); } @java.lang.Override public int hashCode() { return Objects.hash(this.ocrConfidence, this.logprobsConfidence, this.citations, this.insights); } @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<Double> ocrConfidence = Optional.empty(); private Optional<Double> logprobsConfidence = Optional.empty(); private Optional<List<JsonOutputMetadataValueCitationsItem>> citations = Optional.empty(); private Optional<List<JsonOutputMetadataValueInsightsItem>> insights = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(JsonOutputMetadataValue other) { ocrConfidence(other.getOcrConfidence()); logprobsConfidence(other.getLogprobsConfidence()); citations(other.getCitations()); insights(other.getInsights()); return this; } /** * <p>Confidence score from OCR processing, if applicable</p> */ @JsonSetter(value = "ocrConfidence", nulls = Nulls.SKIP) public Builder ocrConfidence(Optional<Double> ocrConfidence) { this.ocrConfidence = ocrConfidence; return this; } public Builder ocrConfidence(Double ocrConfidence) { this.ocrConfidence = Optional.ofNullable(ocrConfidence); return this; } /** * <p>Confidence score based on model logprobs</p> */ @JsonSetter(value = "logprobsConfidence", nulls = Nulls.SKIP) public Builder logprobsConfidence(Optional<Double> logprobsConfidence) { this.logprobsConfidence = logprobsConfidence; return this; } public Builder logprobsConfidence(Double logprobsConfidence) { this.logprobsConfidence = Optional.ofNullable(logprobsConfidence); return this; } @JsonSetter(value = "citations", nulls = Nulls.SKIP) public Builder citations(Optional<List<JsonOutputMetadataValueCitationsItem>> citations) { this.citations = citations; return this; } public Builder citations(List<JsonOutputMetadataValueCitationsItem> citations) { this.citations = Optional.ofNullable(citations); return this; } @JsonSetter(value = "insights", nulls = Nulls.SKIP) public Builder insights(Optional<List<JsonOutputMetadataValueInsightsItem>> insights) { this.insights = insights; return this; } public Builder insights(List<JsonOutputMetadataValueInsightsItem> insights) { this.insights = Optional.ofNullable(insights); return this; } public JsonOutputMetadataValue build() { return new JsonOutputMetadataValue( ocrConfidence, logprobsConfidence, citations, insights, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/JsonOutputMetadataValueCitationsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = JsonOutputMetadataValueCitationsItem.Builder.class) public final class JsonOutputMetadataValueCitationsItem { private final Optional<Double> page; private final Optional<String> referenceText; private final Optional<List<JsonOutputMetadataValueCitationsItemPolygonItem>> polygon; private final Map<String, Object> additionalProperties; private JsonOutputMetadataValueCitationsItem( Optional<Double> page, Optional<String> referenceText, Optional<List<JsonOutputMetadataValueCitationsItemPolygonItem>> polygon, Map<String, Object> additionalProperties) { this.page = page; this.referenceText = referenceText; this.polygon = polygon; this.additionalProperties = additionalProperties; } /** * @return Page number where the citation was found */ @JsonProperty("page") public Optional<Double> getPage() { return page; } /** * @return The text that was referenced */ @JsonProperty("referenceText") public Optional<String> getReferenceText() { return referenceText; } /** * @return Array of points defining the polygon around the referenced text */ @JsonProperty("polygon") public Optional<List<JsonOutputMetadataValueCitationsItemPolygonItem>> getPolygon() { return polygon; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof JsonOutputMetadataValueCitationsItem && equalTo((JsonOutputMetadataValueCitationsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(JsonOutputMetadataValueCitationsItem other) { return page.equals(other.page) && referenceText.equals(other.referenceText) && polygon.equals(other.polygon); } @java.lang.Override public int hashCode() { return Objects.hash(this.page, this.referenceText, this.polygon); } @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<Double> page = Optional.empty(); private Optional<String> referenceText = Optional.empty(); private Optional<List<JsonOutputMetadataValueCitationsItemPolygonItem>> polygon = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(JsonOutputMetadataValueCitationsItem other) { page(other.getPage()); referenceText(other.getReferenceText()); polygon(other.getPolygon()); return this; } /** * <p>Page number where the citation was found</p> */ @JsonSetter(value = "page", nulls = Nulls.SKIP) public Builder page(Optional<Double> page) { this.page = page; return this; } public Builder page(Double page) { this.page = Optional.ofNullable(page); return this; } /** * <p>The text that was referenced</p> */ @JsonSetter(value = "referenceText", nulls = Nulls.SKIP) public Builder referenceText(Optional<String> referenceText) { this.referenceText = referenceText; return this; } public Builder referenceText(String referenceText) { this.referenceText = Optional.ofNullable(referenceText); return this; } /** * <p>Array of points defining the polygon around the referenced text</p> */ @JsonSetter(value = "polygon", nulls = Nulls.SKIP) public Builder polygon(Optional<List<JsonOutputMetadataValueCitationsItemPolygonItem>> polygon) { this.polygon = polygon; return this; } public Builder polygon(List<JsonOutputMetadataValueCitationsItemPolygonItem> polygon) { this.polygon = Optional.ofNullable(polygon); return this; } public JsonOutputMetadataValueCitationsItem build() { return new JsonOutputMetadataValueCitationsItem(page, referenceText, polygon, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/JsonOutputMetadataValueCitationsItemPolygonItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JsonOutputMetadataValueCitationsItemPolygonItem.Builder.class) public final class JsonOutputMetadataValueCitationsItemPolygonItem { private final double x; private final double y; private final Map<String, Object> additionalProperties; private JsonOutputMetadataValueCitationsItemPolygonItem( double x, double y, Map<String, Object> additionalProperties) { this.x = x; this.y = y; this.additionalProperties = additionalProperties; } /** * @return X coordinate of the point */ @JsonProperty("x") public double getX() { return x; } /** * @return Y coordinate of the point */ @JsonProperty("y") public double getY() { return y; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof JsonOutputMetadataValueCitationsItemPolygonItem && equalTo((JsonOutputMetadataValueCitationsItemPolygonItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(JsonOutputMetadataValueCitationsItemPolygonItem other) { return x == other.x && y == other.y; } @java.lang.Override public int hashCode() { return Objects.hash(this.x, this.y); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static XStage builder() { return new Builder(); } public interface XStage { /** * <p>X coordinate of the point</p> */ YStage x(double x); Builder from(JsonOutputMetadataValueCitationsItemPolygonItem other); } public interface YStage { /** * <p>Y coordinate of the point</p> */ _FinalStage y(double y); } public interface _FinalStage { JsonOutputMetadataValueCitationsItemPolygonItem build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements XStage, YStage, _FinalStage { private double x; private double y; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(JsonOutputMetadataValueCitationsItemPolygonItem other) { x(other.getX()); y(other.getY()); return this; } /** * <p>X coordinate of the point</p> * <p>X coordinate of the point</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("x") public YStage x(double x) { this.x = x; return this; } /** * <p>Y coordinate of the point</p> * <p>Y coordinate of the point</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("y") public _FinalStage y(double y) { this.y = y; return this; } @java.lang.Override public JsonOutputMetadataValueCitationsItemPolygonItem build() { return new JsonOutputMetadataValueCitationsItemPolygonItem(x, y, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/JsonOutputMetadataValueInsightsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JsonOutputMetadataValueInsightsItem.Builder.class) public final class JsonOutputMetadataValueInsightsItem { private final String content; private final Map<String, Object> additionalProperties; private JsonOutputMetadataValueInsightsItem(String content, Map<String, Object> additionalProperties) { this.content = content; this.additionalProperties = additionalProperties; } /** * @return The type of insight */ @JsonProperty("type") public String getType() { return "reasoning"; } /** * @return The content of the insight */ @JsonProperty("content") public String getContent() { return content; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof JsonOutputMetadataValueInsightsItem && equalTo((JsonOutputMetadataValueInsightsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(JsonOutputMetadataValueInsightsItem other) { return content.equals(other.content); } @java.lang.Override public int hashCode() { return Objects.hash(this.content); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ContentStage builder() { return new Builder(); } public interface ContentStage { /** * <p>The content of the insight</p> */ _FinalStage content(@NotNull String content); Builder from(JsonOutputMetadataValueInsightsItem other); } public interface _FinalStage { JsonOutputMetadataValueInsightsItem build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ContentStage, _FinalStage { private String content; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(JsonOutputMetadataValueInsightsItem other) { content(other.getContent()); return this; } /** * <p>The content of the insight</p> * <p>The content of the insight</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("content") public _FinalStage content(@NotNull String content) { this.content = Objects.requireNonNull(content, "content must not be null"); return this; } @java.lang.Override public JsonOutputMetadataValueInsightsItem build() { return new JsonOutputMetadataValueInsightsItem(content, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/OutputMetadataValue.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = OutputMetadataValue.Builder.class) public final class OutputMetadataValue { private final Optional<Double> ocrConfidence; private final Optional<Double> logprobsConfidence; private final Optional<List<Citation>> citations; private final Optional<List<Insight>> insights; private final Map<String, Object> additionalProperties; private OutputMetadataValue( Optional<Double> ocrConfidence, Optional<Double> logprobsConfidence, Optional<List<Citation>> citations, Optional<List<Insight>> insights, Map<String, Object> additionalProperties) { this.ocrConfidence = ocrConfidence; this.logprobsConfidence = logprobsConfidence; this.citations = citations; this.insights = insights; this.additionalProperties = additionalProperties; } /** * @return Confidence score from OCR processing, if applicable */ @JsonProperty("ocrConfidence") public Optional<Double> getOcrConfidence() { return ocrConfidence; } /** * @return Confidence score based on model logprobs */ @JsonProperty("logprobsConfidence") public Optional<Double> getLogprobsConfidence() { return logprobsConfidence; } @JsonProperty("citations") public Optional<List<Citation>> getCitations() { return citations; } @JsonProperty("insights") public Optional<List<Insight>> getInsights() { return insights; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof OutputMetadataValue && equalTo((OutputMetadataValue) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(OutputMetadataValue other) { return ocrConfidence.equals(other.ocrConfidence) && logprobsConfidence.equals(other.logprobsConfidence) && citations.equals(other.citations) && insights.equals(other.insights); } @java.lang.Override public int hashCode() { return Objects.hash(this.ocrConfidence, this.logprobsConfidence, this.citations, this.insights); } @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<Double> ocrConfidence = Optional.empty(); private Optional<Double> logprobsConfidence = Optional.empty(); private Optional<List<Citation>> citations = Optional.empty(); private Optional<List<Insight>> insights = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(OutputMetadataValue other) { ocrConfidence(other.getOcrConfidence()); logprobsConfidence(other.getLogprobsConfidence()); citations(other.getCitations()); insights(other.getInsights()); return this; } /** * <p>Confidence score from OCR processing, if applicable</p> */ @JsonSetter(value = "ocrConfidence", nulls = Nulls.SKIP) public Builder ocrConfidence(Optional<Double> ocrConfidence) { this.ocrConfidence = ocrConfidence; return this; } public Builder ocrConfidence(Double ocrConfidence) { this.ocrConfidence = Optional.ofNullable(ocrConfidence); return this; } /** * <p>Confidence score based on model logprobs</p> */ @JsonSetter(value = "logprobsConfidence", nulls = Nulls.SKIP) public Builder logprobsConfidence(Optional<Double> logprobsConfidence) { this.logprobsConfidence = logprobsConfidence; return this; } public Builder logprobsConfidence(Double logprobsConfidence) { this.logprobsConfidence = Optional.ofNullable(logprobsConfidence); return this; } @JsonSetter(value = "citations", nulls = Nulls.SKIP) public Builder citations(Optional<List<Citation>> citations) { this.citations = citations; return this; } public Builder citations(List<Citation> citations) { this.citations = Optional.ofNullable(citations); return this; } @JsonSetter(value = "insights", nulls = Nulls.SKIP) public Builder insights(Optional<List<Insight>> insights) { this.insights = insights; return this; } public Builder insights(List<Insight> insights) { this.insights = Optional.ofNullable(insights); return this; } public OutputMetadataValue build() { return new OutputMetadataValue( ocrConfidence, logprobsConfidence, citations, insights, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/PageRangesItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = PageRangesItem.Builder.class) public final class PageRangesItem { private final Optional<Integer> start; private final Optional<Integer> end; private final Map<String, Object> additionalProperties; private PageRangesItem(Optional<Integer> start, Optional<Integer> end, Map<String, Object> additionalProperties) { this.start = start; this.end = end; this.additionalProperties = additionalProperties; } /** * @return The start page of the range. */ @JsonProperty("start") public Optional<Integer> getStart() { return start; } /** * @return The end page of the range. */ @JsonProperty("end") public Optional<Integer> getEnd() { return end; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof PageRangesItem && equalTo((PageRangesItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(PageRangesItem other) { return start.equals(other.start) && end.equals(other.end); } @java.lang.Override public int hashCode() { return Objects.hash(this.start, this.end); } @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<Integer> start = Optional.empty(); private Optional<Integer> end = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PageRangesItem other) { start(other.getStart()); end(other.getEnd()); return this; } /** * <p>The start page of the range.</p> */ @JsonSetter(value = "start", nulls = Nulls.SKIP) public Builder start(Optional<Integer> start) { this.start = start; return this; } public Builder start(Integer start) { this.start = Optional.ofNullable(start); return this; } /** * <p>The end page of the range.</p> */ @JsonSetter(value = "end", nulls = Nulls.SKIP) public Builder end(Optional<Integer> end) { this.end = end; return this; } public Builder end(Integer end) { this.end = Optional.ofNullable(end); return this; } public PageRangesItem build() { return new PageRangesItem(start, end, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseAsyncRequestFile.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseAsyncRequestFile.Builder.class) public final class ParseAsyncRequestFile { private final Optional<String> fileName; private final Optional<String> fileUrl; private final Optional<String> fileId; private final Map<String, Object> additionalProperties; private ParseAsyncRequestFile( Optional<String> fileName, Optional<String> fileUrl, Optional<String> fileId, Map<String, Object> additionalProperties) { this.fileName = fileName; this.fileUrl = fileUrl; this.fileId = fileId; this.additionalProperties = additionalProperties; } /** * @return The name of the file. If not set, the file name is taken from the url. */ @JsonProperty("fileName") public Optional<String> getFileName() { return fileName; } /** * @return A URL to download the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time. One of <code>fileUrl</code> or <code>fileId</code> must be provided. */ @JsonProperty("fileUrl") public Optional<String> getFileUrl() { return fileUrl; } /** * @return If you already have an Extend file id (for instance from running a workflow or a previous <a href="https://docs.extend.ai/2025-04-21/developers/api-reference/file-endpoints/upload-file">file upload</a>) then you can use that file id when running the parse endpoint so that it leverage any cached data that might be available. The file id will start with &quot;file_&quot;. One of <code>fileUrl</code> or <code>fileId</code> must be provided. * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("fileId") public Optional<String> getFileId() { return fileId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseAsyncRequestFile && equalTo((ParseAsyncRequestFile) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseAsyncRequestFile other) { return fileName.equals(other.fileName) && fileUrl.equals(other.fileUrl) && fileId.equals(other.fileId); } @java.lang.Override public int hashCode() { return Objects.hash(this.fileName, this.fileUrl, this.fileId); } @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<String> fileName = Optional.empty(); private Optional<String> fileUrl = Optional.empty(); private Optional<String> fileId = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseAsyncRequestFile other) { fileName(other.getFileName()); fileUrl(other.getFileUrl()); fileId(other.getFileId()); return this; } /** * <p>The name of the file. If not set, the file name is taken from the url.</p> */ @JsonSetter(value = "fileName", nulls = Nulls.SKIP) public Builder fileName(Optional<String> fileName) { this.fileName = fileName; return this; } public Builder fileName(String fileName) { this.fileName = Optional.ofNullable(fileName); return this; } /** * <p>A URL to download the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time. One of <code>fileUrl</code> or <code>fileId</code> must be provided.</p> */ @JsonSetter(value = "fileUrl", nulls = Nulls.SKIP) public Builder fileUrl(Optional<String> fileUrl) { this.fileUrl = fileUrl; return this; } public Builder fileUrl(String fileUrl) { this.fileUrl = Optional.ofNullable(fileUrl); return this; } /** * <p>If you already have an Extend file id (for instance from running a workflow or a previous <a href="https://docs.extend.ai/2025-04-21/developers/api-reference/file-endpoints/upload-file">file upload</a>) then you can use that file id when running the parse endpoint so that it leverage any cached data that might be available. The file id will start with &quot;file_&quot;. One of <code>fileUrl</code> or <code>fileId</code> must be provided.</p> * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonSetter(value = "fileId", nulls = Nulls.SKIP) public Builder fileId(Optional<String> fileId) { this.fileId = fileId; return this; } public Builder fileId(String fileId) { this.fileId = Optional.ofNullable(fileId); return this; } public ParseAsyncRequestFile build() { return new ParseAsyncRequestFile(fileName, fileUrl, fileId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfig.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfig.Builder.class) public final class ParseConfig { private final Optional<ParseConfigTarget> target; private final Optional<ParseConfigChunkingStrategy> chunkingStrategy; private final Optional<ParseConfigBlockOptions> blockOptions; private final Optional<ParseConfigAdvancedOptions> advancedOptions; private final Map<String, Object> additionalProperties; private ParseConfig( Optional<ParseConfigTarget> target, Optional<ParseConfigChunkingStrategy> chunkingStrategy, Optional<ParseConfigBlockOptions> blockOptions, Optional<ParseConfigAdvancedOptions> advancedOptions, Map<String, Object> additionalProperties) { this.target = target; this.chunkingStrategy = chunkingStrategy; this.blockOptions = blockOptions; this.advancedOptions = advancedOptions; this.additionalProperties = additionalProperties; } /** * @return The target format for the parsed content. * <p>Supported values:</p> * <ul> * <li><code>markdown</code>: True markdown with logical reading order (headings, lists, tables, checkboxes). Best default for LLMs/RAG and enables section-based chunking.</li> * <li><code>spatial</code>: Layout/position-preserving text that uses markdown elements for block types but is not strictly markdown due to whitespace/tabs used to maintain placement. Only page-based chunking is supported.</li> * </ul> * <p>Guidance:</p> * <ul> * <li>Prefer <code>markdown</code> for most documents, multi-column reading order, and retrieval use cases</li> * <li>Prefer <code>spatial</code> for messy/scanned/handwritten or skewed documents, when you need near 1:1 layout fidelity, or for BOL-like logistics docs</li> * </ul> * <p>See “Markdown vs Spatial” in the Parse guide for details: /2025-04-21/developers/guides/parse#markdown-vs-spatial</p> */ @JsonProperty("target") public Optional<ParseConfigTarget> getTarget() { return target; } /** * @return Strategy for dividing the document into chunks. */ @JsonProperty("chunkingStrategy") public Optional<ParseConfigChunkingStrategy> getChunkingStrategy() { return chunkingStrategy; } /** * @return Options for controlling how different block types are processed. */ @JsonProperty("blockOptions") public Optional<ParseConfigBlockOptions> getBlockOptions() { return blockOptions; } @JsonProperty("advancedOptions") public Optional<ParseConfigAdvancedOptions> getAdvancedOptions() { return advancedOptions; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfig && equalTo((ParseConfig) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfig other) { return target.equals(other.target) && chunkingStrategy.equals(other.chunkingStrategy) && blockOptions.equals(other.blockOptions) && advancedOptions.equals(other.advancedOptions); } @java.lang.Override public int hashCode() { return Objects.hash(this.target, this.chunkingStrategy, this.blockOptions, this.advancedOptions); } @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<ParseConfigTarget> target = Optional.empty(); private Optional<ParseConfigChunkingStrategy> chunkingStrategy = Optional.empty(); private Optional<ParseConfigBlockOptions> blockOptions = Optional.empty(); private Optional<ParseConfigAdvancedOptions> advancedOptions = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfig other) { target(other.getTarget()); chunkingStrategy(other.getChunkingStrategy()); blockOptions(other.getBlockOptions()); advancedOptions(other.getAdvancedOptions()); return this; } /** * <p>The target format for the parsed content.</p> * <p>Supported values:</p> * <ul> * <li><code>markdown</code>: True markdown with logical reading order (headings, lists, tables, checkboxes). Best default for LLMs/RAG and enables section-based chunking.</li> * <li><code>spatial</code>: Layout/position-preserving text that uses markdown elements for block types but is not strictly markdown due to whitespace/tabs used to maintain placement. Only page-based chunking is supported.</li> * </ul> * <p>Guidance:</p> * <ul> * <li>Prefer <code>markdown</code> for most documents, multi-column reading order, and retrieval use cases</li> * <li>Prefer <code>spatial</code> for messy/scanned/handwritten or skewed documents, when you need near 1:1 layout fidelity, or for BOL-like logistics docs</li> * </ul> * <p>See “Markdown vs Spatial” in the Parse guide for details: /2025-04-21/developers/guides/parse#markdown-vs-spatial</p> */ @JsonSetter(value = "target", nulls = Nulls.SKIP) public Builder target(Optional<ParseConfigTarget> target) { this.target = target; return this; } public Builder target(ParseConfigTarget target) { this.target = Optional.ofNullable(target); return this; } /** * <p>Strategy for dividing the document into chunks.</p> */ @JsonSetter(value = "chunkingStrategy", nulls = Nulls.SKIP) public Builder chunkingStrategy(Optional<ParseConfigChunkingStrategy> chunkingStrategy) { this.chunkingStrategy = chunkingStrategy; return this; } public Builder chunkingStrategy(ParseConfigChunkingStrategy chunkingStrategy) { this.chunkingStrategy = Optional.ofNullable(chunkingStrategy); return this; } /** * <p>Options for controlling how different block types are processed.</p> */ @JsonSetter(value = "blockOptions", nulls = Nulls.SKIP) public Builder blockOptions(Optional<ParseConfigBlockOptions> blockOptions) { this.blockOptions = blockOptions; return this; } public Builder blockOptions(ParseConfigBlockOptions blockOptions) { this.blockOptions = Optional.ofNullable(blockOptions); return this; } @JsonSetter(value = "advancedOptions", nulls = Nulls.SKIP) public Builder advancedOptions(Optional<ParseConfigAdvancedOptions> advancedOptions) { this.advancedOptions = advancedOptions; return this; } public Builder advancedOptions(ParseConfigAdvancedOptions advancedOptions) { this.advancedOptions = Optional.ofNullable(advancedOptions); return this; } public ParseConfig build() { return new ParseConfig(target, chunkingStrategy, blockOptions, advancedOptions, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigAdvancedOptions.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigAdvancedOptions.Builder.class) public final class ParseConfigAdvancedOptions { private final Optional<Boolean> pageRotationEnabled; private final Optional<Boolean> agenticOcrEnabled; private final Optional<List<PageRangesItem>> pageRanges; private final Map<String, Object> additionalProperties; private ParseConfigAdvancedOptions( Optional<Boolean> pageRotationEnabled, Optional<Boolean> agenticOcrEnabled, Optional<List<PageRangesItem>> pageRanges, Map<String, Object> additionalProperties) { this.pageRotationEnabled = pageRotationEnabled; this.agenticOcrEnabled = agenticOcrEnabled; this.pageRanges = pageRanges; this.additionalProperties = additionalProperties; } /** * @return Whether to automatically detect and correct page rotation. */ @JsonProperty("pageRotationEnabled") public Optional<Boolean> getPageRotationEnabled() { return pageRotationEnabled; } /** * @return Whether to enable agentic OCR corrections using VLM-based review and correction of OCR errors for messy handwriting and poorly scanned text. */ @JsonProperty("agenticOcrEnabled") public Optional<Boolean> getAgenticOcrEnabled() { return agenticOcrEnabled; } @JsonProperty("pageRanges") public Optional<List<PageRangesItem>> getPageRanges() { return pageRanges; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigAdvancedOptions && equalTo((ParseConfigAdvancedOptions) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigAdvancedOptions other) { return pageRotationEnabled.equals(other.pageRotationEnabled) && agenticOcrEnabled.equals(other.agenticOcrEnabled) && pageRanges.equals(other.pageRanges); } @java.lang.Override public int hashCode() { return Objects.hash(this.pageRotationEnabled, this.agenticOcrEnabled, this.pageRanges); } @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<Boolean> pageRotationEnabled = Optional.empty(); private Optional<Boolean> agenticOcrEnabled = Optional.empty(); private Optional<List<PageRangesItem>> pageRanges = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigAdvancedOptions other) { pageRotationEnabled(other.getPageRotationEnabled()); agenticOcrEnabled(other.getAgenticOcrEnabled()); pageRanges(other.getPageRanges()); return this; } /** * <p>Whether to automatically detect and correct page rotation.</p> */ @JsonSetter(value = "pageRotationEnabled", nulls = Nulls.SKIP) public Builder pageRotationEnabled(Optional<Boolean> pageRotationEnabled) { this.pageRotationEnabled = pageRotationEnabled; return this; } public Builder pageRotationEnabled(Boolean pageRotationEnabled) { this.pageRotationEnabled = Optional.ofNullable(pageRotationEnabled); return this; } /** * <p>Whether to enable agentic OCR corrections using VLM-based review and correction of OCR errors for messy handwriting and poorly scanned text.</p> */ @JsonSetter(value = "agenticOcrEnabled", nulls = Nulls.SKIP) public Builder agenticOcrEnabled(Optional<Boolean> agenticOcrEnabled) { this.agenticOcrEnabled = agenticOcrEnabled; return this; } public Builder agenticOcrEnabled(Boolean agenticOcrEnabled) { this.agenticOcrEnabled = Optional.ofNullable(agenticOcrEnabled); return this; } @JsonSetter(value = "pageRanges", nulls = Nulls.SKIP) public Builder pageRanges(Optional<List<PageRangesItem>> pageRanges) { this.pageRanges = pageRanges; return this; } public Builder pageRanges(List<PageRangesItem> pageRanges) { this.pageRanges = Optional.ofNullable(pageRanges); return this; } public ParseConfigAdvancedOptions build() { return new ParseConfigAdvancedOptions( pageRotationEnabled, agenticOcrEnabled, pageRanges, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigBlockOptions.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigBlockOptions.Builder.class) public final class ParseConfigBlockOptions { private final Optional<ParseConfigBlockOptionsFigures> figures; private final Optional<ParseConfigBlockOptionsTables> tables; private final Optional<ParseConfigBlockOptionsText> text; private final Map<String, Object> additionalProperties; private ParseConfigBlockOptions( Optional<ParseConfigBlockOptionsFigures> figures, Optional<ParseConfigBlockOptionsTables> tables, Optional<ParseConfigBlockOptionsText> text, Map<String, Object> additionalProperties) { this.figures = figures; this.tables = tables; this.text = text; this.additionalProperties = additionalProperties; } /** * @return Options for figure blocks. */ @JsonProperty("figures") public Optional<ParseConfigBlockOptionsFigures> getFigures() { return figures; } /** * @return Options for table blocks. */ @JsonProperty("tables") public Optional<ParseConfigBlockOptionsTables> getTables() { return tables; } /** * @return Options for text blocks. */ @JsonProperty("text") public Optional<ParseConfigBlockOptionsText> getText() { return text; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigBlockOptions && equalTo((ParseConfigBlockOptions) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigBlockOptions other) { return figures.equals(other.figures) && tables.equals(other.tables) && text.equals(other.text); } @java.lang.Override public int hashCode() { return Objects.hash(this.figures, this.tables, this.text); } @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<ParseConfigBlockOptionsFigures> figures = Optional.empty(); private Optional<ParseConfigBlockOptionsTables> tables = Optional.empty(); private Optional<ParseConfigBlockOptionsText> text = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigBlockOptions other) { figures(other.getFigures()); tables(other.getTables()); text(other.getText()); return this; } /** * <p>Options for figure blocks.</p> */ @JsonSetter(value = "figures", nulls = Nulls.SKIP) public Builder figures(Optional<ParseConfigBlockOptionsFigures> figures) { this.figures = figures; return this; } public Builder figures(ParseConfigBlockOptionsFigures figures) { this.figures = Optional.ofNullable(figures); return this; } /** * <p>Options for table blocks.</p> */ @JsonSetter(value = "tables", nulls = Nulls.SKIP) public Builder tables(Optional<ParseConfigBlockOptionsTables> tables) { this.tables = tables; return this; } public Builder tables(ParseConfigBlockOptionsTables tables) { this.tables = Optional.ofNullable(tables); return this; } /** * <p>Options for text blocks.</p> */ @JsonSetter(value = "text", nulls = Nulls.SKIP) public Builder text(Optional<ParseConfigBlockOptionsText> text) { this.text = text; return this; } public Builder text(ParseConfigBlockOptionsText text) { this.text = Optional.ofNullable(text); return this; } public ParseConfigBlockOptions build() { return new ParseConfigBlockOptions(figures, tables, text, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigBlockOptionsFigures.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigBlockOptionsFigures.Builder.class) public final class ParseConfigBlockOptionsFigures { private final Optional<Boolean> enabled; private final Optional<Boolean> figureImageClippingEnabled; private final Map<String, Object> additionalProperties; private ParseConfigBlockOptionsFigures( Optional<Boolean> enabled, Optional<Boolean> figureImageClippingEnabled, Map<String, Object> additionalProperties) { this.enabled = enabled; this.figureImageClippingEnabled = figureImageClippingEnabled; this.additionalProperties = additionalProperties; } /** * @return Whether to include figures in the output. */ @JsonProperty("enabled") public Optional<Boolean> getEnabled() { return enabled; } /** * @return Whether to clip and extract images from figures. */ @JsonProperty("figureImageClippingEnabled") public Optional<Boolean> getFigureImageClippingEnabled() { return figureImageClippingEnabled; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigBlockOptionsFigures && equalTo((ParseConfigBlockOptionsFigures) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigBlockOptionsFigures other) { return enabled.equals(other.enabled) && figureImageClippingEnabled.equals(other.figureImageClippingEnabled); } @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.figureImageClippingEnabled); } @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<Boolean> enabled = Optional.empty(); private Optional<Boolean> figureImageClippingEnabled = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigBlockOptionsFigures other) { enabled(other.getEnabled()); figureImageClippingEnabled(other.getFigureImageClippingEnabled()); return this; } /** * <p>Whether to include figures in the output.</p> */ @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public Builder enabled(Optional<Boolean> enabled) { this.enabled = enabled; return this; } public Builder enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; } /** * <p>Whether to clip and extract images from figures.</p> */ @JsonSetter(value = "figureImageClippingEnabled", nulls = Nulls.SKIP) public Builder figureImageClippingEnabled(Optional<Boolean> figureImageClippingEnabled) { this.figureImageClippingEnabled = figureImageClippingEnabled; return this; } public Builder figureImageClippingEnabled(Boolean figureImageClippingEnabled) { this.figureImageClippingEnabled = Optional.ofNullable(figureImageClippingEnabled); return this; } public ParseConfigBlockOptionsFigures build() { return new ParseConfigBlockOptionsFigures(enabled, figureImageClippingEnabled, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigBlockOptionsTables.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigBlockOptionsTables.Builder.class) public final class ParseConfigBlockOptionsTables { private final Optional<Boolean> enabled; private final Optional<ParseConfigBlockOptionsTablesTargetFormat> targetFormat; private final Optional<Boolean> tableHeaderContinuationEnabled; private final Map<String, Object> additionalProperties; private ParseConfigBlockOptionsTables( Optional<Boolean> enabled, Optional<ParseConfigBlockOptionsTablesTargetFormat> targetFormat, Optional<Boolean> tableHeaderContinuationEnabled, Map<String, Object> additionalProperties) { this.enabled = enabled; this.targetFormat = targetFormat; this.tableHeaderContinuationEnabled = tableHeaderContinuationEnabled; this.additionalProperties = additionalProperties; } /** * @return Whether to include tables in the output. */ @JsonProperty("enabled") public Optional<Boolean> getEnabled() { return enabled; } /** * @return The target format for the table blocks. Supported values: * <ul> * <li><code>markdown</code>: Convert table to Markdown format</li> * <li><code>html</code>: Convert table to HTML format</li> * </ul> */ @JsonProperty("targetFormat") public Optional<ParseConfigBlockOptionsTablesTargetFormat> getTargetFormat() { return targetFormat; } /** * @return Whether to automatically copy table headers to headerless tables on subsequent pages when they have matching column counts. Useful for multi-page tables. */ @JsonProperty("tableHeaderContinuationEnabled") public Optional<Boolean> getTableHeaderContinuationEnabled() { return tableHeaderContinuationEnabled; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigBlockOptionsTables && equalTo((ParseConfigBlockOptionsTables) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigBlockOptionsTables other) { return enabled.equals(other.enabled) && targetFormat.equals(other.targetFormat) && tableHeaderContinuationEnabled.equals(other.tableHeaderContinuationEnabled); } @java.lang.Override public int hashCode() { return Objects.hash(this.enabled, this.targetFormat, this.tableHeaderContinuationEnabled); } @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<Boolean> enabled = Optional.empty(); private Optional<ParseConfigBlockOptionsTablesTargetFormat> targetFormat = Optional.empty(); private Optional<Boolean> tableHeaderContinuationEnabled = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigBlockOptionsTables other) { enabled(other.getEnabled()); targetFormat(other.getTargetFormat()); tableHeaderContinuationEnabled(other.getTableHeaderContinuationEnabled()); return this; } /** * <p>Whether to include tables in the output.</p> */ @JsonSetter(value = "enabled", nulls = Nulls.SKIP) public Builder enabled(Optional<Boolean> enabled) { this.enabled = enabled; return this; } public Builder enabled(Boolean enabled) { this.enabled = Optional.ofNullable(enabled); return this; } /** * <p>The target format for the table blocks. Supported values:</p> * <ul> * <li><code>markdown</code>: Convert table to Markdown format</li> * <li><code>html</code>: Convert table to HTML format</li> * </ul> */ @JsonSetter(value = "targetFormat", nulls = Nulls.SKIP) public Builder targetFormat(Optional<ParseConfigBlockOptionsTablesTargetFormat> targetFormat) { this.targetFormat = targetFormat; return this; } public Builder targetFormat(ParseConfigBlockOptionsTablesTargetFormat targetFormat) { this.targetFormat = Optional.ofNullable(targetFormat); return this; } /** * <p>Whether to automatically copy table headers to headerless tables on subsequent pages when they have matching column counts. Useful for multi-page tables.</p> */ @JsonSetter(value = "tableHeaderContinuationEnabled", nulls = Nulls.SKIP) public Builder tableHeaderContinuationEnabled(Optional<Boolean> tableHeaderContinuationEnabled) { this.tableHeaderContinuationEnabled = tableHeaderContinuationEnabled; return this; } public Builder tableHeaderContinuationEnabled(Boolean tableHeaderContinuationEnabled) { this.tableHeaderContinuationEnabled = Optional.ofNullable(tableHeaderContinuationEnabled); return this; } public ParseConfigBlockOptionsTables build() { return new ParseConfigBlockOptionsTables( enabled, targetFormat, tableHeaderContinuationEnabled, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigBlockOptionsTablesTargetFormat.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParseConfigBlockOptionsTablesTargetFormat { MARKDOWN("markdown"), HTML("html"); private final String value; ParseConfigBlockOptionsTablesTargetFormat(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigBlockOptionsText.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigBlockOptionsText.Builder.class) public final class ParseConfigBlockOptionsText { private final Optional<Boolean> signatureDetectionEnabled; private final Map<String, Object> additionalProperties; private ParseConfigBlockOptionsText( Optional<Boolean> signatureDetectionEnabled, Map<String, Object> additionalProperties) { this.signatureDetectionEnabled = signatureDetectionEnabled; this.additionalProperties = additionalProperties; } /** * @return Whether an additional vision model will be utilized for advanced signature detection. Recommended for most use cases, but should be disabled if signature detection is not necessary and latency is a concern. */ @JsonProperty("signatureDetectionEnabled") public Optional<Boolean> getSignatureDetectionEnabled() { return signatureDetectionEnabled; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigBlockOptionsText && equalTo((ParseConfigBlockOptionsText) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigBlockOptionsText other) { return signatureDetectionEnabled.equals(other.signatureDetectionEnabled); } @java.lang.Override public int hashCode() { return Objects.hash(this.signatureDetectionEnabled); } @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<Boolean> signatureDetectionEnabled = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigBlockOptionsText other) { signatureDetectionEnabled(other.getSignatureDetectionEnabled()); return this; } /** * <p>Whether an additional vision model will be utilized for advanced signature detection. Recommended for most use cases, but should be disabled if signature detection is not necessary and latency is a concern.</p> */ @JsonSetter(value = "signatureDetectionEnabled", nulls = Nulls.SKIP) public Builder signatureDetectionEnabled(Optional<Boolean> signatureDetectionEnabled) { this.signatureDetectionEnabled = signatureDetectionEnabled; return this; } public Builder signatureDetectionEnabled(Boolean signatureDetectionEnabled) { this.signatureDetectionEnabled = Optional.ofNullable(signatureDetectionEnabled); return this; } public ParseConfigBlockOptionsText build() { return new ParseConfigBlockOptionsText(signatureDetectionEnabled, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigChunkingStrategy.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigChunkingStrategy.Builder.class) public final class ParseConfigChunkingStrategy { private final Optional<ParseConfigChunkingStrategyType> type; private final Optional<ParseConfigChunkingStrategyOptions> options; private final Map<String, Object> additionalProperties; private ParseConfigChunkingStrategy( Optional<ParseConfigChunkingStrategyType> type, Optional<ParseConfigChunkingStrategyOptions> options, Map<String, Object> additionalProperties) { this.type = type; this.options = options; this.additionalProperties = additionalProperties; } /** * @return The type of chunking strategy. Supported values: * <ul> * <li><code>page</code>: Chunk document by pages.</li> * <li><code>document</code>: Entire document is a single chunk. Essentially no chunking.</li> * <li><code>section</code>: Split by logical sections. Not supported for target=spatial.</li> * </ul> */ @JsonProperty("type") public Optional<ParseConfigChunkingStrategyType> getType() { return type; } /** * @return Additional options for the chunking strategy. */ @JsonProperty("options") public Optional<ParseConfigChunkingStrategyOptions> getOptions() { return options; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigChunkingStrategy && equalTo((ParseConfigChunkingStrategy) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigChunkingStrategy other) { return type.equals(other.type) && options.equals(other.options); } @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.options); } @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<ParseConfigChunkingStrategyType> type = Optional.empty(); private Optional<ParseConfigChunkingStrategyOptions> options = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigChunkingStrategy other) { type(other.getType()); options(other.getOptions()); return this; } /** * <p>The type of chunking strategy. Supported values:</p> * <ul> * <li><code>page</code>: Chunk document by pages.</li> * <li><code>document</code>: Entire document is a single chunk. Essentially no chunking.</li> * <li><code>section</code>: Split by logical sections. Not supported for target=spatial.</li> * </ul> */ @JsonSetter(value = "type", nulls = Nulls.SKIP) public Builder type(Optional<ParseConfigChunkingStrategyType> type) { this.type = type; return this; } public Builder type(ParseConfigChunkingStrategyType type) { this.type = Optional.ofNullable(type); return this; } /** * <p>Additional options for the chunking strategy.</p> */ @JsonSetter(value = "options", nulls = Nulls.SKIP) public Builder options(Optional<ParseConfigChunkingStrategyOptions> options) { this.options = options; return this; } public Builder options(ParseConfigChunkingStrategyOptions options) { this.options = Optional.ofNullable(options); return this; } public ParseConfigChunkingStrategy build() { return new ParseConfigChunkingStrategy(type, options, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigChunkingStrategyOptions.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseConfigChunkingStrategyOptions.Builder.class) public final class ParseConfigChunkingStrategyOptions { private final Optional<Integer> minCharacters; private final Optional<Integer> maxCharacters; private final Map<String, Object> additionalProperties; private ParseConfigChunkingStrategyOptions( Optional<Integer> minCharacters, Optional<Integer> maxCharacters, Map<String, Object> additionalProperties) { this.minCharacters = minCharacters; this.maxCharacters = maxCharacters; this.additionalProperties = additionalProperties; } /** * @return Specify a minimum number of characters per chunk. */ @JsonProperty("minCharacters") public Optional<Integer> getMinCharacters() { return minCharacters; } /** * @return Specify a maximum number of characters per chunk. */ @JsonProperty("maxCharacters") public Optional<Integer> getMaxCharacters() { return maxCharacters; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseConfigChunkingStrategyOptions && equalTo((ParseConfigChunkingStrategyOptions) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseConfigChunkingStrategyOptions other) { return minCharacters.equals(other.minCharacters) && maxCharacters.equals(other.maxCharacters); } @java.lang.Override public int hashCode() { return Objects.hash(this.minCharacters, this.maxCharacters); } @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<Integer> minCharacters = Optional.empty(); private Optional<Integer> maxCharacters = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseConfigChunkingStrategyOptions other) { minCharacters(other.getMinCharacters()); maxCharacters(other.getMaxCharacters()); return this; } /** * <p>Specify a minimum number of characters per chunk.</p> */ @JsonSetter(value = "minCharacters", nulls = Nulls.SKIP) public Builder minCharacters(Optional<Integer> minCharacters) { this.minCharacters = minCharacters; return this; } public Builder minCharacters(Integer minCharacters) { this.minCharacters = Optional.ofNullable(minCharacters); return this; } /** * <p>Specify a maximum number of characters per chunk.</p> */ @JsonSetter(value = "maxCharacters", nulls = Nulls.SKIP) public Builder maxCharacters(Optional<Integer> maxCharacters) { this.maxCharacters = maxCharacters; return this; } public Builder maxCharacters(Integer maxCharacters) { this.maxCharacters = Optional.ofNullable(maxCharacters); return this; } public ParseConfigChunkingStrategyOptions build() { return new ParseConfigChunkingStrategyOptions(minCharacters, maxCharacters, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigChunkingStrategyType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParseConfigChunkingStrategyType { PAGE("page"), DOCUMENT("document"), SECTION("section"); private final String value; ParseConfigChunkingStrategyType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseConfigTarget.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParseConfigTarget { MARKDOWN("markdown"), SPATIAL("spatial"); private final String value; ParseConfigTarget(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseError.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseError.Builder.class) public final class ParseError { private final Optional<ParseErrorCode> code; private final Optional<String> message; private final Optional<String> requestId; private final Optional<Boolean> retryable; private final Map<String, Object> additionalProperties; private ParseError( Optional<ParseErrorCode> code, Optional<String> message, Optional<String> requestId, Optional<Boolean> retryable, Map<String, Object> additionalProperties) { this.code = code; this.message = message; this.requestId = requestId; this.retryable = retryable; this.additionalProperties = additionalProperties; } @JsonProperty("code") public Optional<ParseErrorCode> getCode() { return code; } @JsonProperty("message") public Optional<String> getMessage() { return message; } @JsonProperty("requestId") public Optional<String> getRequestId() { return requestId; } @JsonProperty("retryable") public Optional<Boolean> getRetryable() { return retryable; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseError && equalTo((ParseError) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseError other) { return code.equals(other.code) && message.equals(other.message) && requestId.equals(other.requestId) && retryable.equals(other.retryable); } @java.lang.Override public int hashCode() { return Objects.hash(this.code, this.message, this.requestId, this.retryable); } @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<ParseErrorCode> code = Optional.empty(); private Optional<String> message = Optional.empty(); private Optional<String> requestId = Optional.empty(); private Optional<Boolean> retryable = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseError other) { code(other.getCode()); message(other.getMessage()); requestId(other.getRequestId()); retryable(other.getRetryable()); return this; } @JsonSetter(value = "code", nulls = Nulls.SKIP) public Builder code(Optional<ParseErrorCode> code) { this.code = code; return this; } public Builder code(ParseErrorCode code) { this.code = Optional.ofNullable(code); return this; } @JsonSetter(value = "message", nulls = Nulls.SKIP) public Builder message(Optional<String> message) { this.message = message; return this; } public Builder message(String message) { this.message = Optional.ofNullable(message); return this; } @JsonSetter(value = "requestId", nulls = Nulls.SKIP) public Builder requestId(Optional<String> requestId) { this.requestId = requestId; return this; } public Builder requestId(String requestId) { this.requestId = Optional.ofNullable(requestId); return this; } @JsonSetter(value = "retryable", nulls = Nulls.SKIP) public Builder retryable(Optional<Boolean> retryable) { this.retryable = retryable; return this; } public Builder retryable(Boolean retryable) { this.retryable = Optional.ofNullable(retryable); return this; } public ParseError build() { return new ParseError(code, message, requestId, retryable, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseErrorCode.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParseErrorCode { INVALID_CONFIG_OPTIONS("INVALID_CONFIG_OPTIONS"), UNABLE_TO_DOWNLOAD_FILE("UNABLE_TO_DOWNLOAD_FILE"), FILE_TYPE_NOT_SUPPORTED("FILE_TYPE_NOT_SUPPORTED"), FILE_SIZE_TOO_LARGE("FILE_SIZE_TOO_LARGE"), CORRUPT_FILE("CORRUPT_FILE"), OCR_ERROR("OCR_ERROR"), PASSWORD_PROTECTED_FILE("PASSWORD_PROTECTED_FILE"), FAILED_TO_CONVERT_TO_PDF("FAILED_TO_CONVERT_TO_PDF"), FAILED_TO_GENERATE_TARGET_FORMAT("FAILED_TO_GENERATE_TARGET_FORMAT"), INTERNAL_ERROR("INTERNAL_ERROR"); private final String value; ParseErrorCode(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseRequestFile.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ParseRequestFile.Builder.class) public final class ParseRequestFile { private final Optional<String> fileName; private final Optional<String> fileUrl; private final Optional<String> fileId; private final Map<String, Object> additionalProperties; private ParseRequestFile( Optional<String> fileName, Optional<String> fileUrl, Optional<String> fileId, Map<String, Object> additionalProperties) { this.fileName = fileName; this.fileUrl = fileUrl; this.fileId = fileId; this.additionalProperties = additionalProperties; } /** * @return The name of the file. If not set, the file name is taken from the url. */ @JsonProperty("fileName") public Optional<String> getFileName() { return fileName; } /** * @return A URL to download the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time. One of <code>fileUrl</code> or <code>fileId</code> must be provided. */ @JsonProperty("fileUrl") public Optional<String> getFileUrl() { return fileUrl; } /** * @return If you already have an Extend file id (for instance from running a workflow or a previous <a href="https://docs.extend.ai/2025-04-21/developers/api-reference/file-endpoints/upload-file">file upload</a>) then you can use that file id when running the parse endpoint so that it leverage any cached data that might be available. The file id will start with &quot;file_&quot;. One of <code>fileUrl</code> or <code>fileId</code> must be provided. * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("fileId") public Optional<String> getFileId() { return fileId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParseRequestFile && equalTo((ParseRequestFile) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParseRequestFile other) { return fileName.equals(other.fileName) && fileUrl.equals(other.fileUrl) && fileId.equals(other.fileId); } @java.lang.Override public int hashCode() { return Objects.hash(this.fileName, this.fileUrl, this.fileId); } @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<String> fileName = Optional.empty(); private Optional<String> fileUrl = Optional.empty(); private Optional<String> fileId = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ParseRequestFile other) { fileName(other.getFileName()); fileUrl(other.getFileUrl()); fileId(other.getFileId()); return this; } /** * <p>The name of the file. If not set, the file name is taken from the url.</p> */ @JsonSetter(value = "fileName", nulls = Nulls.SKIP) public Builder fileName(Optional<String> fileName) { this.fileName = fileName; return this; } public Builder fileName(String fileName) { this.fileName = Optional.ofNullable(fileName); return this; } /** * <p>A URL to download the file. For production use cases, we recommend using presigned URLs with a 5-15 minute expiration time. One of <code>fileUrl</code> or <code>fileId</code> must be provided.</p> */ @JsonSetter(value = "fileUrl", nulls = Nulls.SKIP) public Builder fileUrl(Optional<String> fileUrl) { this.fileUrl = fileUrl; return this; } public Builder fileUrl(String fileUrl) { this.fileUrl = Optional.ofNullable(fileUrl); return this; } /** * <p>If you already have an Extend file id (for instance from running a workflow or a previous <a href="https://docs.extend.ai/2025-04-21/developers/api-reference/file-endpoints/upload-file">file upload</a>) then you can use that file id when running the parse endpoint so that it leverage any cached data that might be available. The file id will start with &quot;file_&quot;. One of <code>fileUrl</code> or <code>fileId</code> must be provided.</p> * <p>Example: <code>&quot;file_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonSetter(value = "fileId", nulls = Nulls.SKIP) public Builder fileId(Optional<String> fileId) { this.fileId = fileId; return this; } public Builder fileId(String fileId) { this.fileId = Optional.ofNullable(fileId); return this; } public ParseRequestFile build() { return new ParseRequestFile(fileName, fileUrl, fileId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParseRequestResponseType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParseRequestResponseType { JSON("json"), URL("url"); private final String value; ParseRequestResponseType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParserRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ParserRun.Builder.class) public final class ParserRun { private final String id; private final String fileId; private final List<Chunk> chunks; private final ParserRunStatusEnum status; private final Optional<String> failureReason; private final ParserRunMetrics metrics; private final ParseConfig config; private final Map<String, Object> additionalProperties; private ParserRun( String id, String fileId, List<Chunk> chunks, ParserRunStatusEnum status, Optional<String> failureReason, ParserRunMetrics metrics, ParseConfig config, Map<String, Object> additionalProperties) { this.id = id; this.fileId = fileId; this.chunks = chunks; this.status = status; this.failureReason = failureReason; this.metrics = metrics; this.config = config; this.additionalProperties = additionalProperties; } /** * @return A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs. */ @JsonProperty("fileId") public String getFileId() { return fileId; } /** * @return An array of chunks that were parsed from the file. */ @JsonProperty("chunks") public List<Chunk> getChunks() { return chunks; } /** * @return The status of the parser run: * <ul> * <li><code>&quot;PROCESSED&quot;</code> - The file was successfully processed</li> * <li><code>&quot;FAILED&quot;</code> - The processing failed (see failureReason for details)</li> * </ul> */ @JsonProperty("status") public ParserRunStatusEnum getStatus() { return status; } /** * @return The reason for failure if status is &quot;FAILED&quot;. */ @JsonProperty("failureReason") public Optional<String> getFailureReason() { return failureReason; } /** * @return Metrics about the parsing process. */ @JsonProperty("metrics") public ParserRunMetrics getMetrics() { return metrics; } /** * @return The configuration used for the parsing process, including any default values that were applied. */ @JsonProperty("config") public ParseConfig getConfig() { return config; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParserRun && equalTo((ParserRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParserRun other) { return id.equals(other.id) && fileId.equals(other.fileId) && chunks.equals(other.chunks) && status.equals(other.status) && failureReason.equals(other.failureReason) && metrics.equals(other.metrics) && config.equals(other.config); } @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.fileId, this.chunks, this.status, this.failureReason, this.metrics, this.config); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ FileIdStage id(@NotNull String id); Builder from(ParserRun other); } public interface FileIdStage { /** * <p>The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs.</p> */ StatusStage fileId(@NotNull String fileId); } public interface StatusStage { /** * <p>The status of the parser run:</p> * <ul> * <li><code>&quot;PROCESSED&quot;</code> - The file was successfully processed</li> * <li><code>&quot;FAILED&quot;</code> - The processing failed (see failureReason for details)</li> * </ul> */ MetricsStage status(@NotNull ParserRunStatusEnum status); } public interface MetricsStage { /** * <p>Metrics about the parsing process.</p> */ ConfigStage metrics(@NotNull ParserRunMetrics metrics); } public interface ConfigStage { /** * <p>The configuration used for the parsing process, including any default values that were applied.</p> */ _FinalStage config(@NotNull ParseConfig config); } public interface _FinalStage { ParserRun build(); /** * <p>An array of chunks that were parsed from the file.</p> */ _FinalStage chunks(List<Chunk> chunks); _FinalStage addChunks(Chunk chunks); _FinalStage addAllChunks(List<Chunk> chunks); /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> */ _FinalStage failureReason(Optional<String> failureReason); _FinalStage failureReason(String failureReason); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, FileIdStage, StatusStage, MetricsStage, ConfigStage, _FinalStage { private String id; private String fileId; private ParserRunStatusEnum status; private ParserRunMetrics metrics; private ParseConfig config; private Optional<String> failureReason = Optional.empty(); private List<Chunk> chunks = new ArrayList<>(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ParserRun other) { id(other.getId()); fileId(other.getFileId()); chunks(other.getChunks()); status(other.getStatus()); failureReason(other.getFailureReason()); metrics(other.getMetrics()); config(other.getConfig()); return this; } /** * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public FileIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs.</p> * <p>The identifier of the file that was parsed. This can be used as a parameter to other Extend endpoints, such as processor runs.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("fileId") public StatusStage fileId(@NotNull String fileId) { this.fileId = Objects.requireNonNull(fileId, "fileId must not be null"); return this; } /** * <p>The status of the parser run:</p> * <ul> * <li><code>&quot;PROCESSED&quot;</code> - The file was successfully processed</li> * <li><code>&quot;FAILED&quot;</code> - The processing failed (see failureReason for details)</li> * </ul> * <p>The status of the parser run:</p> * <ul> * <li><code>&quot;PROCESSED&quot;</code> - The file was successfully processed</li> * <li><code>&quot;FAILED&quot;</code> - The processing failed (see failureReason for details)</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("status") public MetricsStage status(@NotNull ParserRunStatusEnum status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } /** * <p>Metrics about the parsing process.</p> * <p>Metrics about the parsing process.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("metrics") public ConfigStage metrics(@NotNull ParserRunMetrics metrics) { this.metrics = Objects.requireNonNull(metrics, "metrics must not be null"); return this; } /** * <p>The configuration used for the parsing process, including any default values that were applied.</p> * <p>The configuration used for the parsing process, including any default values that were applied.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("config") public _FinalStage config(@NotNull ParseConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureReason(String failureReason) { this.failureReason = Optional.ofNullable(failureReason); return this; } /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> */ @java.lang.Override @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) public _FinalStage failureReason(Optional<String> failureReason) { this.failureReason = failureReason; return this; } /** * <p>An array of chunks that were parsed from the file.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addAllChunks(List<Chunk> chunks) { this.chunks.addAll(chunks); return this; } /** * <p>An array of chunks that were parsed from the file.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addChunks(Chunk chunks) { this.chunks.add(chunks); return this; } /** * <p>An array of chunks that were parsed from the file.</p> */ @java.lang.Override @JsonSetter(value = "chunks", nulls = Nulls.SKIP) public _FinalStage chunks(List<Chunk> chunks) { this.chunks.clear(); this.chunks.addAll(chunks); return this; } @java.lang.Override public ParserRun build() { return new ParserRun(id, fileId, chunks, status, failureReason, metrics, config, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParserRunMetrics.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ParserRunMetrics.Builder.class) public final class ParserRunMetrics { private final double processingTimeMs; private final double pageCount; private final Map<String, Object> additionalProperties; private ParserRunMetrics(double processingTimeMs, double pageCount, Map<String, Object> additionalProperties) { this.processingTimeMs = processingTimeMs; this.pageCount = pageCount; this.additionalProperties = additionalProperties; } /** * @return The time taken to process the document in milliseconds. */ @JsonProperty("processingTimeMs") public double getProcessingTimeMs() { return processingTimeMs; } /** * @return The number of pages in the document. */ @JsonProperty("pageCount") public double getPageCount() { return pageCount; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParserRunMetrics && equalTo((ParserRunMetrics) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParserRunMetrics other) { return processingTimeMs == other.processingTimeMs && pageCount == other.pageCount; } @java.lang.Override public int hashCode() { return Objects.hash(this.processingTimeMs, this.pageCount); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ProcessingTimeMsStage builder() { return new Builder(); } public interface ProcessingTimeMsStage { /** * <p>The time taken to process the document in milliseconds.</p> */ PageCountStage processingTimeMs(double processingTimeMs); Builder from(ParserRunMetrics other); } public interface PageCountStage { /** * <p>The number of pages in the document.</p> */ _FinalStage pageCount(double pageCount); } public interface _FinalStage { ParserRunMetrics build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ProcessingTimeMsStage, PageCountStage, _FinalStage { private double processingTimeMs; private double pageCount; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ParserRunMetrics other) { processingTimeMs(other.getProcessingTimeMs()); pageCount(other.getPageCount()); return this; } /** * <p>The time taken to process the document in milliseconds.</p> * <p>The time taken to process the document in milliseconds.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processingTimeMs") public PageCountStage processingTimeMs(double processingTimeMs) { this.processingTimeMs = processingTimeMs; return this; } /** * <p>The number of pages in the document.</p> * <p>The number of pages in the document.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("pageCount") public _FinalStage pageCount(double pageCount) { this.pageCount = pageCount; return this; } @java.lang.Override public ParserRunMetrics build() { return new ParserRunMetrics(processingTimeMs, pageCount, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParserRunStatus.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ParserRunStatus.Builder.class) public final class ParserRunStatus { private final String id; private final ParserRunStatusStatus status; private final Optional<String> failureReason; private final Map<String, Object> additionalProperties; private ParserRunStatus( String id, ParserRunStatusStatus status, Optional<String> failureReason, Map<String, Object> additionalProperties) { this.id = id; this.status = status; this.failureReason = failureReason; this.additionalProperties = additionalProperties; } /** * @return A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The status of the parser run. */ @JsonProperty("status") public ParserRunStatusStatus getStatus() { return status; } /** * @return The reason for failure if status is &quot;FAILED&quot;. */ @JsonProperty("failureReason") public Optional<String> getFailureReason() { return failureReason; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ParserRunStatus && equalTo((ParserRunStatus) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ParserRunStatus other) { return id.equals(other.id) && status.equals(other.status) && failureReason.equals(other.failureReason); } @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.status, this.failureReason); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ StatusStage id(@NotNull String id); Builder from(ParserRunStatus other); } public interface StatusStage { /** * <p>The status of the parser run.</p> */ _FinalStage status(@NotNull ParserRunStatusStatus status); } public interface _FinalStage { ParserRunStatus build(); /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> */ _FinalStage failureReason(Optional<String> failureReason); _FinalStage failureReason(String failureReason); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, StatusStage, _FinalStage { private String id; private ParserRunStatusStatus status; private Optional<String> failureReason = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ParserRunStatus other) { id(other.getId()); status(other.getStatus()); failureReason(other.getFailureReason()); return this; } /** * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * <p>A unique identifier for the parser run. Will always start with <code>&quot;parser_run_&quot;</code></p> * <p>Example: <code>&quot;parser_run_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public StatusStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The status of the parser run.</p> * <p>The status of the parser run.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("status") public _FinalStage status(@NotNull ParserRunStatusStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureReason(String failureReason) { this.failureReason = Optional.ofNullable(failureReason); return this; } /** * <p>The reason for failure if status is &quot;FAILED&quot;.</p> */ @java.lang.Override @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) public _FinalStage failureReason(Optional<String> failureReason) { this.failureReason = failureReason; return this; } @java.lang.Override public ParserRunStatus build() { return new ParserRunStatus(id, status, failureReason, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParserRunStatusEnum.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParserRunStatusEnum { PROCESSED("PROCESSED"), FAILED("FAILED"); private final String value; ParserRunStatusEnum(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ParserRunStatusStatus.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ParserRunStatusStatus { PROCESSING("PROCESSING"), PROCESSED("PROCESSED"), FAILED("FAILED"); private final String value; ParserRunStatusStatus(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/Polygon.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Polygon.Builder.class) public final class Polygon { private final double x; private final double y; private final Map<String, Object> additionalProperties; private Polygon(double x, double y, Map<String, Object> additionalProperties) { this.x = x; this.y = y; this.additionalProperties = additionalProperties; } /** * @return X coordinate of the point */ @JsonProperty("x") public double getX() { return x; } /** * @return Y coordinate of the point */ @JsonProperty("y") public double getY() { return y; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Polygon && equalTo((Polygon) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(Polygon other) { return x == other.x && y == other.y; } @java.lang.Override public int hashCode() { return Objects.hash(this.x, this.y); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static XStage builder() { return new Builder(); } public interface XStage { /** * <p>X coordinate of the point</p> */ YStage x(double x); Builder from(Polygon other); } public interface YStage { /** * <p>Y coordinate of the point</p> */ _FinalStage y(double y); } public interface _FinalStage { Polygon build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements XStage, YStage, _FinalStage { private double x; private double y; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(Polygon other) { x(other.getX()); y(other.getY()); return this; } /** * <p>X coordinate of the point</p> * <p>X coordinate of the point</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("x") public YStage x(double x) { this.x = x; return this; } /** * <p>Y coordinate of the point</p> * <p>Y coordinate of the point</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("y") public _FinalStage y(double y) { this.y = y; return this; } @java.lang.Override public Polygon build() { return new Polygon(x, y, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/Processor.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Processor.Builder.class) public final class Processor { private final String object; private final String id; private final String name; private final ProcessorType type; private final OffsetDateTime createdAt; private final OffsetDateTime updatedAt; private final ProcessorVersion draftVersion; private final Map<String, Object> additionalProperties; private Processor( String object, String id, String name, ProcessorType type, OffsetDateTime createdAt, OffsetDateTime updatedAt, ProcessorVersion draftVersion, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.name = name; this.type = type; this.createdAt = createdAt; this.updatedAt = updatedAt; this.draftVersion = draftVersion; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;document_processor&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The ID of the processor. * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The name of the processor. * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ @JsonProperty("name") public String getName() { return name; } @JsonProperty("type") public ProcessorType getType() { return type; } /** * @return The time (in UTC) at which the processor was created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } /** * @return The time (in UTC) at which the processor was last updated. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("updatedAt") public OffsetDateTime getUpdatedAt() { return updatedAt; } @JsonProperty("draftVersion") public ProcessorVersion getDraftVersion() { return draftVersion; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Processor && equalTo((Processor) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(Processor other) { return object.equals(other.object) && id.equals(other.id) && name.equals(other.name) && type.equals(other.type) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt) && draftVersion.equals(other.draftVersion); } @java.lang.Override public int hashCode() { return Objects.hash( this.object, this.id, this.name, this.type, this.createdAt, this.updatedAt, this.draftVersion); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;document_processor&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(Processor other); } public interface IdStage { /** * <p>The ID of the processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ NameStage id(@NotNull String id); } public interface NameStage { /** * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ TypeStage name(@NotNull String name); } public interface TypeStage { CreatedAtStage type(@NotNull ProcessorType type); } public interface CreatedAtStage { /** * <p>The time (in UTC) at which the processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); } public interface UpdatedAtStage { /** * <p>The time (in UTC) at which the processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ DraftVersionStage updatedAt(@NotNull OffsetDateTime updatedAt); } public interface DraftVersionStage { _FinalStage draftVersion(@NotNull ProcessorVersion draftVersion); } public interface _FinalStage { Processor build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, NameStage, TypeStage, CreatedAtStage, UpdatedAtStage, DraftVersionStage, _FinalStage { private String object; private String id; private String name; private ProcessorType type; private OffsetDateTime createdAt; private OffsetDateTime updatedAt; private ProcessorVersion draftVersion; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(Processor other) { object(other.getObject()); id(other.getId()); name(other.getName()); type(other.getType()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); draftVersion(other.getDraftVersion()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;document_processor&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;document_processor&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The ID of the processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The ID of the processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public TypeStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } @java.lang.Override @JsonSetter("type") public CreatedAtStage type(@NotNull ProcessorType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>The time (in UTC) at which the processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * <p>The time (in UTC) at which the processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("createdAt") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } /** * <p>The time (in UTC) at which the processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * <p>The time (in UTC) at which the processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("updatedAt") public DraftVersionStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } @java.lang.Override @JsonSetter("draftVersion") public _FinalStage draftVersion(@NotNull ProcessorVersion draftVersion) { this.draftVersion = Objects.requireNonNull(draftVersion, "draftVersion must not be null"); return this; } @java.lang.Override public Processor build() { return new Processor(object, id, name, type, createdAt, updatedAt, draftVersion, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; import java.util.Objects; @JsonDeserialize(using = ProcessorOutput.Deserializer.class) public final class ProcessorOutput { private final Object value; private final int type; private ProcessorOutput(Object value, int type) { this.value = value; this.type = type; } @JsonValue public Object get() { return this.value; } @SuppressWarnings("unchecked") public <T> T visit(Visitor<T> visitor) { if (this.type == 0) { return visitor.visit((ExtractionOutput) this.value); } else if (this.type == 1) { return visitor.visit((ClassifierOutput) this.value); } else if (this.type == 2) { return visitor.visit((SplitterOutput) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProcessorOutput && equalTo((ProcessorOutput) other); } private boolean equalTo(ProcessorOutput other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return this.value.toString(); } public static ProcessorOutput of(ExtractionOutput value) { return new ProcessorOutput(value, 0); } public static ProcessorOutput of(ClassifierOutput value) { return new ProcessorOutput(value, 1); } public static ProcessorOutput of(SplitterOutput value) { return new ProcessorOutput(value, 2); } public interface Visitor<T> { T visit(ExtractionOutput value); T visit(ClassifierOutput value); T visit(SplitterOutput value); } static final class Deserializer extends StdDeserializer<ProcessorOutput> { Deserializer() { super(ProcessorOutput.class); } @java.lang.Override public ProcessorOutput deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ExtractionOutput.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ClassifierOutput.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, SplitterOutput.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProcessorRun.Builder.class) public final class ProcessorRun { private final String object; private final String id; private final String processorId; private final String processorVersionId; private final String processorName; private final ProcessorRunStatus status; private final ProcessorOutput output; private final Optional<String> failureReason; private final Optional<String> failureMessage; private final Optional<Map<String, Object>> metadata; private final boolean reviewed; private final boolean edited; private final Map<String, ExtractionOutputEdits> edits; private final ProcessorRunType type; private final ProcessorRunConfig config; private final Optional<ProcessorOutput> initialOutput; private final Optional<ProcessorOutput> reviewedOutput; private final List<File> files; private final List<ProcessorRunMergedProcessorsItem> mergedProcessors; private final String url; private final Map<String, Object> additionalProperties; private ProcessorRun( String object, String id, String processorId, String processorVersionId, String processorName, ProcessorRunStatus status, ProcessorOutput output, Optional<String> failureReason, Optional<String> failureMessage, Optional<Map<String, Object>> metadata, boolean reviewed, boolean edited, Map<String, ExtractionOutputEdits> edits, ProcessorRunType type, ProcessorRunConfig config, Optional<ProcessorOutput> initialOutput, Optional<ProcessorOutput> reviewedOutput, List<File> files, List<ProcessorRunMergedProcessorsItem> mergedProcessors, String url, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.processorId = processorId; this.processorVersionId = processorVersionId; this.processorName = processorName; this.status = status; this.output = output; this.failureReason = failureReason; this.failureMessage = failureMessage; this.metadata = metadata; this.reviewed = reviewed; this.edited = edited; this.edits = edits; this.type = type; this.config = config; this.initialOutput = initialOutput; this.reviewedOutput = reviewedOutput; this.files = files; this.mergedProcessors = mergedProcessors; this.url = url; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;document_processor_run&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The unique identifier for this processor run. * <p>Example: <code>&quot;dpr_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The ID of the processor used for this run. * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ @JsonProperty("processorId") public String getProcessorId() { return processorId; } /** * @return The ID of the specific processor version used. */ @JsonProperty("processorVersionId") public String getProcessorVersionId() { return processorVersionId; } /** * @return The name of the processor. * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ @JsonProperty("processorName") public String getProcessorName() { return processorName; } /** * @return The current status of the processor run: * <ul> * <li><code>&quot;PROCESSING&quot;</code> - The processor is currently running</li> * <li><code>&quot;PROCESSED&quot;</code> - The processor has completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The processor encountered an error</li> * <li><code>&quot;CANCELLED&quot;</code> - The processor run was cancelled</li> * </ul> */ @JsonProperty("status") public ProcessorRunStatus getStatus() { return status; } /** * @return The final output, either reviewed or initial. * <p>Conforms to the shape of output types and depends on the processor type and configuration shape.</p> */ @JsonProperty("output") public ProcessorOutput getOutput() { return output; } /** * @return If the run failed, indicates the reason for failure. */ @JsonProperty("failureReason") public Optional<String> getFailureReason() { return failureReason; } /** * @return If the run failed, provides a detailed message about the failure. */ @JsonProperty("failureMessage") public Optional<String> getFailureMessage() { return failureMessage; } /** * @return Any metadata that was provided when creating the processor run. */ @JsonProperty("metadata") public Optional<Map<String, Object>> getMetadata() { return metadata; } /** * @return Indicates whether the run has been reviewed. */ @JsonProperty("reviewed") public boolean getReviewed() { return reviewed; } /** * @return Indicates whether the run results have been edited. */ @JsonProperty("edited") public boolean getEdited() { return edited; } @JsonProperty("edits") public Map<String, ExtractionOutputEdits> getEdits() { return edits; } /** * @return The type of processor: * <ul> * <li><code>&quot;CLASSIFY&quot;</code> - Classifies documents into categories</li> * <li><code>&quot;EXTRACT&quot;</code> - Extracts structured data from documents</li> * <li><code>&quot;SPLITTER&quot;</code> - Splits documents into multiple parts</li> * </ul> */ @JsonProperty("type") public ProcessorRunType getType() { return type; } /** * @return The configuration used for this processor run. The type of configuration will match the processor type. */ @JsonProperty("config") public ProcessorRunConfig getConfig() { return config; } /** * @return The initial output from the processor run. The type of output will match the processor type. */ @JsonProperty("initialOutput") public Optional<ProcessorOutput> getInitialOutput() { return initialOutput; } /** * @return The output after review, if any. */ @JsonProperty("reviewedOutput") public Optional<ProcessorOutput> getReviewedOutput() { return reviewedOutput; } /** * @return Details of the processed files. * <p>If this was a file generated from a splitter processor, this will be the sub file.</p> * <p>See the File object for more details.</p> */ @JsonProperty("files") public List<File> getFiles() { return files; } /** * @return An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow. */ @JsonProperty("mergedProcessors") public List<ProcessorRunMergedProcessorsItem> getMergedProcessors() { return mergedProcessors; } /** * @return The URL to view the processor run. */ @JsonProperty("url") public String getUrl() { return url; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProcessorRun && equalTo((ProcessorRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProcessorRun other) { return object.equals(other.object) && id.equals(other.id) && processorId.equals(other.processorId) && processorVersionId.equals(other.processorVersionId) && processorName.equals(other.processorName) && status.equals(other.status) && output.equals(other.output) && failureReason.equals(other.failureReason) && failureMessage.equals(other.failureMessage) && metadata.equals(other.metadata) && reviewed == other.reviewed && edited == other.edited && edits.equals(other.edits) && type.equals(other.type) && config.equals(other.config) && initialOutput.equals(other.initialOutput) && reviewedOutput.equals(other.reviewedOutput) && files.equals(other.files) && mergedProcessors.equals(other.mergedProcessors) && url.equals(other.url); } @java.lang.Override public int hashCode() { return Objects.hash( this.object, this.id, this.processorId, this.processorVersionId, this.processorName, this.status, this.output, this.failureReason, this.failureMessage, this.metadata, this.reviewed, this.edited, this.edits, this.type, this.config, this.initialOutput, this.reviewedOutput, this.files, this.mergedProcessors, this.url); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;document_processor_run&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(ProcessorRun other); } public interface IdStage { /** * <p>The unique identifier for this processor run.</p> * <p>Example: <code>&quot;dpr_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ ProcessorIdStage id(@NotNull String id); } public interface ProcessorIdStage { /** * <p>The ID of the processor used for this run.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ ProcessorVersionIdStage processorId(@NotNull String processorId); } public interface ProcessorVersionIdStage { /** * <p>The ID of the specific processor version used.</p> */ ProcessorNameStage processorVersionId(@NotNull String processorVersionId); } public interface ProcessorNameStage { /** * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ StatusStage processorName(@NotNull String processorName); } public interface StatusStage { /** * <p>The current status of the processor run:</p> * <ul> * <li><code>&quot;PROCESSING&quot;</code> - The processor is currently running</li> * <li><code>&quot;PROCESSED&quot;</code> - The processor has completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The processor encountered an error</li> * <li><code>&quot;CANCELLED&quot;</code> - The processor run was cancelled</li> * </ul> */ OutputStage status(@NotNull ProcessorRunStatus status); } public interface OutputStage { /** * <p>The final output, either reviewed or initial.</p> * <p>Conforms to the shape of output types and depends on the processor type and configuration shape.</p> */ ReviewedStage output(@NotNull ProcessorOutput output); } public interface ReviewedStage { /** * <p>Indicates whether the run has been reviewed.</p> */ EditedStage reviewed(boolean reviewed); } public interface EditedStage { /** * <p>Indicates whether the run results have been edited.</p> */ TypeStage edited(boolean edited); } public interface TypeStage { /** * <p>The type of processor:</p> * <ul> * <li><code>&quot;CLASSIFY&quot;</code> - Classifies documents into categories</li> * <li><code>&quot;EXTRACT&quot;</code> - Extracts structured data from documents</li> * <li><code>&quot;SPLITTER&quot;</code> - Splits documents into multiple parts</li> * </ul> */ ConfigStage type(@NotNull ProcessorRunType type); } public interface ConfigStage { /** * <p>The configuration used for this processor run. The type of configuration will match the processor type.</p> */ UrlStage config(@NotNull ProcessorRunConfig config); } public interface UrlStage { /** * <p>The URL to view the processor run.</p> */ _FinalStage url(@NotNull String url); } public interface _FinalStage { ProcessorRun build(); /** * <p>If the run failed, indicates the reason for failure.</p> */ _FinalStage failureReason(Optional<String> failureReason); _FinalStage failureReason(String failureReason); /** * <p>If the run failed, provides a detailed message about the failure.</p> */ _FinalStage failureMessage(Optional<String> failureMessage); _FinalStage failureMessage(String failureMessage); /** * <p>Any metadata that was provided when creating the processor run.</p> */ _FinalStage metadata(Optional<Map<String, Object>> metadata); _FinalStage metadata(Map<String, Object> metadata); _FinalStage edits(Map<String, ExtractionOutputEdits> edits); _FinalStage putAllEdits(Map<String, ExtractionOutputEdits> edits); _FinalStage edits(String key, ExtractionOutputEdits value); /** * <p>The initial output from the processor run. The type of output will match the processor type.</p> */ _FinalStage initialOutput(Optional<ProcessorOutput> initialOutput); _FinalStage initialOutput(ProcessorOutput initialOutput); /** * <p>The output after review, if any.</p> */ _FinalStage reviewedOutput(Optional<ProcessorOutput> reviewedOutput); _FinalStage reviewedOutput(ProcessorOutput reviewedOutput); /** * <p>Details of the processed files.</p> * <p>If this was a file generated from a splitter processor, this will be the sub file.</p> * <p>See the File object for more details.</p> */ _FinalStage files(List<File> files); _FinalStage addFiles(File files); _FinalStage addAllFiles(List<File> files); /** * <p>An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.</p> */ _FinalStage mergedProcessors(List<ProcessorRunMergedProcessorsItem> mergedProcessors); _FinalStage addMergedProcessors(ProcessorRunMergedProcessorsItem mergedProcessors); _FinalStage addAllMergedProcessors(List<ProcessorRunMergedProcessorsItem> mergedProcessors); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, ProcessorIdStage, ProcessorVersionIdStage, ProcessorNameStage, StatusStage, OutputStage, ReviewedStage, EditedStage, TypeStage, ConfigStage, UrlStage, _FinalStage { private String object; private String id; private String processorId; private String processorVersionId; private String processorName; private ProcessorRunStatus status; private ProcessorOutput output; private boolean reviewed; private boolean edited; private ProcessorRunType type; private ProcessorRunConfig config; private String url; private List<ProcessorRunMergedProcessorsItem> mergedProcessors = new ArrayList<>(); private List<File> files = new ArrayList<>(); private Optional<ProcessorOutput> reviewedOutput = Optional.empty(); private Optional<ProcessorOutput> initialOutput = Optional.empty(); private Map<String, ExtractionOutputEdits> edits = new LinkedHashMap<>(); private Optional<Map<String, Object>> metadata = Optional.empty(); private Optional<String> failureMessage = Optional.empty(); private Optional<String> failureReason = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProcessorRun other) { object(other.getObject()); id(other.getId()); processorId(other.getProcessorId()); processorVersionId(other.getProcessorVersionId()); processorName(other.getProcessorName()); status(other.getStatus()); output(other.getOutput()); failureReason(other.getFailureReason()); failureMessage(other.getFailureMessage()); metadata(other.getMetadata()); reviewed(other.getReviewed()); edited(other.getEdited()); edits(other.getEdits()); type(other.getType()); config(other.getConfig()); initialOutput(other.getInitialOutput()); reviewedOutput(other.getReviewedOutput()); files(other.getFiles()); mergedProcessors(other.getMergedProcessors()); url(other.getUrl()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;document_processor_run&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;document_processor_run&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The unique identifier for this processor run.</p> * <p>Example: <code>&quot;dpr_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The unique identifier for this processor run.</p> * <p>Example: <code>&quot;dpr_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public ProcessorIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The ID of the processor used for this run.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The ID of the processor used for this run.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorId") public ProcessorVersionIdStage processorId(@NotNull String processorId) { this.processorId = Objects.requireNonNull(processorId, "processorId must not be null"); return this; } /** * <p>The ID of the specific processor version used.</p> * <p>The ID of the specific processor version used.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorVersionId") public ProcessorNameStage processorVersionId(@NotNull String processorVersionId) { this.processorVersionId = Objects.requireNonNull(processorVersionId, "processorVersionId must not be null"); return this; } /** * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> * <p>The name of the processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorName") public StatusStage processorName(@NotNull String processorName) { this.processorName = Objects.requireNonNull(processorName, "processorName must not be null"); return this; } /** * <p>The current status of the processor run:</p> * <ul> * <li><code>&quot;PROCESSING&quot;</code> - The processor is currently running</li> * <li><code>&quot;PROCESSED&quot;</code> - The processor has completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The processor encountered an error</li> * <li><code>&quot;CANCELLED&quot;</code> - The processor run was cancelled</li> * </ul> * <p>The current status of the processor run:</p> * <ul> * <li><code>&quot;PROCESSING&quot;</code> - The processor is currently running</li> * <li><code>&quot;PROCESSED&quot;</code> - The processor has completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The processor encountered an error</li> * <li><code>&quot;CANCELLED&quot;</code> - The processor run was cancelled</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("status") public OutputStage status(@NotNull ProcessorRunStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } /** * <p>The final output, either reviewed or initial.</p> * <p>Conforms to the shape of output types and depends on the processor type and configuration shape.</p> * <p>The final output, either reviewed or initial.</p> * <p>Conforms to the shape of output types and depends on the processor type and configuration shape.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("output") public ReviewedStage output(@NotNull ProcessorOutput output) { this.output = Objects.requireNonNull(output, "output must not be null"); return this; } /** * <p>Indicates whether the run has been reviewed.</p> * <p>Indicates whether the run has been reviewed.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("reviewed") public EditedStage reviewed(boolean reviewed) { this.reviewed = reviewed; return this; } /** * <p>Indicates whether the run results have been edited.</p> * <p>Indicates whether the run results have been edited.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("edited") public TypeStage edited(boolean edited) { this.edited = edited; return this; } /** * <p>The type of processor:</p> * <ul> * <li><code>&quot;CLASSIFY&quot;</code> - Classifies documents into categories</li> * <li><code>&quot;EXTRACT&quot;</code> - Extracts structured data from documents</li> * <li><code>&quot;SPLITTER&quot;</code> - Splits documents into multiple parts</li> * </ul> * <p>The type of processor:</p> * <ul> * <li><code>&quot;CLASSIFY&quot;</code> - Classifies documents into categories</li> * <li><code>&quot;EXTRACT&quot;</code> - Extracts structured data from documents</li> * <li><code>&quot;SPLITTER&quot;</code> - Splits documents into multiple parts</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public ConfigStage type(@NotNull ProcessorRunType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>The configuration used for this processor run. The type of configuration will match the processor type.</p> * <p>The configuration used for this processor run. The type of configuration will match the processor type.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("config") public UrlStage config(@NotNull ProcessorRunConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } /** * <p>The URL to view the processor run.</p> * <p>The URL to view the processor run.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("url") public _FinalStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } /** * <p>An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addAllMergedProcessors(List<ProcessorRunMergedProcessorsItem> mergedProcessors) { this.mergedProcessors.addAll(mergedProcessors); return this; } /** * <p>An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addMergedProcessors(ProcessorRunMergedProcessorsItem mergedProcessors) { this.mergedProcessors.add(mergedProcessors); return this; } /** * <p>An array of processors that were merged to create this output. Will be an empty array unless this output was the result of a MergeExtraction step in a workflow.</p> */ @java.lang.Override @JsonSetter(value = "mergedProcessors", nulls = Nulls.SKIP) public _FinalStage mergedProcessors(List<ProcessorRunMergedProcessorsItem> mergedProcessors) { this.mergedProcessors.clear(); this.mergedProcessors.addAll(mergedProcessors); return this; } /** * <p>Details of the processed files.</p> * <p>If this was a file generated from a splitter processor, this will be the sub file.</p> * <p>See the File object for more details.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addAllFiles(List<File> files) { this.files.addAll(files); return this; } /** * <p>Details of the processed files.</p> * <p>If this was a file generated from a splitter processor, this will be the sub file.</p> * <p>See the File object for more details.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addFiles(File files) { this.files.add(files); return this; } /** * <p>Details of the processed files.</p> * <p>If this was a file generated from a splitter processor, this will be the sub file.</p> * <p>See the File object for more details.</p> */ @java.lang.Override @JsonSetter(value = "files", nulls = Nulls.SKIP) public _FinalStage files(List<File> files) { this.files.clear(); this.files.addAll(files); return this; } /** * <p>The output after review, if any.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage reviewedOutput(ProcessorOutput reviewedOutput) { this.reviewedOutput = Optional.ofNullable(reviewedOutput); return this; } /** * <p>The output after review, if any.</p> */ @java.lang.Override @JsonSetter(value = "reviewedOutput", nulls = Nulls.SKIP) public _FinalStage reviewedOutput(Optional<ProcessorOutput> reviewedOutput) { this.reviewedOutput = reviewedOutput; return this; } /** * <p>The initial output from the processor run. The type of output will match the processor type.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage initialOutput(ProcessorOutput initialOutput) { this.initialOutput = Optional.ofNullable(initialOutput); return this; } /** * <p>The initial output from the processor run. The type of output will match the processor type.</p> */ @java.lang.Override @JsonSetter(value = "initialOutput", nulls = Nulls.SKIP) public _FinalStage initialOutput(Optional<ProcessorOutput> initialOutput) { this.initialOutput = initialOutput; return this; } @java.lang.Override public _FinalStage edits(String key, ExtractionOutputEdits value) { this.edits.put(key, value); return this; } @java.lang.Override public _FinalStage putAllEdits(Map<String, ExtractionOutputEdits> edits) { this.edits.putAll(edits); return this; } @java.lang.Override @JsonSetter(value = "edits", nulls = Nulls.SKIP) public _FinalStage edits(Map<String, ExtractionOutputEdits> edits) { this.edits.clear(); this.edits.putAll(edits); return this; } /** * <p>Any metadata that was provided when creating the processor run.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage metadata(Map<String, Object> metadata) { this.metadata = Optional.ofNullable(metadata); return this; } /** * <p>Any metadata that was provided when creating the processor run.</p> */ @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Optional<Map<String, Object>> metadata) { this.metadata = metadata; return this; } /** * <p>If the run failed, provides a detailed message about the failure.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureMessage(String failureMessage) { this.failureMessage = Optional.ofNullable(failureMessage); return this; } /** * <p>If the run failed, provides a detailed message about the failure.</p> */ @java.lang.Override @JsonSetter(value = "failureMessage", nulls = Nulls.SKIP) public _FinalStage failureMessage(Optional<String> failureMessage) { this.failureMessage = failureMessage; return this; } /** * <p>If the run failed, indicates the reason for failure.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureReason(String failureReason) { this.failureReason = Optional.ofNullable(failureReason); return this; } /** * <p>If the run failed, indicates the reason for failure.</p> */ @java.lang.Override @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) public _FinalStage failureReason(Optional<String> failureReason) { this.failureReason = failureReason; return this; } @java.lang.Override public ProcessorRun build() { return new ProcessorRun( object, id, processorId, processorVersionId, processorName, status, output, failureReason, failureMessage, metadata, reviewed, edited, edits, type, config, initialOutput, reviewedOutput, files, mergedProcessors, url, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRunConfig.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Objects; import java.util.Optional; public final class ProcessorRunConfig { private final Value value; @JsonCreator(mode = JsonCreator.Mode.DELEGATING) private ProcessorRunConfig(Value value) { this.value = value; } public <T> T visit(Visitor<T> visitor) { return value.visit(visitor); } public static ProcessorRunConfig classify(ClassificationConfig value) { return new ProcessorRunConfig(new ClassifyValue(value)); } public static ProcessorRunConfig extract(ExtractionConfig value) { return new ProcessorRunConfig(new ExtractValue(value)); } public static ProcessorRunConfig splitter(SplitterConfig value) { return new ProcessorRunConfig(new SplitterValue(value)); } public boolean isClassify() { return value instanceof ClassifyValue; } public boolean isExtract() { return value instanceof ExtractValue; } public boolean isSplitter() { return value instanceof SplitterValue; } public boolean _isUnknown() { return value instanceof _UnknownValue; } public Optional<ClassificationConfig> getClassify() { if (isClassify()) { return Optional.of(((ClassifyValue) value).value); } return Optional.empty(); } public Optional<ExtractionConfig> getExtract() { if (isExtract()) { return Optional.of(((ExtractValue) value).value); } return Optional.empty(); } public Optional<SplitterConfig> getSplitter() { if (isSplitter()) { return Optional.of(((SplitterValue) value).value); } return Optional.empty(); } public Optional<Object> _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); } return Optional.empty(); } @JsonValue private Value getValue() { return this.value; } public interface Visitor<T> { T visitClassify(ClassificationConfig classify); T visitExtract(ExtractionConfig extract); T visitSplitter(SplitterConfig splitter); T _visitUnknown(Object unknownType); } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ @JsonSubTypes.Type(ClassifyValue.class), @JsonSubTypes.Type(ExtractValue.class), @JsonSubTypes.Type(SplitterValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { <T> T visit(Visitor<T> visitor); } @JsonTypeName("CLASSIFY") @JsonIgnoreProperties("type") private static final class ClassifyValue implements Value { @JsonUnwrapped private ClassificationConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private ClassifyValue() {} private ClassifyValue(ClassificationConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitClassify(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClassifyValue && equalTo((ClassifyValue) other); } private boolean equalTo(ClassifyValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorRunConfig{" + "value: " + value + "}"; } } @JsonTypeName("EXTRACT") @JsonIgnoreProperties("type") private static final class ExtractValue implements Value { @JsonUnwrapped private ExtractionConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private ExtractValue() {} private ExtractValue(ExtractionConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitExtract(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExtractValue && equalTo((ExtractValue) other); } private boolean equalTo(ExtractValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorRunConfig{" + "value: " + value + "}"; } } @JsonTypeName("SPLITTER") @JsonIgnoreProperties("type") private static final class SplitterValue implements Value { @JsonUnwrapped private SplitterConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private SplitterValue() {} private SplitterValue(SplitterConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitSplitter(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterValue && equalTo((SplitterValue) other); } private boolean equalTo(SplitterValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorRunConfig{" + "value: " + value + "}"; } } @JsonIgnoreProperties("type") private static final class _UnknownValue implements Value { private String type; @JsonValue private Object value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private _UnknownValue(@JsonProperty("value") Object value) {} @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor._visitUnknown(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof _UnknownValue && equalTo((_UnknownValue) other); } private boolean equalTo(_UnknownValue other) { return type.equals(other.type) && value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.value); } @java.lang.Override public String toString() { return "ProcessorRunConfig{" + "type: " + type + ", value: " + value + "}"; } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRunFileInput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = ProcessorRunFileInput.Builder.class) public final class ProcessorRunFileInput { private final Optional<String> fileName; private final Optional<String> fileUrl; private final Optional<String> fileId; private final Map<String, Object> additionalProperties; private ProcessorRunFileInput( Optional<String> fileName, Optional<String> fileUrl, Optional<String> fileId, Map<String, Object> additionalProperties) { this.fileName = fileName; this.fileUrl = fileUrl; this.fileId = fileId; this.additionalProperties = additionalProperties; } /** * @return The name of the file to be processed. If not provided, the file name will be inferred from the URL. It is highly recommended to include this parameter for legibility. */ @JsonProperty("fileName") public Optional<String> getFileName() { return fileName; } /** * @return A URL where the file can be downloaded from. If you use presigned URLs, we recommend an expiration time of 5-15 minutes. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. */ @JsonProperty("fileUrl") public Optional<String> getFileUrl() { return fileUrl; } /** * @return Extend's internal ID for the file. It will always start with <code>file_</code>. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. You can view a file ID from the Extend UI, for instance from running a parser or from a previous file creation. If you provide a <code>fileId</code>, any parsed data will be reused. */ @JsonProperty("fileId") public Optional<String> getFileId() { return fileId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProcessorRunFileInput && equalTo((ProcessorRunFileInput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProcessorRunFileInput other) { return fileName.equals(other.fileName) && fileUrl.equals(other.fileUrl) && fileId.equals(other.fileId); } @java.lang.Override public int hashCode() { return Objects.hash(this.fileName, this.fileUrl, this.fileId); } @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<String> fileName = Optional.empty(); private Optional<String> fileUrl = Optional.empty(); private Optional<String> fileId = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ProcessorRunFileInput other) { fileName(other.getFileName()); fileUrl(other.getFileUrl()); fileId(other.getFileId()); return this; } /** * <p>The name of the file to be processed. If not provided, the file name will be inferred from the URL. It is highly recommended to include this parameter for legibility.</p> */ @JsonSetter(value = "fileName", nulls = Nulls.SKIP) public Builder fileName(Optional<String> fileName) { this.fileName = fileName; return this; } public Builder fileName(String fileName) { this.fileName = Optional.ofNullable(fileName); return this; } /** * <p>A URL where the file can be downloaded from. If you use presigned URLs, we recommend an expiration time of 5-15 minutes. One of a <code>fileUrl</code> or <code>fileId</code> must be provided.</p> */ @JsonSetter(value = "fileUrl", nulls = Nulls.SKIP) public Builder fileUrl(Optional<String> fileUrl) { this.fileUrl = fileUrl; return this; } public Builder fileUrl(String fileUrl) { this.fileUrl = Optional.ofNullable(fileUrl); return this; } /** * <p>Extend's internal ID for the file. It will always start with <code>file_</code>. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. You can view a file ID from the Extend UI, for instance from running a parser or from a previous file creation. If you provide a <code>fileId</code>, any parsed data will be reused.</p> */ @JsonSetter(value = "fileId", nulls = Nulls.SKIP) public Builder fileId(Optional<String> fileId) { this.fileId = fileId; return this; } public Builder fileId(String fileId) { this.fileId = Optional.ofNullable(fileId); return this; } public ProcessorRunFileInput build() { return new ProcessorRunFileInput(fileName, fileUrl, fileId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRunMergedProcessorsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProcessorRunMergedProcessorsItem.Builder.class) public final class ProcessorRunMergedProcessorsItem { private final String processorId; private final String processorVersionId; private final String processorName; private final Map<String, Object> additionalProperties; private ProcessorRunMergedProcessorsItem( String processorId, String processorVersionId, String processorName, Map<String, Object> additionalProperties) { this.processorId = processorId; this.processorVersionId = processorVersionId; this.processorName = processorName; this.additionalProperties = additionalProperties; } /** * @return The ID of the merged processor. * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ @JsonProperty("processorId") public String getProcessorId() { return processorId; } /** * @return The ID of the specific processor version used. */ @JsonProperty("processorVersionId") public String getProcessorVersionId() { return processorVersionId; } /** * @return The name of the merged processor. * <p>Example: <code>&quot;Invoice Line Items Processor&quot;</code></p> */ @JsonProperty("processorName") public String getProcessorName() { return processorName; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProcessorRunMergedProcessorsItem && equalTo((ProcessorRunMergedProcessorsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProcessorRunMergedProcessorsItem other) { return processorId.equals(other.processorId) && processorVersionId.equals(other.processorVersionId) && processorName.equals(other.processorName); } @java.lang.Override public int hashCode() { return Objects.hash(this.processorId, this.processorVersionId, this.processorName); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ProcessorIdStage builder() { return new Builder(); } public interface ProcessorIdStage { /** * <p>The ID of the merged processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ ProcessorVersionIdStage processorId(@NotNull String processorId); Builder from(ProcessorRunMergedProcessorsItem other); } public interface ProcessorVersionIdStage { /** * <p>The ID of the specific processor version used.</p> */ ProcessorNameStage processorVersionId(@NotNull String processorVersionId); } public interface ProcessorNameStage { /** * <p>The name of the merged processor.</p> * <p>Example: <code>&quot;Invoice Line Items Processor&quot;</code></p> */ _FinalStage processorName(@NotNull String processorName); } public interface _FinalStage { ProcessorRunMergedProcessorsItem build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ProcessorIdStage, ProcessorVersionIdStage, ProcessorNameStage, _FinalStage { private String processorId; private String processorVersionId; private String processorName; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProcessorRunMergedProcessorsItem other) { processorId(other.getProcessorId()); processorVersionId(other.getProcessorVersionId()); processorName(other.getProcessorName()); return this; } /** * <p>The ID of the merged processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The ID of the merged processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorId") public ProcessorVersionIdStage processorId(@NotNull String processorId) { this.processorId = Objects.requireNonNull(processorId, "processorId must not be null"); return this; } /** * <p>The ID of the specific processor version used.</p> * <p>The ID of the specific processor version used.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorVersionId") public ProcessorNameStage processorVersionId(@NotNull String processorVersionId) { this.processorVersionId = Objects.requireNonNull(processorVersionId, "processorVersionId must not be null"); return this; } /** * <p>The name of the merged processor.</p> * <p>Example: <code>&quot;Invoice Line Items Processor&quot;</code></p> * <p>The name of the merged processor.</p> * <p>Example: <code>&quot;Invoice Line Items Processor&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorName") public _FinalStage processorName(@NotNull String processorName) { this.processorName = Objects.requireNonNull(processorName, "processorName must not be null"); return this; } @java.lang.Override public ProcessorRunMergedProcessorsItem build() { return new ProcessorRunMergedProcessorsItem( processorId, processorVersionId, processorName, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRunStatus.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ProcessorRunStatus { PROCESSING("PROCESSING"), PROCESSED("PROCESSED"), FAILED("FAILED"), CANCELLED("CANCELLED"); private final String value; ProcessorRunStatus(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorRunType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ProcessorRunType { CLASSIFY("CLASSIFY"), EXTRACT("EXTRACT"), SPLITTER("SPLITTER"); private final String value; ProcessorRunType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ProcessorType { EXTRACT("EXTRACT"), CLASSIFY("CLASSIFY"), SPLITTER("SPLITTER"); private final String value; ProcessorType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorVersion.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.time.OffsetDateTime; 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) @JsonDeserialize(builder = ProcessorVersion.Builder.class) public final class ProcessorVersion { private final String object; private final String id; private final String processorId; private final Optional<String> processorName; private final ProcessorType processorType; private final Optional<String> description; private final String version; private final ProcessorVersionConfig config; private final OffsetDateTime createdAt; private final OffsetDateTime updatedAt; private final Map<String, Object> additionalProperties; private ProcessorVersion( String object, String id, String processorId, Optional<String> processorName, ProcessorType processorType, Optional<String> description, String version, ProcessorVersionConfig config, OffsetDateTime createdAt, OffsetDateTime updatedAt, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.processorId = processorId; this.processorName = processorName; this.processorType = processorType; this.description = description; this.version = version; this.config = config; this.createdAt = createdAt; this.updatedAt = updatedAt; this.additionalProperties = additionalProperties; } /** * @return The type of the object. In this case, it will always be <code>&quot;document_processor_version&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The unique identifier for this version of the document processor. * <p>Example: <code>&quot;dpv_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The ID of the parent document processor. * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ @JsonProperty("processorId") public String getProcessorId() { return processorId; } /** * @return The name of the parent document processor. * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ @JsonProperty("processorName") public Optional<String> getProcessorName() { return processorName; } @JsonProperty("processorType") public ProcessorType getProcessorType() { return processorType; } /** * @return An optional description of this version of the document processor. * <p>Example: <code>&quot;Updated extraction fields for new invoice format&quot;</code></p> */ @JsonProperty("description") public Optional<String> getDescription() { return description; } /** * @return The version number or identifier for this specific version of the document processor. The draft version will have version=&quot;draft&quot;. * <p>Examples: <code>&quot;1.0&quot;</code>, <code>&quot;2.1&quot;</code>, <code>&quot;draft&quot;</code></p> */ @JsonProperty("version") public String getVersion() { return version; } /** * @return The configuration settings for this version of the document processor. The structure of this object will vary depending on the processor type. * <p>See the configuration section in the &quot;Guides&quot; tab, for yout specific processor type, for more details on the configuration settings.</p> */ @JsonProperty("config") public ProcessorVersionConfig getConfig() { return config; } /** * @return The time (in UTC) at which this version of the document processor was created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } /** * @return The time (in UTC) at which this version of the document processor was last updated. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("updatedAt") public OffsetDateTime getUpdatedAt() { return updatedAt; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProcessorVersion && equalTo((ProcessorVersion) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProcessorVersion other) { return object.equals(other.object) && id.equals(other.id) && processorId.equals(other.processorId) && processorName.equals(other.processorName) && processorType.equals(other.processorType) && description.equals(other.description) && version.equals(other.version) && config.equals(other.config) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt); } @java.lang.Override public int hashCode() { return Objects.hash( this.object, this.id, this.processorId, this.processorName, this.processorType, this.description, this.version, this.config, this.createdAt, this.updatedAt); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of the object. In this case, it will always be <code>&quot;document_processor_version&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(ProcessorVersion other); } public interface IdStage { /** * <p>The unique identifier for this version of the document processor.</p> * <p>Example: <code>&quot;dpv_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> */ ProcessorIdStage id(@NotNull String id); } public interface ProcessorIdStage { /** * <p>The ID of the parent document processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ ProcessorTypeStage processorId(@NotNull String processorId); } public interface ProcessorTypeStage { VersionStage processorType(@NotNull ProcessorType processorType); } public interface VersionStage { /** * <p>The version number or identifier for this specific version of the document processor. The draft version will have version=&quot;draft&quot;.</p> * <p>Examples: <code>&quot;1.0&quot;</code>, <code>&quot;2.1&quot;</code>, <code>&quot;draft&quot;</code></p> */ ConfigStage version(@NotNull String version); } public interface ConfigStage { /** * <p>The configuration settings for this version of the document processor. The structure of this object will vary depending on the processor type.</p> * <p>See the configuration section in the &quot;Guides&quot; tab, for yout specific processor type, for more details on the configuration settings.</p> */ CreatedAtStage config(@NotNull ProcessorVersionConfig config); } public interface CreatedAtStage { /** * <p>The time (in UTC) at which this version of the document processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); } public interface UpdatedAtStage { /** * <p>The time (in UTC) at which this version of the document processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); } public interface _FinalStage { ProcessorVersion build(); /** * <p>The name of the parent document processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ _FinalStage processorName(Optional<String> processorName); _FinalStage processorName(String processorName); /** * <p>An optional description of this version of the document processor.</p> * <p>Example: <code>&quot;Updated extraction fields for new invoice format&quot;</code></p> */ _FinalStage description(Optional<String> description); _FinalStage description(String description); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, ProcessorIdStage, ProcessorTypeStage, VersionStage, ConfigStage, CreatedAtStage, UpdatedAtStage, _FinalStage { private String object; private String id; private String processorId; private ProcessorType processorType; private String version; private ProcessorVersionConfig config; private OffsetDateTime createdAt; private OffsetDateTime updatedAt; private Optional<String> description = Optional.empty(); private Optional<String> processorName = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProcessorVersion other) { object(other.getObject()); id(other.getId()); processorId(other.getProcessorId()); processorName(other.getProcessorName()); processorType(other.getProcessorType()); description(other.getDescription()); version(other.getVersion()); config(other.getConfig()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); return this; } /** * <p>The type of the object. In this case, it will always be <code>&quot;document_processor_version&quot;</code>.</p> * <p>The type of the object. In this case, it will always be <code>&quot;document_processor_version&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The unique identifier for this version of the document processor.</p> * <p>Example: <code>&quot;dpv_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * <p>The unique identifier for this version of the document processor.</p> * <p>Example: <code>&quot;dpv_xK9mLPqRtN3vS8wF5hB2cQ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public ProcessorIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The ID of the parent document processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The ID of the parent document processor.</p> * <p>Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorId") public ProcessorTypeStage processorId(@NotNull String processorId) { this.processorId = Objects.requireNonNull(processorId, "processorId must not be null"); return this; } @java.lang.Override @JsonSetter("processorType") public VersionStage processorType(@NotNull ProcessorType processorType) { this.processorType = Objects.requireNonNull(processorType, "processorType must not be null"); return this; } /** * <p>The version number or identifier for this specific version of the document processor. The draft version will have version=&quot;draft&quot;.</p> * <p>Examples: <code>&quot;1.0&quot;</code>, <code>&quot;2.1&quot;</code>, <code>&quot;draft&quot;</code></p> * <p>The version number or identifier for this specific version of the document processor. The draft version will have version=&quot;draft&quot;.</p> * <p>Examples: <code>&quot;1.0&quot;</code>, <code>&quot;2.1&quot;</code>, <code>&quot;draft&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("version") public ConfigStage version(@NotNull String version) { this.version = Objects.requireNonNull(version, "version must not be null"); return this; } /** * <p>The configuration settings for this version of the document processor. The structure of this object will vary depending on the processor type.</p> * <p>See the configuration section in the &quot;Guides&quot; tab, for yout specific processor type, for more details on the configuration settings.</p> * <p>The configuration settings for this version of the document processor. The structure of this object will vary depending on the processor type.</p> * <p>See the configuration section in the &quot;Guides&quot; tab, for yout specific processor type, for more details on the configuration settings.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("config") public CreatedAtStage config(@NotNull ProcessorVersionConfig config) { this.config = Objects.requireNonNull(config, "config must not be null"); return this; } /** * <p>The time (in UTC) at which this version of the document processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * <p>The time (in UTC) at which this version of the document processor was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("createdAt") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } /** * <p>The time (in UTC) at which this version of the document processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * <p>The time (in UTC) at which this version of the document processor was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("updatedAt") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } /** * <p>An optional description of this version of the document processor.</p> * <p>Example: <code>&quot;Updated extraction fields for new invoice format&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage description(String description) { this.description = Optional.ofNullable(description); return this; } /** * <p>An optional description of this version of the document processor.</p> * <p>Example: <code>&quot;Updated extraction fields for new invoice format&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) public _FinalStage description(Optional<String> description) { this.description = description; return this; } /** * <p>The name of the parent document processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage processorName(String processorName) { this.processorName = Optional.ofNullable(processorName); return this; } /** * <p>The name of the parent document processor.</p> * <p>Example: <code>&quot;Invoice Processor&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "processorName", nulls = Nulls.SKIP) public _FinalStage processorName(Optional<String> processorName) { this.processorName = processorName; return this; } @java.lang.Override public ProcessorVersion build() { return new ProcessorVersion( object, id, processorId, processorName, processorType, description, version, config, createdAt, updatedAt, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProcessorVersionConfig.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonUnwrapped; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Objects; import java.util.Optional; public final class ProcessorVersionConfig { private final Value value; @JsonCreator(mode = JsonCreator.Mode.DELEGATING) private ProcessorVersionConfig(Value value) { this.value = value; } public <T> T visit(Visitor<T> visitor) { return value.visit(visitor); } public static ProcessorVersionConfig classify(ClassificationConfig value) { return new ProcessorVersionConfig(new ClassifyValue(value)); } public static ProcessorVersionConfig extract(ExtractionConfig value) { return new ProcessorVersionConfig(new ExtractValue(value)); } public static ProcessorVersionConfig splitter(SplitterConfig value) { return new ProcessorVersionConfig(new SplitterValue(value)); } public boolean isClassify() { return value instanceof ClassifyValue; } public boolean isExtract() { return value instanceof ExtractValue; } public boolean isSplitter() { return value instanceof SplitterValue; } public boolean _isUnknown() { return value instanceof _UnknownValue; } public Optional<ClassificationConfig> getClassify() { if (isClassify()) { return Optional.of(((ClassifyValue) value).value); } return Optional.empty(); } public Optional<ExtractionConfig> getExtract() { if (isExtract()) { return Optional.of(((ExtractValue) value).value); } return Optional.empty(); } public Optional<SplitterConfig> getSplitter() { if (isSplitter()) { return Optional.of(((SplitterValue) value).value); } return Optional.empty(); } public Optional<Object> _getUnknown() { if (_isUnknown()) { return Optional.of(((_UnknownValue) value).value); } return Optional.empty(); } @JsonValue private Value getValue() { return this.value; } public interface Visitor<T> { T visitClassify(ClassificationConfig classify); T visitExtract(ExtractionConfig extract); T visitSplitter(SplitterConfig splitter); T _visitUnknown(Object unknownType); } @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) @JsonSubTypes({ @JsonSubTypes.Type(ClassifyValue.class), @JsonSubTypes.Type(ExtractValue.class), @JsonSubTypes.Type(SplitterValue.class) }) @JsonIgnoreProperties(ignoreUnknown = true) private interface Value { <T> T visit(Visitor<T> visitor); } @JsonTypeName("CLASSIFY") @JsonIgnoreProperties("type") private static final class ClassifyValue implements Value { @JsonUnwrapped private ClassificationConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private ClassifyValue() {} private ClassifyValue(ClassificationConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitClassify(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ClassifyValue && equalTo((ClassifyValue) other); } private boolean equalTo(ClassifyValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorVersionConfig{" + "value: " + value + "}"; } } @JsonTypeName("EXTRACT") @JsonIgnoreProperties("type") private static final class ExtractValue implements Value { @JsonUnwrapped private ExtractionConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private ExtractValue() {} private ExtractValue(ExtractionConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitExtract(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ExtractValue && equalTo((ExtractValue) other); } private boolean equalTo(ExtractValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorVersionConfig{" + "value: " + value + "}"; } } @JsonTypeName("SPLITTER") @JsonIgnoreProperties("type") private static final class SplitterValue implements Value { @JsonUnwrapped private SplitterConfig value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private SplitterValue() {} private SplitterValue(SplitterConfig value) { this.value = value; } @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor.visitSplitter(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterValue && equalTo((SplitterValue) other); } private boolean equalTo(SplitterValue other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return "ProcessorVersionConfig{" + "value: " + value + "}"; } } @JsonIgnoreProperties("type") private static final class _UnknownValue implements Value { private String type; @JsonValue private Object value; @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) private _UnknownValue(@JsonProperty("value") Object value) {} @java.lang.Override public <T> T visit(Visitor<T> visitor) { return visitor._visitUnknown(value); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof _UnknownValue && equalTo((_UnknownValue) other); } private boolean equalTo(_UnknownValue other) { return type.equals(other.type) && value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.type, this.value); } @java.lang.Override public String toString() { return "ProcessorVersionConfig{" + "type: " + type + ", value: " + value + "}"; } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedClassifierOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProvidedClassifierOutput.Builder.class) public final class ProvidedClassifierOutput { private final String id; private final String type; private final Optional<Double> confidence; private final Map<String, Object> additionalProperties; private ProvidedClassifierOutput( String id, String type, Optional<Double> confidence, Map<String, Object> additionalProperties) { this.id = id; this.type = type; this.confidence = confidence; this.additionalProperties = additionalProperties; } /** * @return The unique identifier for this classification */ @JsonProperty("id") public String getId() { return id; } /** * @return The type of classification */ @JsonProperty("type") public String getType() { return type; } /** * @return A value between 0 and 1 indicating the model's confidence in the classification, where 1 represents maximum confidence */ @JsonProperty("confidence") public Optional<Double> getConfidence() { return confidence; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedClassifierOutput && equalTo((ProvidedClassifierOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProvidedClassifierOutput other) { return id.equals(other.id) && type.equals(other.type) && confidence.equals(other.confidence); } @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.type, this.confidence); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>The unique identifier for this classification</p> */ TypeStage id(@NotNull String id); Builder from(ProvidedClassifierOutput other); } public interface TypeStage { /** * <p>The type of classification</p> */ _FinalStage type(@NotNull String type); } public interface _FinalStage { ProvidedClassifierOutput build(); /** * <p>A value between 0 and 1 indicating the model's confidence in the classification, where 1 represents maximum confidence</p> */ _FinalStage confidence(Optional<Double> confidence); _FinalStage confidence(Double confidence); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, TypeStage, _FinalStage { private String id; private String type; private Optional<Double> confidence = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProvidedClassifierOutput other) { id(other.getId()); type(other.getType()); confidence(other.getConfidence()); return this; } /** * <p>The unique identifier for this classification</p> * <p>The unique identifier for this classification</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public TypeStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The type of classification</p> * <p>The type of classification</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>A value between 0 and 1 indicating the model's confidence in the classification, where 1 represents maximum confidence</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage confidence(Double confidence) { this.confidence = Optional.ofNullable(confidence); return this; } /** * <p>A value between 0 and 1 indicating the model's confidence in the classification, where 1 represents maximum confidence</p> */ @java.lang.Override @JsonSetter(value = "confidence", nulls = Nulls.SKIP) public _FinalStage confidence(Optional<Double> confidence) { this.confidence = confidence; return this; } @java.lang.Override public ProvidedClassifierOutput build() { return new ProvidedClassifierOutput(id, type, confidence, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedExtractionFieldResult.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProvidedExtractionFieldResult.Builder.class) public final class ProvidedExtractionFieldResult { private final String id; private final Object value; private final Optional<ProvidedExtractionFieldResultType> type; private final Optional<Double> confidence; private final Optional<Double> page; private final Map<String, Object> additionalProperties; private ProvidedExtractionFieldResult( String id, Object value, Optional<ProvidedExtractionFieldResultType> type, Optional<Double> confidence, Optional<Double> page, Map<String, Object> additionalProperties) { this.id = id; this.value = value; this.type = type; this.confidence = confidence; this.page = page; this.additionalProperties = additionalProperties; } /** * @return The unique identifier for this field */ @JsonProperty("id") public String getId() { return id; } @JsonProperty("value") public Object getValue() { return value; } /** * @return The type of the extraction field result */ @JsonProperty("type") public Optional<ProvidedExtractionFieldResultType> getType() { return type; } /** * @return A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided. */ @JsonProperty("confidence") public Optional<Double> getConfidence() { return confidence; } /** * @return The page number where this field was extracted from */ @JsonProperty("page") public Optional<Double> getPage() { return page; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedExtractionFieldResult && equalTo((ProvidedExtractionFieldResult) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProvidedExtractionFieldResult other) { return id.equals(other.id) && value.equals(other.value) && type.equals(other.type) && confidence.equals(other.confidence) && page.equals(other.page); } @java.lang.Override public int hashCode() { return Objects.hash(this.id, this.value, this.type, this.confidence, this.page); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>The unique identifier for this field</p> */ ValueStage id(@NotNull String id); Builder from(ProvidedExtractionFieldResult other); } public interface ValueStage { _FinalStage value(Object value); } public interface _FinalStage { ProvidedExtractionFieldResult build(); /** * <p>The type of the extraction field result</p> */ _FinalStage type(Optional<ProvidedExtractionFieldResultType> type); _FinalStage type(ProvidedExtractionFieldResultType type); /** * <p>A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided.</p> */ _FinalStage confidence(Optional<Double> confidence); _FinalStage confidence(Double confidence); /** * <p>The page number where this field was extracted from</p> */ _FinalStage page(Optional<Double> page); _FinalStage page(Double page); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, ValueStage, _FinalStage { private String id; private Object value; private Optional<Double> page = Optional.empty(); private Optional<Double> confidence = Optional.empty(); private Optional<ProvidedExtractionFieldResultType> type = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProvidedExtractionFieldResult other) { id(other.getId()); value(other.getValue()); type(other.getType()); confidence(other.getConfidence()); page(other.getPage()); return this; } /** * <p>The unique identifier for this field</p> * <p>The unique identifier for this field</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public ValueStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } @java.lang.Override @JsonSetter("value") public _FinalStage value(Object value) { this.value = value; return this; } /** * <p>The page number where this field was extracted from</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage page(Double page) { this.page = Optional.ofNullable(page); return this; } /** * <p>The page number where this field was extracted from</p> */ @java.lang.Override @JsonSetter(value = "page", nulls = Nulls.SKIP) public _FinalStage page(Optional<Double> page) { this.page = page; return this; } /** * <p>A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage confidence(Double confidence) { this.confidence = Optional.ofNullable(confidence); return this; } /** * <p>A value between 0 and 1 indicating confidence in the extraction. Will be set to 1 if not provided.</p> */ @java.lang.Override @JsonSetter(value = "confidence", nulls = Nulls.SKIP) public _FinalStage confidence(Optional<Double> confidence) { this.confidence = confidence; return this; } /** * <p>The type of the extraction field result</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage type(ProvidedExtractionFieldResultType type) { this.type = Optional.ofNullable(type); return this; } /** * <p>The type of the extraction field result</p> */ @java.lang.Override @JsonSetter(value = "type", nulls = Nulls.SKIP) public _FinalStage type(Optional<ProvidedExtractionFieldResultType> type) { this.type = type; return this; } @java.lang.Override public ProvidedExtractionFieldResult build() { return new ProvidedExtractionFieldResult(id, value, type, confidence, page, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedExtractionFieldResultType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum ProvidedExtractionFieldResultType { STRING("string"), NUMBER("number"), CURRENCY("currency"), BOOLEAN("boolean"), DATE("date"), ARRAY("array"), ENUM("enum"), OBJECT("object"), SIGNATURE("signature"); private final String value; ProvidedExtractionFieldResultType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedExtractionOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; import java.util.Map; import java.util.Objects; @JsonDeserialize(using = ProvidedExtractionOutput.Deserializer.class) public final class ProvidedExtractionOutput { private final Object value; private final int type; private ProvidedExtractionOutput(Object value, int type) { this.value = value; this.type = type; } @JsonValue public Object get() { return this.value; } @SuppressWarnings("unchecked") public <T> T visit(Visitor<T> visitor) { if (this.type == 0) { return visitor.visit((ProvidedJsonOutput) this.value); } else if (this.type == 1) { return visitor.visit((Map<String, ProvidedExtractionFieldResult>) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedExtractionOutput && equalTo((ProvidedExtractionOutput) other); } private boolean equalTo(ProvidedExtractionOutput other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return this.value.toString(); } public static ProvidedExtractionOutput of(ProvidedJsonOutput value) { return new ProvidedExtractionOutput(value, 0); } public static ProvidedExtractionOutput of(Map<String, ProvidedExtractionFieldResult> value) { return new ProvidedExtractionOutput(value, 1); } public interface Visitor<T> { T visit(ProvidedJsonOutput value); T visit(Map<String, ProvidedExtractionFieldResult> value); } static final class Deserializer extends StdDeserializer<ProvidedExtractionOutput> { Deserializer() { super(ProvidedExtractionOutput.class); } @java.lang.Override public ProvidedExtractionOutput deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProvidedJsonOutput.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue( value, new TypeReference<Map<String, ProvidedExtractionFieldResult>>() {})); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedJsonOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.LinkedHashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProvidedJsonOutput.Builder.class) public final class ProvidedJsonOutput { private final Map<String, Object> value; private final Map<String, Object> additionalProperties; private ProvidedJsonOutput(Map<String, Object> value, Map<String, Object> additionalProperties) { this.value = value; this.additionalProperties = additionalProperties; } @JsonProperty("value") public Map<String, Object> getValue() { return value; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedJsonOutput && equalTo((ProvidedJsonOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProvidedJsonOutput other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @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 Map<String, Object> value = new LinkedHashMap<>(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ProvidedJsonOutput other) { value(other.getValue()); return this; } @JsonSetter(value = "value", nulls = Nulls.SKIP) public Builder value(Map<String, Object> value) { this.value.clear(); this.value.putAll(value); return this; } public Builder putAllValue(Map<String, Object> value) { this.value.putAll(value); return this; } public Builder value(String key, Object value) { this.value.put(key, value); return this; } public ProvidedJsonOutput build() { return new ProvidedJsonOutput(value, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedProcessorOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; import java.util.Objects; @JsonDeserialize(using = ProvidedProcessorOutput.Deserializer.class) public final class ProvidedProcessorOutput { private final Object value; private final int type; private ProvidedProcessorOutput(Object value, int type) { this.value = value; this.type = type; } @JsonValue public Object get() { return this.value; } @SuppressWarnings("unchecked") public <T> T visit(Visitor<T> visitor) { if (this.type == 0) { return visitor.visit((ProvidedExtractionOutput) this.value); } else if (this.type == 1) { return visitor.visit((ProvidedClassifierOutput) this.value); } else if (this.type == 2) { return visitor.visit((ProvidedSplitterOutput) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedProcessorOutput && equalTo((ProvidedProcessorOutput) other); } private boolean equalTo(ProvidedProcessorOutput other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return this.value.toString(); } public static ProvidedProcessorOutput of(ProvidedExtractionOutput value) { return new ProvidedProcessorOutput(value, 0); } public static ProvidedProcessorOutput of(ProvidedClassifierOutput value) { return new ProvidedProcessorOutput(value, 1); } public static ProvidedProcessorOutput of(ProvidedSplitterOutput value) { return new ProvidedProcessorOutput(value, 2); } public interface Visitor<T> { T visit(ProvidedExtractionOutput value); T visit(ProvidedClassifierOutput value); T visit(ProvidedSplitterOutput value); } static final class Deserializer extends StdDeserializer<ProvidedProcessorOutput> { Deserializer() { super(ProvidedProcessorOutput.class); } @java.lang.Override public ProvidedProcessorOutput deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProvidedExtractionOutput.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProvidedClassifierOutput.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProvidedSplitterOutput.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedSplitterOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProvidedSplitterOutput.Builder.class) public final class ProvidedSplitterOutput { private final List<ProvidedSplitterOutputSplitsItem> splits; private final Map<String, Object> additionalProperties; private ProvidedSplitterOutput( List<ProvidedSplitterOutputSplitsItem> splits, Map<String, Object> additionalProperties) { this.splits = splits; this.additionalProperties = additionalProperties; } @JsonProperty("splits") public List<ProvidedSplitterOutputSplitsItem> getSplits() { return splits; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedSplitterOutput && equalTo((ProvidedSplitterOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProvidedSplitterOutput other) { return splits.equals(other.splits); } @java.lang.Override public int hashCode() { return Objects.hash(this.splits); } @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 List<ProvidedSplitterOutputSplitsItem> splits = new ArrayList<>(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(ProvidedSplitterOutput other) { splits(other.getSplits()); return this; } @JsonSetter(value = "splits", nulls = Nulls.SKIP) public Builder splits(List<ProvidedSplitterOutputSplitsItem> splits) { this.splits.clear(); this.splits.addAll(splits); return this; } public Builder addSplits(ProvidedSplitterOutputSplitsItem splits) { this.splits.add(splits); return this; } public Builder addAllSplits(List<ProvidedSplitterOutputSplitsItem> splits) { this.splits.addAll(splits); return this; } public ProvidedSplitterOutput build() { return new ProvidedSplitterOutput(splits, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/ProvidedSplitterOutputSplitsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProvidedSplitterOutputSplitsItem.Builder.class) public final class ProvidedSplitterOutputSplitsItem { private final String id; private final String classificationId; private final String type; private final Optional<String> observation; private final Optional<String> identifier; private final int startPage; private final int endPage; private final Map<String, Object> additionalProperties; private ProvidedSplitterOutputSplitsItem( String id, String classificationId, String type, Optional<String> observation, Optional<String> identifier, int startPage, int endPage, Map<String, Object> additionalProperties) { this.id = id; this.classificationId = classificationId; this.type = type; this.observation = observation; this.identifier = identifier; this.startPage = startPage; this.endPage = endPage; this.additionalProperties = additionalProperties; } /** * @return Unique ID for this split */ @JsonProperty("id") public String getId() { return id; } /** * @return ID of the classification type (set in the processor config) */ @JsonProperty("classificationId") public String getClassificationId() { return classificationId; } /** * @return The type of the split document (set in the processor config), corresponds to the classificationId */ @JsonProperty("type") public String getType() { return type; } /** * @return Explanation of the results */ @JsonProperty("observation") public Optional<String> getObservation() { return observation; } /** * @return Identifier for the split document (e.g. invoice number) */ @JsonProperty("identifier") public Optional<String> getIdentifier() { return identifier; } /** * @return The start page of the split document */ @JsonProperty("startPage") public int getStartPage() { return startPage; } /** * @return The end page of the split document */ @JsonProperty("endPage") public int getEndPage() { return endPage; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof ProvidedSplitterOutputSplitsItem && equalTo((ProvidedSplitterOutputSplitsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(ProvidedSplitterOutputSplitsItem other) { return id.equals(other.id) && classificationId.equals(other.classificationId) && type.equals(other.type) && observation.equals(other.observation) && identifier.equals(other.identifier) && startPage == other.startPage && endPage == other.endPage; } @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.classificationId, this.type, this.observation, this.identifier, this.startPage, this.endPage); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>Unique ID for this split</p> */ ClassificationIdStage id(@NotNull String id); Builder from(ProvidedSplitterOutputSplitsItem other); } public interface ClassificationIdStage { /** * <p>ID of the classification type (set in the processor config)</p> */ TypeStage classificationId(@NotNull String classificationId); } public interface TypeStage { /** * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> */ StartPageStage type(@NotNull String type); } public interface StartPageStage { /** * <p>The start page of the split document</p> */ EndPageStage startPage(int startPage); } public interface EndPageStage { /** * <p>The end page of the split document</p> */ _FinalStage endPage(int endPage); } public interface _FinalStage { ProvidedSplitterOutputSplitsItem build(); /** * <p>Explanation of the results</p> */ _FinalStage observation(Optional<String> observation); _FinalStage observation(String observation); /** * <p>Identifier for the split document (e.g. invoice number)</p> */ _FinalStage identifier(Optional<String> identifier); _FinalStage identifier(String identifier); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, ClassificationIdStage, TypeStage, StartPageStage, EndPageStage, _FinalStage { private String id; private String classificationId; private String type; private int startPage; private int endPage; private Optional<String> identifier = Optional.empty(); private Optional<String> observation = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(ProvidedSplitterOutputSplitsItem other) { id(other.getId()); classificationId(other.getClassificationId()); type(other.getType()); observation(other.getObservation()); identifier(other.getIdentifier()); startPage(other.getStartPage()); endPage(other.getEndPage()); return this; } /** * <p>Unique ID for this split</p> * <p>Unique ID for this split</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public ClassificationIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>ID of the classification type (set in the processor config)</p> * <p>ID of the classification type (set in the processor config)</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("classificationId") public TypeStage classificationId(@NotNull String classificationId) { this.classificationId = Objects.requireNonNull(classificationId, "classificationId must not be null"); return this; } /** * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public StartPageStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>The start page of the split document</p> * <p>The start page of the split document</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("startPage") public EndPageStage startPage(int startPage) { this.startPage = startPage; return this; } /** * <p>The end page of the split document</p> * <p>The end page of the split document</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("endPage") public _FinalStage endPage(int endPage) { this.endPage = endPage; return this; } /** * <p>Identifier for the split document (e.g. invoice number)</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage identifier(String identifier) { this.identifier = Optional.ofNullable(identifier); return this; } /** * <p>Identifier for the split document (e.g. invoice number)</p> */ @java.lang.Override @JsonSetter(value = "identifier", nulls = Nulls.SKIP) public _FinalStage identifier(Optional<String> identifier) { this.identifier = identifier; return this; } /** * <p>Explanation of the results</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage observation(String observation) { this.observation = Optional.ofNullable(observation); return this; } /** * <p>Explanation of the results</p> */ @java.lang.Override @JsonSetter(value = "observation", nulls = Nulls.SKIP) public _FinalStage observation(Optional<String> observation) { this.observation = observation; return this; } @java.lang.Override public ProvidedSplitterOutputSplitsItem build() { return new ProvidedSplitterOutputSplitsItem( id, classificationId, type, observation, identifier, startPage, endPage, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SortByEnum.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum SortByEnum { UPDATED_AT("updatedAt"), CREATED_AT("createdAt"); private final String value; SortByEnum(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SortDirEnum.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum SortDirEnum { ASC("asc"), DESC("desc"); private final String value; SortDirEnum(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterAdvancedOptions.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = SplitterAdvancedOptions.Builder.class) public final class SplitterAdvancedOptions { private final Optional<String> splitIdentifierRules; private final Optional<SplitterAdvancedOptionsSplitMethod> splitMethod; private final Optional<Boolean> splitExcelDocumentsBySheetEnabled; private final Optional<Integer> fixedPageLimit; private final Optional<List<PageRangesItem>> pageRanges; private final Map<String, Object> additionalProperties; private SplitterAdvancedOptions( Optional<String> splitIdentifierRules, Optional<SplitterAdvancedOptionsSplitMethod> splitMethod, Optional<Boolean> splitExcelDocumentsBySheetEnabled, Optional<Integer> fixedPageLimit, Optional<List<PageRangesItem>> pageRanges, Map<String, Object> additionalProperties) { this.splitIdentifierRules = splitIdentifierRules; this.splitMethod = splitMethod; this.splitExcelDocumentsBySheetEnabled = splitExcelDocumentsBySheetEnabled; this.fixedPageLimit = fixedPageLimit; this.pageRanges = pageRanges; this.additionalProperties = additionalProperties; } /** * @return Custom rules for identifying split points. */ @JsonProperty("splitIdentifierRules") public Optional<String> getSplitIdentifierRules() { return splitIdentifierRules; } /** * @return The method to use for splitting documents. <code>high_precision</code> is more accurate but slower, while <code>low_latency</code> is faster but less precise. */ @JsonProperty("splitMethod") public Optional<SplitterAdvancedOptionsSplitMethod> getSplitMethod() { return splitMethod; } /** * @return For Excel documents, split by worksheet. */ @JsonProperty("splitExcelDocumentsBySheetEnabled") public Optional<Boolean> getSplitExcelDocumentsBySheetEnabled() { return splitExcelDocumentsBySheetEnabled; } /** * @return Limit processing to a specific number of pages from the beginning of the document. See <a href="/product/page-ranges">Page Ranges</a>. */ @JsonProperty("fixedPageLimit") public Optional<Integer> getFixedPageLimit() { return fixedPageLimit; } @JsonProperty("pageRanges") public Optional<List<PageRangesItem>> getPageRanges() { return pageRanges; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterAdvancedOptions && equalTo((SplitterAdvancedOptions) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(SplitterAdvancedOptions other) { return splitIdentifierRules.equals(other.splitIdentifierRules) && splitMethod.equals(other.splitMethod) && splitExcelDocumentsBySheetEnabled.equals(other.splitExcelDocumentsBySheetEnabled) && fixedPageLimit.equals(other.fixedPageLimit) && pageRanges.equals(other.pageRanges); } @java.lang.Override public int hashCode() { return Objects.hash( this.splitIdentifierRules, this.splitMethod, this.splitExcelDocumentsBySheetEnabled, this.fixedPageLimit, this.pageRanges); } @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<String> splitIdentifierRules = Optional.empty(); private Optional<SplitterAdvancedOptionsSplitMethod> splitMethod = Optional.empty(); private Optional<Boolean> splitExcelDocumentsBySheetEnabled = Optional.empty(); private Optional<Integer> fixedPageLimit = Optional.empty(); private Optional<List<PageRangesItem>> pageRanges = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(SplitterAdvancedOptions other) { splitIdentifierRules(other.getSplitIdentifierRules()); splitMethod(other.getSplitMethod()); splitExcelDocumentsBySheetEnabled(other.getSplitExcelDocumentsBySheetEnabled()); fixedPageLimit(other.getFixedPageLimit()); pageRanges(other.getPageRanges()); return this; } /** * <p>Custom rules for identifying split points.</p> */ @JsonSetter(value = "splitIdentifierRules", nulls = Nulls.SKIP) public Builder splitIdentifierRules(Optional<String> splitIdentifierRules) { this.splitIdentifierRules = splitIdentifierRules; return this; } public Builder splitIdentifierRules(String splitIdentifierRules) { this.splitIdentifierRules = Optional.ofNullable(splitIdentifierRules); return this; } /** * <p>The method to use for splitting documents. <code>high_precision</code> is more accurate but slower, while <code>low_latency</code> is faster but less precise.</p> */ @JsonSetter(value = "splitMethod", nulls = Nulls.SKIP) public Builder splitMethod(Optional<SplitterAdvancedOptionsSplitMethod> splitMethod) { this.splitMethod = splitMethod; return this; } public Builder splitMethod(SplitterAdvancedOptionsSplitMethod splitMethod) { this.splitMethod = Optional.ofNullable(splitMethod); return this; } /** * <p>For Excel documents, split by worksheet.</p> */ @JsonSetter(value = "splitExcelDocumentsBySheetEnabled", nulls = Nulls.SKIP) public Builder splitExcelDocumentsBySheetEnabled(Optional<Boolean> splitExcelDocumentsBySheetEnabled) { this.splitExcelDocumentsBySheetEnabled = splitExcelDocumentsBySheetEnabled; return this; } public Builder splitExcelDocumentsBySheetEnabled(Boolean splitExcelDocumentsBySheetEnabled) { this.splitExcelDocumentsBySheetEnabled = Optional.ofNullable(splitExcelDocumentsBySheetEnabled); return this; } /** * <p>Limit processing to a specific number of pages from the beginning of the document. See <a href="/product/page-ranges">Page Ranges</a>.</p> */ @JsonSetter(value = "fixedPageLimit", nulls = Nulls.SKIP) public Builder fixedPageLimit(Optional<Integer> fixedPageLimit) { this.fixedPageLimit = fixedPageLimit; return this; } public Builder fixedPageLimit(Integer fixedPageLimit) { this.fixedPageLimit = Optional.ofNullable(fixedPageLimit); return this; } @JsonSetter(value = "pageRanges", nulls = Nulls.SKIP) public Builder pageRanges(Optional<List<PageRangesItem>> pageRanges) { this.pageRanges = pageRanges; return this; } public Builder pageRanges(List<PageRangesItem> pageRanges) { this.pageRanges = Optional.ofNullable(pageRanges); return this; } public SplitterAdvancedOptions build() { return new SplitterAdvancedOptions( splitIdentifierRules, splitMethod, splitExcelDocumentsBySheetEnabled, fixedPageLimit, pageRanges, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterAdvancedOptionsSplitMethod.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum SplitterAdvancedOptionsSplitMethod { HIGH_PRECISION("high_precision"), LOW_LATENCY("low_latency"); private final String value; SplitterAdvancedOptionsSplitMethod(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterConfig.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.ArrayList; 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 = SplitterConfig.Builder.class) public final class SplitterConfig { private final Optional<SplitterConfigBaseProcessor> baseProcessor; private final Optional<String> baseVersion; private final List<Classification> splitClassifications; private final Optional<String> splitRules; private final Optional<SplitterAdvancedOptions> advancedOptions; private final Optional<ParseConfig> parser; private final Map<String, Object> additionalProperties; private SplitterConfig( Optional<SplitterConfigBaseProcessor> baseProcessor, Optional<String> baseVersion, List<Classification> splitClassifications, Optional<String> splitRules, Optional<SplitterAdvancedOptions> advancedOptions, Optional<ParseConfig> parser, Map<String, Object> additionalProperties) { this.baseProcessor = baseProcessor; this.baseVersion = baseVersion; this.splitClassifications = splitClassifications; this.splitRules = splitRules; this.advancedOptions = advancedOptions; this.parser = parser; this.additionalProperties = additionalProperties; } /** * @return The base processor to use. For splitters, this can currently only be <code>&quot;splitting_performance&quot;</code> or <code>&quot;splitting_light&quot;</code>. See <a href="/changelog/splitting/splitting-performance">Splitting Changelog</a> for more details. */ @JsonProperty("baseProcessor") public Optional<SplitterConfigBaseProcessor> getBaseProcessor() { return baseProcessor; } /** * @return The version of the <code>&quot;splitting_performance&quot;</code> or <code>&quot;splitting_light&quot;</code> processor to use. If this is provided, the <code>baseProcessor</code> must also be provided. See <a href="/changelog/splitting/splitting-performance">Splitting Changelog</a> for more details. */ @JsonProperty("baseVersion") public Optional<String> getBaseVersion() { return baseVersion; } /** * @return Array of classifications that define the possible types of document sections. */ @JsonProperty("splitClassifications") public List<Classification> getSplitClassifications() { return splitClassifications; } /** * @return Custom rules to guide the document splitting process in natural language. */ @JsonProperty("splitRules") public Optional<String> getSplitRules() { return splitRules; } /** * @return Advanced configuration options. */ @JsonProperty("advancedOptions") public Optional<SplitterAdvancedOptions> getAdvancedOptions() { return advancedOptions; } /** * @return Configuration options for the parsing process. */ @JsonProperty("parser") public Optional<ParseConfig> getParser() { return parser; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterConfig && equalTo((SplitterConfig) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(SplitterConfig other) { return baseProcessor.equals(other.baseProcessor) && baseVersion.equals(other.baseVersion) && splitClassifications.equals(other.splitClassifications) && splitRules.equals(other.splitRules) && advancedOptions.equals(other.advancedOptions) && parser.equals(other.parser); } @java.lang.Override public int hashCode() { return Objects.hash( this.baseProcessor, this.baseVersion, this.splitClassifications, this.splitRules, this.advancedOptions, this.parser); } @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<SplitterConfigBaseProcessor> baseProcessor = Optional.empty(); private Optional<String> baseVersion = Optional.empty(); private List<Classification> splitClassifications = new ArrayList<>(); private Optional<String> splitRules = Optional.empty(); private Optional<SplitterAdvancedOptions> advancedOptions = Optional.empty(); private Optional<ParseConfig> parser = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(SplitterConfig other) { baseProcessor(other.getBaseProcessor()); baseVersion(other.getBaseVersion()); splitClassifications(other.getSplitClassifications()); splitRules(other.getSplitRules()); advancedOptions(other.getAdvancedOptions()); parser(other.getParser()); return this; } /** * <p>The base processor to use. For splitters, this can currently only be <code>&quot;splitting_performance&quot;</code> or <code>&quot;splitting_light&quot;</code>. See <a href="/changelog/splitting/splitting-performance">Splitting Changelog</a> for more details.</p> */ @JsonSetter(value = "baseProcessor", nulls = Nulls.SKIP) public Builder baseProcessor(Optional<SplitterConfigBaseProcessor> baseProcessor) { this.baseProcessor = baseProcessor; return this; } public Builder baseProcessor(SplitterConfigBaseProcessor baseProcessor) { this.baseProcessor = Optional.ofNullable(baseProcessor); return this; } /** * <p>The version of the <code>&quot;splitting_performance&quot;</code> or <code>&quot;splitting_light&quot;</code> processor to use. If this is provided, the <code>baseProcessor</code> must also be provided. See <a href="/changelog/splitting/splitting-performance">Splitting Changelog</a> for more details.</p> */ @JsonSetter(value = "baseVersion", nulls = Nulls.SKIP) public Builder baseVersion(Optional<String> baseVersion) { this.baseVersion = baseVersion; return this; } public Builder baseVersion(String baseVersion) { this.baseVersion = Optional.ofNullable(baseVersion); return this; } /** * <p>Array of classifications that define the possible types of document sections.</p> */ @JsonSetter(value = "splitClassifications", nulls = Nulls.SKIP) public Builder splitClassifications(List<Classification> splitClassifications) { this.splitClassifications.clear(); this.splitClassifications.addAll(splitClassifications); return this; } public Builder addSplitClassifications(Classification splitClassifications) { this.splitClassifications.add(splitClassifications); return this; } public Builder addAllSplitClassifications(List<Classification> splitClassifications) { this.splitClassifications.addAll(splitClassifications); return this; } /** * <p>Custom rules to guide the document splitting process in natural language.</p> */ @JsonSetter(value = "splitRules", nulls = Nulls.SKIP) public Builder splitRules(Optional<String> splitRules) { this.splitRules = splitRules; return this; } public Builder splitRules(String splitRules) { this.splitRules = Optional.ofNullable(splitRules); return this; } /** * <p>Advanced configuration options.</p> */ @JsonSetter(value = "advancedOptions", nulls = Nulls.SKIP) public Builder advancedOptions(Optional<SplitterAdvancedOptions> advancedOptions) { this.advancedOptions = advancedOptions; return this; } public Builder advancedOptions(SplitterAdvancedOptions advancedOptions) { this.advancedOptions = Optional.ofNullable(advancedOptions); return this; } /** * <p>Configuration options for the parsing process.</p> */ @JsonSetter(value = "parser", nulls = Nulls.SKIP) public Builder parser(Optional<ParseConfig> parser) { this.parser = parser; return this; } public Builder parser(ParseConfig parser) { this.parser = Optional.ofNullable(parser); return this; } public SplitterConfig build() { return new SplitterConfig( baseProcessor, baseVersion, splitClassifications, splitRules, advancedOptions, parser, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterConfigBaseProcessor.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum SplitterConfigBaseProcessor { SPLITTING_PERFORMANCE("splitting_performance"), SPLITTING_LIGHT("splitting_light"); private final String value; SplitterConfigBaseProcessor(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterMetrics.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = SplitterMetrics.Builder.class) public final class SplitterMetrics implements IBaseMetrics { private final Optional<Double> numFiles; private final Optional<Double> numPages; private final Optional<Double> meanRunTimeMs; private final Optional<String> type; private final Optional<Double> precisionPerc; private final Optional<Double> recallPerc; private final Optional<Double> numExpectedDocs; private final Optional<Double> numPredictedDocs; private final Optional<Double> numCorrectDocs; private final Map<String, Object> additionalProperties; private SplitterMetrics( Optional<Double> numFiles, Optional<Double> numPages, Optional<Double> meanRunTimeMs, Optional<String> type, Optional<Double> precisionPerc, Optional<Double> recallPerc, Optional<Double> numExpectedDocs, Optional<Double> numPredictedDocs, Optional<Double> numCorrectDocs, Map<String, Object> additionalProperties) { this.numFiles = numFiles; this.numPages = numPages; this.meanRunTimeMs = meanRunTimeMs; this.type = type; this.precisionPerc = precisionPerc; this.recallPerc = recallPerc; this.numExpectedDocs = numExpectedDocs; this.numPredictedDocs = numPredictedDocs; this.numCorrectDocs = numCorrectDocs; this.additionalProperties = additionalProperties; } /** * @return The total number of files that were processed. */ @JsonProperty("numFiles") @java.lang.Override public Optional<Double> getNumFiles() { return numFiles; } /** * @return The total number of pages that were processed. */ @JsonProperty("numPages") @java.lang.Override public Optional<Double> getNumPages() { return numPages; } /** * @return The mean runtime in milliseconds per document. */ @JsonProperty("meanRunTimeMs") @java.lang.Override public Optional<Double> getMeanRunTimeMs() { return meanRunTimeMs; } /** * @return The type of metrics. Will always be <code>&quot;SPLITTER&quot;</code> for splitter processors. */ @JsonProperty("type") public Optional<String> getType() { return type; } /** * @return Number of predicted subdocuments that are in the expected set of subdocuments divided by total number of predicted subdocuments. */ @JsonProperty("precisionPerc") public Optional<Double> getPrecisionPerc() { return precisionPerc; } /** * @return Number of expected subdocuments that are in the predicted set of subdocuments divided by total number of expected subdocuments. */ @JsonProperty("recallPerc") public Optional<Double> getRecallPerc() { return recallPerc; } /** * @return The number of expected documents. */ @JsonProperty("numExpectedDocs") public Optional<Double> getNumExpectedDocs() { return numExpectedDocs; } /** * @return The number of predicted documents. */ @JsonProperty("numPredictedDocs") public Optional<Double> getNumPredictedDocs() { return numPredictedDocs; } /** * @return The number of correctly predicted documents. */ @JsonProperty("numCorrectDocs") public Optional<Double> getNumCorrectDocs() { return numCorrectDocs; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterMetrics && equalTo((SplitterMetrics) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(SplitterMetrics other) { return numFiles.equals(other.numFiles) && numPages.equals(other.numPages) && meanRunTimeMs.equals(other.meanRunTimeMs) && type.equals(other.type) && precisionPerc.equals(other.precisionPerc) && recallPerc.equals(other.recallPerc) && numExpectedDocs.equals(other.numExpectedDocs) && numPredictedDocs.equals(other.numPredictedDocs) && numCorrectDocs.equals(other.numCorrectDocs); } @java.lang.Override public int hashCode() { return Objects.hash( this.numFiles, this.numPages, this.meanRunTimeMs, this.type, this.precisionPerc, this.recallPerc, this.numExpectedDocs, this.numPredictedDocs, this.numCorrectDocs); } @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<Double> numFiles = Optional.empty(); private Optional<Double> numPages = Optional.empty(); private Optional<Double> meanRunTimeMs = Optional.empty(); private Optional<String> type = Optional.empty(); private Optional<Double> precisionPerc = Optional.empty(); private Optional<Double> recallPerc = Optional.empty(); private Optional<Double> numExpectedDocs = Optional.empty(); private Optional<Double> numPredictedDocs = Optional.empty(); private Optional<Double> numCorrectDocs = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(SplitterMetrics other) { numFiles(other.getNumFiles()); numPages(other.getNumPages()); meanRunTimeMs(other.getMeanRunTimeMs()); type(other.getType()); precisionPerc(other.getPrecisionPerc()); recallPerc(other.getRecallPerc()); numExpectedDocs(other.getNumExpectedDocs()); numPredictedDocs(other.getNumPredictedDocs()); numCorrectDocs(other.getNumCorrectDocs()); return this; } /** * <p>The total number of files that were processed.</p> */ @JsonSetter(value = "numFiles", nulls = Nulls.SKIP) public Builder numFiles(Optional<Double> numFiles) { this.numFiles = numFiles; return this; } public Builder numFiles(Double numFiles) { this.numFiles = Optional.ofNullable(numFiles); return this; } /** * <p>The total number of pages that were processed.</p> */ @JsonSetter(value = "numPages", nulls = Nulls.SKIP) public Builder numPages(Optional<Double> numPages) { this.numPages = numPages; return this; } public Builder numPages(Double numPages) { this.numPages = Optional.ofNullable(numPages); return this; } /** * <p>The mean runtime in milliseconds per document.</p> */ @JsonSetter(value = "meanRunTimeMs", nulls = Nulls.SKIP) public Builder meanRunTimeMs(Optional<Double> meanRunTimeMs) { this.meanRunTimeMs = meanRunTimeMs; return this; } public Builder meanRunTimeMs(Double meanRunTimeMs) { this.meanRunTimeMs = Optional.ofNullable(meanRunTimeMs); return this; } /** * <p>The type of metrics. Will always be <code>&quot;SPLITTER&quot;</code> for splitter processors.</p> */ @JsonSetter(value = "type", nulls = Nulls.SKIP) public Builder type(Optional<String> type) { this.type = type; return this; } public Builder type(String type) { this.type = Optional.ofNullable(type); return this; } /** * <p>Number of predicted subdocuments that are in the expected set of subdocuments divided by total number of predicted subdocuments.</p> */ @JsonSetter(value = "precisionPerc", nulls = Nulls.SKIP) public Builder precisionPerc(Optional<Double> precisionPerc) { this.precisionPerc = precisionPerc; return this; } public Builder precisionPerc(Double precisionPerc) { this.precisionPerc = Optional.ofNullable(precisionPerc); return this; } /** * <p>Number of expected subdocuments that are in the predicted set of subdocuments divided by total number of expected subdocuments.</p> */ @JsonSetter(value = "recallPerc", nulls = Nulls.SKIP) public Builder recallPerc(Optional<Double> recallPerc) { this.recallPerc = recallPerc; return this; } public Builder recallPerc(Double recallPerc) { this.recallPerc = Optional.ofNullable(recallPerc); return this; } /** * <p>The number of expected documents.</p> */ @JsonSetter(value = "numExpectedDocs", nulls = Nulls.SKIP) public Builder numExpectedDocs(Optional<Double> numExpectedDocs) { this.numExpectedDocs = numExpectedDocs; return this; } public Builder numExpectedDocs(Double numExpectedDocs) { this.numExpectedDocs = Optional.ofNullable(numExpectedDocs); return this; } /** * <p>The number of predicted documents.</p> */ @JsonSetter(value = "numPredictedDocs", nulls = Nulls.SKIP) public Builder numPredictedDocs(Optional<Double> numPredictedDocs) { this.numPredictedDocs = numPredictedDocs; return this; } public Builder numPredictedDocs(Double numPredictedDocs) { this.numPredictedDocs = Optional.ofNullable(numPredictedDocs); return this; } /** * <p>The number of correctly predicted documents.</p> */ @JsonSetter(value = "numCorrectDocs", nulls = Nulls.SKIP) public Builder numCorrectDocs(Optional<Double> numCorrectDocs) { this.numCorrectDocs = numCorrectDocs; return this; } public Builder numCorrectDocs(Double numCorrectDocs) { this.numCorrectDocs = Optional.ofNullable(numCorrectDocs); return this; } public SplitterMetrics build() { return new SplitterMetrics( numFiles, numPages, meanRunTimeMs, type, precisionPerc, recallPerc, numExpectedDocs, numPredictedDocs, numCorrectDocs, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.ArrayList; 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 = SplitterOutput.Builder.class) public final class SplitterOutput { private final List<SplitterOutputSplitsItem> splits; private final Optional<Boolean> isExternal; private final Map<String, Object> additionalProperties; private SplitterOutput( List<SplitterOutputSplitsItem> splits, Optional<Boolean> isExternal, Map<String, Object> additionalProperties) { this.splits = splits; this.isExternal = isExternal; this.additionalProperties = additionalProperties; } @JsonProperty("splits") public List<SplitterOutputSplitsItem> getSplits() { return splits; } @JsonProperty("isExternal") public Optional<Boolean> getIsExternal() { return isExternal; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterOutput && equalTo((SplitterOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(SplitterOutput other) { return splits.equals(other.splits) && isExternal.equals(other.isExternal); } @java.lang.Override public int hashCode() { return Objects.hash(this.splits, this.isExternal); } @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 List<SplitterOutputSplitsItem> splits = new ArrayList<>(); private Optional<Boolean> isExternal = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(SplitterOutput other) { splits(other.getSplits()); isExternal(other.getIsExternal()); return this; } @JsonSetter(value = "splits", nulls = Nulls.SKIP) public Builder splits(List<SplitterOutputSplitsItem> splits) { this.splits.clear(); this.splits.addAll(splits); return this; } public Builder addSplits(SplitterOutputSplitsItem splits) { this.splits.add(splits); return this; } public Builder addAllSplits(List<SplitterOutputSplitsItem> splits) { this.splits.addAll(splits); return this; } @JsonSetter(value = "isExternal", nulls = Nulls.SKIP) public Builder isExternal(Optional<Boolean> isExternal) { this.isExternal = isExternal; return this; } public Builder isExternal(Boolean isExternal) { this.isExternal = Optional.ofNullable(isExternal); return this; } public SplitterOutput build() { return new SplitterOutput(splits, isExternal, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/SplitterOutputSplitsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = SplitterOutputSplitsItem.Builder.class) public final class SplitterOutputSplitsItem { private final String type; private final String observation; private final String identifier; private final int startPage; private final int endPage; private final Optional<String> name; private final String classificationId; private final String id; private final String fileId; private final Map<String, Object> additionalProperties; private SplitterOutputSplitsItem( String type, String observation, String identifier, int startPage, int endPage, Optional<String> name, String classificationId, String id, String fileId, Map<String, Object> additionalProperties) { this.type = type; this.observation = observation; this.identifier = identifier; this.startPage = startPage; this.endPage = endPage; this.name = name; this.classificationId = classificationId; this.id = id; this.fileId = fileId; this.additionalProperties = additionalProperties; } /** * @return The type of the split document (set in the processor config), corresponds to the classificationId */ @JsonProperty("type") public String getType() { return type; } /** * @return Explanation of the results */ @JsonProperty("observation") public String getObservation() { return observation; } /** * @return Identifier for the split document (e.g. invoice number) */ @JsonProperty("identifier") public String getIdentifier() { return identifier; } /** * @return The start page of the split document */ @JsonProperty("startPage") public int getStartPage() { return startPage; } /** * @return The end page of the split document */ @JsonProperty("endPage") public int getEndPage() { return endPage; } /** * @return Optional name for the split */ @JsonProperty("name") public Optional<String> getName() { return name; } /** * @return ID of the classification type (set in the processor config) */ @JsonProperty("classificationId") public String getClassificationId() { return classificationId; } /** * @return Unique ID for this split */ @JsonProperty("id") public String getId() { return id; } /** * @return File ID associated with this split */ @JsonProperty("fileId") public String getFileId() { return fileId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof SplitterOutputSplitsItem && equalTo((SplitterOutputSplitsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(SplitterOutputSplitsItem other) { return type.equals(other.type) && observation.equals(other.observation) && identifier.equals(other.identifier) && startPage == other.startPage && endPage == other.endPage && name.equals(other.name) && classificationId.equals(other.classificationId) && id.equals(other.id) && fileId.equals(other.fileId); } @java.lang.Override public int hashCode() { return Objects.hash( this.type, this.observation, this.identifier, this.startPage, this.endPage, this.name, this.classificationId, this.id, this.fileId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static TypeStage builder() { return new Builder(); } public interface TypeStage { /** * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> */ ObservationStage type(@NotNull String type); Builder from(SplitterOutputSplitsItem other); } public interface ObservationStage { /** * <p>Explanation of the results</p> */ IdentifierStage observation(@NotNull String observation); } public interface IdentifierStage { /** * <p>Identifier for the split document (e.g. invoice number)</p> */ StartPageStage identifier(@NotNull String identifier); } public interface StartPageStage { /** * <p>The start page of the split document</p> */ EndPageStage startPage(int startPage); } public interface EndPageStage { /** * <p>The end page of the split document</p> */ ClassificationIdStage endPage(int endPage); } public interface ClassificationIdStage { /** * <p>ID of the classification type (set in the processor config)</p> */ IdStage classificationId(@NotNull String classificationId); } public interface IdStage { /** * <p>Unique ID for this split</p> */ FileIdStage id(@NotNull String id); } public interface FileIdStage { /** * <p>File ID associated with this split</p> */ _FinalStage fileId(@NotNull String fileId); } public interface _FinalStage { SplitterOutputSplitsItem build(); /** * <p>Optional name for the split</p> */ _FinalStage name(Optional<String> name); _FinalStage name(String name); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements TypeStage, ObservationStage, IdentifierStage, StartPageStage, EndPageStage, ClassificationIdStage, IdStage, FileIdStage, _FinalStage { private String type; private String observation; private String identifier; private int startPage; private int endPage; private String classificationId; private String id; private String fileId; private Optional<String> name = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(SplitterOutputSplitsItem other) { type(other.getType()); observation(other.getObservation()); identifier(other.getIdentifier()); startPage(other.getStartPage()); endPage(other.getEndPage()); name(other.getName()); classificationId(other.getClassificationId()); id(other.getId()); fileId(other.getFileId()); return this; } /** * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> * <p>The type of the split document (set in the processor config), corresponds to the classificationId</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public ObservationStage type(@NotNull String type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } /** * <p>Explanation of the results</p> * <p>Explanation of the results</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("observation") public IdentifierStage observation(@NotNull String observation) { this.observation = Objects.requireNonNull(observation, "observation must not be null"); return this; } /** * <p>Identifier for the split document (e.g. invoice number)</p> * <p>Identifier for the split document (e.g. invoice number)</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("identifier") public StartPageStage identifier(@NotNull String identifier) { this.identifier = Objects.requireNonNull(identifier, "identifier must not be null"); return this; } /** * <p>The start page of the split document</p> * <p>The start page of the split document</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("startPage") public EndPageStage startPage(int startPage) { this.startPage = startPage; return this; } /** * <p>The end page of the split document</p> * <p>The end page of the split document</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("endPage") public ClassificationIdStage endPage(int endPage) { this.endPage = endPage; return this; } /** * <p>ID of the classification type (set in the processor config)</p> * <p>ID of the classification type (set in the processor config)</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("classificationId") public IdStage classificationId(@NotNull String classificationId) { this.classificationId = Objects.requireNonNull(classificationId, "classificationId must not be null"); return this; } /** * <p>Unique ID for this split</p> * <p>Unique ID for this split</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public FileIdStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>File ID associated with this split</p> * <p>File ID associated with this split</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("fileId") public _FinalStage fileId(@NotNull String fileId) { this.fileId = Objects.requireNonNull(fileId, "fileId must not be null"); return this; } /** * <p>Optional name for the split</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage name(String name) { this.name = Optional.ofNullable(name); return this; } /** * <p>Optional name for the split</p> */ @java.lang.Override @JsonSetter(value = "name", nulls = Nulls.SKIP) public _FinalStage name(Optional<String> name) { this.name = name; return this; } @java.lang.Override public SplitterOutputSplitsItem build() { return new SplitterOutputSplitsItem( type, observation, identifier, startPage, endPage, name, classificationId, id, fileId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = StepRun.Builder.class) public final class StepRun { private final String object; private final String id; private final StepRunStatus status; private final StepRunStep step; private final Optional<StepRunOutput> output; private final Map<String, Object> additionalProperties; private StepRun( String object, String id, StepRunStatus status, StepRunStep step, Optional<StepRunOutput> output, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.status = status; this.step = step; this.output = output; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;workflow_step_run&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The ID of the workflow step run. * <p>Example: <code>&quot;workflow_step_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The status of the workflow step run: * <ul> * <li><code>&quot;PENDING&quot;</code> - The step run is waiting to be executed</li> * <li><code>&quot;PROCESSING&quot;</code> - The step run is currently executing</li> * <li><code>&quot;PROCESSED&quot;</code> - The step run completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The step run encountered an error</li> * </ul> */ @JsonProperty("status") public StepRunStatus getStatus() { return status; } @JsonProperty("step") public StepRunStep getStep() { return step; } /** * @return The output of the WorkflowStepRun. The shape of the output depends on the type of the WorkflowStep in the <code>step</code> field: * <ul> * <li>For <code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> steps - The output will be the same object that was returned by the external endpoint configured for this step</li> * <li>For <code>&quot;RULE_VALIDATION&quot;</code> steps - See the below shape:</li> * </ul> */ @JsonProperty("output") public Optional<StepRunOutput> getOutput() { return output; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof StepRun && equalTo((StepRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(StepRun other) { return object.equals(other.object) && id.equals(other.id) && status.equals(other.status) && step.equals(other.step) && output.equals(other.output); } @java.lang.Override public int hashCode() { return Objects.hash(this.object, this.id, this.status, this.step, this.output); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_step_run&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(StepRun other); } public interface IdStage { /** * <p>The ID of the workflow step run.</p> * <p>Example: <code>&quot;workflow_step_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ StatusStage id(@NotNull String id); } public interface StatusStage { /** * <p>The status of the workflow step run:</p> * <ul> * <li><code>&quot;PENDING&quot;</code> - The step run is waiting to be executed</li> * <li><code>&quot;PROCESSING&quot;</code> - The step run is currently executing</li> * <li><code>&quot;PROCESSED&quot;</code> - The step run completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The step run encountered an error</li> * </ul> */ StepStage status(@NotNull StepRunStatus status); } public interface StepStage { _FinalStage step(@NotNull StepRunStep step); } public interface _FinalStage { StepRun build(); /** * <p>The output of the WorkflowStepRun. The shape of the output depends on the type of the WorkflowStep in the <code>step</code> field:</p> * <ul> * <li>For <code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> steps - The output will be the same object that was returned by the external endpoint configured for this step</li> * <li>For <code>&quot;RULE_VALIDATION&quot;</code> steps - See the below shape:</li> * </ul> */ _FinalStage output(Optional<StepRunOutput> output); _FinalStage output(StepRunOutput output); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, StatusStage, StepStage, _FinalStage { private String object; private String id; private StepRunStatus status; private StepRunStep step; private Optional<StepRunOutput> output = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(StepRun other) { object(other.getObject()); id(other.getId()); status(other.getStatus()); step(other.getStep()); output(other.getOutput()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_step_run&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;workflow_step_run&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The ID of the workflow step run.</p> * <p>Example: <code>&quot;workflow_step_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * <p>The ID of the workflow step run.</p> * <p>Example: <code>&quot;workflow_step_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public StatusStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The status of the workflow step run:</p> * <ul> * <li><code>&quot;PENDING&quot;</code> - The step run is waiting to be executed</li> * <li><code>&quot;PROCESSING&quot;</code> - The step run is currently executing</li> * <li><code>&quot;PROCESSED&quot;</code> - The step run completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The step run encountered an error</li> * </ul> * <p>The status of the workflow step run:</p> * <ul> * <li><code>&quot;PENDING&quot;</code> - The step run is waiting to be executed</li> * <li><code>&quot;PROCESSING&quot;</code> - The step run is currently executing</li> * <li><code>&quot;PROCESSED&quot;</code> - The step run completed successfully</li> * <li><code>&quot;FAILED&quot;</code> - The step run encountered an error</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("status") public StepStage status(@NotNull StepRunStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } @java.lang.Override @JsonSetter("step") public _FinalStage step(@NotNull StepRunStep step) { this.step = Objects.requireNonNull(step, "step must not be null"); return this; } /** * <p>The output of the WorkflowStepRun. The shape of the output depends on the type of the WorkflowStep in the <code>step</code> field:</p> * <ul> * <li>For <code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> steps - The output will be the same object that was returned by the external endpoint configured for this step</li> * <li>For <code>&quot;RULE_VALIDATION&quot;</code> steps - See the below shape:</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage output(StepRunOutput output) { this.output = Optional.ofNullable(output); return this; } /** * <p>The output of the WorkflowStepRun. The shape of the output depends on the type of the WorkflowStep in the <code>step</code> field:</p> * <ul> * <li>For <code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> steps - The output will be the same object that was returned by the external endpoint configured for this step</li> * <li>For <code>&quot;RULE_VALIDATION&quot;</code> steps - See the below shape:</li> * </ul> */ @java.lang.Override @JsonSetter(value = "output", nulls = Nulls.SKIP) public _FinalStage output(Optional<StepRunOutput> output) { this.output = output; return this; } @java.lang.Override public StepRun build() { return new StepRun(object, id, status, step, output, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunOutput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = StepRunOutput.Builder.class) public final class StepRunOutput { private final Optional<List<StepRunOutputRulesItem>> rules; private final Map<String, Object> additionalProperties; private StepRunOutput(Optional<List<StepRunOutputRulesItem>> rules, Map<String, Object> additionalProperties) { this.rules = rules; this.additionalProperties = additionalProperties; } @JsonProperty("rules") public Optional<List<StepRunOutputRulesItem>> getRules() { return rules; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof StepRunOutput && equalTo((StepRunOutput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(StepRunOutput other) { return rules.equals(other.rules); } @java.lang.Override public int hashCode() { return Objects.hash(this.rules); } @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<List<StepRunOutputRulesItem>> rules = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(StepRunOutput other) { rules(other.getRules()); return this; } @JsonSetter(value = "rules", nulls = Nulls.SKIP) public Builder rules(Optional<List<StepRunOutputRulesItem>> rules) { this.rules = rules; return this; } public Builder rules(List<StepRunOutputRulesItem> rules) { this.rules = Optional.ofNullable(rules); return this; } public StepRunOutput build() { return new StepRunOutput(rules, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunOutputRulesItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = StepRunOutputRulesItem.Builder.class) public final class StepRunOutputRulesItem { private final String name; private final boolean valid; private final Optional<List<String>> validArray; private final Optional<StepRunOutputRulesItemFailureReason> failureReason; private final Optional<String> error; private final Map<String, Object> additionalProperties; private StepRunOutputRulesItem( String name, boolean valid, Optional<List<String>> validArray, Optional<StepRunOutputRulesItemFailureReason> failureReason, Optional<String> error, Map<String, Object> additionalProperties) { this.name = name; this.valid = valid; this.validArray = validArray; this.failureReason = failureReason; this.error = error; this.additionalProperties = additionalProperties; } /** * @return The name of the validation rule. */ @JsonProperty("name") public String getName() { return name; } /** * @return Indicates whether this validation rule passed or not. This field will be <code>true</code> only if the formula evaluates to <code>true</code>. If the rule's formula is array valued, then this field will only be <code>true</code> if the formula evaluates to <code>true</code> for every item in the array. */ @JsonProperty("valid") public boolean getValid() { return valid; } /** * @return Only present if the validation rule's formula is array valued. This field contains the formula's evaluated result for every item in the array. */ @JsonProperty("validArray") public Optional<List<String>> getValidArray() { return validArray; } /** * @return If the validation rule is not valid, then this describes why the rule failed. * <ul> * <li><code>&quot;RULE_FAILED&quot;</code> - The formula evaluated to <code>false</code> or <code>null</code></li> * <li><code>&quot;PARSE_ERROR&quot;</code> - The formula could not be parsed</li> * <li><code>&quot;VALUE_ERROR&quot;</code> - An error occurred while evaluating the formula</li> * </ul> */ @JsonProperty("failureReason") public Optional<StepRunOutputRulesItemFailureReason> getFailureReason() { return failureReason; } /** * @return If the <code>failureReason</code> is <code>PARSE_ERROR</code> or <code>VALUE_ERROR</code>, then this field contains the error's details. */ @JsonProperty("error") public Optional<String> getError() { return error; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof StepRunOutputRulesItem && equalTo((StepRunOutputRulesItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(StepRunOutputRulesItem other) { return name.equals(other.name) && valid == other.valid && validArray.equals(other.validArray) && failureReason.equals(other.failureReason) && error.equals(other.error); } @java.lang.Override public int hashCode() { return Objects.hash(this.name, this.valid, this.validArray, this.failureReason, this.error); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static NameStage builder() { return new Builder(); } public interface NameStage { /** * <p>The name of the validation rule.</p> */ ValidStage name(@NotNull String name); Builder from(StepRunOutputRulesItem other); } public interface ValidStage { /** * <p>Indicates whether this validation rule passed or not. This field will be <code>true</code> only if the formula evaluates to <code>true</code>. If the rule's formula is array valued, then this field will only be <code>true</code> if the formula evaluates to <code>true</code> for every item in the array.</p> */ _FinalStage valid(boolean valid); } public interface _FinalStage { StepRunOutputRulesItem build(); /** * <p>Only present if the validation rule's formula is array valued. This field contains the formula's evaluated result for every item in the array.</p> */ _FinalStage validArray(Optional<List<String>> validArray); _FinalStage validArray(List<String> validArray); /** * <p>If the validation rule is not valid, then this describes why the rule failed.</p> * <ul> * <li><code>&quot;RULE_FAILED&quot;</code> - The formula evaluated to <code>false</code> or <code>null</code></li> * <li><code>&quot;PARSE_ERROR&quot;</code> - The formula could not be parsed</li> * <li><code>&quot;VALUE_ERROR&quot;</code> - An error occurred while evaluating the formula</li> * </ul> */ _FinalStage failureReason(Optional<StepRunOutputRulesItemFailureReason> failureReason); _FinalStage failureReason(StepRunOutputRulesItemFailureReason failureReason); /** * <p>If the <code>failureReason</code> is <code>PARSE_ERROR</code> or <code>VALUE_ERROR</code>, then this field contains the error's details.</p> */ _FinalStage error(Optional<String> error); _FinalStage error(String error); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements NameStage, ValidStage, _FinalStage { private String name; private boolean valid; private Optional<String> error = Optional.empty(); private Optional<StepRunOutputRulesItemFailureReason> failureReason = Optional.empty(); private Optional<List<String>> validArray = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(StepRunOutputRulesItem other) { name(other.getName()); valid(other.getValid()); validArray(other.getValidArray()); failureReason(other.getFailureReason()); error(other.getError()); return this; } /** * <p>The name of the validation rule.</p> * <p>The name of the validation rule.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public ValidStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } /** * <p>Indicates whether this validation rule passed or not. This field will be <code>true</code> only if the formula evaluates to <code>true</code>. If the rule's formula is array valued, then this field will only be <code>true</code> if the formula evaluates to <code>true</code> for every item in the array.</p> * <p>Indicates whether this validation rule passed or not. This field will be <code>true</code> only if the formula evaluates to <code>true</code>. If the rule's formula is array valued, then this field will only be <code>true</code> if the formula evaluates to <code>true</code> for every item in the array.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("valid") public _FinalStage valid(boolean valid) { this.valid = valid; return this; } /** * <p>If the <code>failureReason</code> is <code>PARSE_ERROR</code> or <code>VALUE_ERROR</code>, then this field contains the error's details.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage error(String error) { this.error = Optional.ofNullable(error); return this; } /** * <p>If the <code>failureReason</code> is <code>PARSE_ERROR</code> or <code>VALUE_ERROR</code>, then this field contains the error's details.</p> */ @java.lang.Override @JsonSetter(value = "error", nulls = Nulls.SKIP) public _FinalStage error(Optional<String> error) { this.error = error; return this; } /** * <p>If the validation rule is not valid, then this describes why the rule failed.</p> * <ul> * <li><code>&quot;RULE_FAILED&quot;</code> - The formula evaluated to <code>false</code> or <code>null</code></li> * <li><code>&quot;PARSE_ERROR&quot;</code> - The formula could not be parsed</li> * <li><code>&quot;VALUE_ERROR&quot;</code> - An error occurred while evaluating the formula</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureReason(StepRunOutputRulesItemFailureReason failureReason) { this.failureReason = Optional.ofNullable(failureReason); return this; } /** * <p>If the validation rule is not valid, then this describes why the rule failed.</p> * <ul> * <li><code>&quot;RULE_FAILED&quot;</code> - The formula evaluated to <code>false</code> or <code>null</code></li> * <li><code>&quot;PARSE_ERROR&quot;</code> - The formula could not be parsed</li> * <li><code>&quot;VALUE_ERROR&quot;</code> - An error occurred while evaluating the formula</li> * </ul> */ @java.lang.Override @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) public _FinalStage failureReason(Optional<StepRunOutputRulesItemFailureReason> failureReason) { this.failureReason = failureReason; return this; } /** * <p>Only present if the validation rule's formula is array valued. This field contains the formula's evaluated result for every item in the array.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage validArray(List<String> validArray) { this.validArray = Optional.ofNullable(validArray); return this; } /** * <p>Only present if the validation rule's formula is array valued. This field contains the formula's evaluated result for every item in the array.</p> */ @java.lang.Override @JsonSetter(value = "validArray", nulls = Nulls.SKIP) public _FinalStage validArray(Optional<List<String>> validArray) { this.validArray = validArray; return this; } @java.lang.Override public StepRunOutputRulesItem build() { return new StepRunOutputRulesItem(name, valid, validArray, failureReason, error, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunOutputRulesItemFailureReason.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum StepRunOutputRulesItemFailureReason { RULE_FAILED("RULE_FAILED"), PARSE_ERROR("PARSE_ERROR"), VALUE_ERROR("VALUE_ERROR"); private final String value; StepRunOutputRulesItemFailureReason(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunStatus.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum StepRunStatus { PENDING("PENDING"), PROCESSING("PROCESSING"), PROCESSED("PROCESSED"), FAILED("FAILED"); private final String value; StepRunStatus(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunStep.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = StepRunStep.Builder.class) public final class StepRunStep { private final String object; private final String id; private final String name; private final StepRunStepType type; private final Map<String, Object> additionalProperties; private StepRunStep( String object, String id, String name, StepRunStepType type, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.name = name; this.type = type; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;workflow_step&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The ID of the workflow step. * <p>Example: <code>&quot;step_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The name of the workflow step. * <p>Example: <code>&quot;Validate Invoice Total&quot;</code></p> */ @JsonProperty("name") public String getName() { return name; } /** * @return The type of workflow step: * <ul> * <li><code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> - Validates data against an external source</li> * <li><code>&quot;RULE_VALIDATION&quot;</code> - Validates data against defined rules</li> * </ul> */ @JsonProperty("type") public StepRunStepType getType() { return type; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof StepRunStep && equalTo((StepRunStep) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(StepRunStep other) { return object.equals(other.object) && id.equals(other.id) && name.equals(other.name) && type.equals(other.type); } @java.lang.Override public int hashCode() { return Objects.hash(this.object, this.id, this.name, this.type); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_step&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(StepRunStep other); } public interface IdStage { /** * <p>The ID of the workflow step.</p> * <p>Example: <code>&quot;step_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ NameStage id(@NotNull String id); } public interface NameStage { /** * <p>The name of the workflow step.</p> * <p>Example: <code>&quot;Validate Invoice Total&quot;</code></p> */ TypeStage name(@NotNull String name); } public interface TypeStage { /** * <p>The type of workflow step:</p> * <ul> * <li><code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> - Validates data against an external source</li> * <li><code>&quot;RULE_VALIDATION&quot;</code> - Validates data against defined rules</li> * </ul> */ _FinalStage type(@NotNull StepRunStepType type); } public interface _FinalStage { StepRunStep build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, NameStage, TypeStage, _FinalStage { private String object; private String id; private String name; private StepRunStepType type; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(StepRunStep other) { object(other.getObject()); id(other.getId()); name(other.getName()); type(other.getType()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_step&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;workflow_step&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The ID of the workflow step.</p> * <p>Example: <code>&quot;step_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * <p>The ID of the workflow step.</p> * <p>Example: <code>&quot;step_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The name of the workflow step.</p> * <p>Example: <code>&quot;Validate Invoice Total&quot;</code></p> * <p>The name of the workflow step.</p> * <p>Example: <code>&quot;Validate Invoice Total&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public TypeStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } /** * <p>The type of workflow step:</p> * <ul> * <li><code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> - Validates data against an external source</li> * <li><code>&quot;RULE_VALIDATION&quot;</code> - Validates data against defined rules</li> * </ul> * <p>The type of workflow step:</p> * <ul> * <li><code>&quot;EXTERNAL_DATA_VALIDATION&quot;</code> - Validates data against an external source</li> * <li><code>&quot;RULE_VALIDATION&quot;</code> - Validates data against defined rules</li> * </ul> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("type") public _FinalStage type(@NotNull StepRunStepType type) { this.type = Objects.requireNonNull(type, "type must not be null"); return this; } @java.lang.Override public StepRunStep build() { return new StepRunStep(object, id, name, type, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/StepRunStepType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum StepRunStepType { EXTERNAL_DATA_VALIDATION("EXTERNAL_DATA_VALIDATION"), RULE_VALIDATION("RULE_VALIDATION"); private final String value; StepRunStepType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/TableCellDetails.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TableCellDetails.Builder.class) public final class TableCellDetails { private final int rowIndex; private final int columnIndex; private final Map<String, Object> additionalProperties; private TableCellDetails(int rowIndex, int columnIndex, Map<String, Object> additionalProperties) { this.rowIndex = rowIndex; this.columnIndex = columnIndex; this.additionalProperties = additionalProperties; } /** * @return Indicates this is a table cell details object */ @JsonProperty("type") public String getType() { return "table_cell_details"; } @JsonProperty("rowIndex") public int getRowIndex() { return rowIndex; } @JsonProperty("columnIndex") public int getColumnIndex() { return columnIndex; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TableCellDetails && equalTo((TableCellDetails) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(TableCellDetails other) { return rowIndex == other.rowIndex && columnIndex == other.columnIndex; } @java.lang.Override public int hashCode() { return Objects.hash(this.rowIndex, this.columnIndex); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static RowIndexStage builder() { return new Builder(); } public interface RowIndexStage { ColumnIndexStage rowIndex(int rowIndex); Builder from(TableCellDetails other); } public interface ColumnIndexStage { _FinalStage columnIndex(int columnIndex); } public interface _FinalStage { TableCellDetails build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements RowIndexStage, ColumnIndexStage, _FinalStage { private int rowIndex; private int columnIndex; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(TableCellDetails other) { rowIndex(other.getRowIndex()); columnIndex(other.getColumnIndex()); return this; } @java.lang.Override @JsonSetter("rowIndex") public ColumnIndexStage rowIndex(int rowIndex) { this.rowIndex = rowIndex; return this; } @java.lang.Override @JsonSetter("columnIndex") public _FinalStage columnIndex(int columnIndex) { this.columnIndex = columnIndex; return this; } @java.lang.Override public TableCellDetails build() { return new TableCellDetails(rowIndex, columnIndex, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/TableDetails.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TableDetails.Builder.class) public final class TableDetails { private final int rowCount; private final int columnCount; private final Map<String, Object> additionalProperties; private TableDetails(int rowCount, int columnCount, Map<String, Object> additionalProperties) { this.rowCount = rowCount; this.columnCount = columnCount; this.additionalProperties = additionalProperties; } /** * @return Indicates this is a table details object */ @JsonProperty("type") public String getType() { return "table_details"; } /** * @return The number of rows in the table */ @JsonProperty("rowCount") public int getRowCount() { return rowCount; } /** * @return The number of columns in the table */ @JsonProperty("columnCount") public int getColumnCount() { return columnCount; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TableDetails && equalTo((TableDetails) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(TableDetails other) { return rowCount == other.rowCount && columnCount == other.columnCount; } @java.lang.Override public int hashCode() { return Objects.hash(this.rowCount, this.columnCount); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static RowCountStage builder() { return new Builder(); } public interface RowCountStage { /** * <p>The number of rows in the table</p> */ ColumnCountStage rowCount(int rowCount); Builder from(TableDetails other); } public interface ColumnCountStage { /** * <p>The number of columns in the table</p> */ _FinalStage columnCount(int columnCount); } public interface _FinalStage { TableDetails build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements RowCountStage, ColumnCountStage, _FinalStage { private int rowCount; private int columnCount; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(TableDetails other) { rowCount(other.getRowCount()); columnCount(other.getColumnCount()); return this; } /** * <p>The number of rows in the table</p> * <p>The number of rows in the table</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("rowCount") public ColumnCountStage rowCount(int rowCount) { this.rowCount = rowCount; return this; } /** * <p>The number of columns in the table</p> * <p>The number of columns in the table</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("columnCount") public _FinalStage columnCount(int columnCount) { this.columnCount = columnCount; return this; } @java.lang.Override public TableDetails build() { return new TableDetails(rowCount, columnCount, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/TooManyRequestsErrorBody.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TooManyRequestsErrorBody.Builder.class) public final class TooManyRequestsErrorBody { private final String error; private final Map<String, Object> additionalProperties; private TooManyRequestsErrorBody(String error, Map<String, Object> additionalProperties) { this.error = error; this.additionalProperties = additionalProperties; } @JsonProperty("error") public String getError() { return error; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof TooManyRequestsErrorBody && equalTo((TooManyRequestsErrorBody) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(TooManyRequestsErrorBody other) { return error.equals(other.error); } @java.lang.Override public int hashCode() { return Objects.hash(this.error); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ErrorStage builder() { return new Builder(); } public interface ErrorStage { _FinalStage error(@NotNull String error); Builder from(TooManyRequestsErrorBody other); } public interface _FinalStage { TooManyRequestsErrorBody build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ErrorStage, _FinalStage { private String error; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(TooManyRequestsErrorBody other) { error(other.getError()); return this; } @java.lang.Override @JsonSetter("error") public _FinalStage error(@NotNull String error) { this.error = Objects.requireNonNull(error, "error must not be null"); return this; } @java.lang.Override public TooManyRequestsErrorBody build() { return new TooManyRequestsErrorBody(error, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEvent.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEvent.Builder.class) public final class WebhookEvent { private final String eventId; private final WebhookEventEventType eventType; private final WebhookEventPayload payload; private final Map<String, Object> additionalProperties; private WebhookEvent( String eventId, WebhookEventEventType eventType, WebhookEventPayload payload, Map<String, Object> additionalProperties) { this.eventId = eventId; this.eventType = eventType; this.payload = payload; this.additionalProperties = additionalProperties; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } /** * @return Type of the event that occurred */ @JsonProperty("eventType") public WebhookEventEventType getEventType() { return eventType; } /** * @return Contains the relevant object for the event type */ @JsonProperty("payload") public WebhookEventPayload getPayload() { return payload; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEvent && equalTo((WebhookEvent) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEvent other) { return eventId.equals(other.eventId) && eventType.equals(other.eventType) && payload.equals(other.payload); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventId, this.eventType, this.payload); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ EventTypeStage eventId(@NotNull String eventId); Builder from(WebhookEvent other); } public interface EventTypeStage { /** * <p>Type of the event that occurred</p> */ PayloadStage eventType(@NotNull WebhookEventEventType eventType); } public interface PayloadStage { /** * <p>Contains the relevant object for the event type</p> */ _FinalStage payload(@NotNull WebhookEventPayload payload); } public interface _FinalStage { WebhookEvent build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, EventTypeStage, PayloadStage, _FinalStage { private String eventId; private WebhookEventEventType eventType; private WebhookEventPayload payload; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEvent other) { eventId(other.getEventId()); eventType(other.getEventType()); payload(other.getPayload()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public EventTypeStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } /** * <p>Type of the event that occurred</p> * <p>Type of the event that occurred</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventType") public PayloadStage eventType(@NotNull WebhookEventEventType eventType) { this.eventType = Objects.requireNonNull(eventType, "eventType must not be null"); return this; } /** * <p>Contains the relevant object for the event type</p> * <p>Contains the relevant object for the event type</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("payload") public _FinalStage payload(@NotNull WebhookEventPayload payload) { this.payload = Objects.requireNonNull(payload, "payload must not be null"); return this; } @java.lang.Override public WebhookEvent build() { return new WebhookEvent(eventId, eventType, payload, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventEventType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WebhookEventEventType { WORKFLOW_RUN_COMPLETED("workflow_run.completed"), WORKFLOW_RUN_FAILED("workflow_run.failed"), WORKFLOW_RUN_NEEDS_REVIEW("workflow_run.needs_review"), WORKFLOW_RUN_REJECTED("workflow_run.rejected"), WORKFLOW_RUN_STEP_RUN_PROCESSED("workflow_run.step_run.processed"), PROCESSOR_RUN_PROCESSED("processor_run.processed"), PROCESSOR_RUN_FAILED("processor_run.failed"), WORKFLOW_CREATED("workflow.created"), WORKFLOW_DEPLOYED("workflow.deployed"), WORKFLOW_DELETED("workflow.deleted"), PROCESSOR_CREATED("processor.created"), PROCESSOR_UPDATED("processor.updated"), PROCESSOR_DELETED("processor.deleted"), PROCESSOR_DRAFT_UPDATED("processor.draft.updated"), PROCESSOR_VERSION_PUBLISHED("processor.version.published"), PARSER_RUN_PROCESSED("parser_run.processed"), PARSER_RUN_FAILED("parser_run.failed"); private final String value; WebhookEventEventType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventPayload.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; import java.util.Objects; @JsonDeserialize(using = WebhookEventPayload.Deserializer.class) public final class WebhookEventPayload { private final Object value; private final int type; private WebhookEventPayload(Object value, int type) { this.value = value; this.type = type; } @JsonValue public Object get() { return this.value; } @SuppressWarnings("unchecked") public <T> T visit(Visitor<T> visitor) { if (this.type == 0) { return visitor.visit((WorkflowRun) this.value); } else if (this.type == 1) { return visitor.visit((ProcessorRun) this.value); } else if (this.type == 2) { return visitor.visit((Workflow) this.value); } else if (this.type == 3) { return visitor.visit((Processor) this.value); } else if (this.type == 4) { return visitor.visit((ProcessorVersion) this.value); } else if (this.type == 5) { return visitor.visit((ParserRunStatus) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventPayload && equalTo((WebhookEventPayload) other); } private boolean equalTo(WebhookEventPayload other) { return value.equals(other.value); } @java.lang.Override public int hashCode() { return Objects.hash(this.value); } @java.lang.Override public String toString() { return this.value.toString(); } public static WebhookEventPayload of(WorkflowRun value) { return new WebhookEventPayload(value, 0); } public static WebhookEventPayload of(ProcessorRun value) { return new WebhookEventPayload(value, 1); } public static WebhookEventPayload of(Workflow value) { return new WebhookEventPayload(value, 2); } public static WebhookEventPayload of(Processor value) { return new WebhookEventPayload(value, 3); } public static WebhookEventPayload of(ProcessorVersion value) { return new WebhookEventPayload(value, 4); } public static WebhookEventPayload of(ParserRunStatus value) { return new WebhookEventPayload(value, 5); } public interface Visitor<T> { T visit(WorkflowRun value); T visit(ProcessorRun value); T visit(Workflow value); T visit(Processor value); T visit(ProcessorVersion value); T visit(ParserRunStatus value); } static final class Deserializer extends StdDeserializer<WebhookEventPayload> { Deserializer() { super(WebhookEventPayload.class); } @java.lang.Override public WebhookEventPayload deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, WorkflowRun.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProcessorRun.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, Workflow.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, Processor.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ProcessorVersion.class)); } catch (RuntimeException e) { } try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, ParserRunStatus.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventProcessor.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEventProcessor.Builder.class) public final class WebhookEventProcessor { private final Optional<WebhookEventProcessorEventType> eventType; private final Optional<Processor> payload; private final String eventId; private final Map<String, Object> additionalProperties; private WebhookEventProcessor( Optional<WebhookEventProcessorEventType> eventType, Optional<Processor> payload, String eventId, Map<String, Object> additionalProperties) { this.eventType = eventType; this.payload = payload; this.eventId = eventId; this.additionalProperties = additionalProperties; } @JsonProperty("eventType") public Optional<WebhookEventProcessorEventType> getEventType() { return eventType; } @JsonProperty("payload") public Optional<Processor> getPayload() { return payload; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventProcessor && equalTo((WebhookEventProcessor) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEventProcessor other) { return eventType.equals(other.eventType) && payload.equals(other.payload) && eventId.equals(other.eventId); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.payload, this.eventId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ _FinalStage eventId(@NotNull String eventId); Builder from(WebhookEventProcessor other); } public interface _FinalStage { WebhookEventProcessor build(); _FinalStage eventType(Optional<WebhookEventProcessorEventType> eventType); _FinalStage eventType(WebhookEventProcessorEventType eventType); _FinalStage payload(Optional<Processor> payload); _FinalStage payload(Processor payload); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, _FinalStage { private String eventId; private Optional<Processor> payload = Optional.empty(); private Optional<WebhookEventProcessorEventType> eventType = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEventProcessor other) { eventType(other.getEventType()); payload(other.getPayload()); eventId(other.getEventId()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public _FinalStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } @java.lang.Override public _FinalStage payload(Processor payload) { this.payload = Optional.ofNullable(payload); return this; } @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional<Processor> payload) { this.payload = payload; return this; } @java.lang.Override public _FinalStage eventType(WebhookEventProcessorEventType eventType) { this.eventType = Optional.ofNullable(eventType); return this; } @java.lang.Override @JsonSetter(value = "eventType", nulls = Nulls.SKIP) public _FinalStage eventType(Optional<WebhookEventProcessorEventType> eventType) { this.eventType = eventType; return this; } @java.lang.Override public WebhookEventProcessor build() { return new WebhookEventProcessor(eventType, payload, eventId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventProcessorEventType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WebhookEventProcessorEventType { PROCESSOR_CREATED("processor.created"), PROCESSOR_UPDATED("processor.updated"), PROCESSOR_DELETED("processor.deleted"), PROCESSOR_DRAFT_UPDATED("processor.draft.updated"); private final String value; WebhookEventProcessorEventType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventProcessorRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEventProcessorRun.Builder.class) public final class WebhookEventProcessorRun { private final Optional<WebhookEventProcessorRunEventType> eventType; private final Optional<ProcessorRun> payload; private final String eventId; private final Map<String, Object> additionalProperties; private WebhookEventProcessorRun( Optional<WebhookEventProcessorRunEventType> eventType, Optional<ProcessorRun> payload, String eventId, Map<String, Object> additionalProperties) { this.eventType = eventType; this.payload = payload; this.eventId = eventId; this.additionalProperties = additionalProperties; } @JsonProperty("eventType") public Optional<WebhookEventProcessorRunEventType> getEventType() { return eventType; } @JsonProperty("payload") public Optional<ProcessorRun> getPayload() { return payload; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventProcessorRun && equalTo((WebhookEventProcessorRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEventProcessorRun other) { return eventType.equals(other.eventType) && payload.equals(other.payload) && eventId.equals(other.eventId); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.payload, this.eventId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ _FinalStage eventId(@NotNull String eventId); Builder from(WebhookEventProcessorRun other); } public interface _FinalStage { WebhookEventProcessorRun build(); _FinalStage eventType(Optional<WebhookEventProcessorRunEventType> eventType); _FinalStage eventType(WebhookEventProcessorRunEventType eventType); _FinalStage payload(Optional<ProcessorRun> payload); _FinalStage payload(ProcessorRun payload); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, _FinalStage { private String eventId; private Optional<ProcessorRun> payload = Optional.empty(); private Optional<WebhookEventProcessorRunEventType> eventType = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEventProcessorRun other) { eventType(other.getEventType()); payload(other.getPayload()); eventId(other.getEventId()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public _FinalStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } @java.lang.Override public _FinalStage payload(ProcessorRun payload) { this.payload = Optional.ofNullable(payload); return this; } @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional<ProcessorRun> payload) { this.payload = payload; return this; } @java.lang.Override public _FinalStage eventType(WebhookEventProcessorRunEventType eventType) { this.eventType = Optional.ofNullable(eventType); return this; } @java.lang.Override @JsonSetter(value = "eventType", nulls = Nulls.SKIP) public _FinalStage eventType(Optional<WebhookEventProcessorRunEventType> eventType) { this.eventType = eventType; return this; } @java.lang.Override public WebhookEventProcessorRun build() { return new WebhookEventProcessorRun(eventType, payload, eventId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventProcessorRunEventType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WebhookEventProcessorRunEventType { PROCESSOR_RUN_PROCESSED("processor_run.processed"), PROCESSOR_RUN_FAILED("processor_run.failed"); private final String value; WebhookEventProcessorRunEventType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventProcessorVersion.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEventProcessorVersion.Builder.class) public final class WebhookEventProcessorVersion { private final Optional<String> eventType; private final Optional<ProcessorVersion> payload; private final String eventId; private final Map<String, Object> additionalProperties; private WebhookEventProcessorVersion( Optional<String> eventType, Optional<ProcessorVersion> payload, String eventId, Map<String, Object> additionalProperties) { this.eventType = eventType; this.payload = payload; this.eventId = eventId; this.additionalProperties = additionalProperties; } @JsonProperty("eventType") public Optional<String> getEventType() { return eventType; } @JsonProperty("payload") public Optional<ProcessorVersion> getPayload() { return payload; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventProcessorVersion && equalTo((WebhookEventProcessorVersion) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEventProcessorVersion other) { return eventType.equals(other.eventType) && payload.equals(other.payload) && eventId.equals(other.eventId); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.payload, this.eventId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ _FinalStage eventId(@NotNull String eventId); Builder from(WebhookEventProcessorVersion other); } public interface _FinalStage { WebhookEventProcessorVersion build(); _FinalStage eventType(Optional<String> eventType); _FinalStage eventType(String eventType); _FinalStage payload(Optional<ProcessorVersion> payload); _FinalStage payload(ProcessorVersion payload); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, _FinalStage { private String eventId; private Optional<ProcessorVersion> payload = Optional.empty(); private Optional<String> eventType = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEventProcessorVersion other) { eventType(other.getEventType()); payload(other.getPayload()); eventId(other.getEventId()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public _FinalStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } @java.lang.Override public _FinalStage payload(ProcessorVersion payload) { this.payload = Optional.ofNullable(payload); return this; } @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional<ProcessorVersion> payload) { this.payload = payload; return this; } @java.lang.Override public _FinalStage eventType(String eventType) { this.eventType = Optional.ofNullable(eventType); return this; } @java.lang.Override @JsonSetter(value = "eventType", nulls = Nulls.SKIP) public _FinalStage eventType(Optional<String> eventType) { this.eventType = eventType; return this; } @java.lang.Override public WebhookEventProcessorVersion build() { return new WebhookEventProcessorVersion(eventType, payload, eventId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventWorkflow.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEventWorkflow.Builder.class) public final class WebhookEventWorkflow { private final Optional<WebhookEventWorkflowEventType> eventType; private final Optional<Workflow> payload; private final String eventId; private final Map<String, Object> additionalProperties; private WebhookEventWorkflow( Optional<WebhookEventWorkflowEventType> eventType, Optional<Workflow> payload, String eventId, Map<String, Object> additionalProperties) { this.eventType = eventType; this.payload = payload; this.eventId = eventId; this.additionalProperties = additionalProperties; } @JsonProperty("eventType") public Optional<WebhookEventWorkflowEventType> getEventType() { return eventType; } @JsonProperty("payload") public Optional<Workflow> getPayload() { return payload; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventWorkflow && equalTo((WebhookEventWorkflow) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEventWorkflow other) { return eventType.equals(other.eventType) && payload.equals(other.payload) && eventId.equals(other.eventId); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.payload, this.eventId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ _FinalStage eventId(@NotNull String eventId); Builder from(WebhookEventWorkflow other); } public interface _FinalStage { WebhookEventWorkflow build(); _FinalStage eventType(Optional<WebhookEventWorkflowEventType> eventType); _FinalStage eventType(WebhookEventWorkflowEventType eventType); _FinalStage payload(Optional<Workflow> payload); _FinalStage payload(Workflow payload); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, _FinalStage { private String eventId; private Optional<Workflow> payload = Optional.empty(); private Optional<WebhookEventWorkflowEventType> eventType = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEventWorkflow other) { eventType(other.getEventType()); payload(other.getPayload()); eventId(other.getEventId()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public _FinalStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } @java.lang.Override public _FinalStage payload(Workflow payload) { this.payload = Optional.ofNullable(payload); return this; } @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional<Workflow> payload) { this.payload = payload; return this; } @java.lang.Override public _FinalStage eventType(WebhookEventWorkflowEventType eventType) { this.eventType = Optional.ofNullable(eventType); return this; } @java.lang.Override @JsonSetter(value = "eventType", nulls = Nulls.SKIP) public _FinalStage eventType(Optional<WebhookEventWorkflowEventType> eventType) { this.eventType = eventType; return this; } @java.lang.Override public WebhookEventWorkflow build() { return new WebhookEventWorkflow(eventType, payload, eventId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventWorkflowEventType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WebhookEventWorkflowEventType { WORKFLOW_CREATED("workflow.created"), WORKFLOW_DEPLOYED("workflow.deployed"), WORKFLOW_DELETED("workflow.deleted"); private final String value; WebhookEventWorkflowEventType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventWorkflowRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WebhookEventWorkflowRun.Builder.class) public final class WebhookEventWorkflowRun { private final Optional<WebhookEventWorkflowRunEventType> eventType; private final Optional<WorkflowRun> payload; private final String eventId; private final Map<String, Object> additionalProperties; private WebhookEventWorkflowRun( Optional<WebhookEventWorkflowRunEventType> eventType, Optional<WorkflowRun> payload, String eventId, Map<String, Object> additionalProperties) { this.eventType = eventType; this.payload = payload; this.eventId = eventId; this.additionalProperties = additionalProperties; } @JsonProperty("eventType") public Optional<WebhookEventWorkflowRunEventType> getEventType() { return eventType; } @JsonProperty("payload") public Optional<WorkflowRun> getPayload() { return payload; } /** * @return Unique identifier for the event */ @JsonProperty("eventId") public String getEventId() { return eventId; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WebhookEventWorkflowRun && equalTo((WebhookEventWorkflowRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WebhookEventWorkflowRun other) { return eventType.equals(other.eventType) && payload.equals(other.payload) && eventId.equals(other.eventId); } @java.lang.Override public int hashCode() { return Objects.hash(this.eventType, this.payload, this.eventId); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static EventIdStage builder() { return new Builder(); } public interface EventIdStage { /** * <p>Unique identifier for the event</p> */ _FinalStage eventId(@NotNull String eventId); Builder from(WebhookEventWorkflowRun other); } public interface _FinalStage { WebhookEventWorkflowRun build(); _FinalStage eventType(Optional<WebhookEventWorkflowRunEventType> eventType); _FinalStage eventType(WebhookEventWorkflowRunEventType eventType); _FinalStage payload(Optional<WorkflowRun> payload); _FinalStage payload(WorkflowRun payload); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements EventIdStage, _FinalStage { private String eventId; private Optional<WorkflowRun> payload = Optional.empty(); private Optional<WebhookEventWorkflowRunEventType> eventType = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WebhookEventWorkflowRun other) { eventType(other.getEventType()); payload(other.getPayload()); eventId(other.getEventId()); return this; } /** * <p>Unique identifier for the event</p> * <p>Unique identifier for the event</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("eventId") public _FinalStage eventId(@NotNull String eventId) { this.eventId = Objects.requireNonNull(eventId, "eventId must not be null"); return this; } @java.lang.Override public _FinalStage payload(WorkflowRun payload) { this.payload = Optional.ofNullable(payload); return this; } @java.lang.Override @JsonSetter(value = "payload", nulls = Nulls.SKIP) public _FinalStage payload(Optional<WorkflowRun> payload) { this.payload = payload; return this; } @java.lang.Override public _FinalStage eventType(WebhookEventWorkflowRunEventType eventType) { this.eventType = Optional.ofNullable(eventType); return this; } @java.lang.Override @JsonSetter(value = "eventType", nulls = Nulls.SKIP) public _FinalStage eventType(Optional<WebhookEventWorkflowRunEventType> eventType) { this.eventType = eventType; return this; } @java.lang.Override public WebhookEventWorkflowRun build() { return new WebhookEventWorkflowRun(eventType, payload, eventId, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WebhookEventWorkflowRunEventType.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WebhookEventWorkflowRunEventType { WORKFLOW_RUN_COMPLETED("workflow_run.completed"), WORKFLOW_RUN_FAILED("workflow_run.failed"), WORKFLOW_RUN_NEEDS_REVIEW("workflow_run.needs_review"), WORKFLOW_RUN_REJECTED("workflow_run.rejected"), WORKFLOW_RUN_STEP_RUN_PROCESSED("workflow_run.step_run.processed"); private final String value; WebhookEventWorkflowRunEventType(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/Workflow.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Workflow.Builder.class) public final class Workflow { private final String object; private final String id; private final String version; private final String name; private final Map<String, Object> additionalProperties; private Workflow(String object, String id, String version, String name, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.version = version; this.name = name; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;workflow&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The ID of the workflow. * <p>Example: <code>&quot;workflow_BMlfq_yWM3sT-ZzvCnA3f&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The version of the workflow. * <p>Examples: <code>&quot;3&quot;</code>, <code>&quot;draft&quot;</code></p> */ @JsonProperty("version") public String getVersion() { return version; } /** * @return The name of the workflow. * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> */ @JsonProperty("name") public String getName() { return name; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof Workflow && equalTo((Workflow) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(Workflow other) { return object.equals(other.object) && id.equals(other.id) && version.equals(other.version) && name.equals(other.name); } @java.lang.Override public int hashCode() { return Objects.hash(this.object, this.id, this.version, this.name); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;workflow&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(Workflow other); } public interface IdStage { /** * <p>The ID of the workflow.</p> * <p>Example: <code>&quot;workflow_BMlfq_yWM3sT-ZzvCnA3f&quot;</code></p> */ VersionStage id(@NotNull String id); } public interface VersionStage { /** * <p>The version of the workflow.</p> * <p>Examples: <code>&quot;3&quot;</code>, <code>&quot;draft&quot;</code></p> */ NameStage version(@NotNull String version); } public interface NameStage { /** * <p>The name of the workflow.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> */ _FinalStage name(@NotNull String name); } public interface _FinalStage { Workflow build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, VersionStage, NameStage, _FinalStage { private String object; private String id; private String version; private String name; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(Workflow other) { object(other.getObject()); id(other.getId()); version(other.getVersion()); name(other.getName()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;workflow&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;workflow&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The ID of the workflow.</p> * <p>Example: <code>&quot;workflow_BMlfq_yWM3sT-ZzvCnA3f&quot;</code></p> * <p>The ID of the workflow.</p> * <p>Example: <code>&quot;workflow_BMlfq_yWM3sT-ZzvCnA3f&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public VersionStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The version of the workflow.</p> * <p>Examples: <code>&quot;3&quot;</code>, <code>&quot;draft&quot;</code></p> * <p>The version of the workflow.</p> * <p>Examples: <code>&quot;3&quot;</code>, <code>&quot;draft&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("version") public NameStage version(@NotNull String version) { this.version = Objects.requireNonNull(version, "version must not be null"); return this; } /** * <p>The name of the workflow.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> * <p>The name of the workflow.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public _FinalStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } @java.lang.Override public Workflow build() { return new Workflow(object, id, version, name, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WorkflowRun.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.time.OffsetDateTime; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WorkflowRun.Builder.class) public final class WorkflowRun { private final String object; private final String id; private final String name; private final String url; private final WorkflowStatus status; private final Map<String, Object> metadata; private final Optional<String> batchId; private final List<File> files; private final Optional<String> failureReason; private final Optional<String> failureMessage; private final OffsetDateTime initialRunAt; private final Optional<String> reviewedBy; private final boolean reviewed; private final Optional<String> rejectionNote; private final Optional<OffsetDateTime> reviewedAt; private final Optional<OffsetDateTime> startTime; private final Optional<OffsetDateTime> endTime; private final List<ProcessorRun> outputs; private final List<StepRun> stepRuns; private final Workflow workflow; private final Map<String, Object> additionalProperties; private WorkflowRun( String object, String id, String name, String url, WorkflowStatus status, Map<String, Object> metadata, Optional<String> batchId, List<File> files, Optional<String> failureReason, Optional<String> failureMessage, OffsetDateTime initialRunAt, Optional<String> reviewedBy, boolean reviewed, Optional<String> rejectionNote, Optional<OffsetDateTime> reviewedAt, Optional<OffsetDateTime> startTime, Optional<OffsetDateTime> endTime, List<ProcessorRun> outputs, List<StepRun> stepRuns, Workflow workflow, Map<String, Object> additionalProperties) { this.object = object; this.id = id; this.name = name; this.url = url; this.status = status; this.metadata = metadata; this.batchId = batchId; this.files = files; this.failureReason = failureReason; this.failureMessage = failureMessage; this.initialRunAt = initialRunAt; this.reviewedBy = reviewedBy; this.reviewed = reviewed; this.rejectionNote = rejectionNote; this.reviewedAt = reviewedAt; this.startTime = startTime; this.endTime = endTime; this.outputs = outputs; this.stepRuns = stepRuns; this.workflow = workflow; this.additionalProperties = additionalProperties; } /** * @return The type of response. In this case, it will always be <code>&quot;workflow_run&quot;</code>. */ @JsonProperty("object") public String getObject() { return object; } /** * @return The ID of the workflow run. * <p>Example: <code>&quot;workflow_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } /** * @return The name of the workflow run. * <p>Example: <code>&quot;myFirstFile.pdf&quot;</code></p> */ @JsonProperty("name") public String getName() { return name; } /** * @return A URL to view this workflow run in the Extend UI. * <p>Example: <code>&quot;https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg&quot;</code></p> */ @JsonProperty("url") public String getUrl() { return url; } @JsonProperty("status") public WorkflowStatus getStatus() { return status; } /** * @return The metadata that was passed in when running the Workflow. */ @JsonProperty("metadata") public Map<String, Object> getMetadata() { return metadata; } /** * @return The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID. * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ @JsonProperty("batchId") public Optional<String> getBatchId() { return batchId; } @JsonProperty("files") public List<File> getFiles() { return files; } /** * @return The reason why the workflow run failed. Will only be included if the workflow run status is &quot;FAILED&quot;. */ @JsonProperty("failureReason") public Optional<String> getFailureReason() { return failureReason; } /** * @return A more detailed message about the failure. Will only be included if the workflow run status is &quot;FAILED&quot;. */ @JsonProperty("failureMessage") public Optional<String> getFailureMessage() { return failureMessage; } /** * @return The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2025-04-28T17:01:39.285Z&quot;</code></p> */ @JsonProperty("initialRunAt") public OffsetDateTime getInitialRunAt() { return initialRunAt; } /** * @return The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed. * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ @JsonProperty("reviewedBy") public Optional<String> getReviewedBy() { return reviewedBy; } /** * @return Whether the workflow run has been reviewed. */ @JsonProperty("reviewed") public boolean getReviewed() { return reviewed; } /** * @return A note that is added if a workflow run is rejected. * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ @JsonProperty("rejectionNote") public Optional<String> getRejectionNote() { return rejectionNote; } /** * @return The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("reviewedAt") public Optional<OffsetDateTime> getReviewedAt() { return reviewedAt; } /** * @return The time (in UTC) at which the workflow run started executing. This will always be after the <code>initialRunAt</code> time. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("startTime") public Optional<OffsetDateTime> getStartTime() { return startTime; } /** * @return The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing. * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ @JsonProperty("endTime") public Optional<OffsetDateTime> getEndTime() { return endTime; } @JsonProperty("outputs") public List<ProcessorRun> getOutputs() { return outputs; } /** * @return An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output. * <p>Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.</p> */ @JsonProperty("stepRuns") public List<StepRun> getStepRuns() { return stepRuns; } @JsonProperty("workflow") public Workflow getWorkflow() { return workflow; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkflowRun && equalTo((WorkflowRun) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WorkflowRun other) { return object.equals(other.object) && id.equals(other.id) && name.equals(other.name) && url.equals(other.url) && status.equals(other.status) && metadata.equals(other.metadata) && batchId.equals(other.batchId) && files.equals(other.files) && failureReason.equals(other.failureReason) && failureMessage.equals(other.failureMessage) && initialRunAt.equals(other.initialRunAt) && reviewedBy.equals(other.reviewedBy) && reviewed == other.reviewed && rejectionNote.equals(other.rejectionNote) && reviewedAt.equals(other.reviewedAt) && startTime.equals(other.startTime) && endTime.equals(other.endTime) && outputs.equals(other.outputs) && stepRuns.equals(other.stepRuns) && workflow.equals(other.workflow); } @java.lang.Override public int hashCode() { return Objects.hash( this.object, this.id, this.name, this.url, this.status, this.metadata, this.batchId, this.files, this.failureReason, this.failureMessage, this.initialRunAt, this.reviewedBy, this.reviewed, this.rejectionNote, this.reviewedAt, this.startTime, this.endTime, this.outputs, this.stepRuns, this.workflow); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ObjectStage builder() { return new Builder(); } public interface ObjectStage { /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_run&quot;</code>.</p> */ IdStage object(@NotNull String object); Builder from(WorkflowRun other); } public interface IdStage { /** * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> */ NameStage id(@NotNull String id); } public interface NameStage { /** * <p>The name of the workflow run.</p> * <p>Example: <code>&quot;myFirstFile.pdf&quot;</code></p> */ UrlStage name(@NotNull String name); } public interface UrlStage { /** * <p>A URL to view this workflow run in the Extend UI.</p> * <p>Example: <code>&quot;https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg&quot;</code></p> */ StatusStage url(@NotNull String url); } public interface StatusStage { InitialRunAtStage status(@NotNull WorkflowStatus status); } public interface InitialRunAtStage { /** * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2025-04-28T17:01:39.285Z&quot;</code></p> */ ReviewedStage initialRunAt(@NotNull OffsetDateTime initialRunAt); } public interface ReviewedStage { /** * <p>Whether the workflow run has been reviewed.</p> */ WorkflowStage reviewed(boolean reviewed); } public interface WorkflowStage { _FinalStage workflow(@NotNull Workflow workflow); } public interface _FinalStage { WorkflowRun build(); /** * <p>The metadata that was passed in when running the Workflow.</p> */ _FinalStage metadata(Map<String, Object> metadata); _FinalStage putAllMetadata(Map<String, Object> metadata); _FinalStage metadata(String key, Object value); /** * <p>The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ _FinalStage batchId(Optional<String> batchId); _FinalStage batchId(String batchId); _FinalStage files(List<File> files); _FinalStage addFiles(File files); _FinalStage addAllFiles(List<File> files); /** * <p>The reason why the workflow run failed. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> */ _FinalStage failureReason(Optional<String> failureReason); _FinalStage failureReason(String failureReason); /** * <p>A more detailed message about the failure. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> */ _FinalStage failureMessage(Optional<String> failureMessage); _FinalStage failureMessage(String failureMessage); /** * <p>The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ _FinalStage reviewedBy(Optional<String> reviewedBy); _FinalStage reviewedBy(String reviewedBy); /** * <p>A note that is added if a workflow run is rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ _FinalStage rejectionNote(Optional<String> rejectionNote); _FinalStage rejectionNote(String rejectionNote); /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ _FinalStage reviewedAt(Optional<OffsetDateTime> reviewedAt); _FinalStage reviewedAt(OffsetDateTime reviewedAt); /** * <p>The time (in UTC) at which the workflow run started executing. This will always be after the <code>initialRunAt</code> time. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ _FinalStage startTime(Optional<OffsetDateTime> startTime); _FinalStage startTime(OffsetDateTime startTime); /** * <p>The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ _FinalStage endTime(Optional<OffsetDateTime> endTime); _FinalStage endTime(OffsetDateTime endTime); _FinalStage outputs(List<ProcessorRun> outputs); _FinalStage addOutputs(ProcessorRun outputs); _FinalStage addAllOutputs(List<ProcessorRun> outputs); /** * <p>An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.</p> * <p>Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.</p> */ _FinalStage stepRuns(List<StepRun> stepRuns); _FinalStage addStepRuns(StepRun stepRuns); _FinalStage addAllStepRuns(List<StepRun> stepRuns); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ObjectStage, IdStage, NameStage, UrlStage, StatusStage, InitialRunAtStage, ReviewedStage, WorkflowStage, _FinalStage { private String object; private String id; private String name; private String url; private WorkflowStatus status; private OffsetDateTime initialRunAt; private boolean reviewed; private Workflow workflow; private List<StepRun> stepRuns = new ArrayList<>(); private List<ProcessorRun> outputs = new ArrayList<>(); private Optional<OffsetDateTime> endTime = Optional.empty(); private Optional<OffsetDateTime> startTime = Optional.empty(); private Optional<OffsetDateTime> reviewedAt = Optional.empty(); private Optional<String> rejectionNote = Optional.empty(); private Optional<String> reviewedBy = Optional.empty(); private Optional<String> failureMessage = Optional.empty(); private Optional<String> failureReason = Optional.empty(); private List<File> files = new ArrayList<>(); private Optional<String> batchId = Optional.empty(); private Map<String, Object> metadata = new LinkedHashMap<>(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WorkflowRun other) { object(other.getObject()); id(other.getId()); name(other.getName()); url(other.getUrl()); status(other.getStatus()); metadata(other.getMetadata()); batchId(other.getBatchId()); files(other.getFiles()); failureReason(other.getFailureReason()); failureMessage(other.getFailureMessage()); initialRunAt(other.getInitialRunAt()); reviewedBy(other.getReviewedBy()); reviewed(other.getReviewed()); rejectionNote(other.getRejectionNote()); reviewedAt(other.getReviewedAt()); startTime(other.getStartTime()); endTime(other.getEndTime()); outputs(other.getOutputs()); stepRuns(other.getStepRuns()); workflow(other.getWorkflow()); return this; } /** * <p>The type of response. In this case, it will always be <code>&quot;workflow_run&quot;</code>.</p> * <p>The type of response. In this case, it will always be <code>&quot;workflow_run&quot;</code>.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("object") public IdStage object(@NotNull String object) { this.object = Objects.requireNonNull(object, "object must not be null"); return this; } /** * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_xKm9pNv3qWsY_jL2tR5Dh&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public NameStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** * <p>The name of the workflow run.</p> * <p>Example: <code>&quot;myFirstFile.pdf&quot;</code></p> * <p>The name of the workflow run.</p> * <p>Example: <code>&quot;myFirstFile.pdf&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("name") public UrlStage name(@NotNull String name) { this.name = Objects.requireNonNull(name, "name must not be null"); return this; } /** * <p>A URL to view this workflow run in the Extend UI.</p> * <p>Example: <code>&quot;https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg&quot;</code></p> * <p>A URL to view this workflow run in the Extend UI.</p> * <p>Example: <code>&quot;https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("url") public StatusStage url(@NotNull String url) { this.url = Objects.requireNonNull(url, "url must not be null"); return this; } @java.lang.Override @JsonSetter("status") public InitialRunAtStage status(@NotNull WorkflowStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } /** * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2025-04-28T17:01:39.285Z&quot;</code></p> * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2025-04-28T17:01:39.285Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("initialRunAt") public ReviewedStage initialRunAt(@NotNull OffsetDateTime initialRunAt) { this.initialRunAt = Objects.requireNonNull(initialRunAt, "initialRunAt must not be null"); return this; } /** * <p>Whether the workflow run has been reviewed.</p> * <p>Whether the workflow run has been reviewed.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("reviewed") public WorkflowStage reviewed(boolean reviewed) { this.reviewed = reviewed; return this; } @java.lang.Override @JsonSetter("workflow") public _FinalStage workflow(@NotNull Workflow workflow) { this.workflow = Objects.requireNonNull(workflow, "workflow must not be null"); return this; } /** * <p>An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.</p> * <p>Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addAllStepRuns(List<StepRun> stepRuns) { this.stepRuns.addAll(stepRuns); return this; } /** * <p>An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.</p> * <p>Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage addStepRuns(StepRun stepRuns) { this.stepRuns.add(stepRuns); return this; } /** * <p>An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.</p> * <p>Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.</p> */ @java.lang.Override @JsonSetter(value = "stepRuns", nulls = Nulls.SKIP) public _FinalStage stepRuns(List<StepRun> stepRuns) { this.stepRuns.clear(); this.stepRuns.addAll(stepRuns); return this; } @java.lang.Override public _FinalStage addAllOutputs(List<ProcessorRun> outputs) { this.outputs.addAll(outputs); return this; } @java.lang.Override public _FinalStage addOutputs(ProcessorRun outputs) { this.outputs.add(outputs); return this; } @java.lang.Override @JsonSetter(value = "outputs", nulls = Nulls.SKIP) public _FinalStage outputs(List<ProcessorRun> outputs) { this.outputs.clear(); this.outputs.addAll(outputs); return this; } /** * <p>The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage endTime(OffsetDateTime endTime) { this.endTime = Optional.ofNullable(endTime); return this; } /** * <p>The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "endTime", nulls = Nulls.SKIP) public _FinalStage endTime(Optional<OffsetDateTime> endTime) { this.endTime = endTime; return this; } /** * <p>The time (in UTC) at which the workflow run started executing. This will always be after the <code>initialRunAt</code> time. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage startTime(OffsetDateTime startTime) { this.startTime = Optional.ofNullable(startTime); return this; } /** * <p>The time (in UTC) at which the workflow run started executing. This will always be after the <code>initialRunAt</code> time. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "startTime", nulls = Nulls.SKIP) public _FinalStage startTime(Optional<OffsetDateTime> startTime) { this.startTime = startTime; return this; } /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage reviewedAt(OffsetDateTime reviewedAt) { this.reviewedAt = Optional.ofNullable(reviewedAt); return this; } /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "reviewedAt", nulls = Nulls.SKIP) public _FinalStage reviewedAt(Optional<OffsetDateTime> reviewedAt) { this.reviewedAt = reviewedAt; return this; } /** * <p>A note that is added if a workflow run is rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage rejectionNote(String rejectionNote) { this.rejectionNote = Optional.ofNullable(rejectionNote); return this; } /** * <p>A note that is added if a workflow run is rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "rejectionNote", nulls = Nulls.SKIP) public _FinalStage rejectionNote(Optional<String> rejectionNote) { this.rejectionNote = rejectionNote; return this; } /** * <p>The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage reviewedBy(String reviewedBy) { this.reviewedBy = Optional.ofNullable(reviewedBy); return this; } /** * <p>The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "reviewedBy", nulls = Nulls.SKIP) public _FinalStage reviewedBy(Optional<String> reviewedBy) { this.reviewedBy = reviewedBy; return this; } /** * <p>A more detailed message about the failure. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureMessage(String failureMessage) { this.failureMessage = Optional.ofNullable(failureMessage); return this; } /** * <p>A more detailed message about the failure. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> */ @java.lang.Override @JsonSetter(value = "failureMessage", nulls = Nulls.SKIP) public _FinalStage failureMessage(Optional<String> failureMessage) { this.failureMessage = failureMessage; return this; } /** * <p>The reason why the workflow run failed. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage failureReason(String failureReason) { this.failureReason = Optional.ofNullable(failureReason); return this; } /** * <p>The reason why the workflow run failed. Will only be included if the workflow run status is &quot;FAILED&quot;.</p> */ @java.lang.Override @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) public _FinalStage failureReason(Optional<String> failureReason) { this.failureReason = failureReason; return this; } @java.lang.Override public _FinalStage addAllFiles(List<File> files) { this.files.addAll(files); return this; } @java.lang.Override public _FinalStage addFiles(File files) { this.files.add(files); return this; } @java.lang.Override @JsonSetter(value = "files", nulls = Nulls.SKIP) public _FinalStage files(List<File> files) { this.files.clear(); this.files.addAll(files); return this; } /** * <p>The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage batchId(String batchId) { this.batchId = Optional.ofNullable(batchId); return this; } /** * <p>The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "batchId", nulls = Nulls.SKIP) public _FinalStage batchId(Optional<String> batchId) { this.batchId = batchId; return this; } /** * <p>The metadata that was passed in when running the Workflow.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage metadata(String key, Object value) { this.metadata.put(key, value); return this; } /** * <p>The metadata that was passed in when running the Workflow.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage putAllMetadata(Map<String, Object> metadata) { this.metadata.putAll(metadata); return this; } /** * <p>The metadata that was passed in when running the Workflow.</p> */ @java.lang.Override @JsonSetter(value = "metadata", nulls = Nulls.SKIP) public _FinalStage metadata(Map<String, Object> metadata) { this.metadata.clear(); this.metadata.putAll(metadata); return this; } @java.lang.Override public WorkflowRun build() { return new WorkflowRun( object, id, name, url, status, metadata, batchId, files, failureReason, failureMessage, initialRunAt, reviewedBy, reviewed, rejectionNote, reviewedAt, startTime, endTime, outputs, stepRuns, workflow, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WorkflowRunFileInput.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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 = WorkflowRunFileInput.Builder.class) public final class WorkflowRunFileInput { private final Optional<String> fileName; private final Optional<String> fileUrl; private final Optional<String> fileId; private final Optional<List<WorkflowRunFileInputOutputsItem>> outputs; private final Map<String, Object> additionalProperties; private WorkflowRunFileInput( Optional<String> fileName, Optional<String> fileUrl, Optional<String> fileId, Optional<List<WorkflowRunFileInputOutputsItem>> outputs, Map<String, Object> additionalProperties) { this.fileName = fileName; this.fileUrl = fileUrl; this.fileId = fileId; this.outputs = outputs; this.additionalProperties = additionalProperties; } /** * @return The name of the file to be processed. If not provided, the file name will be inferred from the URL. It is highly recommended to include this parameter for legibility. */ @JsonProperty("fileName") public Optional<String> getFileName() { return fileName; } /** * @return A URL where the file can be downloaded from. If you use presigned URLs, we recommend an expiration time of 5-15 minutes. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. */ @JsonProperty("fileUrl") public Optional<String> getFileUrl() { return fileUrl; } /** * @return Extend's internal ID for the file. It will always start with &quot;file_&quot;. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. You can view a file ID from the Extend UI, for instance from running a parser or from a previous file creation. If you provide a <code>fileId</code>, any parsed data will be reused. * <p>Example: <code>&quot;file_Zk9mNP12Qw4yTv8BdR3H&quot;</code></p> */ @JsonProperty("fileId") public Optional<String> getFileId() { return fileId; } /** * @return Predetermined outputs that can be used to override the outputs that are generated. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known. */ @JsonProperty("outputs") public Optional<List<WorkflowRunFileInputOutputsItem>> getOutputs() { return outputs; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkflowRunFileInput && equalTo((WorkflowRunFileInput) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WorkflowRunFileInput other) { return fileName.equals(other.fileName) && fileUrl.equals(other.fileUrl) && fileId.equals(other.fileId) && outputs.equals(other.outputs); } @java.lang.Override public int hashCode() { return Objects.hash(this.fileName, this.fileUrl, this.fileId, this.outputs); } @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<String> fileName = Optional.empty(); private Optional<String> fileUrl = Optional.empty(); private Optional<String> fileId = Optional.empty(); private Optional<List<WorkflowRunFileInputOutputsItem>> outputs = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} public Builder from(WorkflowRunFileInput other) { fileName(other.getFileName()); fileUrl(other.getFileUrl()); fileId(other.getFileId()); outputs(other.getOutputs()); return this; } /** * <p>The name of the file to be processed. If not provided, the file name will be inferred from the URL. It is highly recommended to include this parameter for legibility.</p> */ @JsonSetter(value = "fileName", nulls = Nulls.SKIP) public Builder fileName(Optional<String> fileName) { this.fileName = fileName; return this; } public Builder fileName(String fileName) { this.fileName = Optional.ofNullable(fileName); return this; } /** * <p>A URL where the file can be downloaded from. If you use presigned URLs, we recommend an expiration time of 5-15 minutes. One of a <code>fileUrl</code> or <code>fileId</code> must be provided.</p> */ @JsonSetter(value = "fileUrl", nulls = Nulls.SKIP) public Builder fileUrl(Optional<String> fileUrl) { this.fileUrl = fileUrl; return this; } public Builder fileUrl(String fileUrl) { this.fileUrl = Optional.ofNullable(fileUrl); return this; } /** * <p>Extend's internal ID for the file. It will always start with &quot;file_&quot;. One of a <code>fileUrl</code> or <code>fileId</code> must be provided. You can view a file ID from the Extend UI, for instance from running a parser or from a previous file creation. If you provide a <code>fileId</code>, any parsed data will be reused.</p> * <p>Example: <code>&quot;file_Zk9mNP12Qw4yTv8BdR3H&quot;</code></p> */ @JsonSetter(value = "fileId", nulls = Nulls.SKIP) public Builder fileId(Optional<String> fileId) { this.fileId = fileId; return this; } public Builder fileId(String fileId) { this.fileId = Optional.ofNullable(fileId); return this; } /** * <p>Predetermined outputs that can be used to override the outputs that are generated. Generally not recommended for most use cases, however, can be useful in cases of overriding a classification in a workflow, or a subset of extraction fields when data is known.</p> */ @JsonSetter(value = "outputs", nulls = Nulls.SKIP) public Builder outputs(Optional<List<WorkflowRunFileInputOutputsItem>> outputs) { this.outputs = outputs; return this; } public Builder outputs(List<WorkflowRunFileInputOutputsItem> outputs) { this.outputs = Optional.ofNullable(outputs); return this; } public WorkflowRunFileInput build() { return new WorkflowRunFileInput(fileName, fileUrl, fileId, outputs, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WorkflowRunFileInputOutputsItem.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.databind.annotation.JsonDeserialize; import java.util.HashMap; import java.util.Map; import java.util.Objects; import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = WorkflowRunFileInputOutputsItem.Builder.class) public final class WorkflowRunFileInputOutputsItem { private final String processorId; private final ProvidedProcessorOutput output; private final Map<String, Object> additionalProperties; private WorkflowRunFileInputOutputsItem( String processorId, ProvidedProcessorOutput output, Map<String, Object> additionalProperties) { this.processorId = processorId; this.output = output; this.additionalProperties = additionalProperties; } /** * @return The ID of the processor that the output is associated with. * Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code> */ @JsonProperty("processorId") public String getProcessorId() { return processorId; } /** * @return The output that is being overridden. The structure will depend on the processor type. More details can be found on the &quot;output type&quot; page for the corresponding processor, in the guides section. */ @JsonProperty("output") public ProvidedProcessorOutput getOutput() { return output; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkflowRunFileInputOutputsItem && equalTo((WorkflowRunFileInputOutputsItem) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WorkflowRunFileInputOutputsItem other) { return processorId.equals(other.processorId) && output.equals(other.output); } @java.lang.Override public int hashCode() { return Objects.hash(this.processorId, this.output); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static ProcessorIdStage builder() { return new Builder(); } public interface ProcessorIdStage { /** * <p>The ID of the processor that the output is associated with. * Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> */ OutputStage processorId(@NotNull String processorId); Builder from(WorkflowRunFileInputOutputsItem other); } public interface OutputStage { /** * <p>The output that is being overridden. The structure will depend on the processor type. More details can be found on the &quot;output type&quot; page for the corresponding processor, in the guides section.</p> */ _FinalStage output(@NotNull ProvidedProcessorOutput output); } public interface _FinalStage { WorkflowRunFileInputOutputsItem build(); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements ProcessorIdStage, OutputStage, _FinalStage { private String processorId; private ProvidedProcessorOutput output; @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WorkflowRunFileInputOutputsItem other) { processorId(other.getProcessorId()); output(other.getOutput()); return this; } /** * <p>The ID of the processor that the output is associated with. * Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * <p>The ID of the processor that the output is associated with. * Example: <code>&quot;dp_Xj8mK2pL9nR4vT7qY5wZ&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("processorId") public OutputStage processorId(@NotNull String processorId) { this.processorId = Objects.requireNonNull(processorId, "processorId must not be null"); return this; } /** * <p>The output that is being overridden. The structure will depend on the processor type. More details can be found on the &quot;output type&quot; page for the corresponding processor, in the guides section.</p> * <p>The output that is being overridden. The structure will depend on the processor type. More details can be found on the &quot;output type&quot; page for the corresponding processor, in the guides section.</p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("output") public _FinalStage output(@NotNull ProvidedProcessorOutput output) { this.output = Objects.requireNonNull(output, "output must not be null"); return this; } @java.lang.Override public WorkflowRunFileInputOutputsItem build() { return new WorkflowRunFileInputOutputsItem(processorId, output, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WorkflowRunSummary.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import ai.extend.core.ObjectMappers; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; 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.time.OffsetDateTime; 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) @JsonDeserialize(builder = WorkflowRunSummary.Builder.class) public final class WorkflowRunSummary { private final String id; private final WorkflowStatus status; private final Optional<OffsetDateTime> initialRunAt; private final Optional<String> reviewedByUser; private final Optional<OffsetDateTime> reviewedAt; private final Optional<OffsetDateTime> startTime; private final Optional<OffsetDateTime> endTime; private final String workflowId; private final String workflowName; private final String workflowVersionId; private final Optional<String> batchId; private final Optional<String> rejectionNote; private final OffsetDateTime createdAt; private final OffsetDateTime updatedAt; private final Map<String, Object> additionalProperties; private WorkflowRunSummary( String id, WorkflowStatus status, Optional<OffsetDateTime> initialRunAt, Optional<String> reviewedByUser, Optional<OffsetDateTime> reviewedAt, Optional<OffsetDateTime> startTime, Optional<OffsetDateTime> endTime, String workflowId, String workflowName, String workflowVersionId, Optional<String> batchId, Optional<String> rejectionNote, OffsetDateTime createdAt, OffsetDateTime updatedAt, Map<String, Object> additionalProperties) { this.id = id; this.status = status; this.initialRunAt = initialRunAt; this.reviewedByUser = reviewedByUser; this.reviewedAt = reviewedAt; this.startTime = startTime; this.endTime = endTime; this.workflowId = workflowId; this.workflowName = workflowName; this.workflowVersionId = workflowVersionId; this.batchId = batchId; this.rejectionNote = rejectionNote; this.createdAt = createdAt; this.updatedAt = updatedAt; this.additionalProperties = additionalProperties; } /** * @return The ID of the workflow run. * <p>Example: <code>&quot;workflow_run_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> */ @JsonProperty("id") public String getId() { return id; } @JsonProperty("status") public WorkflowStatus getStatus() { return status; } /** * @return The time (in UTC) at which the workflow was initially created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("initialRunAt") public Optional<OffsetDateTime> getInitialRunAt() { return initialRunAt; } /** * @return The user of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed. * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ @JsonProperty("reviewedByUser") public Optional<String> getReviewedByUser() { return reviewedByUser; } /** * @return The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("reviewedAt") public Optional<OffsetDateTime> getReviewedAt() { return reviewedAt; } /** * @return The start time (in UTC) that the workflow actually started executing. This occurs after the <code>initialRunAt</code> time. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @JsonProperty("startTime") public Optional<OffsetDateTime> getStartTime() { return startTime; } /** * @return The end time (in UTC) that the workflow finished. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ @JsonProperty("endTime") public Optional<OffsetDateTime> getEndTime() { return endTime; } /** * @return The ID of the workflow that was run. Will always start with &quot;workflow&quot;. * <p>Example: <code>&quot;workflow_BMdfq_yWM3sT-ZzvCnA3f&quot;</code></p> */ @JsonProperty("workflowId") public String getWorkflowId() { return workflowId; } /** * @return The name of the workflow that was run. * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> */ @JsonProperty("workflowName") public String getWorkflowName() { return workflowName; } /** * @return The ID of the workflow version that was run. Will always start with &quot;workflow_version&quot;. * <p>Example: <code>&quot;workflow_version_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> */ @JsonProperty("workflowVersionId") public String getWorkflowVersionId() { return workflowVersionId; } /** * @return The batch ID of the WorkflowRun. If that WorkflowRun was created from a batch of files, all runs in that batch will have the same batch ID. * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ @JsonProperty("batchId") public Optional<String> getBatchId() { return batchId; } /** * @return The note that was added when the workflow run was rejected. * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ @JsonProperty("rejectionNote") public Optional<String> getRejectionNote() { return rejectionNote; } /** * @return The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T15:29:55Z&quot;</code></p> */ @JsonProperty("createdAt") public OffsetDateTime getCreatedAt() { return createdAt; } /** * @return The time (in UTC) at which the workflow run was last updated. Will follow the RFC 3339 format. * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @JsonProperty("updatedAt") public OffsetDateTime getUpdatedAt() { return updatedAt; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; return other instanceof WorkflowRunSummary && equalTo((WorkflowRunSummary) other); } @JsonAnyGetter public Map<String, Object> getAdditionalProperties() { return this.additionalProperties; } private boolean equalTo(WorkflowRunSummary other) { return id.equals(other.id) && status.equals(other.status) && initialRunAt.equals(other.initialRunAt) && reviewedByUser.equals(other.reviewedByUser) && reviewedAt.equals(other.reviewedAt) && startTime.equals(other.startTime) && endTime.equals(other.endTime) && workflowId.equals(other.workflowId) && workflowName.equals(other.workflowName) && workflowVersionId.equals(other.workflowVersionId) && batchId.equals(other.batchId) && rejectionNote.equals(other.rejectionNote) && createdAt.equals(other.createdAt) && updatedAt.equals(other.updatedAt); } @java.lang.Override public int hashCode() { return Objects.hash( this.id, this.status, this.initialRunAt, this.reviewedByUser, this.reviewedAt, this.startTime, this.endTime, this.workflowId, this.workflowName, this.workflowVersionId, this.batchId, this.rejectionNote, this.createdAt, this.updatedAt); } @java.lang.Override public String toString() { return ObjectMappers.stringify(this); } public static IdStage builder() { return new Builder(); } public interface IdStage { /** * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> */ StatusStage id(@NotNull String id); Builder from(WorkflowRunSummary other); } public interface StatusStage { WorkflowIdStage status(@NotNull WorkflowStatus status); } public interface WorkflowIdStage { /** * <p>The ID of the workflow that was run. Will always start with &quot;workflow&quot;.</p> * <p>Example: <code>&quot;workflow_BMdfq_yWM3sT-ZzvCnA3f&quot;</code></p> */ WorkflowNameStage workflowId(@NotNull String workflowId); } public interface WorkflowNameStage { /** * <p>The name of the workflow that was run.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> */ WorkflowVersionIdStage workflowName(@NotNull String workflowName); } public interface WorkflowVersionIdStage { /** * <p>The ID of the workflow version that was run. Will always start with &quot;workflow_version&quot;.</p> * <p>Example: <code>&quot;workflow_version_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> */ CreatedAtStage workflowVersionId(@NotNull String workflowVersionId); } public interface CreatedAtStage { /** * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:29:55Z&quot;</code></p> */ UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt); } public interface UpdatedAtStage { /** * <p>The time (in UTC) at which the workflow run was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt); } public interface _FinalStage { WorkflowRunSummary build(); /** * <p>The time (in UTC) at which the workflow was initially created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ _FinalStage initialRunAt(Optional<OffsetDateTime> initialRunAt); _FinalStage initialRunAt(OffsetDateTime initialRunAt); /** * <p>The user of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ _FinalStage reviewedByUser(Optional<String> reviewedByUser); _FinalStage reviewedByUser(String reviewedByUser); /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ _FinalStage reviewedAt(Optional<OffsetDateTime> reviewedAt); _FinalStage reviewedAt(OffsetDateTime reviewedAt); /** * <p>The start time (in UTC) that the workflow actually started executing. This occurs after the <code>initialRunAt</code> time. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ _FinalStage startTime(Optional<OffsetDateTime> startTime); _FinalStage startTime(OffsetDateTime startTime); /** * <p>The end time (in UTC) that the workflow finished. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ _FinalStage endTime(Optional<OffsetDateTime> endTime); _FinalStage endTime(OffsetDateTime endTime); /** * <p>The batch ID of the WorkflowRun. If that WorkflowRun was created from a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ _FinalStage batchId(Optional<String> batchId); _FinalStage batchId(String batchId); /** * <p>The note that was added when the workflow run was rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ _FinalStage rejectionNote(Optional<String> rejectionNote); _FinalStage rejectionNote(String rejectionNote); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements IdStage, StatusStage, WorkflowIdStage, WorkflowNameStage, WorkflowVersionIdStage, CreatedAtStage, UpdatedAtStage, _FinalStage { private String id; private WorkflowStatus status; private String workflowId; private String workflowName; private String workflowVersionId; private OffsetDateTime createdAt; private OffsetDateTime updatedAt; private Optional<String> rejectionNote = Optional.empty(); private Optional<String> batchId = Optional.empty(); private Optional<OffsetDateTime> endTime = Optional.empty(); private Optional<OffsetDateTime> startTime = Optional.empty(); private Optional<OffsetDateTime> reviewedAt = Optional.empty(); private Optional<String> reviewedByUser = Optional.empty(); private Optional<OffsetDateTime> initialRunAt = Optional.empty(); @JsonAnySetter private Map<String, Object> additionalProperties = new HashMap<>(); private Builder() {} @java.lang.Override public Builder from(WorkflowRunSummary other) { id(other.getId()); status(other.getStatus()); initialRunAt(other.getInitialRunAt()); reviewedByUser(other.getReviewedByUser()); reviewedAt(other.getReviewedAt()); startTime(other.getStartTime()); endTime(other.getEndTime()); workflowId(other.getWorkflowId()); workflowName(other.getWorkflowName()); workflowVersionId(other.getWorkflowVersionId()); batchId(other.getBatchId()); rejectionNote(other.getRejectionNote()); createdAt(other.getCreatedAt()); updatedAt(other.getUpdatedAt()); return this; } /** * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> * <p>The ID of the workflow run.</p> * <p>Example: <code>&quot;workflow_run_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") public StatusStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } @java.lang.Override @JsonSetter("status") public WorkflowIdStage status(@NotNull WorkflowStatus status) { this.status = Objects.requireNonNull(status, "status must not be null"); return this; } /** * <p>The ID of the workflow that was run. Will always start with &quot;workflow&quot;.</p> * <p>Example: <code>&quot;workflow_BMdfq_yWM3sT-ZzvCnA3f&quot;</code></p> * <p>The ID of the workflow that was run. Will always start with &quot;workflow&quot;.</p> * <p>Example: <code>&quot;workflow_BMdfq_yWM3sT-ZzvCnA3f&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("workflowId") public WorkflowNameStage workflowId(@NotNull String workflowId) { this.workflowId = Objects.requireNonNull(workflowId, "workflowId must not be null"); return this; } /** * <p>The name of the workflow that was run.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> * <p>The name of the workflow that was run.</p> * <p>Example: <code>&quot;Invoice Processing&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("workflowName") public WorkflowVersionIdStage workflowName(@NotNull String workflowName) { this.workflowName = Objects.requireNonNull(workflowName, "workflowName must not be null"); return this; } /** * <p>The ID of the workflow version that was run. Will always start with &quot;workflow_version&quot;.</p> * <p>Example: <code>&quot;workflow_version_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> * <p>The ID of the workflow version that was run. Will always start with &quot;workflow_version&quot;.</p> * <p>Example: <code>&quot;workflow_version_Zk9mNP12Qw4-yTv8BdR3H&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("workflowVersionId") public CreatedAtStage workflowVersionId(@NotNull String workflowVersionId) { this.workflowVersionId = Objects.requireNonNull(workflowVersionId, "workflowVersionId must not be null"); return this; } /** * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:29:55Z&quot;</code></p> * <p>The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:29:55Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("createdAt") public UpdatedAtStage createdAt(@NotNull OffsetDateTime createdAt) { this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } /** * <p>The time (in UTC) at which the workflow run was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * <p>The time (in UTC) at which the workflow run was last updated. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("updatedAt") public _FinalStage updatedAt(@NotNull OffsetDateTime updatedAt) { this.updatedAt = Objects.requireNonNull(updatedAt, "updatedAt must not be null"); return this; } /** * <p>The note that was added when the workflow run was rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage rejectionNote(String rejectionNote) { this.rejectionNote = Optional.ofNullable(rejectionNote); return this; } /** * <p>The note that was added when the workflow run was rejected.</p> * <p>Example: <code>&quot;Invalid invoice format&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "rejectionNote", nulls = Nulls.SKIP) public _FinalStage rejectionNote(Optional<String> rejectionNote) { this.rejectionNote = rejectionNote; return this; } /** * <p>The batch ID of the WorkflowRun. If that WorkflowRun was created from a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage batchId(String batchId) { this.batchId = Optional.ofNullable(batchId); return this; } /** * <p>The batch ID of the WorkflowRun. If that WorkflowRun was created from a batch of files, all runs in that batch will have the same batch ID.</p> * <p>Example: <code>&quot;batch_7Ws31-F5&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "batchId", nulls = Nulls.SKIP) public _FinalStage batchId(Optional<String> batchId) { this.batchId = batchId; return this; } /** * <p>The end time (in UTC) that the workflow finished. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage endTime(OffsetDateTime endTime) { this.endTime = Optional.ofNullable(endTime); return this; } /** * <p>The end time (in UTC) that the workflow finished. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:35:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "endTime", nulls = Nulls.SKIP) public _FinalStage endTime(Optional<OffsetDateTime> endTime) { this.endTime = endTime; return this; } /** * <p>The start time (in UTC) that the workflow actually started executing. This occurs after the <code>initialRunAt</code> time. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage startTime(OffsetDateTime startTime) { this.startTime = Optional.ofNullable(startTime); return this; } /** * <p>The start time (in UTC) that the workflow actually started executing. This occurs after the <code>initialRunAt</code> time. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "startTime", nulls = Nulls.SKIP) public _FinalStage startTime(Optional<OffsetDateTime> startTime) { this.startTime = startTime; return this; } /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage reviewedAt(OffsetDateTime reviewedAt) { this.reviewedAt = Optional.ofNullable(reviewedAt); return this; } /** * <p>The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T16:45:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "reviewedAt", nulls = Nulls.SKIP) public _FinalStage reviewedAt(Optional<OffsetDateTime> reviewedAt) { this.reviewedAt = reviewedAt; return this; } /** * <p>The user of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage reviewedByUser(String reviewedByUser) { this.reviewedByUser = Optional.ofNullable(reviewedByUser); return this; } /** * <p>The user of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.</p> * <p>Example: <code>&quot;jane.doe@example.com&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "reviewedByUser", nulls = Nulls.SKIP) public _FinalStage reviewedByUser(Optional<String> reviewedByUser) { this.reviewedByUser = reviewedByUser; return this; } /** * <p>The time (in UTC) at which the workflow was initially created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override public _FinalStage initialRunAt(OffsetDateTime initialRunAt) { this.initialRunAt = Optional.ofNullable(initialRunAt); return this; } /** * <p>The time (in UTC) at which the workflow was initially created. Will follow the RFC 3339 format.</p> * <p>Example: <code>&quot;2024-03-21T15:30:00Z&quot;</code></p> */ @java.lang.Override @JsonSetter(value = "initialRunAt", nulls = Nulls.SKIP) public _FinalStage initialRunAt(Optional<OffsetDateTime> initialRunAt) { this.initialRunAt = initialRunAt; return this; } @java.lang.Override public WorkflowRunSummary build() { return new WorkflowRunSummary( id, status, initialRunAt, reviewedByUser, reviewedAt, startTime, endTime, workflowId, workflowName, workflowVersionId, batchId, rejectionNote, createdAt, updatedAt, additionalProperties); } } }
0
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend
java-sources/ai/extend/extend-java-sdk/0.0.3-beta/ai/extend/types/WorkflowStatus.java
/** * This file was auto-generated by Fern from our API Definition. */ package ai.extend.types; import com.fasterxml.jackson.annotation.JsonValue; public enum WorkflowStatus { PENDING("PENDING"), PROCESSING("PROCESSING"), NEEDS_REVIEW("NEEDS_REVIEW"), REJECTED("REJECTED"), PROCESSED("PROCESSED"), FAILED("FAILED"); private final String value; WorkflowStatus(String value) { this.value = value; } @JsonValue @java.lang.Override public String toString() { return this.value; } }
0
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant/common/BaseActivity.java
/* * UVCCamera * library and sample to access to UVC web camera on non-rooted Android device * * Copyright (c) 2014-2017 saki t_saki@serenegiant.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * All files in the folder are under this Apache License, Version 2.0. * Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder * may have a different license, see the respective files. */ package com.serenegiant.common; import android.Manifest; import android.annotation.SuppressLint; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.support.annotation.NonNull; import android.support.annotation.StringRes; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.Toast; import com.serenegiant.dialog.MessageDialogFragmentV4; import com.serenegiant.utils.BuildCheck; import com.serenegiant.utils.HandlerThreadHandler; import com.serenegiant.utils.PermissionCheck; /** * Created by saki on 2016/11/18. * */ public class BaseActivity extends AppCompatActivity implements MessageDialogFragmentV4.MessageDialogListener { private static boolean DEBUG = false; // FIXME 実働時はfalseにセットすること private static final String TAG = BaseActivity.class.getSimpleName(); /** UI操作のためのHandler */ private final Handler mUIHandler = new Handler(Looper.getMainLooper()); private final Thread mUiThread = mUIHandler.getLooper().getThread(); /** ワーカースレッド上で処理するためのHandler */ private Handler mWorkerHandler; private long mWorkerThreadID = -1; @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // ワーカースレッドを生成 if (mWorkerHandler == null) { mWorkerHandler = HandlerThreadHandler.createHandler(TAG); mWorkerThreadID = mWorkerHandler.getLooper().getThread().getId(); } } @Override protected void onPause() { clearToast(); super.onPause(); } @Override protected synchronized void onDestroy() { // ワーカースレッドを破棄 if (mWorkerHandler != null) { try { mWorkerHandler.getLooper().quit(); } catch (final Exception e) { // } mWorkerHandler = null; } super.onDestroy(); } //================================================================================ /** * UIスレッドでRunnableを実行するためのヘルパーメソッド * @param task * @param duration */ public final void runOnUiThread(final Runnable task, final long duration) { if (task == null) return; mUIHandler.removeCallbacks(task); if ((duration > 0) || Thread.currentThread() != mUiThread) { mUIHandler.postDelayed(task, duration); } else { try { task.run(); } catch (final Exception e) { Log.w(TAG, e); } } } /** * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する * @param task */ public final void removeFromUiThread(final Runnable task) { if (task == null) return; mUIHandler.removeCallbacks(task); } /** * ワーカースレッド上で指定したRunnableを実行する * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される) * @param task * @param delayMillis */ protected final synchronized void queueEvent(final Runnable task, final long delayMillis) { if ((task == null) || (mWorkerHandler == null)) return; try { mWorkerHandler.removeCallbacks(task); if (delayMillis > 0) { mWorkerHandler.postDelayed(task, delayMillis); } else if (mWorkerThreadID == Thread.currentThread().getId()) { task.run(); } else { mWorkerHandler.post(task); } } catch (final Exception e) { // ignore } } /** * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする * @param task */ protected final synchronized void removeEvent(final Runnable task) { if (task == null) return; try { mWorkerHandler.removeCallbacks(task); } catch (final Exception e) { // ignore } } //================================================================================ private Toast mToast; /** * Toastでメッセージを表示 * @param msg */ protected void showToast(@StringRes final int msg, final Object... args) { removeFromUiThread(mShowToastTask); mShowToastTask = new ShowToastTask(msg, args); runOnUiThread(mShowToastTask, 0); } /** * Toastが表示されていればキャンセルする */ protected void clearToast() { removeFromUiThread(mShowToastTask); mShowToastTask = null; try { if (mToast != null) { mToast.cancel(); mToast = null; } } catch (final Exception e) { // ignore } } private ShowToastTask mShowToastTask; private final class ShowToastTask implements Runnable { final int msg; final Object args; private ShowToastTask(@StringRes final int msg, final Object... args) { this.msg = msg; this.args = args; } @Override public void run() { try { if (mToast != null) { mToast.cancel(); mToast = null; } final String _msg = (args != null) ? getString(msg, args) : getString(msg); mToast = Toast.makeText(BaseActivity.this, _msg, Toast.LENGTH_SHORT); mToast.show(); } catch (final Exception e) { // ignore } } } //================================================================================ /** * MessageDialogFragmentメッセージダイアログからのコールバックリスナー * @param dialog * @param requestCode * @param permissions * @param result */ @SuppressLint("NewApi") @Override public void onMessageDialogResult(final MessageDialogFragmentV4 dialog, final int requestCode, final String[] permissions, final boolean result) { if (result) { // メッセージダイアログでOKを押された時はパーミッション要求する if (BuildCheck.isMarshmallow()) { requestPermissions(permissions, requestCode); return; } } // メッセージダイアログでキャンセルされた時とAndroid6でない時は自前でチェックして#checkPermissionResultを呼び出す for (final String permission: permissions) { checkPermissionResult(requestCode, permission, PermissionCheck.hasPermission(this, permission)); } } /** * パーミッション要求結果を受け取るためのメソッド * @param requestCode * @param permissions * @param grantResults */ @Override public void onRequestPermissionsResult(final int requestCode, @NonNull final String[] permissions, @NonNull final int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); // 何もしてないけど一応呼んどく final int n = Math.min(permissions.length, grantResults.length); for (int i = 0; i < n; i++) { checkPermissionResult(requestCode, permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED); } } /** * パーミッション要求の結果をチェック * ここではパーミッションを取得できなかった時にToastでメッセージ表示するだけ * @param requestCode * @param permission * @param result */ protected void checkPermissionResult(final int requestCode, final String permission, final boolean result) { // パーミッションがないときにはメッセージを表示する if (!result && (permission != null)) { if (Manifest.permission.RECORD_AUDIO.equals(permission)) { showToast(R.string.permission_audio); } if (Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permission)) { showToast(R.string.permission_ext_storage); } if (Manifest.permission.INTERNET.equals(permission)) { showToast(R.string.permission_network); } } } // 動的パーミッション要求時の要求コード protected static final int REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE = 0x12345; protected static final int REQUEST_PERMISSION_AUDIO_RECORDING = 0x234567; protected static final int REQUEST_PERMISSION_NETWORK = 0x345678; protected static final int REQUEST_PERMISSION_CAMERA = 0x537642; /** * 外部ストレージへの書き込みパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true 外部ストレージへの書き込みパーミッションが有る */ protected boolean checkPermissionWriteExternalStorage() { if (!PermissionCheck.hasWriteExternalStorage(this)) { MessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE, R.string.permission_title, R.string.permission_ext_storage_request, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}); return false; } return true; } /** * 録音のパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true 録音のパーミッションが有る */ protected boolean checkPermissionAudio() { if (!PermissionCheck.hasAudio(this)) { MessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_AUDIO_RECORDING, R.string.permission_title, R.string.permission_audio_recording_request, new String[]{Manifest.permission.RECORD_AUDIO}); return false; } return true; } /** * ネットワークアクセスのパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true ネットワークアクセスのパーミッションが有る */ protected boolean checkPermissionNetwork() { if (!PermissionCheck.hasNetwork(this)) { MessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_NETWORK, R.string.permission_title, R.string.permission_network_request, new String[]{Manifest.permission.INTERNET}); return false; } return true; } /** * カメラアクセスのパーミッションがあるかどうかをチェック * なければ説明ダイアログを表示する * @return true カメラアクセスのパーミッションが有る */ protected boolean checkPermissionCamera() { if (!PermissionCheck.hasCamera(this)) { MessageDialogFragmentV4.showDialog(this, REQUEST_PERMISSION_CAMERA, R.string.permission_title, R.string.permission_camera_request, new String[]{Manifest.permission.CAMERA}); return false; } return true; } }
0
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant/common/BaseFragment.java
/* * UVCCamera * library and sample to access to UVC web camera on non-rooted Android device * * Copyright (c) 2014-2017 saki t_saki@serenegiant.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * All files in the folder are under this Apache License, Version 2.0. * Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder * may have a different license, see the respective files. */ package com.serenegiant.common; import android.Manifest; import android.annotation.SuppressLint; import android.app.Fragment; import android.content.pm.PackageManager; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.support.annotation.NonNull; import android.support.annotation.StringRes; import android.util.Log; import android.widget.Toast; import com.serenegiant.dialog.MessageDialogFragment; import com.serenegiant.utils.BuildCheck; import com.serenegiant.utils.HandlerThreadHandler; import com.serenegiant.utils.PermissionCheck; /** * Created by saki on 2016/11/19. * */ public class BaseFragment extends Fragment implements MessageDialogFragment.MessageDialogListener { private static boolean DEBUG = false; // FIXME 実働時はfalseにセットすること private static final String TAG = BaseFragment.class.getSimpleName(); /** UI操作のためのHandler */ private final Handler mUIHandler = new Handler(Looper.getMainLooper()); private final Thread mUiThread = mUIHandler.getLooper().getThread(); /** ワーカースレッド上で処理するためのHandler */ private Handler mWorkerHandler; private long mWorkerThreadID = -1; public BaseFragment() { super(); } @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // ワーカースレッドを生成 if (mWorkerHandler == null) { mWorkerHandler = HandlerThreadHandler.createHandler(TAG); mWorkerThreadID = mWorkerHandler.getLooper().getThread().getId(); } } @Override public void onPause() { clearToast(); super.onPause(); } @Override public synchronized void onDestroy() { // ワーカースレッドを破棄 if (mWorkerHandler != null) { try { mWorkerHandler.getLooper().quit(); } catch (final Exception e) { // } mWorkerHandler = null; } super.onDestroy(); } //================================================================================ /** * UIスレッドでRunnableを実行するためのヘルパーメソッド * @param task * @param duration */ public final void runOnUiThread(final Runnable task, final long duration) { if (task == null) return; mUIHandler.removeCallbacks(task); if ((duration > 0) || Thread.currentThread() != mUiThread) { mUIHandler.postDelayed(task, duration); } else { try { task.run(); } catch (final Exception e) { Log.w(TAG, e); } } } /** * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する * @param task */ public final void removeFromUiThread(final Runnable task) { if (task == null) return; mUIHandler.removeCallbacks(task); } /** * ワーカースレッド上で指定したRunnableを実行する * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される) * @param task * @param delayMillis */ protected final synchronized void queueEvent(final Runnable task, final long delayMillis) { if ((task == null) || (mWorkerHandler == null)) return; try { mWorkerHandler.removeCallbacks(task); if (delayMillis > 0) { mWorkerHandler.postDelayed(task, delayMillis); } else if (mWorkerThreadID == Thread.currentThread().getId()) { task.run(); } else { mWorkerHandler.post(task); } } catch (final Exception e) { // ignore } } /** * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする * @param task */ protected final synchronized void removeEvent(final Runnable task) { if (task == null) return; try { mWorkerHandler.removeCallbacks(task); } catch (final Exception e) { // ignore } } //================================================================================ private Toast mToast; /** * Toastでメッセージを表示 * @param msg */ protected void showToast(@StringRes final int msg, final Object... args) { removeFromUiThread(mShowToastTask); mShowToastTask = new ShowToastTask(msg, args); runOnUiThread(mShowToastTask, 0); } /** * Toastが表示されていればキャンセルする */ protected void clearToast() { removeFromUiThread(mShowToastTask); mShowToastTask = null; try { if (mToast != null) { mToast.cancel(); mToast = null; } } catch (final Exception e) { // ignore } } private ShowToastTask mShowToastTask; private final class ShowToastTask implements Runnable { final int msg; final Object args; private ShowToastTask(@StringRes final int msg, final Object... args) { this.msg = msg; this.args = args; } @Override public void run() { try { if (mToast != null) { mToast.cancel(); mToast = null; } if (args != null) { final String _msg = getString(msg, args); mToast = Toast.makeText(getActivity(), _msg, Toast.LENGTH_SHORT); } else { mToast = Toast.makeText(getActivity(), msg, Toast.LENGTH_SHORT); } mToast.show(); } catch (final Exception e) { // ignore } } } //================================================================================ /** * MessageDialogFragmentメッセージダイアログからのコールバックリスナー * @param dialog * @param requestCode * @param permissions * @param result */ @SuppressLint("NewApi") @Override public void onMessageDialogResult(final MessageDialogFragment dialog, final int requestCode, final String[] permissions, final boolean result) { if (result) { // メッセージダイアログでOKを押された時はパーミッション要求する if (BuildCheck.isMarshmallow()) { requestPermissions(permissions, requestCode); return; } } // メッセージダイアログでキャンセルされた時とAndroid6でない時は自前でチェックして#checkPermissionResultを呼び出す for (final String permission: permissions) { checkPermissionResult(requestCode, permission, PermissionCheck.hasPermission(getActivity(), permission)); } } /** * パーミッション要求結果を受け取るためのメソッド * @param requestCode * @param permissions * @param grantResults */ @Override public void onRequestPermissionsResult(final int requestCode, @NonNull final String[] permissions, @NonNull final int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); // 何もしてないけど一応呼んどく final int n = Math.min(permissions.length, grantResults.length); for (int i = 0; i < n; i++) { checkPermissionResult(requestCode, permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED); } } /** * パーミッション要求の結果をチェック * ここではパーミッションを取得できなかった時にToastでメッセージ表示するだけ * @param requestCode * @param permission * @param result */ protected void checkPermissionResult(final int requestCode, final String permission, final boolean result) { // パーミッションがないときにはメッセージを表示する if (!result && (permission != null)) { if (Manifest.permission.RECORD_AUDIO.equals(permission)) { showToast(com.serenegiant.common.R.string.permission_audio); } if (Manifest.permission.WRITE_EXTERNAL_STORAGE.equals(permission)) { showToast(com.serenegiant.common.R.string.permission_ext_storage); } if (Manifest.permission.INTERNET.equals(permission)) { showToast(com.serenegiant.common.R.string.permission_network); } } } // 動的パーミッション要求時の要求コード protected static final int REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE = 0x12345; protected static final int REQUEST_PERMISSION_AUDIO_RECORDING = 0x234567; protected static final int REQUEST_PERMISSION_NETWORK = 0x345678; protected static final int REQUEST_PERMISSION_CAMERA = 0x537642; /** * 外部ストレージへの書き込みパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true 外部ストレージへの書き込みパーミッションが有る */ protected boolean checkPermissionWriteExternalStorage() { if (!PermissionCheck.hasWriteExternalStorage(getActivity())) { MessageDialogFragment.showDialog(this, REQUEST_PERMISSION_WRITE_EXTERNAL_STORAGE, com.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_ext_storage_request, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}); return false; } return true; } /** * 録音のパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true 録音のパーミッションが有る */ protected boolean checkPermissionAudio() { if (!PermissionCheck.hasAudio(getActivity())) { MessageDialogFragment.showDialog(this, REQUEST_PERMISSION_AUDIO_RECORDING, com.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_audio_recording_request, new String[]{Manifest.permission.RECORD_AUDIO}); return false; } return true; } /** * ネットワークアクセスのパーミッションが有るかどうかをチェック * なければ説明ダイアログを表示する * @return true ネットワークアクセスのパーミッションが有る */ protected boolean checkPermissionNetwork() { if (!PermissionCheck.hasNetwork(getActivity())) { MessageDialogFragment.showDialog(this, REQUEST_PERMISSION_NETWORK, com.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_network_request, new String[]{Manifest.permission.INTERNET}); return false; } return true; } /** * カメラアクセスのパーミッションがあるかどうかをチェック * なければ説明ダイアログを表示する * @return true カメラアクセスのパーミッションが有る */ protected boolean checkPermissionCamera() { if (!PermissionCheck.hasCamera(getActivity())) { MessageDialogFragment.showDialog(this, REQUEST_PERMISSION_CAMERA, com.serenegiant.common.R.string.permission_title, com.serenegiant.common.R.string.permission_camera_request, new String[]{Manifest.permission.CAMERA}); return false; } return true; } }
0
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant/common/BaseService.java
/* * UVCCamera * library and sample to access to UVC web camera on non-rooted Android device * * Copyright (c) 2014-2017 saki t_saki@serenegiant.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * All files in the folder are under this Apache License, Version 2.0. * Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder * may have a different license, see the respective files. */ package com.serenegiant.common; import android.app.Service; import android.os.Handler; import android.os.Looper; import android.util.Log; import com.serenegiant.utils.HandlerThreadHandler; public abstract class BaseService extends Service { private static boolean DEBUG = false; // FIXME 実働時はfalseにセットすること private static final String TAG = BaseService.class.getSimpleName(); /** UI操作のためのHandler */ private final Handler mUIHandler = new Handler(Looper.getMainLooper()); private final Thread mUiThread = mUIHandler.getLooper().getThread(); /** ワーカースレッド上で処理するためのHandler */ private Handler mWorkerHandler; private long mWorkerThreadID = -1; @Override public void onCreate() { super.onCreate(); // ワーカースレッドを生成 if (mWorkerHandler == null) { mWorkerHandler = HandlerThreadHandler.createHandler(TAG); mWorkerThreadID = mWorkerHandler.getLooper().getThread().getId(); } } @Override public synchronized void onDestroy() { // ワーカースレッドを破棄 if (mWorkerHandler != null) { try { mWorkerHandler.getLooper().quit(); } catch (final Exception e) { // } mWorkerHandler = null; } super.onDestroy(); } //================================================================================ /** * UIスレッドでRunnableを実行するためのヘルパーメソッド * @param task * @param duration */ public final void runOnUiThread(final Runnable task, final long duration) { if (task == null) return; mUIHandler.removeCallbacks(task); if ((duration > 0) || Thread.currentThread() != mUiThread) { mUIHandler.postDelayed(task, duration); } else { try { task.run(); } catch (final Exception e) { Log.w(TAG, e); } } } /** * UIスレッド上で指定したRunnableが実行待ちしていれば実行待ちを解除する * @param task */ public final void removeFromUiThread(final Runnable task) { if (task == null) return; mUIHandler.removeCallbacks(task); } /** * ワーカースレッド上で指定したRunnableを実行する * 未実行の同じRunnableがあればキャンセルされる(後から指定した方のみ実行される) * @param task * @param delayMillis */ protected final synchronized void queueEvent(final Runnable task, final long delayMillis) { if ((task == null) || (mWorkerHandler == null)) return; try { mWorkerHandler.removeCallbacks(task); if (delayMillis > 0) { mWorkerHandler.postDelayed(task, delayMillis); } else if (mWorkerThreadID == Thread.currentThread().getId()) { task.run(); } else { mWorkerHandler.post(task); } } catch (final Exception e) { // ignore } } /** * 指定したRunnableをワーカースレッド上で実行予定であればキャンセルする * @param task */ protected final synchronized void removeEvent(final Runnable task) { if (task == null) return; try { mWorkerHandler.removeCallbacks(task); } catch (final Exception e) { // ignore } } }
0
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant/usb/CameraDialog.java
/* * UVCCamera * library and sample to access to UVC web camera on non-rooted Android device * * Copyright (c) 2014-2017 saki t_saki@serenegiant.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * All files in the folder are under this Apache License, Version 2.0. * Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder * may have a different license, see the respective files. */ package com.serenegiant.usb; import java.util.ArrayList; import java.util.List; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.Context; import android.content.DialogInterface; import android.hardware.usb.UsbDevice; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.CheckedTextView; import android.widget.Spinner; import com.serenegiant.usb.DeviceFilter; import com.serenegiant.usb.USBMonitor; import com.serenegiant.uvccamera.R; public class CameraDialog extends DialogFragment { private static final String TAG = CameraDialog.class.getSimpleName(); public interface CameraDialogParent { public USBMonitor getUSBMonitor(); public void onDialogResult(boolean canceled); } /** * Helper method * @param parent FragmentActivity * @return */ public static CameraDialog showDialog(final Activity parent/* add parameters here if you need */) { CameraDialog dialog = newInstance(/* add parameters here if you need */); try { dialog.show(parent.getFragmentManager(), TAG); } catch (final IllegalStateException e) { dialog = null; } return dialog; } public static CameraDialog newInstance(/* add parameters here if you need */) { final CameraDialog dialog = new CameraDialog(); final Bundle args = new Bundle(); // add parameters here if you need dialog.setArguments(args); return dialog; } protected USBMonitor mUSBMonitor; private Spinner mSpinner; private DeviceListAdapter mDeviceListAdapter; public CameraDialog(/* no arguments */) { // Fragment need default constructor } @SuppressWarnings("deprecation") @Override public void onAttach(final Activity activity) { super.onAttach(activity); if (mUSBMonitor == null) try { mUSBMonitor = ((CameraDialogParent)activity).getUSBMonitor(); } catch (final ClassCastException e) { } catch (final NullPointerException e) { } if (mUSBMonitor == null) { throw new ClassCastException(activity.toString() + " must implement CameraDialogParent#getUSBController"); } } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState == null) savedInstanceState = getArguments(); } @Override public void onSaveInstanceState(final Bundle saveInstanceState) { final Bundle args = getArguments(); if (args != null) saveInstanceState.putAll(args); super.onSaveInstanceState(saveInstanceState); } @Override public Dialog onCreateDialog(final Bundle savedInstanceState) { final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setView(initView()); builder.setTitle(R.string.select); builder.setPositiveButton(android.R.string.ok, mOnDialogClickListener); builder.setNegativeButton(android.R.string.cancel , mOnDialogClickListener); builder.setNeutralButton(R.string.refresh, null); final Dialog dialog = builder.create(); dialog.setCancelable(true); dialog.setCanceledOnTouchOutside(true); return dialog; } /** * create view that this fragment shows * @return */ private final View initView() { final View rootView = getActivity().getLayoutInflater().inflate(R.layout.dialog_camera, null); mSpinner = (Spinner)rootView.findViewById(R.id.spinner1); final View empty = rootView.findViewById(android.R.id.empty); mSpinner.setEmptyView(empty); return rootView; } @Override public void onResume() { super.onResume(); updateDevices(); final Button button = (Button)getDialog().findViewById(android.R.id.button3); if (button != null) { button.setOnClickListener(mOnClickListener); } } private final OnClickListener mOnClickListener = new OnClickListener() { @Override public void onClick(final View v) { switch (v.getId()) { case android.R.id.button3: updateDevices(); break; } } }; private final DialogInterface.OnClickListener mOnDialogClickListener = new DialogInterface.OnClickListener() { @Override public void onClick(final DialogInterface dialog, final int which) { switch (which) { case DialogInterface.BUTTON_POSITIVE: final Object item = mSpinner.getSelectedItem(); if (item instanceof UsbDevice) { mUSBMonitor.requestPermission((UsbDevice)item); ((CameraDialogParent)getActivity()).onDialogResult(false); } break; case DialogInterface.BUTTON_NEGATIVE: ((CameraDialogParent)getActivity()).onDialogResult(true); break; } } }; @Override public void onCancel(final DialogInterface dialog) { ((CameraDialogParent)getActivity()).onDialogResult(true); super.onCancel(dialog); } public void updateDevices() { // mUSBMonitor.dumpDevices(); final List<DeviceFilter> filter = DeviceFilter.getDeviceFilters(getActivity(), R.xml.device_filter); mDeviceListAdapter = new DeviceListAdapter(getActivity(), mUSBMonitor.getDeviceList(filter.get(0))); mSpinner.setAdapter(mDeviceListAdapter); } private static final class DeviceListAdapter extends BaseAdapter { private final LayoutInflater mInflater; private final List<UsbDevice> mList; public DeviceListAdapter(final Context context, final List<UsbDevice>list) { mInflater = LayoutInflater.from(context); mList = list != null ? list : new ArrayList<UsbDevice>(); } @Override public int getCount() { return mList.size(); } @Override public UsbDevice getItem(final int position) { if ((position >= 0) && (position < mList.size())) return mList.get(position); else return null; } @Override public long getItemId(final int position) { return position; } @Override public View getView(final int position, View convertView, final ViewGroup parent) { if (convertView == null) { convertView = mInflater.inflate(R.layout.listitem_device, parent, false); } if (convertView instanceof CheckedTextView) { final UsbDevice device = getItem(position); ((CheckedTextView)convertView).setText( String.format("UVC Camera:(%x:%x:%s)", device.getVendorId(), device.getProductId(), device.getDeviceName())); } return convertView; } } }
0
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant
java-sources/ai/eye2you/libuvccamera/2018.10.2/com/serenegiant/usb/DeviceFilter.java
/* * UVCCamera * library and sample to access to UVC web camera on non-rooted Android device * * Copyright (c) 2014-2017 saki t_saki@serenegiant.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * All files in the folder are under this Apache License, Version 2.0. * Files in the libjpeg-turbo, libusb, libuvc, rapidjson folder * may have a different license, see the respective files. */ package com.serenegiant.usb; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import android.content.Context; import android.content.res.Resources.NotFoundException; import android.hardware.usb.UsbDevice; import android.hardware.usb.UsbInterface; import android.text.TextUtils; import android.util.Log; public final class DeviceFilter { private static final String TAG = "DeviceFilter"; // USB Vendor ID (or -1 for unspecified) public final int mVendorId; // USB Product ID (or -1 for unspecified) public final int mProductId; // USB device or interface class (or -1 for unspecified) public final int mClass; // USB device subclass (or -1 for unspecified) public final int mSubclass; // USB device protocol (or -1 for unspecified) public final int mProtocol; // USB device manufacturer name string (or null for unspecified) public final String mManufacturerName; // USB device product name string (or null for unspecified) public final String mProductName; // USB device serial number string (or null for unspecified) public final String mSerialNumber; // set true if specific device(s) should exclude public final boolean isExclude; public DeviceFilter(final int vid, final int pid, final int clasz, final int subclass, final int protocol, final String manufacturer, final String product, final String serialNum) { this(vid, pid, clasz, subclass, protocol, manufacturer, product, serialNum, false); } public DeviceFilter(final int vid, final int pid, final int clasz, final int subclass, final int protocol, final String manufacturer, final String product, final String serialNum, final boolean isExclude) { mVendorId = vid; mProductId = pid; mClass = clasz; mSubclass = subclass; mProtocol = protocol; mManufacturerName = manufacturer; mProductName = product; mSerialNumber = serialNum; this.isExclude = isExclude; /* Log.i(TAG, String.format("vendorId=0x%04x,productId=0x%04x,class=0x%02x,subclass=0x%02x,protocol=0x%02x", mVendorId, mProductId, mClass, mSubclass, mProtocol)); */ } public DeviceFilter(final UsbDevice device) { this(device, false); } public DeviceFilter(final UsbDevice device, final boolean isExclude) { mVendorId = device.getVendorId(); mProductId = device.getProductId(); mClass = device.getDeviceClass(); mSubclass = device.getDeviceSubclass(); mProtocol = device.getDeviceProtocol(); mManufacturerName = null; // device.getManufacturerName(); mProductName = null; // device.getProductName(); mSerialNumber = null; // device.getSerialNumber(); this.isExclude = isExclude; /* Log.i(TAG, String.format("vendorId=0x%04x,productId=0x%04x,class=0x%02x,subclass=0x%02x,protocol=0x%02x", mVendorId, mProductId, mClass, mSubclass, mProtocol)); */ } /** * 指定したxmlリソースからDeviceFilterリストを生成する * @param context * @param deviceFilterXmlId * @return */ public static List<DeviceFilter> getDeviceFilters(final Context context, final int deviceFilterXmlId) { final XmlPullParser parser = context.getResources().getXml(deviceFilterXmlId); final List<DeviceFilter> deviceFilters = new ArrayList<DeviceFilter>(); try { int eventType = parser.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { if (eventType == XmlPullParser.START_TAG) { final DeviceFilter deviceFilter = readEntryOne(context, parser); if (deviceFilter != null) { deviceFilters.add(deviceFilter); } } eventType = parser.next(); } } catch (final XmlPullParserException e) { Log.d(TAG, "XmlPullParserException", e); } catch (final IOException e) { Log.d(TAG, "IOException", e); } return Collections.unmodifiableList(deviceFilters); } /** * read as integer values with default value from xml(w/o exception throws) * resource integer id is also resolved into integer * @param parser * @param namespace * @param name * @param defaultValue * @return */ private static final int getAttributeInteger(final Context context, final XmlPullParser parser, final String namespace, final String name, final int defaultValue) { int result = defaultValue; try { String v = parser.getAttributeValue(namespace, name); if (!TextUtils.isEmpty(v) && v.startsWith("@")) { final String r = v.substring(1); final int resId = context.getResources().getIdentifier(r, null, context.getPackageName()); if (resId > 0) { result = context.getResources().getInteger(resId); } } else { int radix = 10; if (v != null && v.length() > 2 && v.charAt(0) == '0' && (v.charAt(1) == 'x' || v.charAt(1) == 'X')) { // allow hex values starting with 0x or 0X radix = 16; v = v.substring(2); } result = Integer.parseInt(v, radix); } } catch (final NotFoundException e) { result = defaultValue; } catch (final NumberFormatException e) { result = defaultValue; } catch (final NullPointerException e) { result = defaultValue; } return result; } /** * read as boolean values with default value from xml(w/o exception throws) * resource boolean id is also resolved into boolean * if the value is zero, return false, if the value is non-zero integer, return true * @param context * @param parser * @param namespace * @param name * @param defaultValue * @return */ private static final boolean getAttributeBoolean(final Context context, final XmlPullParser parser, final String namespace, final String name, final boolean defaultValue) { boolean result = defaultValue; try { String v = parser.getAttributeValue(namespace, name); if ("TRUE".equalsIgnoreCase(v)) { result = true; } else if ("FALSE".equalsIgnoreCase(v)) { result = false; } else if (!TextUtils.isEmpty(v) && v.startsWith("@")) { final String r = v.substring(1); final int resId = context.getResources().getIdentifier(r, null, context.getPackageName()); if (resId > 0) { result = context.getResources().getBoolean(resId); } } else { int radix = 10; if (v != null && v.length() > 2 && v.charAt(0) == '0' && (v.charAt(1) == 'x' || v.charAt(1) == 'X')) { // allow hex values starting with 0x or 0X radix = 16; v = v.substring(2); } final int val = Integer.parseInt(v, radix); result = val != 0; } } catch (final NotFoundException e) { result = defaultValue; } catch (final NumberFormatException e) { result = defaultValue; } catch (final NullPointerException e) { result = defaultValue; } return result; } /** * read as String attribute with default value from xml(w/o exception throws) * resource string id is also resolved into string * @param parser * @param namespace * @param name * @param defaultValue * @return */ private static final String getAttributeString(final Context context, final XmlPullParser parser, final String namespace, final String name, final String defaultValue) { String result = defaultValue; try { result = parser.getAttributeValue(namespace, name); if (result == null) result = defaultValue; if (!TextUtils.isEmpty(result) && result.startsWith("@")) { final String r = result.substring(1); final int resId = context.getResources().getIdentifier(r, null, context.getPackageName()); if (resId > 0) result = context.getResources().getString(resId); } } catch (final NotFoundException e) { result = defaultValue; } catch (final NumberFormatException e) { result = defaultValue; } catch (final NullPointerException e) { result = defaultValue; } return result; } public static DeviceFilter readEntryOne(final Context context, final XmlPullParser parser) throws XmlPullParserException, IOException { int vendorId = -1; int productId = -1; int deviceClass = -1; int deviceSubclass = -1; int deviceProtocol = -1; boolean exclude = false; String manufacturerName = null; String productName = null; String serialNumber = null; boolean hasValue = false; String tag; int eventType = parser.getEventType(); while (eventType != XmlPullParser.END_DOCUMENT) { tag = parser.getName(); if (!TextUtils.isEmpty(tag) && (tag.equalsIgnoreCase("usb-device"))) { if (eventType == XmlPullParser.START_TAG) { hasValue = true; vendorId = getAttributeInteger(context, parser, null, "vendor-id", -1); if (vendorId == -1) { vendorId = getAttributeInteger(context, parser, null, "vendorId", -1); if (vendorId == -1) vendorId = getAttributeInteger(context, parser, null, "venderId", -1); } productId = getAttributeInteger(context, parser, null, "product-id", -1); if (productId == -1) productId = getAttributeInteger(context, parser, null, "productId", -1); deviceClass = getAttributeInteger(context, parser, null, "class", -1); deviceSubclass = getAttributeInteger(context, parser, null, "subclass", -1); deviceProtocol = getAttributeInteger(context, parser, null, "protocol", -1); manufacturerName = getAttributeString(context, parser, null, "manufacturer-name", null); if (TextUtils.isEmpty(manufacturerName)) manufacturerName = getAttributeString(context, parser, null, "manufacture", null); productName = getAttributeString(context, parser, null, "product-name", null); if (TextUtils.isEmpty(productName)) productName = getAttributeString(context, parser, null, "product", null); serialNumber = getAttributeString(context, parser, null, "serial-number", null); if (TextUtils.isEmpty(serialNumber)) serialNumber = getAttributeString(context, parser, null, "serial", null); exclude = getAttributeBoolean(context, parser, null, "exclude", false); } else if (eventType == XmlPullParser.END_TAG) { if (hasValue) { return new DeviceFilter(vendorId, productId, deviceClass, deviceSubclass, deviceProtocol, manufacturerName, productName, serialNumber, exclude); } } } eventType = parser.next(); } return null; } /* public void write(XmlSerializer serializer) throws IOException { serializer.startTag(null, "usb-device"); if (mVendorId != -1) { serializer .attribute(null, "vendor-id", Integer.toString(mVendorId)); } if (mProductId != -1) { serializer.attribute(null, "product-id", Integer.toString(mProductId)); } if (mClass != -1) { serializer.attribute(null, "class", Integer.toString(mClass)); } if (mSubclass != -1) { serializer.attribute(null, "subclass", Integer.toString(mSubclass)); } if (mProtocol != -1) { serializer.attribute(null, "protocol", Integer.toString(mProtocol)); } if (mManufacturerName != null) { serializer.attribute(null, "manufacturer-name", mManufacturerName); } if (mProductName != null) { serializer.attribute(null, "product-name", mProductName); } if (mSerialNumber != null) { serializer.attribute(null, "serial-number", mSerialNumber); } serializer.attribute(null, "serial-number", Boolean.toString(isExclude)); serializer.endTag(null, "usb-device"); } */ /** * 指定したクラス・サブクラス・プロトコルがこのDeviceFilterとマッチするかどうかを返す * mExcludeフラグは別途#isExcludeか自前でチェックすること * @param clasz * @param subclass * @param protocol * @return */ private boolean matches(final int clasz, final int subclass, final int protocol) { return ((mClass == -1 || clasz == mClass) && (mSubclass == -1 || subclass == mSubclass) && (mProtocol == -1 || protocol == mProtocol)); } /** * 指定したUsbDeviceがこのDeviceFilterにマッチするかどうかを返す * mExcludeフラグは別途#isExcludeか自前でチェックすること * @param device * @return */ public boolean matches(final UsbDevice device) { if (mVendorId != -1 && device.getVendorId() != mVendorId) { return false; } if (mProductId != -1 && device.getProductId() != mProductId) { return false; } /* if (mManufacturerName != null && device.getManufacturerName() == null) return false; if (mProductName != null && device.getProductName() == null) return false; if (mSerialNumber != null && device.getSerialNumber() == null) return false; if (mManufacturerName != null && device.getManufacturerName() != null && !mManufacturerName.equals(device.getManufacturerName())) return false; if (mProductName != null && device.getProductName() != null && !mProductName.equals(device.getProductName())) return false; if (mSerialNumber != null && device.getSerialNumber() != null && !mSerialNumber.equals(device.getSerialNumber())) return false; */ // check device class/subclass/protocol if (matches(device.getDeviceClass(), device.getDeviceSubclass(), device.getDeviceProtocol())) { return true; } // if device doesn't match, check the interfaces final int count = device.getInterfaceCount(); for (int i = 0; i < count; i++) { final UsbInterface intf = device.getInterface(i); if (matches(intf.getInterfaceClass(), intf.getInterfaceSubclass(), intf.getInterfaceProtocol())) { return true; } } return false; } /** * このDeviceFilterに一致してかつmExcludeがtrueならtrueを返す * @param device * @return */ public boolean isExclude(final UsbDevice device) { return isExclude && matches(device); } /** * これって要らんかも, equalsでできる気が * @param f * @return */ public boolean matches(final DeviceFilter f) { if (isExclude != f.isExclude) { return false; } if (mVendorId != -1 && f.mVendorId != mVendorId) { return false; } if (mProductId != -1 && f.mProductId != mProductId) { return false; } if (f.mManufacturerName != null && mManufacturerName == null) { return false; } if (f.mProductName != null && mProductName == null) { return false; } if (f.mSerialNumber != null && mSerialNumber == null) { return false; } if (mManufacturerName != null && f.mManufacturerName != null && !mManufacturerName.equals(f.mManufacturerName)) { return false; } if (mProductName != null && f.mProductName != null && !mProductName.equals(f.mProductName)) { return false; } if (mSerialNumber != null && f.mSerialNumber != null && !mSerialNumber.equals(f.mSerialNumber)) { return false; } // check device class/subclass/protocol return matches(f.mClass, f.mSubclass, f.mProtocol); } @Override public boolean equals(final Object obj) { // can't compare if we have wildcard strings if (mVendorId == -1 || mProductId == -1 || mClass == -1 || mSubclass == -1 || mProtocol == -1) { return false; } if (obj instanceof DeviceFilter) { final DeviceFilter filter = (DeviceFilter) obj; if (filter.mVendorId != mVendorId || filter.mProductId != mProductId || filter.mClass != mClass || filter.mSubclass != mSubclass || filter.mProtocol != mProtocol) { return false; } if ((filter.mManufacturerName != null && mManufacturerName == null) || (filter.mManufacturerName == null && mManufacturerName != null) || (filter.mProductName != null && mProductName == null) || (filter.mProductName == null && mProductName != null) || (filter.mSerialNumber != null && mSerialNumber == null) || (filter.mSerialNumber == null && mSerialNumber != null)) { return false; } if ((filter.mManufacturerName != null && mManufacturerName != null && !mManufacturerName .equals(filter.mManufacturerName)) || (filter.mProductName != null && mProductName != null && !mProductName .equals(filter.mProductName)) || (filter.mSerialNumber != null && mSerialNumber != null && !mSerialNumber .equals(filter.mSerialNumber))) { return false; } return (filter.isExclude != isExclude); } if (obj instanceof UsbDevice) { final UsbDevice device = (UsbDevice) obj; if (isExclude || (device.getVendorId() != mVendorId) || (device.getProductId() != mProductId) || (device.getDeviceClass() != mClass) || (device.getDeviceSubclass() != mSubclass) || (device.getDeviceProtocol() != mProtocol) ) { return false; } /* if ((mManufacturerName != null && device.getManufacturerName() == null) || (mManufacturerName == null && device .getManufacturerName() != null) || (mProductName != null && device.getProductName() == null) || (mProductName == null && device.getProductName() != null) || (mSerialNumber != null && device.getSerialNumber() == null) || (mSerialNumber == null && device.getSerialNumber() != null)) { return (false); } */ /* if ((device.getManufacturerName() != null && !mManufacturerName .equals(device.getManufacturerName())) || (device.getProductName() != null && !mProductName .equals(device.getProductName())) || (device.getSerialNumber() != null && !mSerialNumber .equals(device.getSerialNumber()))) { return (false); } */ return true; } return false; } @Override public int hashCode() { return (((mVendorId << 16) | mProductId) ^ ((mClass << 16) | (mSubclass << 8) | mProtocol)); } @Override public String toString() { return "DeviceFilter[mVendorId=" + mVendorId + ",mProductId=" + mProductId + ",mClass=" + mClass + ",mSubclass=" + mSubclass + ",mProtocol=" + mProtocol + ",mManufacturerName=" + mManufacturerName + ",mProductName=" + mProductName + ",mSerialNumber=" + mSerialNumber + ",isExclude=" + isExclude + "]"; } }