diff --git a/.fern/metadata.json b/.fern/metadata.json index f59ca14..093c310 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -10,9 +10,9 @@ "base-exception-class-name": "CloudPDFException", "base-api-exception-class-name": "CloudPDFApiException" }, - "originGitCommit": "20cebe429411ef5019c9e31fc7841d72b7fb98a8", + "originGitCommit": "e5cd0731cb3a1f2ed5821f8d60191bd58934c3dd", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.8", + "requestedVersion": "3.0.0-alpha.9", "ciProvider": "github" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index 9602b08..b198c0b 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ java { group = 'com.cloudpdf' -version = '3.0.0-alpha.8' +version = '3.0.0-alpha.9' jar { dependsOn(":generatePomFileForMavenPublication") @@ -73,7 +73,7 @@ publishing { maven(MavenPublication) { groupId = 'com.cloudpdf' artifactId = 'sdk' - version = '3.0.0-alpha.8' + version = '3.0.0-alpha.9' from components.java pom { name = 'CloudPDF' diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 7091e26..084033f 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "java", - "canonicalVersion": "3.0.0-next.8", - "sdkVersion": "3.0.0-alpha.8", + "canonicalVersion": "3.0.0-next.9", + "sdkVersion": "3.0.0-alpha.9", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "e997d51317662fe0666e6582916ded9b17a8bcd225c178548e1ff226e4d01c6d", - "gitCommit": "20cebe429411ef5019c9e31fc7841d72b7fb98a8", + "openapiSha256": "4ee27900dbb0b13408ce00a0e80d606444ab81e9d5a76186fa984c8c8dfe09fe", + "gitCommit": "e5cd0731cb3a1f2ed5821f8d60191bd58934c3dd", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index 028f79c..8b030b6 100644 --- a/reference.md +++ b/reference.md @@ -2872,6 +2872,97 @@ client.doc().pages().delete( + + + + +
client.doc.pages.extract(docId, layerName, request) -> InputStream +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A read, not a mutation: the source document is untouched and no event is published. Body is `{"pageObjectNumbers": number[]}`; the response body is the new PDF. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.doc().pages().extract( + "docId", + "layerName", + ExtractPagesRequest + .builder() + .body( + new HashMap() {{ + put("string", new + HashMap() {{put("key", "value"); + }}); + }} + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**docId:** `String` + +
+
+ +
+
+ +**layerName:** `String` + +
+
+ +
+
+ +**documentPassword:** `Optional` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ +
@@ -2947,6 +3038,172 @@ client.doc().pages().flatten( + + + + +
client.doc.pages.insert(docId, layerName, request) -> DocPagesInsert200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Multipart mutation envelope: a `body` field holding `{"destIndex"?: number}` (omitted → append) plus a `resource:source` file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.doc().pages().insert( + "docId", + "layerName", + null, + InsertPagesRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**docId:** `String` + +
+
+ +
+
+ +**layerName:** `String` + +
+
+ +
+
+ +**documentPassword:** `Optional` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +
client.doc.pages.insertBlank(docId, layerName, request) -> DocPagesInsertBlank200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Body is `{"size": {"width", "height"}, "count"?, "destIndex"?}` — size in PDF points, count in [1, 100], destIndex omitted → append. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.doc().pages().insertBlank( + "docId", + "layerName", + InsertBlankPagesRequest + .builder() + .body( + new HashMap() {{ + put("key", "value"); + }} + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**docId:** `String` + +
+
+ +
+
+ +**layerName:** `String` + +
+
+ +
+
+ +**documentPassword:** `Optional` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**request:** `Map` + +
+
+
+
+ +
diff --git a/src/main/java/api/core/ClientOptions.java b/src/main/java/api/core/ClientOptions.java index 24375b2..bce99f0 100644 --- a/src/main/java/api/core/ClientOptions.java +++ b/src/main/java/api/core/ClientOptions.java @@ -49,7 +49,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.cloudpdf:sdk"); - put("X-Fern-SDK-Version", "3.0.0-alpha.8"); + put("X-Fern-SDK-Version", "3.0.0-alpha.9"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/api/resources/doc/pages/AsyncPagesClient.java b/src/main/java/api/resources/doc/pages/AsyncPagesClient.java index 7c71600..4a48e5e 100644 --- a/src/main/java/api/resources/doc/pages/AsyncPagesClient.java +++ b/src/main/java/api/resources/doc/pages/AsyncPagesClient.java @@ -6,15 +6,23 @@ import com.cloudpdf.api.core.ClientOptions; import com.cloudpdf.api.core.RequestOptions; import com.cloudpdf.api.resources.doc.pages.requests.DeletePagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.ExtractPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.FlattenPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertBlankPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.MovePagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.RotatePagesRequest; import com.cloudpdf.api.types.DocPagesDelete200Response; import com.cloudpdf.api.types.DocPagesFlatten200Response; +import com.cloudpdf.api.types.DocPagesInsert200Response; +import com.cloudpdf.api.types.DocPagesInsertBlank200Response; import com.cloudpdf.api.types.DocPagesMove200Response; import com.cloudpdf.api.types.DocPagesRotate200Response; +import java.io.File; +import java.io.InputStream; import java.util.Map; import java.util.concurrent.CompletableFuture; +import okhttp3.MediaType; public class AsyncPagesClient { protected final ClientOptions clientOptions; @@ -53,6 +61,36 @@ public CompletableFuture delete( return this.rawClient.delete(docId, layerName, request, requestOptions).thenApply(response -> response.body()); } + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture extract(String docId, String layerName, Map body) { + return this.rawClient.extract(docId, layerName, body).thenApply(response -> response.body()); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture extract( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return this.rawClient.extract(docId, layerName, body, requestOptions).thenApply(response -> response.body()); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture extract(String docId, String layerName, ExtractPagesRequest request) { + return this.rawClient.extract(docId, layerName, request).thenApply(response -> response.body()); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture extract( + String docId, String layerName, ExtractPagesRequest request, RequestOptions requestOptions) { + return this.rawClient.extract(docId, layerName, request, requestOptions).thenApply(response -> response.body()); + } + public CompletableFuture flatten( String docId, String layerName, Map body) { return this.rawClient.flatten(docId, layerName, body).thenApply(response -> response.body()); @@ -73,6 +111,91 @@ public CompletableFuture flatten( return this.rawClient.flatten(docId, layerName, request, requestOptions).thenApply(response -> response.body()); } + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CompletableFuture insert( + String docId, String layerName, File file, InsertPagesRequest request) { + return this.rawClient.insert(docId, layerName, file, request).thenApply(response -> response.body()); + } + + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CompletableFuture insert( + String docId, String layerName, File file, InsertPagesRequest request, RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, file, request, requestOptions) + .thenApply(response -> response.body()); + } + + public CompletableFuture insert( + String docId, String layerName, InputStream stream, String filename) { + return this.rawClient.insert(docId, layerName, stream, filename).thenApply(response -> response.body()); + } + + public CompletableFuture insert( + String docId, String layerName, InputStream stream, String filename, MediaType mediaType) { + return this.rawClient + .insert(docId, layerName, stream, filename, mediaType) + .thenApply(response -> response.body()); + } + + public CompletableFuture insert( + String docId, String layerName, InputStream stream, String filename, RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, stream, filename, requestOptions) + .thenApply(response -> response.body()); + } + + public CompletableFuture insert( + String docId, + String layerName, + InputStream stream, + String filename, + MediaType mediaType, + RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, stream, filename, mediaType, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture insertBlank( + String docId, String layerName, Map body) { + return this.rawClient.insertBlank(docId, layerName, body).thenApply(response -> response.body()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture insertBlank( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return this.rawClient + .insertBlank(docId, layerName, body, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture insertBlank( + String docId, String layerName, InsertBlankPagesRequest request) { + return this.rawClient.insertBlank(docId, layerName, request).thenApply(response -> response.body()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture insertBlank( + String docId, String layerName, InsertBlankPagesRequest request, RequestOptions requestOptions) { + return this.rawClient + .insertBlank(docId, layerName, request, requestOptions) + .thenApply(response -> response.body()); + } + public CompletableFuture move(String docId, String layerName, Map body) { return this.rawClient.move(docId, layerName, body).thenApply(response -> response.body()); } diff --git a/src/main/java/api/resources/doc/pages/AsyncRawPagesClient.java b/src/main/java/api/resources/doc/pages/AsyncRawPagesClient.java index 5970637..a314d05 100644 --- a/src/main/java/api/resources/doc/pages/AsyncRawPagesClient.java +++ b/src/main/java/api/resources/doc/pages/AsyncRawPagesClient.java @@ -7,28 +7,40 @@ import com.cloudpdf.api.core.CloudPDFApiException; import com.cloudpdf.api.core.CloudPDFClientHttpResponse; import com.cloudpdf.api.core.CloudPDFException; +import com.cloudpdf.api.core.FileStream; import com.cloudpdf.api.core.MediaTypes; import com.cloudpdf.api.core.ObjectMappers; import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.core.ResponseBodyInputStream; import com.cloudpdf.api.core.RetryInterceptor; import com.cloudpdf.api.errors.BadRequestError; import com.cloudpdf.api.errors.NotFoundError; import com.cloudpdf.api.resources.doc.pages.requests.DeletePagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.ExtractPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.FlattenPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertBlankPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.MovePagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.RotatePagesRequest; import com.cloudpdf.api.types.DocPagesDelete200Response; import com.cloudpdf.api.types.DocPagesFlatten200Response; +import com.cloudpdf.api.types.DocPagesInsert200Response; +import com.cloudpdf.api.types.DocPagesInsertBlank200Response; import com.cloudpdf.api.types.DocPagesMove200Response; import com.cloudpdf.api.types.DocPagesRotate200Response; import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Headers; import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; @@ -153,6 +165,129 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture> extract( + String docId, String layerName, Map body) { + return extract( + docId, layerName, ExtractPagesRequest.builder().body(body).build()); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture> extract( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return extract( + docId, layerName, ExtractPagesRequest.builder().body(body).build(), requestOptions); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture> extract( + String docId, String layerName, ExtractPagesRequest request) { + return extract(docId, layerName, request, null); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CompletableFuture> extract( + String docId, String layerName, ExtractPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("extract"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + future.complete( + new CloudPDFClientHttpResponse<>(new ResponseBodyInputStream(response), response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + public CompletableFuture> flatten( String docId, String layerName, Map body) { return flatten( @@ -265,6 +400,553 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CompletableFuture> insert( + String docId, String layerName, File file, InsertPagesRequest request) { + return insert(docId, layerName, file, request, null); + } + + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CompletableFuture> insert( + String docId, String layerName, File file, InsertPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + try { + String fileMimeType = Files.probeContentType(file.toPath()); + MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; + multipartBodyBuilder.addFormDataPart( + "file", file.getName(), RequestBody.create(file, fileMimeTypeMediaType)); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", multipartBodyBuilder.build()) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsert200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> insert( + String docId, String layerName, InputStream stream, String filename) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsert200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> insert( + String docId, String layerName, InputStream stream, String filename, MediaType mediaType) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsert200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> insert( + String docId, String layerName, InputStream stream, String filename, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsert200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + + public CompletableFuture> insert( + String docId, + String layerName, + InputStream stream, + String filename, + MediaType mediaType, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsert200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture> insertBlank( + String docId, String layerName, Map body) { + return insertBlank( + docId, layerName, InsertBlankPagesRequest.builder().body(body).build()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture> insertBlank( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return insertBlank( + docId, layerName, InsertBlankPagesRequest.builder().body(body).build(), requestOptions); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture> insertBlank( + String docId, String layerName, InsertBlankPagesRequest request) { + return insertBlank(docId, layerName, request, null); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CompletableFuture> insertBlank( + String docId, String layerName, InsertBlankPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert-blank"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + CompletableFuture> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, DocPagesInsertBlank200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (JsonProcessingException e) { + future.completeExceptionally( + new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e)); + } catch (IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e)); + } + }); + return future; + } + public CompletableFuture> move( String docId, String layerName, Map body) { return move(docId, layerName, MovePagesRequest.builder().body(body).build()); diff --git a/src/main/java/api/resources/doc/pages/PagesClient.java b/src/main/java/api/resources/doc/pages/PagesClient.java index 1dd7e2f..bfa2e68 100644 --- a/src/main/java/api/resources/doc/pages/PagesClient.java +++ b/src/main/java/api/resources/doc/pages/PagesClient.java @@ -6,14 +6,22 @@ import com.cloudpdf.api.core.ClientOptions; import com.cloudpdf.api.core.RequestOptions; import com.cloudpdf.api.resources.doc.pages.requests.DeletePagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.ExtractPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.FlattenPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertBlankPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.MovePagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.RotatePagesRequest; import com.cloudpdf.api.types.DocPagesDelete200Response; import com.cloudpdf.api.types.DocPagesFlatten200Response; +import com.cloudpdf.api.types.DocPagesInsert200Response; +import com.cloudpdf.api.types.DocPagesInsertBlank200Response; import com.cloudpdf.api.types.DocPagesMove200Response; import com.cloudpdf.api.types.DocPagesRotate200Response; +import java.io.File; +import java.io.InputStream; import java.util.Map; +import okhttp3.MediaType; public class PagesClient { protected final ClientOptions clientOptions; @@ -50,6 +58,36 @@ public DocPagesDelete200Response delete( return this.rawClient.delete(docId, layerName, request, requestOptions).body(); } + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public InputStream extract(String docId, String layerName, Map body) { + return this.rawClient.extract(docId, layerName, body).body(); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public InputStream extract( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return this.rawClient.extract(docId, layerName, body, requestOptions).body(); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public InputStream extract(String docId, String layerName, ExtractPagesRequest request) { + return this.rawClient.extract(docId, layerName, request).body(); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public InputStream extract( + String docId, String layerName, ExtractPagesRequest request, RequestOptions requestOptions) { + return this.rawClient.extract(docId, layerName, request, requestOptions).body(); + } + public DocPagesFlatten200Response flatten(String docId, String layerName, Map body) { return this.rawClient.flatten(docId, layerName, body).body(); } @@ -68,6 +106,87 @@ public DocPagesFlatten200Response flatten( return this.rawClient.flatten(docId, layerName, request, requestOptions).body(); } + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public DocPagesInsert200Response insert(String docId, String layerName, File file, InsertPagesRequest request) { + return this.rawClient.insert(docId, layerName, file, request).body(); + } + + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public DocPagesInsert200Response insert( + String docId, String layerName, File file, InsertPagesRequest request, RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, file, request, requestOptions) + .body(); + } + + public DocPagesInsert200Response insert(String docId, String layerName, InputStream stream, String filename) { + return this.rawClient.insert(docId, layerName, stream, filename).body(); + } + + public DocPagesInsert200Response insert( + String docId, String layerName, InputStream stream, String filename, MediaType mediaType) { + return this.rawClient + .insert(docId, layerName, stream, filename, mediaType) + .body(); + } + + public DocPagesInsert200Response insert( + String docId, String layerName, InputStream stream, String filename, RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, stream, filename, requestOptions) + .body(); + } + + public DocPagesInsert200Response insert( + String docId, + String layerName, + InputStream stream, + String filename, + MediaType mediaType, + RequestOptions requestOptions) { + return this.rawClient + .insert(docId, layerName, stream, filename, mediaType, requestOptions) + .body(); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public DocPagesInsertBlank200Response insertBlank(String docId, String layerName, Map body) { + return this.rawClient.insertBlank(docId, layerName, body).body(); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public DocPagesInsertBlank200Response insertBlank( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return this.rawClient + .insertBlank(docId, layerName, body, requestOptions) + .body(); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public DocPagesInsertBlank200Response insertBlank(String docId, String layerName, InsertBlankPagesRequest request) { + return this.rawClient.insertBlank(docId, layerName, request).body(); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public DocPagesInsertBlank200Response insertBlank( + String docId, String layerName, InsertBlankPagesRequest request, RequestOptions requestOptions) { + return this.rawClient + .insertBlank(docId, layerName, request, requestOptions) + .body(); + } + public DocPagesMove200Response move(String docId, String layerName, Map body) { return this.rawClient.move(docId, layerName, body).body(); } diff --git a/src/main/java/api/resources/doc/pages/RawPagesClient.java b/src/main/java/api/resources/doc/pages/RawPagesClient.java index 411e15d..2a46ae6 100644 --- a/src/main/java/api/resources/doc/pages/RawPagesClient.java +++ b/src/main/java/api/resources/doc/pages/RawPagesClient.java @@ -7,25 +7,37 @@ import com.cloudpdf.api.core.CloudPDFApiException; import com.cloudpdf.api.core.CloudPDFClientHttpResponse; import com.cloudpdf.api.core.CloudPDFException; +import com.cloudpdf.api.core.FileStream; import com.cloudpdf.api.core.MediaTypes; import com.cloudpdf.api.core.ObjectMappers; import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.core.ResponseBodyInputStream; import com.cloudpdf.api.core.RetryInterceptor; import com.cloudpdf.api.errors.BadRequestError; import com.cloudpdf.api.errors.NotFoundError; import com.cloudpdf.api.resources.doc.pages.requests.DeletePagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.ExtractPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.FlattenPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertBlankPagesRequest; +import com.cloudpdf.api.resources.doc.pages.requests.InsertPagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.MovePagesRequest; import com.cloudpdf.api.resources.doc.pages.requests.RotatePagesRequest; import com.cloudpdf.api.types.DocPagesDelete200Response; import com.cloudpdf.api.types.DocPagesFlatten200Response; +import com.cloudpdf.api.types.DocPagesInsert200Response; +import com.cloudpdf.api.types.DocPagesInsertBlank200Response; import com.cloudpdf.api.types.DocPagesMove200Response; import com.cloudpdf.api.types.DocPagesRotate200Response; import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.RequestBody; @@ -130,6 +142,109 @@ public CloudPDFClientHttpResponse delete( } } + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CloudPDFClientHttpResponse extract(String docId, String layerName, Map body) { + return extract( + docId, layerName, ExtractPagesRequest.builder().body(body).build()); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CloudPDFClientHttpResponse extract( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return extract( + docId, layerName, ExtractPagesRequest.builder().body(body).build(), requestOptions); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CloudPDFClientHttpResponse extract( + String docId, String layerName, ExtractPagesRequest request) { + return extract(docId, layerName, request, null); + } + + /** + * A read, not a mutation: the source document is untouched and no event is published. Body is {"pageObjectNumbers": number[]}; the response body is the new PDF. + */ + public CloudPDFClientHttpResponse extract( + String docId, String layerName, ExtractPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("extract"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try { + Response response = client.newCall(okhttpRequest).execute(); + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>(new ResponseBodyInputStream(response), response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + public CloudPDFClientHttpResponse flatten( String docId, String layerName, Map body) { return flatten( @@ -223,6 +338,438 @@ public CloudPDFClientHttpResponse flatten( } } + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CloudPDFClientHttpResponse insert( + String docId, String layerName, File file, InsertPagesRequest request) { + return insert(docId, layerName, file, request, null); + } + + /** + * Multipart mutation envelope: a body field holding {"destIndex"?: number} (omitted → append) plus a resource:source file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + */ + public CloudPDFClientHttpResponse insert( + String docId, String layerName, File file, InsertPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + try { + String fileMimeType = Files.probeContentType(file.toPath()); + MediaType fileMimeTypeMediaType = fileMimeType != null ? MediaType.parse(fileMimeType) : null; + multipartBodyBuilder.addFormDataPart( + "file", file.getName(), RequestBody.create(file, fileMimeTypeMediaType)); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", multipartBodyBuilder.build()) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsert200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + + public CloudPDFClientHttpResponse insert( + String docId, String layerName, InputStream stream, String filename) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsert200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + + public CloudPDFClientHttpResponse insert( + String docId, String layerName, InputStream stream, String filename, MediaType mediaType) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers((RequestOptions) null))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsert200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + + public CloudPDFClientHttpResponse insert( + String docId, String layerName, InputStream stream, String filename, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + FileStream fs = new FileStream(stream, filename, null); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsert200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + + public CloudPDFClientHttpResponse insert( + String docId, + String layerName, + InputStream stream, + String filename, + MediaType mediaType, + RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + FileStream fs = new FileStream(stream, filename, mediaType); + MultipartBody.Builder multipartBodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + multipartBodyBuilder.addFormDataPart("file", filename, fs.toRequestBody()); + RequestBody body = multipartBodyBuilder.build(); + Request.Builder _requestBuilder = new Request.Builder(); + _requestBuilder.url(httpUrl.build()); + _requestBuilder.method("POST", body); + _requestBuilder.headers(Headers.of(this.clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsert200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CloudPDFClientHttpResponse insertBlank( + String docId, String layerName, Map body) { + return insertBlank( + docId, layerName, InsertBlankPagesRequest.builder().body(body).build()); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CloudPDFClientHttpResponse insertBlank( + String docId, String layerName, Map body, RequestOptions requestOptions) { + return insertBlank( + docId, layerName, InsertBlankPagesRequest.builder().body(body).build(), requestOptions); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CloudPDFClientHttpResponse insertBlank( + String docId, String layerName, InsertBlankPagesRequest request) { + return insertBlank(docId, layerName, request, null); + } + + /** + * Body is {"size": {"width", "height"}, "count"?, "destIndex"?} — size in PDF points, count in [1, 100], destIndex omitted → append. + */ + public CloudPDFClientHttpResponse insertBlank( + String docId, String layerName, InsertBlankPagesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/docs") + .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) + .addPathSegments("pages") + .addPathSegments("insert-blank"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + if (request.getDocumentPassword().isPresent()) { + _requestBuilder.addHeader( + "X-Document-Password", request.getDocumentPassword().get()); + } + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) { + okhttpRequest = okhttpRequest + .newBuilder() + .tag( + RetryInterceptor.MaxRetriesOverride.class, + new RetryInterceptor.MaxRetriesOverride( + requestOptions.getMaxRetries().get())) + .build(); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new CloudPDFClientHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DocPagesInsertBlank200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new CloudPDFApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e); + } catch (IOException e) { + throw new CloudPDFException("Network error executing HTTP request", e); + } + } + public CloudPDFClientHttpResponse move( String docId, String layerName, Map body) { return move(docId, layerName, MovePagesRequest.builder().body(body).build()); diff --git a/src/main/java/api/resources/doc/pages/requests/ExtractPagesRequest.java b/src/main/java/api/resources/doc/pages/requests/ExtractPagesRequest.java new file mode 100644 index 0000000..ae9ba09 --- /dev/null +++ b/src/main/java/api/resources/doc/pages/requests/ExtractPagesRequest.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.doc.pages.requests; + +import com.cloudpdf.api.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExtractPagesRequest.Builder.class) +public final class ExtractPagesRequest { + private final Optional documentPassword; + + private final Map body; + + private final Map additionalProperties; + + private ExtractPagesRequest( + Optional documentPassword, Map body, Map additionalProperties) { + this.documentPassword = documentPassword; + this.body = body; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + */ + @JsonIgnore + public Optional getDocumentPassword() { + return documentPassword; + } + + @JsonProperty("body") + public Map getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExtractPagesRequest && equalTo((ExtractPagesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExtractPagesRequest other) { + return documentPassword.equals(other.documentPassword) && body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.documentPassword, this.body); + } + + @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 documentPassword = Optional.empty(); + + private Map body = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExtractPagesRequest other) { + documentPassword(other.getDocumentPassword()); + body(other.getBody()); + return this; + } + + /** + *

Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

+ */ + public Builder documentPassword(Optional documentPassword) { + this.documentPassword = documentPassword; + return this; + } + + public Builder documentPassword(String documentPassword) { + this.documentPassword = Optional.ofNullable(documentPassword); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Map body) { + this.body.clear(); + if (body != null) { + this.body.putAll(body); + } + return this; + } + + public Builder putAllBody(Map body) { + if (body != null) { + this.body.putAll(body); + } + return this; + } + + public Builder body(String key, Object value) { + this.body.put(key, value); + return this; + } + + public ExtractPagesRequest build() { + return new ExtractPagesRequest(documentPassword, body, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/resources/doc/pages/requests/InsertBlankPagesRequest.java b/src/main/java/api/resources/doc/pages/requests/InsertBlankPagesRequest.java new file mode 100644 index 0000000..e332722 --- /dev/null +++ b/src/main/java/api/resources/doc/pages/requests/InsertBlankPagesRequest.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.doc.pages.requests; + +import com.cloudpdf.api.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InsertBlankPagesRequest.Builder.class) +public final class InsertBlankPagesRequest { + private final Optional documentPassword; + + private final Map body; + + private final Map additionalProperties; + + private InsertBlankPagesRequest( + Optional documentPassword, Map body, Map additionalProperties) { + this.documentPassword = documentPassword; + this.body = body; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + */ + @JsonIgnore + public Optional getDocumentPassword() { + return documentPassword; + } + + @JsonProperty("body") + public Map getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InsertBlankPagesRequest && equalTo((InsertBlankPagesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InsertBlankPagesRequest other) { + return documentPassword.equals(other.documentPassword) && body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.documentPassword, this.body); + } + + @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 documentPassword = Optional.empty(); + + private Map body = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InsertBlankPagesRequest other) { + documentPassword(other.getDocumentPassword()); + body(other.getBody()); + return this; + } + + /** + *

Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

+ */ + public Builder documentPassword(Optional documentPassword) { + this.documentPassword = documentPassword; + return this; + } + + public Builder documentPassword(String documentPassword) { + this.documentPassword = Optional.ofNullable(documentPassword); + return this; + } + + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Map body) { + this.body.clear(); + if (body != null) { + this.body.putAll(body); + } + return this; + } + + public Builder putAllBody(Map body) { + if (body != null) { + this.body.putAll(body); + } + return this; + } + + public Builder body(String key, Object value) { + this.body.put(key, value); + return this; + } + + public InsertBlankPagesRequest build() { + return new InsertBlankPagesRequest(documentPassword, body, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/resources/doc/pages/requests/InsertPagesRequest.java b/src/main/java/api/resources/doc/pages/requests/InsertPagesRequest.java new file mode 100644 index 0000000..a47130d --- /dev/null +++ b/src/main/java/api/resources/doc/pages/requests/InsertPagesRequest.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.doc.pages.requests; + +import com.cloudpdf.api.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.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 = InsertPagesRequest.Builder.class) +public final class InsertPagesRequest { + private final Optional documentPassword; + + private final Map additionalProperties; + + private InsertPagesRequest(Optional documentPassword, Map additionalProperties) { + this.documentPassword = documentPassword; + this.additionalProperties = additionalProperties; + } + + /** + * @return Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + */ + @JsonIgnore + public Optional getDocumentPassword() { + return documentPassword; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InsertPagesRequest && equalTo((InsertPagesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InsertPagesRequest other) { + return documentPassword.equals(other.documentPassword); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.documentPassword); + } + + @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 documentPassword = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InsertPagesRequest other) { + documentPassword(other.getDocumentPassword()); + return this; + } + + /** + *

Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.

+ */ + public Builder documentPassword(Optional documentPassword) { + this.documentPassword = documentPassword; + return this; + } + + public Builder documentPassword(String documentPassword) { + this.documentPassword = Optional.ofNullable(documentPassword); + return this; + } + + public InsertPagesRequest build() { + return new InsertPagesRequest(documentPassword, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesExtract400Response.java b/src/main/java/api/types/DocPagesExtract400Response.java new file mode 100644 index 0000000..5a3e557 --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract400Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesExtract400Response.Builder.class) +public final class DocPagesExtract400Response { + private final DocPagesExtract400ResponseName name; + + private final DocPagesExtract400ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesExtract400Response( + DocPagesExtract400ResponseName name, + DocPagesExtract400ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesExtract400ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesExtract400ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesExtract400Response && equalTo((DocPagesExtract400Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesExtract400Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesExtract400ResponseName name); + + Builder from(DocPagesExtract400Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesExtract400ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesExtract400Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesExtract400ResponseName name; + + private DocPagesExtract400ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesExtract400Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesExtract400ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesExtract400ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesExtract400Response build() { + return new DocPagesExtract400Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesExtract400ResponseCode.java b/src/main/java/api/types/DocPagesExtract400ResponseCode.java new file mode 100644 index 0000000..a11af42 --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract400ResponseCode.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesExtract400ResponseCode { + public static final DocPagesExtract400ResponseCode MALFORMED_PDF = + new DocPagesExtract400ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesExtract400ResponseCode UNKNOWN = + new DocPagesExtract400ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesExtract400ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesExtract400ResponseCode(Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesExtract400ResponseCode WIRE_FORMAT = + new DocPagesExtract400ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesExtract400ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesExtract400ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesExtract400ResponseCode UNAUTHENTICATED = + new DocPagesExtract400ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesExtract400ResponseCode FORBIDDEN = + new DocPagesExtract400ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesExtract400ResponseCode DOC_OPEN_FAILED = + new DocPagesExtract400ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesExtract400ResponseCode NOT_FOUND = + new DocPagesExtract400ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesExtract400ResponseCode ABORTED = + new DocPagesExtract400ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesExtract400ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesExtract400ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesExtract400ResponseCode INVALID_ARG = + new DocPagesExtract400ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesExtract400ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesExtract400ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesExtract400ResponseCode NETWORK = + new DocPagesExtract400ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesExtract400ResponseCode INVALID_REFERENCE = + new DocPagesExtract400ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesExtract400ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesExtract400ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesExtract400ResponseCode DOC_NOT_OPEN = + new DocPagesExtract400ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesExtract400ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesExtract400ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesExtract400ResponseCode NOT_IMPLEMENTED = + new DocPagesExtract400ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesExtract400ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesExtract400ResponseCode + && this.string.equals(((DocPagesExtract400ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesExtract400ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesExtract400ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesExtract400ResponseName.java b/src/main/java/api/types/DocPagesExtract400ResponseName.java new file mode 100644 index 0000000..c21401d --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract400ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesExtract400ResponseName { + public static final DocPagesExtract400ResponseName ENGINE_ERROR = + new DocPagesExtract400ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesExtract400ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesExtract400ResponseName + && this.string.equals(((DocPagesExtract400ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesExtract400ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesExtract400ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesExtract404Response.java b/src/main/java/api/types/DocPagesExtract404Response.java new file mode 100644 index 0000000..0182a94 --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract404Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesExtract404Response.Builder.class) +public final class DocPagesExtract404Response { + private final DocPagesExtract404ResponseName name; + + private final DocPagesExtract404ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesExtract404Response( + DocPagesExtract404ResponseName name, + DocPagesExtract404ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesExtract404ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesExtract404ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesExtract404Response && equalTo((DocPagesExtract404Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesExtract404Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesExtract404ResponseName name); + + Builder from(DocPagesExtract404Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesExtract404ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesExtract404Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesExtract404ResponseName name; + + private DocPagesExtract404ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesExtract404Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesExtract404ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesExtract404ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesExtract404Response build() { + return new DocPagesExtract404Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesExtract404ResponseCode.java b/src/main/java/api/types/DocPagesExtract404ResponseCode.java new file mode 100644 index 0000000..0709628 --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract404ResponseCode.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesExtract404ResponseCode { + public static final DocPagesExtract404ResponseCode MALFORMED_PDF = + new DocPagesExtract404ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesExtract404ResponseCode UNKNOWN = + new DocPagesExtract404ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesExtract404ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesExtract404ResponseCode(Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesExtract404ResponseCode WIRE_FORMAT = + new DocPagesExtract404ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesExtract404ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesExtract404ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesExtract404ResponseCode UNAUTHENTICATED = + new DocPagesExtract404ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesExtract404ResponseCode FORBIDDEN = + new DocPagesExtract404ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesExtract404ResponseCode DOC_OPEN_FAILED = + new DocPagesExtract404ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesExtract404ResponseCode NOT_FOUND = + new DocPagesExtract404ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesExtract404ResponseCode ABORTED = + new DocPagesExtract404ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesExtract404ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesExtract404ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesExtract404ResponseCode INVALID_ARG = + new DocPagesExtract404ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesExtract404ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesExtract404ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesExtract404ResponseCode NETWORK = + new DocPagesExtract404ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesExtract404ResponseCode INVALID_REFERENCE = + new DocPagesExtract404ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesExtract404ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesExtract404ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesExtract404ResponseCode DOC_NOT_OPEN = + new DocPagesExtract404ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesExtract404ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesExtract404ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesExtract404ResponseCode NOT_IMPLEMENTED = + new DocPagesExtract404ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesExtract404ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesExtract404ResponseCode + && this.string.equals(((DocPagesExtract404ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesExtract404ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesExtract404ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesExtract404ResponseName.java b/src/main/java/api/types/DocPagesExtract404ResponseName.java new file mode 100644 index 0000000..6bd7566 --- /dev/null +++ b/src/main/java/api/types/DocPagesExtract404ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesExtract404ResponseName { + public static final DocPagesExtract404ResponseName ENGINE_ERROR = + new DocPagesExtract404ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesExtract404ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesExtract404ResponseName + && this.string.equals(((DocPagesExtract404ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesExtract404ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesExtract404ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsert200Response.java b/src/main/java/api/types/DocPagesInsert200Response.java new file mode 100644 index 0000000..49a55b2 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200Response.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200Response.Builder.class) +public final class DocPagesInsert200Response { + private final DocPagesInsert200ResponseMeta meta; + + private final Map additionalProperties; + + private DocPagesInsert200Response(DocPagesInsert200ResponseMeta meta, Map additionalProperties) { + this.meta = meta; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("meta") + public DocPagesInsert200ResponseMeta getMeta() { + return meta; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200Response && equalTo((DocPagesInsert200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200Response other) { + return meta.equals(other.meta); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.meta); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MetaStage builder() { + return new Builder(); + } + + public interface MetaStage { + _FinalStage meta(@NotNull DocPagesInsert200ResponseMeta meta); + + Builder from(DocPagesInsert200Response other); + } + + public interface _FinalStage { + DocPagesInsert200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MetaStage, _FinalStage { + private DocPagesInsert200ResponseMeta meta; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200Response other) { + meta(other.getMeta()); + return this; + } + + @java.lang.Override + @JsonSetter("meta") + public _FinalStage meta(@NotNull DocPagesInsert200ResponseMeta meta) { + this.meta = Objects.requireNonNull(meta, "meta must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsert200Response build() { + return new DocPagesInsert200Response(meta, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMeta.java b/src/main/java/api/types/DocPagesInsert200ResponseMeta.java new file mode 100644 index 0000000..19a106d --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMeta.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.core.Nullable; +import com.cloudpdf.api.core.NullableNonemptyFilter; +import com.cloudpdf.api.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.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 = DocPagesInsert200ResponseMeta.Builder.class) +public final class DocPagesInsert200ResponseMeta { + private final List affectedPages; + + private final Optional cacheDelta; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMeta( + List affectedPages, + Optional cacheDelta, + Map additionalProperties) { + this.affectedPages = affectedPages; + this.cacheDelta = cacheDelta; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("affectedPages") + public List getAffectedPages() { + return affectedPages; + } + + @JsonIgnore + public Optional getCacheDelta() { + if (cacheDelta == null) { + return Optional.empty(); + } + return cacheDelta; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cacheDelta") + private Optional _getCacheDelta() { + return cacheDelta; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMeta && equalTo((DocPagesInsert200ResponseMeta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMeta other) { + return affectedPages.equals(other.affectedPages) && cacheDelta.equals(other.cacheDelta); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.affectedPages, this.cacheDelta); + } + + @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 affectedPages = new ArrayList<>(); + + private Optional cacheDelta = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DocPagesInsert200ResponseMeta other) { + affectedPages(other.getAffectedPages()); + cacheDelta(other.getCacheDelta()); + return this; + } + + @JsonSetter(value = "affectedPages", nulls = Nulls.SKIP) + public Builder affectedPages(List affectedPages) { + this.affectedPages.clear(); + if (affectedPages != null) { + this.affectedPages.addAll(affectedPages); + } + return this; + } + + public Builder addAffectedPages(DocPagesInsert200ResponseMetaAffectedPagesItem affectedPages) { + this.affectedPages.add(affectedPages); + return this; + } + + public Builder addAllAffectedPages(List affectedPages) { + if (affectedPages != null) { + this.affectedPages.addAll(affectedPages); + } + return this; + } + + @JsonSetter(value = "cacheDelta", nulls = Nulls.SKIP) + public Builder cacheDelta(Optional cacheDelta) { + this.cacheDelta = cacheDelta; + return this; + } + + public Builder cacheDelta(DocPagesInsert200ResponseMetaCacheDelta cacheDelta) { + this.cacheDelta = Optional.ofNullable(cacheDelta); + return this; + } + + public Builder cacheDelta(Nullable cacheDelta) { + if (cacheDelta.isNull()) { + this.cacheDelta = null; + } else if (cacheDelta.isEmpty()) { + this.cacheDelta = Optional.empty(); + } else { + this.cacheDelta = Optional.of(cacheDelta.get()); + } + return this; + } + + public DocPagesInsert200ResponseMeta build() { + return new DocPagesInsert200ResponseMeta(affectedPages, cacheDelta, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItem.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItem.java new file mode 100644 index 0000000..49a3b69 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItem.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaAffectedPagesItem.Builder.class) +public final class DocPagesInsert200ResponseMetaAffectedPagesItem { + private final int pageObjectNumber; + + private final DocPagesInsert200ResponseMetaAffectedPagesItemRevision revision; + + private final DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaAffectedPagesItem( + int pageObjectNumber, + DocPagesInsert200ResponseMetaAffectedPagesItemRevision revision, + DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState, + Map additionalProperties) { + this.pageObjectNumber = pageObjectNumber; + this.revision = revision; + this.weakAnnotationState = weakAnnotationState; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("revision") + public DocPagesInsert200ResponseMetaAffectedPagesItemRevision getRevision() { + return revision; + } + + @JsonProperty("weakAnnotationState") + public DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState getWeakAnnotationState() { + return weakAnnotationState; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaAffectedPagesItem + && equalTo((DocPagesInsert200ResponseMetaAffectedPagesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaAffectedPagesItem other) { + return pageObjectNumber == other.pageObjectNumber + && revision.equals(other.revision) + && weakAnnotationState.equals(other.weakAnnotationState); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pageObjectNumber, this.revision, this.weakAnnotationState); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PageObjectNumberStage builder() { + return new Builder(); + } + + public interface PageObjectNumberStage { + RevisionStage pageObjectNumber(int pageObjectNumber); + + Builder from(DocPagesInsert200ResponseMetaAffectedPagesItem other); + } + + public interface RevisionStage { + WeakAnnotationStateStage revision(@NotNull DocPagesInsert200ResponseMetaAffectedPagesItemRevision revision); + } + + public interface WeakAnnotationStateStage { + _FinalStage weakAnnotationState( + @NotNull DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaAffectedPagesItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements PageObjectNumberStage, RevisionStage, WeakAnnotationStateStage, _FinalStage { + private int pageObjectNumber; + + private DocPagesInsert200ResponseMetaAffectedPagesItemRevision revision; + + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaAffectedPagesItem other) { + pageObjectNumber(other.getPageObjectNumber()); + revision(other.getRevision()); + weakAnnotationState(other.getWeakAnnotationState()); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public RevisionStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("revision") + public WeakAnnotationStateStage revision( + @NotNull DocPagesInsert200ResponseMetaAffectedPagesItemRevision revision) { + this.revision = Objects.requireNonNull(revision, "revision must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("weakAnnotationState") + public _FinalStage weakAnnotationState( + @NotNull DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState) { + this.weakAnnotationState = + Objects.requireNonNull(weakAnnotationState, "weakAnnotationState must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaAffectedPagesItem build() { + return new DocPagesInsert200ResponseMetaAffectedPagesItem( + pageObjectNumber, revision, weakAnnotationState, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.java new file mode 100644 index 0000000..65de971 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaAffectedPagesItemRevision.Builder.class) +public final class DocPagesInsert200ResponseMetaAffectedPagesItemRevision { + private final String docSessionId; + + private final int pageObjectNumber; + + private final int generation; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaAffectedPagesItemRevision( + String docSessionId, int pageObjectNumber, int generation, Map additionalProperties) { + this.docSessionId = docSessionId; + this.pageObjectNumber = pageObjectNumber; + this.generation = generation; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("docSessionId") + public String getDocSessionId() { + return docSessionId; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("generation") + public int getGeneration() { + return generation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaAffectedPagesItemRevision + && equalTo((DocPagesInsert200ResponseMetaAffectedPagesItemRevision) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaAffectedPagesItemRevision other) { + return docSessionId.equals(other.docSessionId) + && pageObjectNumber == other.pageObjectNumber + && generation == other.generation; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.docSessionId, this.pageObjectNumber, this.generation); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DocSessionIdStage builder() { + return new Builder(); + } + + public interface DocSessionIdStage { + PageObjectNumberStage docSessionId(@NotNull String docSessionId); + + Builder from(DocPagesInsert200ResponseMetaAffectedPagesItemRevision other); + } + + public interface PageObjectNumberStage { + GenerationStage pageObjectNumber(int pageObjectNumber); + } + + public interface GenerationStage { + _FinalStage generation(int generation); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaAffectedPagesItemRevision build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DocSessionIdStage, PageObjectNumberStage, GenerationStage, _FinalStage { + private String docSessionId; + + private int pageObjectNumber; + + private int generation; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaAffectedPagesItemRevision other) { + docSessionId(other.getDocSessionId()); + pageObjectNumber(other.getPageObjectNumber()); + generation(other.getGeneration()); + return this; + } + + @java.lang.Override + @JsonSetter("docSessionId") + public PageObjectNumberStage docSessionId(@NotNull String docSessionId) { + this.docSessionId = Objects.requireNonNull(docSessionId, "docSessionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public GenerationStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("generation") + public _FinalStage generation(int generation) { + this.generation = generation; + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaAffectedPagesItemRevision build() { + return new DocPagesInsert200ResponseMetaAffectedPagesItemRevision( + docSessionId, pageObjectNumber, generation, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.java new file mode 100644 index 0000000..9cdae35 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.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 DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState unknown( + DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value) { + return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState(new UnknownValue(value)); + } + + public static DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState known( + DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value) { + return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState(new KnownValue(value)); + } + + public boolean isUnknown() { + return value instanceof UnknownValue; + } + + public boolean isKnown() { + return value instanceof KnownValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getUnknown() { + if (isUnknown()) { + return Optional.of(((UnknownValue) value).value); + } + return Optional.empty(); + } + + public Optional getKnown() { + if (isKnown()) { + return Optional.of(((KnownValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState + && value.equals(((DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitUnknown(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown unknown); + + T visitKnown(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown known); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(UnknownValue.class), @JsonSubTypes.Type(KnownValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("unknown") + @JsonIgnoreProperties("kind") + private static final class UnknownValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "kind", allowSetters = true) + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnknownValue() {} + + private UnknownValue(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor 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 value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "value: " + value + "}"; + } + } + + @JsonTypeName("known") + @JsonIgnoreProperties("kind") + private static final class KnownValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "kind", allowSetters = true) + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private KnownValue() {} + + private KnownValue(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitKnown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof KnownValue && equalTo((KnownValue) other); + } + + private boolean equalTo(KnownValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("kind") + 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 visit(Visitor 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 "DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "type: " + type + ", value: " + + value + "}"; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java new file mode 100644 index 0000000..332cb70 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.Builder.class) +public final class DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown { + private final boolean hasAnyWeakAnnotations; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown( + boolean hasAnyWeakAnnotations, Map additionalProperties) { + this.hasAnyWeakAnnotations = hasAnyWeakAnnotations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("hasAnyWeakAnnotations") + public boolean getHasAnyWeakAnnotations() { + return hasAnyWeakAnnotations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown + && equalTo((DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other) { + return hasAnyWeakAnnotations == other.hasAnyWeakAnnotations; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hasAnyWeakAnnotations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasAnyWeakAnnotationsStage builder() { + return new Builder(); + } + + public interface HasAnyWeakAnnotationsStage { + _FinalStage hasAnyWeakAnnotations(boolean hasAnyWeakAnnotations); + + Builder from(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HasAnyWeakAnnotationsStage, _FinalStage { + private boolean hasAnyWeakAnnotations; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other) { + hasAnyWeakAnnotations(other.getHasAnyWeakAnnotations()); + return this; + } + + @java.lang.Override + @JsonSetter("hasAnyWeakAnnotations") + public _FinalStage hasAnyWeakAnnotations(boolean hasAnyWeakAnnotations) { + this.hasAnyWeakAnnotations = hasAnyWeakAnnotations; + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown build() { + return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown( + hasAnyWeakAnnotations, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java new file mode 100644 index 0000000..e472539 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.Builder.class) +public final class DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown { + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown( + Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown other) { + return this; + } + + public DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown build() { + return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown(additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDelta.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDelta.java new file mode 100644 index 0000000..9c2e599 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDelta.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaCacheDelta.Builder.class) +public final class DocPagesInsert200ResponseMetaCacheDelta { + private final int previousDocVersion; + + private final int docVersion; + + private final List pages; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaCacheDelta( + int previousDocVersion, + int docVersion, + List pages, + Map additionalProperties) { + this.previousDocVersion = previousDocVersion; + this.docVersion = docVersion; + this.pages = pages; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("previousDocVersion") + public int getPreviousDocVersion() { + return previousDocVersion; + } + + @JsonProperty("docVersion") + public int getDocVersion() { + return docVersion; + } + + @JsonProperty("pages") + public List getPages() { + return pages; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaCacheDelta + && equalTo((DocPagesInsert200ResponseMetaCacheDelta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaCacheDelta other) { + return previousDocVersion == other.previousDocVersion + && docVersion == other.docVersion + && pages.equals(other.pages); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.previousDocVersion, this.docVersion, this.pages); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PreviousDocVersionStage builder() { + return new Builder(); + } + + public interface PreviousDocVersionStage { + DocVersionStage previousDocVersion(int previousDocVersion); + + Builder from(DocPagesInsert200ResponseMetaCacheDelta other); + } + + public interface DocVersionStage { + _FinalStage docVersion(int docVersion); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaCacheDelta build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage pages(List pages); + + _FinalStage addPages(DocPagesInsert200ResponseMetaCacheDeltaPagesItem pages); + + _FinalStage addAllPages(List pages); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PreviousDocVersionStage, DocVersionStage, _FinalStage { + private int previousDocVersion; + + private int docVersion; + + private List pages = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaCacheDelta other) { + previousDocVersion(other.getPreviousDocVersion()); + docVersion(other.getDocVersion()); + pages(other.getPages()); + return this; + } + + @java.lang.Override + @JsonSetter("previousDocVersion") + public DocVersionStage previousDocVersion(int previousDocVersion) { + this.previousDocVersion = previousDocVersion; + return this; + } + + @java.lang.Override + @JsonSetter("docVersion") + public _FinalStage docVersion(int docVersion) { + this.docVersion = docVersion; + return this; + } + + @java.lang.Override + public _FinalStage addAllPages(List pages) { + if (pages != null) { + this.pages.addAll(pages); + } + return this; + } + + @java.lang.Override + public _FinalStage addPages(DocPagesInsert200ResponseMetaCacheDeltaPagesItem pages) { + this.pages.add(pages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pages", nulls = Nulls.SKIP) + public _FinalStage pages(List pages) { + this.pages.clear(); + if (pages != null) { + this.pages.addAll(pages); + } + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaCacheDelta build() { + return new DocPagesInsert200ResponseMetaCacheDelta( + previousDocVersion, docVersion, pages, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.java new file mode 100644 index 0000000..bee4dd0 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaCacheDeltaPagesItem.Builder.class) +public final class DocPagesInsert200ResponseMetaCacheDeltaPagesItem { + private final int pageObjectNumber; + + private final DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache cache; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaCacheDeltaPagesItem( + int pageObjectNumber, + DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache cache, + Map additionalProperties) { + this.pageObjectNumber = pageObjectNumber; + this.cache = cache; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("cache") + public DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache getCache() { + return cache; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaCacheDeltaPagesItem + && equalTo((DocPagesInsert200ResponseMetaCacheDeltaPagesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaCacheDeltaPagesItem other) { + return pageObjectNumber == other.pageObjectNumber && cache.equals(other.cache); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pageObjectNumber, this.cache); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PageObjectNumberStage builder() { + return new Builder(); + } + + public interface PageObjectNumberStage { + CacheStage pageObjectNumber(int pageObjectNumber); + + Builder from(DocPagesInsert200ResponseMetaCacheDeltaPagesItem other); + } + + public interface CacheStage { + _FinalStage cache(@NotNull DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache cache); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaCacheDeltaPagesItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PageObjectNumberStage, CacheStage, _FinalStage { + private int pageObjectNumber; + + private DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache cache; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaCacheDeltaPagesItem other) { + pageObjectNumber(other.getPageObjectNumber()); + cache(other.getCache()); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public CacheStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("cache") + public _FinalStage cache(@NotNull DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache cache) { + this.cache = Objects.requireNonNull(cache, "cache must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaCacheDeltaPagesItem build() { + return new DocPagesInsert200ResponseMetaCacheDeltaPagesItem(pageObjectNumber, cache, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.java b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.java new file mode 100644 index 0000000..782bf32 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.Builder.class) +public final class DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache { + private final int contentVersion; + + private final int annotationVersion; + + private final Map additionalProperties; + + private DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache( + int contentVersion, int annotationVersion, Map additionalProperties) { + this.contentVersion = contentVersion; + this.annotationVersion = annotationVersion; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("contentVersion") + public int getContentVersion() { + return contentVersion; + } + + @JsonProperty("annotationVersion") + public int getAnnotationVersion() { + return annotationVersion; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache + && equalTo((DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache other) { + return contentVersion == other.contentVersion && annotationVersion == other.annotationVersion; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.contentVersion, this.annotationVersion); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ContentVersionStage builder() { + return new Builder(); + } + + public interface ContentVersionStage { + AnnotationVersionStage contentVersion(int contentVersion); + + Builder from(DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache other); + } + + public interface AnnotationVersionStage { + _FinalStage annotationVersion(int annotationVersion); + } + + public interface _FinalStage { + DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ContentVersionStage, AnnotationVersionStage, _FinalStage { + private int contentVersion; + + private int annotationVersion; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache other) { + contentVersion(other.getContentVersion()); + annotationVersion(other.getAnnotationVersion()); + return this; + } + + @java.lang.Override + @JsonSetter("contentVersion") + public AnnotationVersionStage contentVersion(int contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + @java.lang.Override + @JsonSetter("annotationVersion") + public _FinalStage annotationVersion(int annotationVersion) { + this.annotationVersion = annotationVersion; + return this; + } + + @java.lang.Override + public DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache build() { + return new DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache( + contentVersion, annotationVersion, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert400Response.java b/src/main/java/api/types/DocPagesInsert400Response.java new file mode 100644 index 0000000..c5399fb --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert400Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert400Response.Builder.class) +public final class DocPagesInsert400Response { + private final DocPagesInsert400ResponseName name; + + private final DocPagesInsert400ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesInsert400Response( + DocPagesInsert400ResponseName name, + DocPagesInsert400ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesInsert400ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesInsert400ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert400Response && equalTo((DocPagesInsert400Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert400Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesInsert400ResponseName name); + + Builder from(DocPagesInsert400Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesInsert400ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesInsert400Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesInsert400ResponseName name; + + private DocPagesInsert400ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert400Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesInsert400ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesInsert400ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesInsert400Response build() { + return new DocPagesInsert400Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert400ResponseCode.java b/src/main/java/api/types/DocPagesInsert400ResponseCode.java new file mode 100644 index 0000000..876c85e --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert400ResponseCode.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsert400ResponseCode { + public static final DocPagesInsert400ResponseCode MALFORMED_PDF = + new DocPagesInsert400ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesInsert400ResponseCode UNKNOWN = + new DocPagesInsert400ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesInsert400ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesInsert400ResponseCode(Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesInsert400ResponseCode WIRE_FORMAT = + new DocPagesInsert400ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesInsert400ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesInsert400ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesInsert400ResponseCode UNAUTHENTICATED = + new DocPagesInsert400ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesInsert400ResponseCode FORBIDDEN = + new DocPagesInsert400ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesInsert400ResponseCode DOC_OPEN_FAILED = + new DocPagesInsert400ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesInsert400ResponseCode NOT_FOUND = + new DocPagesInsert400ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesInsert400ResponseCode ABORTED = + new DocPagesInsert400ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesInsert400ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesInsert400ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesInsert400ResponseCode INVALID_ARG = + new DocPagesInsert400ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesInsert400ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesInsert400ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesInsert400ResponseCode NETWORK = + new DocPagesInsert400ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesInsert400ResponseCode INVALID_REFERENCE = + new DocPagesInsert400ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesInsert400ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesInsert400ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesInsert400ResponseCode DOC_NOT_OPEN = + new DocPagesInsert400ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesInsert400ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesInsert400ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesInsert400ResponseCode NOT_IMPLEMENTED = + new DocPagesInsert400ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesInsert400ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsert400ResponseCode + && this.string.equals(((DocPagesInsert400ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsert400ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesInsert400ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsert400ResponseName.java b/src/main/java/api/types/DocPagesInsert400ResponseName.java new file mode 100644 index 0000000..4fd5af6 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert400ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsert400ResponseName { + public static final DocPagesInsert400ResponseName ENGINE_ERROR = + new DocPagesInsert400ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesInsert400ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsert400ResponseName + && this.string.equals(((DocPagesInsert400ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsert400ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesInsert400ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsert404Response.java b/src/main/java/api/types/DocPagesInsert404Response.java new file mode 100644 index 0000000..d4e9492 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert404Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsert404Response.Builder.class) +public final class DocPagesInsert404Response { + private final DocPagesInsert404ResponseName name; + + private final DocPagesInsert404ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesInsert404Response( + DocPagesInsert404ResponseName name, + DocPagesInsert404ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesInsert404ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesInsert404ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsert404Response && equalTo((DocPagesInsert404Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsert404Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesInsert404ResponseName name); + + Builder from(DocPagesInsert404Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesInsert404ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesInsert404Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesInsert404ResponseName name; + + private DocPagesInsert404ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsert404Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesInsert404ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesInsert404ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesInsert404Response build() { + return new DocPagesInsert404Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsert404ResponseCode.java b/src/main/java/api/types/DocPagesInsert404ResponseCode.java new file mode 100644 index 0000000..6133fac --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert404ResponseCode.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsert404ResponseCode { + public static final DocPagesInsert404ResponseCode MALFORMED_PDF = + new DocPagesInsert404ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesInsert404ResponseCode UNKNOWN = + new DocPagesInsert404ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesInsert404ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesInsert404ResponseCode(Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesInsert404ResponseCode WIRE_FORMAT = + new DocPagesInsert404ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesInsert404ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesInsert404ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesInsert404ResponseCode UNAUTHENTICATED = + new DocPagesInsert404ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesInsert404ResponseCode FORBIDDEN = + new DocPagesInsert404ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesInsert404ResponseCode DOC_OPEN_FAILED = + new DocPagesInsert404ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesInsert404ResponseCode NOT_FOUND = + new DocPagesInsert404ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesInsert404ResponseCode ABORTED = + new DocPagesInsert404ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesInsert404ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesInsert404ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesInsert404ResponseCode INVALID_ARG = + new DocPagesInsert404ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesInsert404ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesInsert404ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesInsert404ResponseCode NETWORK = + new DocPagesInsert404ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesInsert404ResponseCode INVALID_REFERENCE = + new DocPagesInsert404ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesInsert404ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesInsert404ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesInsert404ResponseCode DOC_NOT_OPEN = + new DocPagesInsert404ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesInsert404ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesInsert404ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesInsert404ResponseCode NOT_IMPLEMENTED = + new DocPagesInsert404ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesInsert404ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsert404ResponseCode + && this.string.equals(((DocPagesInsert404ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsert404ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesInsert404ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsert404ResponseName.java b/src/main/java/api/types/DocPagesInsert404ResponseName.java new file mode 100644 index 0000000..bce4e37 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsert404ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsert404ResponseName { + public static final DocPagesInsert404ResponseName ENGINE_ERROR = + new DocPagesInsert404ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesInsert404ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsert404ResponseName + && this.string.equals(((DocPagesInsert404ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsert404ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesInsert404ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200Response.java b/src/main/java/api/types/DocPagesInsertBlank200Response.java new file mode 100644 index 0000000..650e451 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200Response.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200Response.Builder.class) +public final class DocPagesInsertBlank200Response { + private final DocPagesInsertBlank200ResponseMeta meta; + + private final Map additionalProperties; + + private DocPagesInsertBlank200Response( + DocPagesInsertBlank200ResponseMeta meta, Map additionalProperties) { + this.meta = meta; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("meta") + public DocPagesInsertBlank200ResponseMeta getMeta() { + return meta; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200Response && equalTo((DocPagesInsertBlank200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200Response other) { + return meta.equals(other.meta); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.meta); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MetaStage builder() { + return new Builder(); + } + + public interface MetaStage { + _FinalStage meta(@NotNull DocPagesInsertBlank200ResponseMeta meta); + + Builder from(DocPagesInsertBlank200Response other); + } + + public interface _FinalStage { + DocPagesInsertBlank200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MetaStage, _FinalStage { + private DocPagesInsertBlank200ResponseMeta meta; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200Response other) { + meta(other.getMeta()); + return this; + } + + @java.lang.Override + @JsonSetter("meta") + public _FinalStage meta(@NotNull DocPagesInsertBlank200ResponseMeta meta) { + this.meta = Objects.requireNonNull(meta, "meta must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200Response build() { + return new DocPagesInsertBlank200Response(meta, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMeta.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMeta.java new file mode 100644 index 0000000..5b86e6b --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMeta.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.core.Nullable; +import com.cloudpdf.api.core.NullableNonemptyFilter; +import com.cloudpdf.api.core.ObjectMappers; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.util.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 = DocPagesInsertBlank200ResponseMeta.Builder.class) +public final class DocPagesInsertBlank200ResponseMeta { + private final List affectedPages; + + private final Optional cacheDelta; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMeta( + List affectedPages, + Optional cacheDelta, + Map additionalProperties) { + this.affectedPages = affectedPages; + this.cacheDelta = cacheDelta; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("affectedPages") + public List getAffectedPages() { + return affectedPages; + } + + @JsonIgnore + public Optional getCacheDelta() { + if (cacheDelta == null) { + return Optional.empty(); + } + return cacheDelta; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cacheDelta") + private Optional _getCacheDelta() { + return cacheDelta; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMeta + && equalTo((DocPagesInsertBlank200ResponseMeta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMeta other) { + return affectedPages.equals(other.affectedPages) && cacheDelta.equals(other.cacheDelta); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.affectedPages, this.cacheDelta); + } + + @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 affectedPages = new ArrayList<>(); + + private Optional cacheDelta = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DocPagesInsertBlank200ResponseMeta other) { + affectedPages(other.getAffectedPages()); + cacheDelta(other.getCacheDelta()); + return this; + } + + @JsonSetter(value = "affectedPages", nulls = Nulls.SKIP) + public Builder affectedPages(List affectedPages) { + this.affectedPages.clear(); + if (affectedPages != null) { + this.affectedPages.addAll(affectedPages); + } + return this; + } + + public Builder addAffectedPages(DocPagesInsertBlank200ResponseMetaAffectedPagesItem affectedPages) { + this.affectedPages.add(affectedPages); + return this; + } + + public Builder addAllAffectedPages(List affectedPages) { + if (affectedPages != null) { + this.affectedPages.addAll(affectedPages); + } + return this; + } + + @JsonSetter(value = "cacheDelta", nulls = Nulls.SKIP) + public Builder cacheDelta(Optional cacheDelta) { + this.cacheDelta = cacheDelta; + return this; + } + + public Builder cacheDelta(DocPagesInsertBlank200ResponseMetaCacheDelta cacheDelta) { + this.cacheDelta = Optional.ofNullable(cacheDelta); + return this; + } + + public Builder cacheDelta(Nullable cacheDelta) { + if (cacheDelta.isNull()) { + this.cacheDelta = null; + } else if (cacheDelta.isEmpty()) { + this.cacheDelta = Optional.empty(); + } else { + this.cacheDelta = Optional.of(cacheDelta.get()); + } + return this; + } + + public DocPagesInsertBlank200ResponseMeta build() { + return new DocPagesInsertBlank200ResponseMeta(affectedPages, cacheDelta, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.java new file mode 100644 index 0000000..bd87a8d --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.java @@ -0,0 +1,176 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaAffectedPagesItem.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaAffectedPagesItem { + private final int pageObjectNumber; + + private final DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision revision; + + private final DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItem( + int pageObjectNumber, + DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision revision, + DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState, + Map additionalProperties) { + this.pageObjectNumber = pageObjectNumber; + this.revision = revision; + this.weakAnnotationState = weakAnnotationState; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("revision") + public DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision getRevision() { + return revision; + } + + @JsonProperty("weakAnnotationState") + public DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState getWeakAnnotationState() { + return weakAnnotationState; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItem + && equalTo((DocPagesInsertBlank200ResponseMetaAffectedPagesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaAffectedPagesItem other) { + return pageObjectNumber == other.pageObjectNumber + && revision.equals(other.revision) + && weakAnnotationState.equals(other.weakAnnotationState); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pageObjectNumber, this.revision, this.weakAnnotationState); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PageObjectNumberStage builder() { + return new Builder(); + } + + public interface PageObjectNumberStage { + RevisionStage pageObjectNumber(int pageObjectNumber); + + Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItem other); + } + + public interface RevisionStage { + WeakAnnotationStateStage revision( + @NotNull DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision revision); + } + + public interface WeakAnnotationStateStage { + _FinalStage weakAnnotationState( + @NotNull DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaAffectedPagesItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements PageObjectNumberStage, RevisionStage, WeakAnnotationStateStage, _FinalStage { + private int pageObjectNumber; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision revision; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItem other) { + pageObjectNumber(other.getPageObjectNumber()); + revision(other.getRevision()); + weakAnnotationState(other.getWeakAnnotationState()); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public RevisionStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("revision") + public WeakAnnotationStateStage revision( + @NotNull DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision revision) { + this.revision = Objects.requireNonNull(revision, "revision must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("weakAnnotationState") + public _FinalStage weakAnnotationState( + @NotNull DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState weakAnnotationState) { + this.weakAnnotationState = + Objects.requireNonNull(weakAnnotationState, "weakAnnotationState must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaAffectedPagesItem build() { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItem( + pageObjectNumber, revision, weakAnnotationState, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.java new file mode 100644 index 0000000..9a511f5 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision { + private final String docSessionId; + + private final int pageObjectNumber; + + private final int generation; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision( + String docSessionId, int pageObjectNumber, int generation, Map additionalProperties) { + this.docSessionId = docSessionId; + this.pageObjectNumber = pageObjectNumber; + this.generation = generation; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("docSessionId") + public String getDocSessionId() { + return docSessionId; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("generation") + public int getGeneration() { + return generation; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision + && equalTo((DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision other) { + return docSessionId.equals(other.docSessionId) + && pageObjectNumber == other.pageObjectNumber + && generation == other.generation; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.docSessionId, this.pageObjectNumber, this.generation); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DocSessionIdStage builder() { + return new Builder(); + } + + public interface DocSessionIdStage { + PageObjectNumberStage docSessionId(@NotNull String docSessionId); + + Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision other); + } + + public interface PageObjectNumberStage { + GenerationStage pageObjectNumber(int pageObjectNumber); + } + + public interface GenerationStage { + _FinalStage generation(int generation); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements DocSessionIdStage, PageObjectNumberStage, GenerationStage, _FinalStage { + private String docSessionId; + + private int pageObjectNumber; + + private int generation; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision other) { + docSessionId(other.getDocSessionId()); + pageObjectNumber(other.getPageObjectNumber()); + generation(other.getGeneration()); + return this; + } + + @java.lang.Override + @JsonSetter("docSessionId") + public PageObjectNumberStage docSessionId(@NotNull String docSessionId) { + this.docSessionId = Objects.requireNonNull(docSessionId, "docSessionId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public GenerationStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("generation") + public _FinalStage generation(int generation) { + this.generation = generation; + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision build() { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision( + docSessionId, pageObjectNumber, generation, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.java new file mode 100644 index 0000000..7955ba3 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.java @@ -0,0 +1,225 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.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 DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState unknown( + DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value) { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState(new UnknownValue(value)); + } + + public static DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState known( + DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value) { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState(new KnownValue(value)); + } + + public boolean isUnknown() { + return value instanceof UnknownValue; + } + + public boolean isKnown() { + return value instanceof KnownValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getUnknown() { + if (isUnknown()) { + return Optional.of(((UnknownValue) value).value); + } + return Optional.empty(); + } + + public Optional getKnown() { + if (isKnown()) { + return Optional.of(((KnownValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState + && value.equals(((DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitUnknown(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown unknown); + + T visitKnown(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown known); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({@JsonSubTypes.Type(UnknownValue.class), @JsonSubTypes.Type(KnownValue.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("unknown") + @JsonIgnoreProperties("kind") + private static final class UnknownValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "kind", allowSetters = true) + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnknownValue() {} + + private UnknownValue(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor 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 value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "value: " + value + "}"; + } + } + + @JsonTypeName("known") + @JsonIgnoreProperties("kind") + private static final class KnownValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "kind", allowSetters = true) + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private KnownValue() {} + + private KnownValue(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitKnown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof KnownValue && equalTo((KnownValue) other); + } + + private boolean equalTo(KnownValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("kind") + 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 visit(Visitor 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 "DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState{" + "type: " + type + + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java new file mode 100644 index 0000000..40090dd --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown { + private final boolean hasAnyWeakAnnotations; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown( + boolean hasAnyWeakAnnotations, Map additionalProperties) { + this.hasAnyWeakAnnotations = hasAnyWeakAnnotations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("hasAnyWeakAnnotations") + public boolean getHasAnyWeakAnnotations() { + return hasAnyWeakAnnotations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown + && equalTo((DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other) { + return hasAnyWeakAnnotations == other.hasAnyWeakAnnotations; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.hasAnyWeakAnnotations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HasAnyWeakAnnotationsStage builder() { + return new Builder(); + } + + public interface HasAnyWeakAnnotationsStage { + _FinalStage hasAnyWeakAnnotations(boolean hasAnyWeakAnnotations); + + Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HasAnyWeakAnnotationsStage, _FinalStage { + private boolean hasAnyWeakAnnotations; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown other) { + hasAnyWeakAnnotations(other.getHasAnyWeakAnnotations()); + return this; + } + + @java.lang.Override + @JsonSetter("hasAnyWeakAnnotations") + public _FinalStage hasAnyWeakAnnotations(boolean hasAnyWeakAnnotations) { + this.hasAnyWeakAnnotations = hasAnyWeakAnnotations; + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown build() { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown( + hasAnyWeakAnnotations, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java new file mode 100644 index 0000000..e666140 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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.databind.annotation.JsonDeserialize; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown { + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown( + Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown other) { + return this; + } + + public DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown build() { + return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown( + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDelta.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDelta.java new file mode 100644 index 0000000..66c1587 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDelta.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaCacheDelta.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaCacheDelta { + private final int previousDocVersion; + + private final int docVersion; + + private final List pages; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaCacheDelta( + int previousDocVersion, + int docVersion, + List pages, + Map additionalProperties) { + this.previousDocVersion = previousDocVersion; + this.docVersion = docVersion; + this.pages = pages; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("previousDocVersion") + public int getPreviousDocVersion() { + return previousDocVersion; + } + + @JsonProperty("docVersion") + public int getDocVersion() { + return docVersion; + } + + @JsonProperty("pages") + public List getPages() { + return pages; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaCacheDelta + && equalTo((DocPagesInsertBlank200ResponseMetaCacheDelta) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaCacheDelta other) { + return previousDocVersion == other.previousDocVersion + && docVersion == other.docVersion + && pages.equals(other.pages); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.previousDocVersion, this.docVersion, this.pages); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PreviousDocVersionStage builder() { + return new Builder(); + } + + public interface PreviousDocVersionStage { + DocVersionStage previousDocVersion(int previousDocVersion); + + Builder from(DocPagesInsertBlank200ResponseMetaCacheDelta other); + } + + public interface DocVersionStage { + _FinalStage docVersion(int docVersion); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaCacheDelta build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage pages(List pages); + + _FinalStage addPages(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem pages); + + _FinalStage addAllPages(List pages); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PreviousDocVersionStage, DocVersionStage, _FinalStage { + private int previousDocVersion; + + private int docVersion; + + private List pages = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaCacheDelta other) { + previousDocVersion(other.getPreviousDocVersion()); + docVersion(other.getDocVersion()); + pages(other.getPages()); + return this; + } + + @java.lang.Override + @JsonSetter("previousDocVersion") + public DocVersionStage previousDocVersion(int previousDocVersion) { + this.previousDocVersion = previousDocVersion; + return this; + } + + @java.lang.Override + @JsonSetter("docVersion") + public _FinalStage docVersion(int docVersion) { + this.docVersion = docVersion; + return this; + } + + @java.lang.Override + public _FinalStage addAllPages(List pages) { + if (pages != null) { + this.pages.addAll(pages); + } + return this; + } + + @java.lang.Override + public _FinalStage addPages(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem pages) { + this.pages.add(pages); + return this; + } + + @java.lang.Override + @JsonSetter(value = "pages", nulls = Nulls.SKIP) + public _FinalStage pages(List pages) { + this.pages.clear(); + if (pages != null) { + this.pages.addAll(pages); + } + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaCacheDelta build() { + return new DocPagesInsertBlank200ResponseMetaCacheDelta( + previousDocVersion, docVersion, pages, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.java new file mode 100644 index 0000000..414d99f --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem { + private final int pageObjectNumber; + + private final DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache cache; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem( + int pageObjectNumber, + DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache cache, + Map additionalProperties) { + this.pageObjectNumber = pageObjectNumber; + this.cache = cache; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pageObjectNumber") + public int getPageObjectNumber() { + return pageObjectNumber; + } + + @JsonProperty("cache") + public DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache getCache() { + return cache; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem + && equalTo((DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem other) { + return pageObjectNumber == other.pageObjectNumber && cache.equals(other.cache); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pageObjectNumber, this.cache); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PageObjectNumberStage builder() { + return new Builder(); + } + + public interface PageObjectNumberStage { + CacheStage pageObjectNumber(int pageObjectNumber); + + Builder from(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem other); + } + + public interface CacheStage { + _FinalStage cache(@NotNull DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache cache); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PageObjectNumberStage, CacheStage, _FinalStage { + private int pageObjectNumber; + + private DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache cache; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem other) { + pageObjectNumber(other.getPageObjectNumber()); + cache(other.getCache()); + return this; + } + + @java.lang.Override + @JsonSetter("pageObjectNumber") + public CacheStage pageObjectNumber(int pageObjectNumber) { + this.pageObjectNumber = pageObjectNumber; + return this; + } + + @java.lang.Override + @JsonSetter("cache") + public _FinalStage cache(@NotNull DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache cache) { + this.cache = Objects.requireNonNull(cache, "cache must not be null"); + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem build() { + return new DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem( + pageObjectNumber, cache, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.java b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.java new file mode 100644 index 0000000..163780a --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.Builder.class) +public final class DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache { + private final int contentVersion; + + private final int annotationVersion; + + private final Map additionalProperties; + + private DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache( + int contentVersion, int annotationVersion, Map additionalProperties) { + this.contentVersion = contentVersion; + this.annotationVersion = annotationVersion; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("contentVersion") + public int getContentVersion() { + return contentVersion; + } + + @JsonProperty("annotationVersion") + public int getAnnotationVersion() { + return annotationVersion; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache + && equalTo((DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache other) { + return contentVersion == other.contentVersion && annotationVersion == other.annotationVersion; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.contentVersion, this.annotationVersion); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ContentVersionStage builder() { + return new Builder(); + } + + public interface ContentVersionStage { + AnnotationVersionStage contentVersion(int contentVersion); + + Builder from(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache other); + } + + public interface AnnotationVersionStage { + _FinalStage annotationVersion(int annotationVersion); + } + + public interface _FinalStage { + DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ContentVersionStage, AnnotationVersionStage, _FinalStage { + private int contentVersion; + + private int annotationVersion; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache other) { + contentVersion(other.getContentVersion()); + annotationVersion(other.getAnnotationVersion()); + return this; + } + + @java.lang.Override + @JsonSetter("contentVersion") + public AnnotationVersionStage contentVersion(int contentVersion) { + this.contentVersion = contentVersion; + return this; + } + + @java.lang.Override + @JsonSetter("annotationVersion") + public _FinalStage annotationVersion(int annotationVersion) { + this.annotationVersion = annotationVersion; + return this; + } + + @java.lang.Override + public DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache build() { + return new DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache( + contentVersion, annotationVersion, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank400Response.java b/src/main/java/api/types/DocPagesInsertBlank400Response.java new file mode 100644 index 0000000..4293aef --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank400Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank400Response.Builder.class) +public final class DocPagesInsertBlank400Response { + private final DocPagesInsertBlank400ResponseName name; + + private final DocPagesInsertBlank400ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesInsertBlank400Response( + DocPagesInsertBlank400ResponseName name, + DocPagesInsertBlank400ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesInsertBlank400ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesInsertBlank400ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank400Response && equalTo((DocPagesInsertBlank400Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank400Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesInsertBlank400ResponseName name); + + Builder from(DocPagesInsertBlank400Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesInsertBlank400ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesInsertBlank400Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesInsertBlank400ResponseName name; + + private DocPagesInsertBlank400ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank400Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesInsertBlank400ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesInsertBlank400ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesInsertBlank400Response build() { + return new DocPagesInsertBlank400Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank400ResponseCode.java b/src/main/java/api/types/DocPagesInsertBlank400ResponseCode.java new file mode 100644 index 0000000..bbc2e3f --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank400ResponseCode.java @@ -0,0 +1,274 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsertBlank400ResponseCode { + public static final DocPagesInsertBlank400ResponseCode MALFORMED_PDF = + new DocPagesInsertBlank400ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesInsertBlank400ResponseCode UNKNOWN = + new DocPagesInsertBlank400ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesInsertBlank400ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesInsertBlank400ResponseCode( + Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesInsertBlank400ResponseCode WIRE_FORMAT = + new DocPagesInsertBlank400ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesInsertBlank400ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesInsertBlank400ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesInsertBlank400ResponseCode UNAUTHENTICATED = + new DocPagesInsertBlank400ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesInsertBlank400ResponseCode FORBIDDEN = + new DocPagesInsertBlank400ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesInsertBlank400ResponseCode DOC_OPEN_FAILED = + new DocPagesInsertBlank400ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesInsertBlank400ResponseCode NOT_FOUND = + new DocPagesInsertBlank400ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesInsertBlank400ResponseCode ABORTED = + new DocPagesInsertBlank400ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesInsertBlank400ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesInsertBlank400ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesInsertBlank400ResponseCode INVALID_ARG = + new DocPagesInsertBlank400ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesInsertBlank400ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesInsertBlank400ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesInsertBlank400ResponseCode NETWORK = + new DocPagesInsertBlank400ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesInsertBlank400ResponseCode INVALID_REFERENCE = + new DocPagesInsertBlank400ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesInsertBlank400ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesInsertBlank400ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesInsertBlank400ResponseCode DOC_NOT_OPEN = + new DocPagesInsertBlank400ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesInsertBlank400ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesInsertBlank400ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesInsertBlank400ResponseCode NOT_IMPLEMENTED = + new DocPagesInsertBlank400ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesInsertBlank400ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsertBlank400ResponseCode + && this.string.equals(((DocPagesInsertBlank400ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsertBlank400ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesInsertBlank400ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank400ResponseName.java b/src/main/java/api/types/DocPagesInsertBlank400ResponseName.java new file mode 100644 index 0000000..abc4fee --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank400ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsertBlank400ResponseName { + public static final DocPagesInsertBlank400ResponseName ENGINE_ERROR = + new DocPagesInsertBlank400ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesInsertBlank400ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsertBlank400ResponseName + && this.string.equals(((DocPagesInsertBlank400ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsertBlank400ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesInsertBlank400ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank404Response.java b/src/main/java/api/types/DocPagesInsertBlank404Response.java new file mode 100644 index 0000000..4df87c8 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank404Response.java @@ -0,0 +1,200 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.cloudpdf.api.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 = DocPagesInsertBlank404Response.Builder.class) +public final class DocPagesInsertBlank404Response { + private final DocPagesInsertBlank404ResponseName name; + + private final DocPagesInsertBlank404ResponseCode code; + + private final String message; + + private final Optional> details; + + private final Map additionalProperties; + + private DocPagesInsertBlank404Response( + DocPagesInsertBlank404ResponseName name, + DocPagesInsertBlank404ResponseCode code, + String message, + Optional> details, + Map additionalProperties) { + this.name = name; + this.code = code; + this.message = message; + this.details = details; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public DocPagesInsertBlank404ResponseName getName() { + return name; + } + + @JsonProperty("code") + public DocPagesInsertBlank404ResponseCode getCode() { + return code; + } + + @JsonProperty("message") + public String getMessage() { + return message; + } + + @JsonProperty("details") + public Optional> getDetails() { + return details; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocPagesInsertBlank404Response && equalTo((DocPagesInsertBlank404Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocPagesInsertBlank404Response other) { + return name.equals(other.name) + && code.equals(other.code) + && message.equals(other.message) + && details.equals(other.details); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.code, this.message, this.details); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + CodeStage name(@NotNull DocPagesInsertBlank404ResponseName name); + + Builder from(DocPagesInsertBlank404Response other); + } + + public interface CodeStage { + MessageStage code(@NotNull DocPagesInsertBlank404ResponseCode code); + } + + public interface MessageStage { + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + DocPagesInsertBlank404Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage details(Optional> details); + + _FinalStage details(Map details); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CodeStage, MessageStage, _FinalStage { + private DocPagesInsertBlank404ResponseName name; + + private DocPagesInsertBlank404ResponseCode code; + + private String message; + + private Optional> details = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocPagesInsertBlank404Response other) { + name(other.getName()); + code(other.getCode()); + message(other.getMessage()); + details(other.getDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CodeStage name(@NotNull DocPagesInsertBlank404ResponseName name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull DocPagesInsertBlank404ResponseCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage details(Map details) { + this.details = Optional.ofNullable(details); + return this; + } + + @java.lang.Override + @JsonSetter(value = "details", nulls = Nulls.SKIP) + public _FinalStage details(Optional> details) { + this.details = details; + return this; + } + + @java.lang.Override + public DocPagesInsertBlank404Response build() { + return new DocPagesInsertBlank404Response(name, code, message, details, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank404ResponseCode.java b/src/main/java/api/types/DocPagesInsertBlank404ResponseCode.java new file mode 100644 index 0000000..2db939f --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank404ResponseCode.java @@ -0,0 +1,274 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsertBlank404ResponseCode { + public static final DocPagesInsertBlank404ResponseCode MALFORMED_PDF = + new DocPagesInsertBlank404ResponseCode(Value.MALFORMED_PDF, "MalformedPdf"); + + public static final DocPagesInsertBlank404ResponseCode UNKNOWN = + new DocPagesInsertBlank404ResponseCode(Value.UNKNOWN, "Unknown"); + + public static final DocPagesInsertBlank404ResponseCode WEAK_ANNOTATION_SESSION_CONFLICT = + new DocPagesInsertBlank404ResponseCode( + Value.WEAK_ANNOTATION_SESSION_CONFLICT, "WeakAnnotationSessionConflict"); + + public static final DocPagesInsertBlank404ResponseCode WIRE_FORMAT = + new DocPagesInsertBlank404ResponseCode(Value.WIRE_FORMAT, "WireFormat"); + + public static final DocPagesInsertBlank404ResponseCode RUNTIME_UNAVAILABLE = + new DocPagesInsertBlank404ResponseCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); + + public static final DocPagesInsertBlank404ResponseCode UNAUTHENTICATED = + new DocPagesInsertBlank404ResponseCode(Value.UNAUTHENTICATED, "Unauthenticated"); + + public static final DocPagesInsertBlank404ResponseCode FORBIDDEN = + new DocPagesInsertBlank404ResponseCode(Value.FORBIDDEN, "Forbidden"); + + public static final DocPagesInsertBlank404ResponseCode DOC_OPEN_FAILED = + new DocPagesInsertBlank404ResponseCode(Value.DOC_OPEN_FAILED, "DocOpenFailed"); + + public static final DocPagesInsertBlank404ResponseCode NOT_FOUND = + new DocPagesInsertBlank404ResponseCode(Value.NOT_FOUND, "NotFound"); + + public static final DocPagesInsertBlank404ResponseCode ABORTED = + new DocPagesInsertBlank404ResponseCode(Value.ABORTED, "Aborted"); + + public static final DocPagesInsertBlank404ResponseCode DOC_PASSWORD_REQUIRED = + new DocPagesInsertBlank404ResponseCode(Value.DOC_PASSWORD_REQUIRED, "DocPasswordRequired"); + + public static final DocPagesInsertBlank404ResponseCode INVALID_ARG = + new DocPagesInsertBlank404ResponseCode(Value.INVALID_ARG, "InvalidArg"); + + public static final DocPagesInsertBlank404ResponseCode SHARE_PASSWORD_REQUIRED = + new DocPagesInsertBlank404ResponseCode(Value.SHARE_PASSWORD_REQUIRED, "SharePasswordRequired"); + + public static final DocPagesInsertBlank404ResponseCode NETWORK = + new DocPagesInsertBlank404ResponseCode(Value.NETWORK, "Network"); + + public static final DocPagesInsertBlank404ResponseCode INVALID_REFERENCE = + new DocPagesInsertBlank404ResponseCode(Value.INVALID_REFERENCE, "InvalidReference"); + + public static final DocPagesInsertBlank404ResponseCode DOC_PASSWORD_INCORRECT = + new DocPagesInsertBlank404ResponseCode(Value.DOC_PASSWORD_INCORRECT, "DocPasswordIncorrect"); + + public static final DocPagesInsertBlank404ResponseCode DOC_NOT_OPEN = + new DocPagesInsertBlank404ResponseCode(Value.DOC_NOT_OPEN, "DocNotOpen"); + + public static final DocPagesInsertBlank404ResponseCode LAYER_VERSION_CONFLICT = + new DocPagesInsertBlank404ResponseCode(Value.LAYER_VERSION_CONFLICT, "LayerVersionConflict"); + + public static final DocPagesInsertBlank404ResponseCode NOT_IMPLEMENTED = + new DocPagesInsertBlank404ResponseCode(Value.NOT_IMPLEMENTED, "NotImplemented"); + + private final Value value; + + private final String string; + + DocPagesInsertBlank404ResponseCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsertBlank404ResponseCode + && this.string.equals(((DocPagesInsertBlank404ResponseCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MALFORMED_PDF: + return visitor.visitMalformedPdf(); + case UNKNOWN: + return visitor.visitUnknown(); + case WEAK_ANNOTATION_SESSION_CONFLICT: + return visitor.visitWeakAnnotationSessionConflict(); + case WIRE_FORMAT: + return visitor.visitWireFormat(); + case RUNTIME_UNAVAILABLE: + return visitor.visitRuntimeUnavailable(); + case UNAUTHENTICATED: + return visitor.visitUnauthenticated(); + case FORBIDDEN: + return visitor.visitForbidden(); + case DOC_OPEN_FAILED: + return visitor.visitDocOpenFailed(); + case NOT_FOUND: + return visitor.visitNotFound(); + case ABORTED: + return visitor.visitAborted(); + case DOC_PASSWORD_REQUIRED: + return visitor.visitDocPasswordRequired(); + case INVALID_ARG: + return visitor.visitInvalidArg(); + case SHARE_PASSWORD_REQUIRED: + return visitor.visitSharePasswordRequired(); + case NETWORK: + return visitor.visitNetwork(); + case INVALID_REFERENCE: + return visitor.visitInvalidReference(); + case DOC_PASSWORD_INCORRECT: + return visitor.visitDocPasswordIncorrect(); + case DOC_NOT_OPEN: + return visitor.visitDocNotOpen(); + case LAYER_VERSION_CONFLICT: + return visitor.visitLayerVersionConflict(); + case NOT_IMPLEMENTED: + return visitor.visitNotImplemented(); + case _UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsertBlank404ResponseCode valueOf(String value) { + switch (value) { + case "MalformedPdf": + return MALFORMED_PDF; + case "Unknown": + return UNKNOWN; + case "WeakAnnotationSessionConflict": + return WEAK_ANNOTATION_SESSION_CONFLICT; + case "WireFormat": + return WIRE_FORMAT; + case "RuntimeUnavailable": + return RUNTIME_UNAVAILABLE; + case "Unauthenticated": + return UNAUTHENTICATED; + case "Forbidden": + return FORBIDDEN; + case "DocOpenFailed": + return DOC_OPEN_FAILED; + case "NotFound": + return NOT_FOUND; + case "Aborted": + return ABORTED; + case "DocPasswordRequired": + return DOC_PASSWORD_REQUIRED; + case "InvalidArg": + return INVALID_ARG; + case "SharePasswordRequired": + return SHARE_PASSWORD_REQUIRED; + case "Network": + return NETWORK; + case "InvalidReference": + return INVALID_REFERENCE; + case "DocPasswordIncorrect": + return DOC_PASSWORD_INCORRECT; + case "DocNotOpen": + return DOC_NOT_OPEN; + case "LayerVersionConflict": + return LAYER_VERSION_CONFLICT; + case "NotImplemented": + return NOT_IMPLEMENTED; + default: + return new DocPagesInsertBlank404ResponseCode(Value._UNKNOWN, value); + } + } + + public enum Value { + UNKNOWN, + + INVALID_ARG, + + DOC_NOT_OPEN, + + DOC_OPEN_FAILED, + + DOC_PASSWORD_REQUIRED, + + DOC_PASSWORD_INCORRECT, + + SHARE_PASSWORD_REQUIRED, + + ABORTED, + + NETWORK, + + UNAUTHENTICATED, + + FORBIDDEN, + + NOT_FOUND, + + WIRE_FORMAT, + + RUNTIME_UNAVAILABLE, + + INVALID_REFERENCE, + + WEAK_ANNOTATION_SESSION_CONFLICT, + + LAYER_VERSION_CONFLICT, + + NOT_IMPLEMENTED, + + MALFORMED_PDF, + + _UNKNOWN + } + + public interface Visitor { + T visitUnknown(); + + T visitInvalidArg(); + + T visitDocNotOpen(); + + T visitDocOpenFailed(); + + T visitDocPasswordRequired(); + + T visitDocPasswordIncorrect(); + + T visitSharePasswordRequired(); + + T visitAborted(); + + T visitNetwork(); + + T visitUnauthenticated(); + + T visitForbidden(); + + T visitNotFound(); + + T visitWireFormat(); + + T visitRuntimeUnavailable(); + + T visitInvalidReference(); + + T visitWeakAnnotationSessionConflict(); + + T visitLayerVersionConflict(); + + T visitNotImplemented(); + + T visitMalformedPdf(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocPagesInsertBlank404ResponseName.java b/src/main/java/api/types/DocPagesInsertBlank404ResponseName.java new file mode 100644 index 0000000..16df193 --- /dev/null +++ b/src/main/java/api/types/DocPagesInsertBlank404ResponseName.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DocPagesInsertBlank404ResponseName { + public static final DocPagesInsertBlank404ResponseName ENGINE_ERROR = + new DocPagesInsertBlank404ResponseName(Value.ENGINE_ERROR, "EngineError"); + + private final Value value; + + private final String string; + + DocPagesInsertBlank404ResponseName(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DocPagesInsertBlank404ResponseName + && this.string.equals(((DocPagesInsertBlank404ResponseName) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ENGINE_ERROR: + return visitor.visitEngineError(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocPagesInsertBlank404ResponseName valueOf(String value) { + switch (value) { + case "EngineError": + return ENGINE_ERROR; + default: + return new DocPagesInsertBlank404ResponseName(Value.UNKNOWN, value); + } + } + + public enum Value { + ENGINE_ERROR, + + UNKNOWN + } + + public interface Visitor { + T visitEngineError(); + + T visitUnknown(String unknownType); + } +}