diff --git a/.fern/metadata.json b/.fern/metadata.json index 25e2eb3..f9b90bd 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": "07aa3f26c82243b36a5ec94f7072130c7298d977", + "originGitCommit": "3a88df90980e5c0546a5ebbfd1252d8fca77ff9b", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.17", + "requestedVersion": "3.0.0-alpha.18", "ciProvider": "github" } \ No newline at end of file diff --git a/build.gradle b/build.gradle index bf778e0..c74d06b 100644 --- a/build.gradle +++ b/build.gradle @@ -46,7 +46,7 @@ java { group = 'com.cloudpdf' -version = '3.0.0-alpha.17' +version = '3.0.0-alpha.18' jar { dependsOn(":generatePomFileForMavenPublication") @@ -73,7 +73,7 @@ publishing { maven(MavenPublication) { groupId = 'com.cloudpdf' artifactId = 'sdk' - version = '3.0.0-alpha.17' + version = '3.0.0-alpha.18' from components.java pom { name = 'CloudPDF' diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 34b02b2..27e5b59 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "java", - "canonicalVersion": "3.0.0-next.17", - "sdkVersion": "3.0.0-alpha.17", + "canonicalVersion": "3.0.0-next.18", + "sdkVersion": "3.0.0-alpha.18", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "8fa53cef2776eb0de9ec50c263aa547b309a04d1a2ecb6ee54b6338d6698dc00", - "gitCommit": "07aa3f26c82243b36a5ec94f7072130c7298d977", + "openapiSha256": "ad2a3baa628061e7b3e8b597cfd15bcda7f103d0f829cb01388a0fed6c4f5873", + "gitCommit": "3a88df90980e5c0546a5ebbfd1252d8fca77ff9b", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index e080525..b502cae 100644 --- a/reference.md +++ b/reference.md @@ -811,6 +811,14 @@ client.shares().create(
+**identity:** `Optional` + +
+
+ +
+
+ **scope:** `List`
@@ -1053,6 +1061,14 @@ client.shares().update(
+**identity:** `Optional` + +
+
+ +
+
+ **scope:** `Optional>`
@@ -1620,7 +1636,39 @@ client.documents().list(
-**state:** `Optional` +**state:** `Optional` — Only documents in this state. Without it, every state except deleting. + +
+
+ +
+
+ +**q:** `Optional` — Only documents whose name contains this text, ignoring case. + +
+
+ +
+
+ +**folderId:** `Optional` — Only documents directly in this folder (root: the top level). Without it, documents in every folder. + +
+
+ +
+
+ +**sort:** `Optional` — createdAt (default), name (ignoring case), or size (stored bytes; 0 while pending). + +
+
+ +
+
+ +**order:** `Optional` — Defaults to the reading order of the sort: A to Z for name, newest and largest first otherwise.
@@ -1674,53 +1722,636 @@ client.documents().get(
-**id:** `String` +**id:** `String` + +
+
+ +
+ + + +
+ + +
client.documents.delete(tenantId, id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().delete( + "tenantId", + "id", + DeleteDocumentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.update(tenantId, id, request) -> DocumentsUpdate200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A document that is being deleted answers 404. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().update( + "tenantId", + "id", + DocumentsUpdateRequest + .builder() + .name("name") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**name:** `String` — What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + +
+
+
+
+ + +
+
+
+ +
client.documents.commit(tenantId, id, request) -> DocumentsCommit200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().commit( + "tenantId", + "id", + DocumentsCommitRequest + .builder() + .sha256("sha256") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+ +
+
+ +**sha256:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.download(tenantId, id) -> InputStream +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().download( + "tenantId", + "id", + DownloadDocumentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.thumbnail(tenantId, id) -> InputStream +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().thumbnail( + "tenantId", + "id", + ThumbnailDocumentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.uploadProxy(tenantId, id, request) -> DocumentsUploadProxy200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().uploadProxy( + "tenantId", + "id", + null, + UploadProxyDocumentsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**id:** `String` + +
+
+
+
+ + +
+
+
+ +
client.documents.importFrom(tenantId, request) -> DocumentsImportFrom200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().importFrom( + "tenantId", + DocumentsImportFromRequest + .builder() + .source( + DocumentsImportFromRequestSource.url( + DocumentsImportFromRequestSourceUrl + .builder() + .url("url") + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**source:** `DocumentsImportFromRequestSource` — Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file. + +
+
+ +
+
+ +**expected:** `Optional` — Integrity pins, enforced when present. When absent, the server-observed values become authoritative. + +
+
+ +
+
+ +**name:** `Optional` — What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + +
+
+ +
+
+ +**folderId:** `Optional` — A folder id, or root for the top level. + +
+
+ +
+
+ +**metadata:** `Optional>` + +
+
+ +
+
+ +**idempotencyKey:** `Optional` — Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. + +
+
+ +
+
+ +**dedupMode:** `Optional` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. + +
+
+ +
+
+ +**docId:** `Optional` + +
+
+ +
+
+ +**mode:** `Optional` — sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. + +
+
+
+
+ + +
+
+
+ +
client.documents.init(tenantId, request) -> DocumentsInit200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.documents().init( + "tenantId", + DocumentsInitRequest + .builder() + .contentLength(1.1) + .contentSha256("contentSha256") + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**tenantId:** `String` + +
+
+ +
+
+ +**contentLength:** `Double` + +
+
+ +
+
+ +**contentSha256:** `String` + +
+
+ +
+
+ +**name:** `Optional` — What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + +
+
+ +
+
+ +**folderId:** `Optional` — A folder id, or root for the top level. + +
+
+ +
+
+ +**metadata:** `Optional>`
-
-
+
+
+**idempotencyKey:** `Optional` +
-
-
client.documents.delete(tenantId, id)
-#### 🔌 Usage - -
-
+**dedupMode:** `Optional` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. + +
+
-```java -client.documents().delete( - "tenantId", - "id", - DeleteDocumentsRequest - .builder() - .build() -); -``` -
-
+**docId:** `Optional` +
-#### ⚙️ Parameters - -
-
-
-**tenantId:** `String` +**uploadTtlSec:** `Optional`
@@ -1728,7 +2359,7 @@ client.documents().delete(
-**id:** `String` +**uploadPreference:** `Optional`
@@ -1740,7 +2371,8 @@ client.documents().delete(
-
client.documents.commit(tenantId, id, request) -> DocumentsCommit200Response +## Folders +
client.folders.list(tenantId) -> FoldersList200Response
@@ -1753,12 +2385,10 @@ client.documents().delete(
```java -client.documents().commit( +client.folders().list( "tenantId", - "id", - DocumentsCommitRequest + ListFoldersRequest .builder() - .sha256("sha256") .build() ); ``` @@ -1783,7 +2413,7 @@ client.documents().commit(
-**id:** `String` +**limit:** `Optional`
@@ -1791,7 +2421,15 @@ client.documents().commit(
-**sha256:** `String` +**cursor:** `Optional` + +
+
+ +
+
+ +**parentId:** `Optional` — Only the folders directly in this folder (root: the top level). Without it, every folder.
@@ -1803,10 +2441,24 @@ client.documents().commit(
-
client.documents.download(tenantId, id) -> InputStream +
client.folders.create(tenantId, request) -> FoldersCreate200Response +
+
+ +#### 📝 Description + +
+
+
+409 Conflict carries `details.reason`: `name-taken` (a sibling has the name, ignoring case; `details.name`) or `too-deep` (folders nest at most 100 levels; `details.maxDepth`). 404 when the parent folder does not exist. +
+
+
+
+ #### 🔌 Usage
@@ -1816,11 +2468,11 @@ client.documents().commit(
```java -client.documents().download( +client.folders().create( "tenantId", - "id", - DownloadDocumentsRequest + FoldersCreateRequest .builder() + .name("name") .build() ); ``` @@ -1845,7 +2497,15 @@ client.documents().download(
-**id:** `String` +**name:** `String` — What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case. + +
+
+ +
+
+ +**parentId:** `Optional` — A folder id, or root for the top level.
@@ -1857,7 +2517,7 @@ client.documents().download(
-
client.documents.thumbnail(tenantId, id) -> InputStream +
client.folders.get(tenantId, folderId) -> FoldersGet200Response
@@ -1870,10 +2530,10 @@ client.documents().download(
```java -client.documents().thumbnail( +client.folders().get( "tenantId", - "id", - ThumbnailDocumentsRequest + "folderId", + GetFoldersRequest .builder() .build() ); @@ -1899,7 +2559,7 @@ client.documents().thumbnail(
-**id:** `String` +**folderId:** `String`
@@ -1911,7 +2571,7 @@ client.documents().thumbnail(
-
client.documents.uploadProxy(tenantId, id, request) -> DocumentsUploadProxy200Response +
client.folders.delete(tenantId, folderId)
@@ -1923,7 +2583,7 @@ client.documents().thumbnail(
-This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. +Without recursive, a folder with anything inside is refused: 409 Conflict with `details.reason` `not-empty` and what it holds, counted over every level below, in `details.folders` and `details.documents`. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit.
@@ -1938,11 +2598,10 @@ This bounded origin-mediated fallback must only be used after documents.init ret
```java -client.documents().uploadProxy( +client.folders().delete( "tenantId", - "id", - null, - UploadProxyDocumentsRequest + "folderId", + DeleteFoldersRequest .builder() .build() ); @@ -1968,7 +2627,15 @@ client.documents().uploadProxy(
-**id:** `String` +**folderId:** `String` + +
+
+ +
+
+ +**recursive:** `Optional` — true deletes everything in the folder too. Never the default.
@@ -1980,7 +2647,7 @@ client.documents().uploadProxy(
-
client.documents.importFrom(tenantId, request) -> DocumentsImportFrom200Response +
client.folders.update(tenantId, folderId, request) -> FoldersUpdate200Response
@@ -1992,7 +2659,7 @@ client.documents().uploadProxy(
-Default mode is synchronous and bounded: the response returns only after the transfer verified and committed (or failed). mode=async (connection sources only) answers 202 immediately and an in-process worker performs the transfer with leased, fenced retries; poll the document until ready/failed. The deployment import policy gates scheme, network range, and size; sources must declare a length. CloudPDF copies and owns the bytes — the source is never referenced in place. A 502 marks a retryable upstream failure: retry with the same idempotencyKey to resume the same document. URL sources are capabilities and never echoed back. Connection sources name operator-registered storage (bucket/prefix scope, allowed credential classes, and tenant bindings are deployment configuration); `revision` is provider-interpreted (S3 VersionId, GCS generation, Azure version id). +409 Conflict with `details.reason` `name-taken` when a sibling has the name, ignoring case.
@@ -2007,18 +2674,12 @@ Default mode is synchronous and bounded: the response returns only after the tra
```java -client.documents().importFrom( +client.folders().update( "tenantId", - DocumentsImportFromRequest + "folderId", + FoldersUpdateRequest .builder() - .source( - DocumentsImportFromRequestSource.url( - DocumentsImportFromRequestSourceUrl - .builder() - .url("url") - .build() - ) - ) + .name("name") .build() ); ``` @@ -2043,7 +2704,7 @@ client.documents().importFrom(
-**source:** `DocumentsImportFromRequestSource` — Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file. +**folderId:** `String`
@@ -2051,61 +2712,35 @@ client.documents().importFrom(
-**expected:** `Optional` — Integrity pins, enforced when present. When absent, the server-observed values become authoritative. +**name:** `String` — What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case.
- -
-
- -**metadata:** `Optional>` -
-
-
-**idempotencyKey:** `Optional` — Retrying with the same key resumes the same document rather than importing a second copy — including after a 502. -
+
+
client.folders.moveInto(tenantId, folderId, request)
-**dedupMode:** `Optional` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. - -
-
+#### 📝 Description
-**docId:** `Optional` - -
-
-
-**mode:** `Optional` — sync (default) holds the response open for the whole transfer. async answers 202 with the document pending and transfers in the background; it requires a connection source, and filesystem connections additionally require expected.sha256. - -
-
+Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in `details.documentIds` and `details.folderIds`. 409 Conflict carries `details.reason`: `cycle` (the destination is a moved folder or inside one; `details.folderId`), `too-deep` (the move would nest folders deeper than 100 levels; `details.maxDepth`) or `name-taken` (a moved folder's name is taken in the destination, ignoring case; `details.name`). - - -
- -
client.documents.init(tenantId, request) -> DocumentsInit200Response -
-
#### 🔌 Usage @@ -2116,12 +2751,11 @@ client.documents().importFrom(
```java -client.documents().init( +client.folders().moveInto( "tenantId", - DocumentsInitRequest + "folderId", + FoldersMoveIntoRequest .builder() - .contentLength(1.1) - .contentSha256("contentSha256") .build() ); ``` @@ -2146,47 +2780,7 @@ client.documents().init(
-**contentLength:** `Double` - -
-
- -
-
- -**contentSha256:** `String` - -
-
- -
-
- -**metadata:** `Optional>` - -
-
- -
-
- -**idempotencyKey:** `Optional` - -
-
- -
-
- -**dedupMode:** `Optional` — always-create (default) creates a new document every time. reuse-existing returns a document that already holds the same content instead of storing it twice. - -
-
- -
-
- -**docId:** `Optional` +**folderId:** `String` — A folder id, or root for the top level.
@@ -2194,7 +2788,7 @@ client.documents().init(
-**uploadTtlSec:** `Optional` +**documentIds:** `Optional>`
@@ -2202,7 +2796,7 @@ client.documents().init(
-**uploadPreference:** `Optional` +**folderIds:** `Optional>`
@@ -4959,7 +5553,7 @@ client.doc().signatures().cancel(
-`cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. Every layer of the document then sits over the new version; refetch the manifest after a completion. +`cms` is the detached CMS over the prepared digest, base64. `expectedVersion` must be what prepare returned. Idempotent by signing id: the same CMS again answers `already-completed`. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion.
@@ -5168,7 +5762,7 @@ client.doc().signatures().analysis(
-Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). +Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made.
@@ -5234,7 +5828,7 @@ client.doc().signatures().prepare(
## Doc Versions -
client.doc.versions.list(docId) -> DocVersionsList200Response +
client.doc.versions.list(docId, layerName) -> DocVersionsList200Response
@@ -5246,7 +5840,7 @@ client.doc().signatures().prepare(
-Every completed signature publishes a new version. Never cached: the list grows. +Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows.
@@ -5263,6 +5857,7 @@ Every completed signature publishes a new version. Never cached: the list grows. ```java client.doc().versions().list( "docId", + "layerName", ListVersionsRequest .builder() .build() @@ -5289,6 +5884,14 @@ client.doc().versions().list(
+**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.
@@ -5301,7 +5904,7 @@ client.doc().versions().list(
-
client.doc.versions.analysis(docId, sha) -> DocVersionsAnalysis200Response +
client.doc.versions.analysis(docId, layerName, sha) -> DocVersionsAnalysis200Response
@@ -5313,7 +5916,7 @@ client.doc().versions().list(
-Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every layer and every caller. +Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every caller.
@@ -5330,6 +5933,7 @@ Exactly one of `since.signature` / `since.revision`; `until=` defaults ```java client.doc().versions().analysis( "docId", + "layerName", "sha", AnalysisVersionsRequest .builder() @@ -5357,6 +5961,14 @@ client.doc().versions().analysis(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
@@ -5417,7 +6029,7 @@ client.doc().versions().analysis(
-
client.doc.versions.download(docId, sha) -> InputStream +
client.doc.versions.download(docId, layerName, sha) -> InputStream
@@ -5432,6 +6044,7 @@ client.doc().versions().analysis( ```java client.doc().versions().download( "docId", + "layerName", "sha", DownloadVersionsRequest .builder() @@ -5459,6 +6072,14 @@ client.doc().versions().download(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
@@ -5479,7 +6100,7 @@ client.doc().versions().download(
-
client.doc.versions.revision(docId, sha, index) -> InputStream +
client.doc.versions.revision(docId, layerName, sha, index) -> InputStream
@@ -5494,6 +6115,7 @@ client.doc().versions().download( ```java client.doc().versions().revision( "docId", + "layerName", "sha", 1, RevisionVersionsRequest @@ -5522,6 +6144,14 @@ client.doc().versions().revision(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
@@ -5550,7 +6180,7 @@ client.doc().versions().revision(
-
client.doc.versions.signatures(docId, sha) -> DocVersionsSignatures200Response +
client.doc.versions.signatures(docId, layerName, sha) -> DocVersionsSignatures200Response
@@ -5565,6 +6195,7 @@ client.doc().versions().revision( ```java client.doc().versions().signatures( "docId", + "layerName", "sha", SignaturesVersionsRequest .builder() @@ -5592,6 +6223,14 @@ client.doc().versions().signatures(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
@@ -5612,7 +6251,7 @@ client.doc().versions().signatures(
-
client.doc.versions.signatureContents(docId, sha, fieldKey) -> InputStream +
client.doc.versions.signatureContents(docId, layerName, sha, fieldKey) -> InputStream
@@ -5641,6 +6280,7 @@ client.doc().versions().signatures( ```java client.doc().versions().signatureContents( "docId", + "layerName", "sha", "fieldKey", SignatureContentsVersionsRequest @@ -5669,6 +6309,14 @@ client.doc().versions().signatureContents(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
@@ -5697,7 +6345,7 @@ client.doc().versions().signatureContents(
-
client.doc.versions.signatureDigest(docId, sha, fieldKey, algorithm) -> InputStream +
client.doc.versions.signatureDigest(docId, layerName, sha, fieldKey, algorithm) -> InputStream
@@ -5726,6 +6374,7 @@ What a CMS verifier compares its message digest to. ```java client.doc().versions().signatureDigest( "docId", + "layerName", "sha", "fieldKey", SignatureDigestVersionsRequestAlgorithm.SHA1, @@ -5755,6 +6404,14 @@ client.doc().versions().signatureDigest(
+**layerName:** `String` + +
+
+ +
+
+ **sha:** `String`
diff --git a/src/main/java/api/AsyncCloudPDFClient.java b/src/main/java/api/AsyncCloudPDFClient.java index 0a9cd6c..4ca2d98 100644 --- a/src/main/java/api/AsyncCloudPDFClient.java +++ b/src/main/java/api/AsyncCloudPDFClient.java @@ -8,6 +8,7 @@ import com.cloudpdf.api.resources.deployment.AsyncDeploymentClient; import com.cloudpdf.api.resources.doc.AsyncDocClient; import com.cloudpdf.api.resources.documents.AsyncDocumentsClient; +import com.cloudpdf.api.resources.folders.AsyncFoldersClient; import com.cloudpdf.api.resources.shares.AsyncSharesClient; import com.cloudpdf.api.resources.tenants.AsyncTenantsClient; import com.cloudpdf.api.resources.tokens.AsyncTokensClient; @@ -26,6 +27,8 @@ public class AsyncCloudPDFClient { protected final Supplier documentsClient; + protected final Supplier foldersClient; + protected final Supplier tokensClient; public AsyncCloudPDFClient(ClientOptions clientOptions) { @@ -35,6 +38,7 @@ public AsyncCloudPDFClient(ClientOptions clientOptions) { this.sharesClient = Suppliers.memoize(() -> new AsyncSharesClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new AsyncTenantsClient(clientOptions)); this.documentsClient = Suppliers.memoize(() -> new AsyncDocumentsClient(clientOptions)); + this.foldersClient = Suppliers.memoize(() -> new AsyncFoldersClient(clientOptions)); this.tokensClient = Suppliers.memoize(() -> new AsyncTokensClient(clientOptions)); } @@ -58,6 +62,10 @@ public AsyncDocumentsClient documents() { return this.documentsClient.get(); } + public AsyncFoldersClient folders() { + return this.foldersClient.get(); + } + public AsyncTokensClient tokens() { return this.tokensClient.get(); } diff --git a/src/main/java/api/CloudPDFClient.java b/src/main/java/api/CloudPDFClient.java index 9dee4bf..8a1cbff 100644 --- a/src/main/java/api/CloudPDFClient.java +++ b/src/main/java/api/CloudPDFClient.java @@ -8,6 +8,7 @@ import com.cloudpdf.api.resources.deployment.DeploymentClient; import com.cloudpdf.api.resources.doc.DocClient; import com.cloudpdf.api.resources.documents.DocumentsClient; +import com.cloudpdf.api.resources.folders.FoldersClient; import com.cloudpdf.api.resources.shares.SharesClient; import com.cloudpdf.api.resources.tenants.TenantsClient; import com.cloudpdf.api.resources.tokens.TokensClient; @@ -26,6 +27,8 @@ public class CloudPDFClient { protected final Supplier documentsClient; + protected final Supplier foldersClient; + protected final Supplier tokensClient; public CloudPDFClient(ClientOptions clientOptions) { @@ -35,6 +38,7 @@ public CloudPDFClient(ClientOptions clientOptions) { this.sharesClient = Suppliers.memoize(() -> new SharesClient(clientOptions)); this.tenantsClient = Suppliers.memoize(() -> new TenantsClient(clientOptions)); this.documentsClient = Suppliers.memoize(() -> new DocumentsClient(clientOptions)); + this.foldersClient = Suppliers.memoize(() -> new FoldersClient(clientOptions)); this.tokensClient = Suppliers.memoize(() -> new TokensClient(clientOptions)); } @@ -58,6 +62,10 @@ public DocumentsClient documents() { return this.documentsClient.get(); } + public FoldersClient folders() { + return this.foldersClient.get(); + } + public TokensClient tokens() { return this.tokensClient.get(); } diff --git a/src/main/java/api/core/ClientOptions.java b/src/main/java/api/core/ClientOptions.java index e9cee88..60e76c4 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.17"); + put("X-Fern-SDK-Version", "3.0.0-alpha.18"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/api/resources/doc/signatures/AsyncRawSignaturesClient.java b/src/main/java/api/resources/doc/signatures/AsyncRawSignaturesClient.java index 917bb94..3d8819f 100644 --- a/src/main/java/api/resources/doc/signatures/AsyncRawSignaturesClient.java +++ b/src/main/java/api/resources/doc/signatures/AsyncRawSignaturesClient.java @@ -261,7 +261,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CompletableFuture> complete( String docId, String layerName, String signingId, DocSignaturesCompleteRequest request) { @@ -269,7 +269,7 @@ public CompletableFuturecms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CompletableFuture> complete( String docId, @@ -505,7 +505,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CompletableFuture> prepare( String docId, String layerName, File file, PrepareSignaturesRequest request) { @@ -513,7 +513,7 @@ public CompletableFuturebody part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CompletableFuture> prepare( String docId, diff --git a/src/main/java/api/resources/doc/signatures/AsyncSignaturesClient.java b/src/main/java/api/resources/doc/signatures/AsyncSignaturesClient.java index db27b4e..6bdc23a 100644 --- a/src/main/java/api/resources/doc/signatures/AsyncSignaturesClient.java +++ b/src/main/java/api/resources/doc/signatures/AsyncSignaturesClient.java @@ -96,7 +96,7 @@ public CompletableFuture cancel( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CompletableFuture complete( String docId, String layerName, String signingId, DocSignaturesCompleteRequest request) { @@ -104,7 +104,7 @@ public CompletableFuture complete( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CompletableFuture complete( String docId, @@ -151,7 +151,7 @@ public CompletableFuture analysis( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CompletableFuture prepare( String docId, String layerName, File file, PrepareSignaturesRequest request) { @@ -159,7 +159,7 @@ public CompletableFuture prepare( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CompletableFuture prepare( String docId, diff --git a/src/main/java/api/resources/doc/signatures/RawSignaturesClient.java b/src/main/java/api/resources/doc/signatures/RawSignaturesClient.java index 0dcf198..033b3bd 100644 --- a/src/main/java/api/resources/doc/signatures/RawSignaturesClient.java +++ b/src/main/java/api/resources/doc/signatures/RawSignaturesClient.java @@ -223,7 +223,7 @@ public CloudPDFClientHttpResponse cancel( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CloudPDFClientHttpResponse complete( String docId, String layerName, String signingId, DocSignaturesCompleteRequest request) { @@ -231,7 +231,7 @@ public CloudPDFClientHttpResponse complete( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public CloudPDFClientHttpResponse complete( String docId, @@ -424,7 +424,7 @@ public CloudPDFClientHttpResponse analysis( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CloudPDFClientHttpResponse prepare( String docId, String layerName, File file, PrepareSignaturesRequest request) { @@ -432,7 +432,7 @@ public CloudPDFClientHttpResponse prepare( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public CloudPDFClientHttpResponse prepare( String docId, diff --git a/src/main/java/api/resources/doc/signatures/SignaturesClient.java b/src/main/java/api/resources/doc/signatures/SignaturesClient.java index c2907d8..4e5e877 100644 --- a/src/main/java/api/resources/doc/signatures/SignaturesClient.java +++ b/src/main/java/api/resources/doc/signatures/SignaturesClient.java @@ -93,7 +93,7 @@ public DocSignaturesCancel200Response cancel( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public DocSignaturesComplete200Response complete( String docId, String layerName, String signingId, DocSignaturesCompleteRequest request) { @@ -101,7 +101,7 @@ public DocSignaturesComplete200Response complete( } /** - * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. Every layer of the document then sits over the new version; refetch the manifest after a completion. + * cms is the detached CMS over the prepared digest, base64. expectedVersion must be what prepare returned. Idempotent by signing id: the same CMS again answers already-completed. The new version is the layer's own: only this layer moves to it, and the document and every other layer stay as they were. Refetch the manifest after a completion. */ public DocSignaturesComplete200Response complete( String docId, @@ -147,7 +147,7 @@ public DocSignaturesAnalysis200Response analysis( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public DocSignaturesPrepare200Response prepare( String docId, String layerName, File file, PrepareSignaturesRequest request) { @@ -155,7 +155,7 @@ public DocSignaturesPrepare200Response prepare( } /** - * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON body part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as resources: { appearance: '<key>' }, and that PDF as the part resource:<key>. A certification (certify.permission) additionally requires doc.sign.certify. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. */ public DocSignaturesPrepare200Response prepare( String docId, diff --git a/src/main/java/api/resources/doc/versions/AsyncRawVersionsClient.java b/src/main/java/api/resources/doc/versions/AsyncRawVersionsClient.java index cdc79a3..5fd80b0 100644 --- a/src/main/java/api/resources/doc/versions/AsyncRawVersionsClient.java +++ b/src/main/java/api/resources/doc/versions/AsyncRawVersionsClient.java @@ -47,37 +47,40 @@ public AsyncRawVersionsClient(ClientOptions clientOptions) { } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CompletableFuture> list(String docId) { - return list(docId, ListVersionsRequest.builder().build()); + public CompletableFuture> list( + String docId, String layerName) { + return list(docId, layerName, ListVersionsRequest.builder().build()); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ public CompletableFuture> list( - String docId, RequestOptions requestOptions) { - return list(docId, ListVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, RequestOptions requestOptions) { + return list(docId, layerName, ListVersionsRequest.builder().build(), requestOptions); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ public CompletableFuture> list( - String docId, ListVersionsRequest request) { - return list(docId, request, null); + String docId, String layerName, ListVersionsRequest request) { + return list(docId, layerName, request, null); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ public CompletableFuture> list( - String docId, ListVersionsRequest request, RequestOptions requestOptions) { + String docId, String layerName, ListVersionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions"); if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { @@ -150,38 +153,44 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture> analysis( - String docId, String sha) { - return analysis(docId, sha, AnalysisVersionsRequest.builder().build()); + String docId, String layerName, String sha) { + return analysis(docId, layerName, sha, AnalysisVersionsRequest.builder().build()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture> analysis( - String docId, String sha, RequestOptions requestOptions) { - return analysis(docId, sha, AnalysisVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return analysis(docId, layerName, sha, AnalysisVersionsRequest.builder().build(), requestOptions); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture> analysis( - String docId, String sha, AnalysisVersionsRequest request) { - return analysis(docId, sha, request, null); + String docId, String layerName, String sha, AnalysisVersionsRequest request) { + return analysis(docId, layerName, sha, request, null); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture> analysis( - String docId, String sha, AnalysisVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + AnalysisVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/analysis") .addPathSegment(sha); if (request.getSinceSignature().isPresent()) { @@ -282,26 +291,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> download(String docId, String sha) { - return download(docId, sha, DownloadVersionsRequest.builder().build()); + public CompletableFuture> download( + String docId, String layerName, String sha) { + return download(docId, layerName, sha, DownloadVersionsRequest.builder().build()); } public CompletableFuture> download( - String docId, String sha, RequestOptions requestOptions) { - return download(docId, sha, DownloadVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return download(docId, layerName, sha, DownloadVersionsRequest.builder().build(), requestOptions); } public CompletableFuture> download( - String docId, String sha, DownloadVersionsRequest request) { - return download(docId, sha, request, null); + String docId, String layerName, String sha, DownloadVersionsRequest request) { + return download(docId, layerName, sha, request, null); } public CompletableFuture> download( - String docId, String sha, DownloadVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + DownloadVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/download") .addPathSegment(sha); if (requestOptions != null) { @@ -373,26 +389,36 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } - public CompletableFuture> revision(String docId, String sha, int index) { - return revision(docId, sha, index, RevisionVersionsRequest.builder().build()); + public CompletableFuture> revision( + String docId, String layerName, String sha, int index) { + return revision( + docId, layerName, sha, index, RevisionVersionsRequest.builder().build()); } public CompletableFuture> revision( - String docId, String sha, int index, RequestOptions requestOptions) { - return revision(docId, sha, index, RevisionVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, int index, RequestOptions requestOptions) { + return revision( + docId, layerName, sha, index, RevisionVersionsRequest.builder().build(), requestOptions); } public CompletableFuture> revision( - String docId, String sha, int index, RevisionVersionsRequest request) { - return revision(docId, sha, index, request, null); + String docId, String layerName, String sha, int index, RevisionVersionsRequest request) { + return revision(docId, layerName, sha, index, request, null); } public CompletableFuture> revision( - String docId, String sha, int index, RevisionVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + int index, + RevisionVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/revisions") .addPathSegment(sha) .addPathSegment(Integer.toString(index)); @@ -466,26 +492,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } public CompletableFuture> signatures( - String docId, String sha) { - return signatures(docId, sha, SignaturesVersionsRequest.builder().build()); + String docId, String layerName, String sha) { + return signatures( + docId, layerName, sha, SignaturesVersionsRequest.builder().build()); } public CompletableFuture> signatures( - String docId, String sha, RequestOptions requestOptions) { - return signatures(docId, sha, SignaturesVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return signatures( + docId, layerName, sha, SignaturesVersionsRequest.builder().build(), requestOptions); } public CompletableFuture> signatures( - String docId, String sha, SignaturesVersionsRequest request) { - return signatures(docId, sha, request, null); + String docId, String layerName, String sha, SignaturesVersionsRequest request) { + return signatures(docId, layerName, sha, request, null); } public CompletableFuture> signatures( - String docId, String sha, SignaturesVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + SignaturesVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha); if (requestOptions != null) { @@ -563,26 +597,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CompletableFuture> signatureContents( - String docId, String sha, String fieldKey) { + String docId, String layerName, String sha, String fieldKey) { return signatureContents( - docId, sha, fieldKey, SignatureContentsVersionsRequest.builder().build()); + docId, + layerName, + sha, + fieldKey, + SignatureContentsVersionsRequest.builder().build()); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CompletableFuture> signatureContents( - String docId, String sha, String fieldKey, RequestOptions requestOptions) { + String docId, String layerName, String sha, String fieldKey, RequestOptions requestOptions) { return signatureContents( - docId, sha, fieldKey, SignatureContentsVersionsRequest.builder().build(), requestOptions); + docId, + layerName, + sha, + fieldKey, + SignatureContentsVersionsRequest.builder().build(), + requestOptions); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CompletableFuture> signatureContents( - String docId, String sha, String fieldKey, SignatureContentsVersionsRequest request) { - return signatureContents(docId, sha, fieldKey, request, null); + String docId, String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request) { + return signatureContents(docId, layerName, sha, fieldKey, request, null); } /** @@ -590,6 +633,7 @@ public CompletableFuture> signatureConte */ public CompletableFuture> signatureContents( String docId, + String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request, @@ -598,6 +642,8 @@ public CompletableFuture> signatureConte .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha) .addPathSegment(fieldKey) @@ -675,9 +721,14 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * What a CMS verifier compares its message digest to. */ public CompletableFuture> signatureDigest( - String docId, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm) { + String docId, + String layerName, + String sha, + String fieldKey, + SignatureDigestVersionsRequestAlgorithm algorithm) { return signatureDigest( docId, + layerName, sha, fieldKey, algorithm, @@ -689,12 +740,14 @@ public CompletableFuture> signatureDiges */ public CompletableFuture> signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, RequestOptions requestOptions) { return signatureDigest( docId, + layerName, sha, fieldKey, algorithm, @@ -707,11 +760,12 @@ public CompletableFuture> signatureDiges */ public CompletableFuture> signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request) { - return signatureDigest(docId, sha, fieldKey, algorithm, request, null); + return signatureDigest(docId, layerName, sha, fieldKey, algorithm, request, null); } /** @@ -719,6 +773,7 @@ public CompletableFuture> signatureDiges */ public CompletableFuture> signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, @@ -728,6 +783,8 @@ public CompletableFuture> signatureDiges .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha) .addPathSegment(fieldKey) diff --git a/src/main/java/api/resources/doc/versions/AsyncVersionsClient.java b/src/main/java/api/resources/doc/versions/AsyncVersionsClient.java index b176fbd..ffcab2b 100644 --- a/src/main/java/api/resources/doc/versions/AsyncVersionsClient.java +++ b/src/main/java/api/resources/doc/versions/AsyncVersionsClient.java @@ -37,135 +37,166 @@ public AsyncRawVersionsClient withRawResponse() { } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CompletableFuture list(String docId) { - return this.rawClient.list(docId).thenApply(response -> response.body()); + public CompletableFuture list(String docId, String layerName) { + return this.rawClient.list(docId, layerName).thenApply(response -> response.body()); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CompletableFuture list(String docId, RequestOptions requestOptions) { - return this.rawClient.list(docId, requestOptions).thenApply(response -> response.body()); + public CompletableFuture list( + String docId, String layerName, RequestOptions requestOptions) { + return this.rawClient.list(docId, layerName, requestOptions).thenApply(response -> response.body()); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CompletableFuture list(String docId, ListVersionsRequest request) { - return this.rawClient.list(docId, request).thenApply(response -> response.body()); + public CompletableFuture list( + String docId, String layerName, ListVersionsRequest request) { + return this.rawClient.list(docId, layerName, request).thenApply(response -> response.body()); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ public CompletableFuture list( - String docId, ListVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.list(docId, request, requestOptions).thenApply(response -> response.body()); + String docId, String layerName, ListVersionsRequest request, RequestOptions requestOptions) { + return this.rawClient.list(docId, layerName, request, requestOptions).thenApply(response -> response.body()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ - public CompletableFuture analysis(String docId, String sha) { - return this.rawClient.analysis(docId, sha).thenApply(response -> response.body()); + public CompletableFuture analysis(String docId, String layerName, String sha) { + return this.rawClient.analysis(docId, layerName, sha).thenApply(response -> response.body()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture analysis( - String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.analysis(docId, sha, requestOptions).thenApply(response -> response.body()); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.analysis(docId, layerName, sha, requestOptions).thenApply(response -> response.body()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture analysis( - String docId, String sha, AnalysisVersionsRequest request) { - return this.rawClient.analysis(docId, sha, request).thenApply(response -> response.body()); + String docId, String layerName, String sha, AnalysisVersionsRequest request) { + return this.rawClient.analysis(docId, layerName, sha, request).thenApply(response -> response.body()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CompletableFuture analysis( - String docId, String sha, AnalysisVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.analysis(docId, sha, request, requestOptions).thenApply(response -> response.body()); + String docId, + String layerName, + String sha, + AnalysisVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .analysis(docId, layerName, sha, request, requestOptions) + .thenApply(response -> response.body()); } - public CompletableFuture download(String docId, String sha) { - return this.rawClient.download(docId, sha).thenApply(response -> response.body()); + public CompletableFuture download(String docId, String layerName, String sha) { + return this.rawClient.download(docId, layerName, sha).thenApply(response -> response.body()); } - public CompletableFuture download(String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.download(docId, sha, requestOptions).thenApply(response -> response.body()); + public CompletableFuture download( + String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.download(docId, layerName, sha, requestOptions).thenApply(response -> response.body()); } - public CompletableFuture download(String docId, String sha, DownloadVersionsRequest request) { - return this.rawClient.download(docId, sha, request).thenApply(response -> response.body()); + public CompletableFuture download( + String docId, String layerName, String sha, DownloadVersionsRequest request) { + return this.rawClient.download(docId, layerName, sha, request).thenApply(response -> response.body()); } public CompletableFuture download( - String docId, String sha, DownloadVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.download(docId, sha, request, requestOptions).thenApply(response -> response.body()); + String docId, + String layerName, + String sha, + DownloadVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .download(docId, layerName, sha, request, requestOptions) + .thenApply(response -> response.body()); } - public CompletableFuture revision(String docId, String sha, int index) { - return this.rawClient.revision(docId, sha, index).thenApply(response -> response.body()); + public CompletableFuture revision(String docId, String layerName, String sha, int index) { + return this.rawClient.revision(docId, layerName, sha, index).thenApply(response -> response.body()); } - public CompletableFuture revision(String docId, String sha, int index, RequestOptions requestOptions) { - return this.rawClient.revision(docId, sha, index, requestOptions).thenApply(response -> response.body()); + public CompletableFuture revision( + String docId, String layerName, String sha, int index, RequestOptions requestOptions) { + return this.rawClient + .revision(docId, layerName, sha, index, requestOptions) + .thenApply(response -> response.body()); } public CompletableFuture revision( - String docId, String sha, int index, RevisionVersionsRequest request) { - return this.rawClient.revision(docId, sha, index, request).thenApply(response -> response.body()); + String docId, String layerName, String sha, int index, RevisionVersionsRequest request) { + return this.rawClient.revision(docId, layerName, sha, index, request).thenApply(response -> response.body()); } public CompletableFuture revision( - String docId, String sha, int index, RevisionVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + int index, + RevisionVersionsRequest request, + RequestOptions requestOptions) { return this.rawClient - .revision(docId, sha, index, request, requestOptions) + .revision(docId, layerName, sha, index, request, requestOptions) .thenApply(response -> response.body()); } - public CompletableFuture signatures(String docId, String sha) { - return this.rawClient.signatures(docId, sha).thenApply(response -> response.body()); + public CompletableFuture signatures(String docId, String layerName, String sha) { + return this.rawClient.signatures(docId, layerName, sha).thenApply(response -> response.body()); } public CompletableFuture signatures( - String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.signatures(docId, sha, requestOptions).thenApply(response -> response.body()); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.signatures(docId, layerName, sha, requestOptions).thenApply(response -> response.body()); } public CompletableFuture signatures( - String docId, String sha, SignaturesVersionsRequest request) { - return this.rawClient.signatures(docId, sha, request).thenApply(response -> response.body()); + String docId, String layerName, String sha, SignaturesVersionsRequest request) { + return this.rawClient.signatures(docId, layerName, sha, request).thenApply(response -> response.body()); } public CompletableFuture signatures( - String docId, String sha, SignaturesVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.signatures(docId, sha, request, requestOptions).thenApply(response -> response.body()); + String docId, + String layerName, + String sha, + SignaturesVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .signatures(docId, layerName, sha, request, requestOptions) + .thenApply(response -> response.body()); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ - public CompletableFuture signatureContents(String docId, String sha, String fieldKey) { - return this.rawClient.signatureContents(docId, sha, fieldKey).thenApply(response -> response.body()); + public CompletableFuture signatureContents( + String docId, String layerName, String sha, String fieldKey) { + return this.rawClient.signatureContents(docId, layerName, sha, fieldKey).thenApply(response -> response.body()); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CompletableFuture signatureContents( - String docId, String sha, String fieldKey, RequestOptions requestOptions) { + String docId, String layerName, String sha, String fieldKey, RequestOptions requestOptions) { return this.rawClient - .signatureContents(docId, sha, fieldKey, requestOptions) + .signatureContents(docId, layerName, sha, fieldKey, requestOptions) .thenApply(response -> response.body()); } @@ -173,8 +204,10 @@ public CompletableFuture signatureContents( * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CompletableFuture signatureContents( - String docId, String sha, String fieldKey, SignatureContentsVersionsRequest request) { - return this.rawClient.signatureContents(docId, sha, fieldKey, request).thenApply(response -> response.body()); + String docId, String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request) { + return this.rawClient + .signatureContents(docId, layerName, sha, fieldKey, request) + .thenApply(response -> response.body()); } /** @@ -182,12 +215,13 @@ public CompletableFuture signatureContents( */ public CompletableFuture signatureContents( String docId, + String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request, RequestOptions requestOptions) { return this.rawClient - .signatureContents(docId, sha, fieldKey, request, requestOptions) + .signatureContents(docId, layerName, sha, fieldKey, request, requestOptions) .thenApply(response -> response.body()); } @@ -195,8 +229,14 @@ public CompletableFuture signatureContents( * What a CMS verifier compares its message digest to. */ public CompletableFuture signatureDigest( - String docId, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm) { - return this.rawClient.signatureDigest(docId, sha, fieldKey, algorithm).thenApply(response -> response.body()); + String docId, + String layerName, + String sha, + String fieldKey, + SignatureDigestVersionsRequestAlgorithm algorithm) { + return this.rawClient + .signatureDigest(docId, layerName, sha, fieldKey, algorithm) + .thenApply(response -> response.body()); } /** @@ -204,12 +244,13 @@ public CompletableFuture signatureDigest( */ public CompletableFuture signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, RequestOptions requestOptions) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, requestOptions) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, requestOptions) .thenApply(response -> response.body()); } @@ -218,12 +259,13 @@ public CompletableFuture signatureDigest( */ public CompletableFuture signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, request) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, request) .thenApply(response -> response.body()); } @@ -232,13 +274,14 @@ public CompletableFuture signatureDigest( */ public CompletableFuture signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request, RequestOptions requestOptions) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, request, requestOptions) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/api/resources/doc/versions/RawVersionsClient.java b/src/main/java/api/resources/doc/versions/RawVersionsClient.java index d5fb429..47f2e13 100644 --- a/src/main/java/api/resources/doc/versions/RawVersionsClient.java +++ b/src/main/java/api/resources/doc/versions/RawVersionsClient.java @@ -43,35 +43,39 @@ public RawVersionsClient(ClientOptions clientOptions) { } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CloudPDFClientHttpResponse list(String docId) { - return list(docId, ListVersionsRequest.builder().build()); + public CloudPDFClientHttpResponse list(String docId, String layerName) { + return list(docId, layerName, ListVersionsRequest.builder().build()); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CloudPDFClientHttpResponse list(String docId, RequestOptions requestOptions) { - return list(docId, ListVersionsRequest.builder().build(), requestOptions); + public CloudPDFClientHttpResponse list( + String docId, String layerName, RequestOptions requestOptions) { + return list(docId, layerName, ListVersionsRequest.builder().build(), requestOptions); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public CloudPDFClientHttpResponse list(String docId, ListVersionsRequest request) { - return list(docId, request, null); + public CloudPDFClientHttpResponse list( + String docId, String layerName, ListVersionsRequest request) { + return list(docId, layerName, request, null); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ public CloudPDFClientHttpResponse list( - String docId, ListVersionsRequest request, RequestOptions requestOptions) { + String docId, String layerName, ListVersionsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions"); if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { @@ -128,37 +132,44 @@ public CloudPDFClientHttpResponse list( } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ - public CloudPDFClientHttpResponse analysis(String docId, String sha) { - return analysis(docId, sha, AnalysisVersionsRequest.builder().build()); + public CloudPDFClientHttpResponse analysis( + String docId, String layerName, String sha) { + return analysis(docId, layerName, sha, AnalysisVersionsRequest.builder().build()); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CloudPDFClientHttpResponse analysis( - String docId, String sha, RequestOptions requestOptions) { - return analysis(docId, sha, AnalysisVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return analysis(docId, layerName, sha, AnalysisVersionsRequest.builder().build(), requestOptions); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CloudPDFClientHttpResponse analysis( - String docId, String sha, AnalysisVersionsRequest request) { - return analysis(docId, sha, request, null); + String docId, String layerName, String sha, AnalysisVersionsRequest request) { + return analysis(docId, layerName, sha, request, null); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public CloudPDFClientHttpResponse analysis( - String docId, String sha, AnalysisVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + AnalysisVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/analysis") .addPathSegment(sha); if (request.getSinceSignature().isPresent()) { @@ -239,24 +250,32 @@ public CloudPDFClientHttpResponse analysis( } } - public CloudPDFClientHttpResponse download(String docId, String sha) { - return download(docId, sha, DownloadVersionsRequest.builder().build()); + public CloudPDFClientHttpResponse download(String docId, String layerName, String sha) { + return download(docId, layerName, sha, DownloadVersionsRequest.builder().build()); } - public CloudPDFClientHttpResponse download(String docId, String sha, RequestOptions requestOptions) { - return download(docId, sha, DownloadVersionsRequest.builder().build(), requestOptions); + public CloudPDFClientHttpResponse download( + String docId, String layerName, String sha, RequestOptions requestOptions) { + return download(docId, layerName, sha, DownloadVersionsRequest.builder().build(), requestOptions); } - public CloudPDFClientHttpResponse download(String docId, String sha, DownloadVersionsRequest request) { - return download(docId, sha, request, null); + public CloudPDFClientHttpResponse download( + String docId, String layerName, String sha, DownloadVersionsRequest request) { + return download(docId, layerName, sha, request, null); } public CloudPDFClientHttpResponse download( - String docId, String sha, DownloadVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + DownloadVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/download") .addPathSegment(sha); if (requestOptions != null) { @@ -312,26 +331,35 @@ public CloudPDFClientHttpResponse download( } } - public CloudPDFClientHttpResponse revision(String docId, String sha, int index) { - return revision(docId, sha, index, RevisionVersionsRequest.builder().build()); + public CloudPDFClientHttpResponse revision(String docId, String layerName, String sha, int index) { + return revision( + docId, layerName, sha, index, RevisionVersionsRequest.builder().build()); } public CloudPDFClientHttpResponse revision( - String docId, String sha, int index, RequestOptions requestOptions) { - return revision(docId, sha, index, RevisionVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, int index, RequestOptions requestOptions) { + return revision( + docId, layerName, sha, index, RevisionVersionsRequest.builder().build(), requestOptions); } public CloudPDFClientHttpResponse revision( - String docId, String sha, int index, RevisionVersionsRequest request) { - return revision(docId, sha, index, request, null); + String docId, String layerName, String sha, int index, RevisionVersionsRequest request) { + return revision(docId, layerName, sha, index, request, null); } public CloudPDFClientHttpResponse revision( - String docId, String sha, int index, RevisionVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + int index, + RevisionVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/revisions") .addPathSegment(sha) .addPathSegment(Integer.toString(index)); @@ -388,26 +416,35 @@ public CloudPDFClientHttpResponse revision( } } - public CloudPDFClientHttpResponse signatures(String docId, String sha) { - return signatures(docId, sha, SignaturesVersionsRequest.builder().build()); + public CloudPDFClientHttpResponse signatures( + String docId, String layerName, String sha) { + return signatures( + docId, layerName, sha, SignaturesVersionsRequest.builder().build()); } public CloudPDFClientHttpResponse signatures( - String docId, String sha, RequestOptions requestOptions) { - return signatures(docId, sha, SignaturesVersionsRequest.builder().build(), requestOptions); + String docId, String layerName, String sha, RequestOptions requestOptions) { + return signatures( + docId, layerName, sha, SignaturesVersionsRequest.builder().build(), requestOptions); } public CloudPDFClientHttpResponse signatures( - String docId, String sha, SignaturesVersionsRequest request) { - return signatures(docId, sha, request, null); + String docId, String layerName, String sha, SignaturesVersionsRequest request) { + return signatures(docId, layerName, sha, request, null); } public CloudPDFClientHttpResponse signatures( - String docId, String sha, SignaturesVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + SignaturesVersionsRequest request, + RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha); if (requestOptions != null) { @@ -467,26 +504,36 @@ public CloudPDFClientHttpResponse signatures( /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ - public CloudPDFClientHttpResponse signatureContents(String docId, String sha, String fieldKey) { + public CloudPDFClientHttpResponse signatureContents( + String docId, String layerName, String sha, String fieldKey) { return signatureContents( - docId, sha, fieldKey, SignatureContentsVersionsRequest.builder().build()); + docId, + layerName, + sha, + fieldKey, + SignatureContentsVersionsRequest.builder().build()); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CloudPDFClientHttpResponse signatureContents( - String docId, String sha, String fieldKey, RequestOptions requestOptions) { + String docId, String layerName, String sha, String fieldKey, RequestOptions requestOptions) { return signatureContents( - docId, sha, fieldKey, SignatureContentsVersionsRequest.builder().build(), requestOptions); + docId, + layerName, + sha, + fieldKey, + SignatureContentsVersionsRequest.builder().build(), + requestOptions); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public CloudPDFClientHttpResponse signatureContents( - String docId, String sha, String fieldKey, SignatureContentsVersionsRequest request) { - return signatureContents(docId, sha, fieldKey, request, null); + String docId, String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request) { + return signatureContents(docId, layerName, sha, fieldKey, request, null); } /** @@ -494,6 +541,7 @@ public CloudPDFClientHttpResponse signatureContents( */ public CloudPDFClientHttpResponse signatureContents( String docId, + String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request, @@ -502,6 +550,8 @@ public CloudPDFClientHttpResponse signatureContents( .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha) .addPathSegment(fieldKey) @@ -563,9 +613,14 @@ public CloudPDFClientHttpResponse signatureContents( * What a CMS verifier compares its message digest to. */ public CloudPDFClientHttpResponse signatureDigest( - String docId, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm) { + String docId, + String layerName, + String sha, + String fieldKey, + SignatureDigestVersionsRequestAlgorithm algorithm) { return signatureDigest( docId, + layerName, sha, fieldKey, algorithm, @@ -577,12 +632,14 @@ public CloudPDFClientHttpResponse signatureDigest( */ public CloudPDFClientHttpResponse signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, RequestOptions requestOptions) { return signatureDigest( docId, + layerName, sha, fieldKey, algorithm, @@ -595,11 +652,12 @@ public CloudPDFClientHttpResponse signatureDigest( */ public CloudPDFClientHttpResponse signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request) { - return signatureDigest(docId, sha, fieldKey, algorithm, request, null); + return signatureDigest(docId, layerName, sha, fieldKey, algorithm, request, null); } /** @@ -607,6 +665,7 @@ public CloudPDFClientHttpResponse signatureDigest( */ public CloudPDFClientHttpResponse signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, @@ -616,6 +675,8 @@ public CloudPDFClientHttpResponse signatureDigest( .newBuilder() .addPathSegments("v1/docs") .addPathSegment(docId) + .addPathSegments("layers") + .addPathSegment(layerName) .addPathSegments("versions/signatures") .addPathSegment(sha) .addPathSegment(fieldKey) diff --git a/src/main/java/api/resources/doc/versions/VersionsClient.java b/src/main/java/api/resources/doc/versions/VersionsClient.java index 6c01351..6c2e0da 100644 --- a/src/main/java/api/resources/doc/versions/VersionsClient.java +++ b/src/main/java/api/resources/doc/versions/VersionsClient.java @@ -36,128 +36,160 @@ public RawVersionsClient withRawResponse() { } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public DocVersionsList200Response list(String docId) { - return this.rawClient.list(docId).body(); + public DocVersionsList200Response list(String docId, String layerName) { + return this.rawClient.list(docId, layerName).body(); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public DocVersionsList200Response list(String docId, RequestOptions requestOptions) { - return this.rawClient.list(docId, requestOptions).body(); + public DocVersionsList200Response list(String docId, String layerName, RequestOptions requestOptions) { + return this.rawClient.list(docId, layerName, requestOptions).body(); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public DocVersionsList200Response list(String docId, ListVersionsRequest request) { - return this.rawClient.list(docId, request).body(); + public DocVersionsList200Response list(String docId, String layerName, ListVersionsRequest request) { + return this.rawClient.list(docId, layerName, request).body(); } /** - * Every completed signature publishes a new version. Never cached: the list grows. + * Every completed signature makes a new version of its layer; another layer's versions are never listed. Never cached: the list grows. */ - public DocVersionsList200Response list(String docId, ListVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.list(docId, request, requestOptions).body(); + public DocVersionsList200Response list( + String docId, String layerName, ListVersionsRequest request, RequestOptions requestOptions) { + return this.rawClient.list(docId, layerName, request, requestOptions).body(); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ - public DocVersionsAnalysis200Response analysis(String docId, String sha) { - return this.rawClient.analysis(docId, sha).body(); + public DocVersionsAnalysis200Response analysis(String docId, String layerName, String sha) { + return this.rawClient.analysis(docId, layerName, sha).body(); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ - public DocVersionsAnalysis200Response analysis(String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.analysis(docId, sha, requestOptions).body(); + public DocVersionsAnalysis200Response analysis( + String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.analysis(docId, layerName, sha, requestOptions).body(); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ - public DocVersionsAnalysis200Response analysis(String docId, String sha, AnalysisVersionsRequest request) { - return this.rawClient.analysis(docId, sha, request).body(); + public DocVersionsAnalysis200Response analysis( + String docId, String layerName, String sha, AnalysisVersionsRequest request) { + return this.rawClient.analysis(docId, layerName, sha, request).body(); } /** - * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every layer and every caller. + * Exactly one of since.signature / since.revision; until=<revision> defaults to the last. The same answer for every caller. */ public DocVersionsAnalysis200Response analysis( - String docId, String sha, AnalysisVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.analysis(docId, sha, request, requestOptions).body(); + String docId, + String layerName, + String sha, + AnalysisVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .analysis(docId, layerName, sha, request, requestOptions) + .body(); } - public InputStream download(String docId, String sha) { - return this.rawClient.download(docId, sha).body(); + public InputStream download(String docId, String layerName, String sha) { + return this.rawClient.download(docId, layerName, sha).body(); } - public InputStream download(String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.download(docId, sha, requestOptions).body(); + public InputStream download(String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.download(docId, layerName, sha, requestOptions).body(); } - public InputStream download(String docId, String sha, DownloadVersionsRequest request) { - return this.rawClient.download(docId, sha, request).body(); + public InputStream download(String docId, String layerName, String sha, DownloadVersionsRequest request) { + return this.rawClient.download(docId, layerName, sha, request).body(); } public InputStream download( - String docId, String sha, DownloadVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.download(docId, sha, request, requestOptions).body(); + String docId, + String layerName, + String sha, + DownloadVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .download(docId, layerName, sha, request, requestOptions) + .body(); } - public InputStream revision(String docId, String sha, int index) { - return this.rawClient.revision(docId, sha, index).body(); + public InputStream revision(String docId, String layerName, String sha, int index) { + return this.rawClient.revision(docId, layerName, sha, index).body(); } - public InputStream revision(String docId, String sha, int index, RequestOptions requestOptions) { - return this.rawClient.revision(docId, sha, index, requestOptions).body(); + public InputStream revision(String docId, String layerName, String sha, int index, RequestOptions requestOptions) { + return this.rawClient + .revision(docId, layerName, sha, index, requestOptions) + .body(); } - public InputStream revision(String docId, String sha, int index, RevisionVersionsRequest request) { - return this.rawClient.revision(docId, sha, index, request).body(); + public InputStream revision( + String docId, String layerName, String sha, int index, RevisionVersionsRequest request) { + return this.rawClient.revision(docId, layerName, sha, index, request).body(); } public InputStream revision( - String docId, String sha, int index, RevisionVersionsRequest request, RequestOptions requestOptions) { + String docId, + String layerName, + String sha, + int index, + RevisionVersionsRequest request, + RequestOptions requestOptions) { return this.rawClient - .revision(docId, sha, index, request, requestOptions) + .revision(docId, layerName, sha, index, request, requestOptions) .body(); } - public DocVersionsSignatures200Response signatures(String docId, String sha) { - return this.rawClient.signatures(docId, sha).body(); + public DocVersionsSignatures200Response signatures(String docId, String layerName, String sha) { + return this.rawClient.signatures(docId, layerName, sha).body(); } - public DocVersionsSignatures200Response signatures(String docId, String sha, RequestOptions requestOptions) { - return this.rawClient.signatures(docId, sha, requestOptions).body(); + public DocVersionsSignatures200Response signatures( + String docId, String layerName, String sha, RequestOptions requestOptions) { + return this.rawClient.signatures(docId, layerName, sha, requestOptions).body(); } - public DocVersionsSignatures200Response signatures(String docId, String sha, SignaturesVersionsRequest request) { - return this.rawClient.signatures(docId, sha, request).body(); + public DocVersionsSignatures200Response signatures( + String docId, String layerName, String sha, SignaturesVersionsRequest request) { + return this.rawClient.signatures(docId, layerName, sha, request).body(); } public DocVersionsSignatures200Response signatures( - String docId, String sha, SignaturesVersionsRequest request, RequestOptions requestOptions) { - return this.rawClient.signatures(docId, sha, request, requestOptions).body(); + String docId, + String layerName, + String sha, + SignaturesVersionsRequest request, + RequestOptions requestOptions) { + return this.rawClient + .signatures(docId, layerName, sha, request, requestOptions) + .body(); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ - public InputStream signatureContents(String docId, String sha, String fieldKey) { - return this.rawClient.signatureContents(docId, sha, fieldKey).body(); + public InputStream signatureContents(String docId, String layerName, String sha, String fieldKey) { + return this.rawClient.signatureContents(docId, layerName, sha, fieldKey).body(); } /** * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ - public InputStream signatureContents(String docId, String sha, String fieldKey, RequestOptions requestOptions) { + public InputStream signatureContents( + String docId, String layerName, String sha, String fieldKey, RequestOptions requestOptions) { return this.rawClient - .signatureContents(docId, sha, fieldKey, requestOptions) + .signatureContents(docId, layerName, sha, fieldKey, requestOptions) .body(); } @@ -165,8 +197,10 @@ public InputStream signatureContents(String docId, String sha, String fieldKey, * fieldKey is the field's fully qualified name, token-text encoded (the same encoding attachment keys use). */ public InputStream signatureContents( - String docId, String sha, String fieldKey, SignatureContentsVersionsRequest request) { - return this.rawClient.signatureContents(docId, sha, fieldKey, request).body(); + String docId, String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request) { + return this.rawClient + .signatureContents(docId, layerName, sha, fieldKey, request) + .body(); } /** @@ -174,12 +208,13 @@ public InputStream signatureContents( */ public InputStream signatureContents( String docId, + String layerName, String sha, String fieldKey, SignatureContentsVersionsRequest request, RequestOptions requestOptions) { return this.rawClient - .signatureContents(docId, sha, fieldKey, request, requestOptions) + .signatureContents(docId, layerName, sha, fieldKey, request, requestOptions) .body(); } @@ -187,8 +222,14 @@ public InputStream signatureContents( * What a CMS verifier compares its message digest to. */ public InputStream signatureDigest( - String docId, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm) { - return this.rawClient.signatureDigest(docId, sha, fieldKey, algorithm).body(); + String docId, + String layerName, + String sha, + String fieldKey, + SignatureDigestVersionsRequestAlgorithm algorithm) { + return this.rawClient + .signatureDigest(docId, layerName, sha, fieldKey, algorithm) + .body(); } /** @@ -196,12 +237,13 @@ public InputStream signatureDigest( */ public InputStream signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, RequestOptions requestOptions) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, requestOptions) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, requestOptions) .body(); } @@ -210,12 +252,13 @@ public InputStream signatureDigest( */ public InputStream signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, request) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, request) .body(); } @@ -224,13 +267,14 @@ public InputStream signatureDigest( */ public InputStream signatureDigest( String docId, + String layerName, String sha, String fieldKey, SignatureDigestVersionsRequestAlgorithm algorithm, SignatureDigestVersionsRequest request, RequestOptions requestOptions) { return this.rawClient - .signatureDigest(docId, sha, fieldKey, algorithm, request, requestOptions) + .signatureDigest(docId, layerName, sha, fieldKey, algorithm, request, requestOptions) .body(); } } diff --git a/src/main/java/api/resources/documents/AsyncDocumentsClient.java b/src/main/java/api/resources/documents/AsyncDocumentsClient.java index 0f4ed2f..94fb1c7 100644 --- a/src/main/java/api/resources/documents/AsyncDocumentsClient.java +++ b/src/main/java/api/resources/documents/AsyncDocumentsClient.java @@ -11,6 +11,7 @@ import com.cloudpdf.api.resources.documents.requests.DocumentsCommitRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsImportFromRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsInitRequest; +import com.cloudpdf.api.resources.documents.requests.DocumentsUpdateRequest; import com.cloudpdf.api.resources.documents.requests.DownloadDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.GetDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.ListDocumentsRequest; @@ -21,6 +22,7 @@ import com.cloudpdf.api.types.DocumentsImportFrom200Response; import com.cloudpdf.api.types.DocumentsInit200Response; import com.cloudpdf.api.types.DocumentsList200Response; +import com.cloudpdf.api.types.DocumentsUpdate200Response; import com.cloudpdf.api.types.DocumentsUploadProxy200Response; import java.io.File; import java.io.InputStream; @@ -99,6 +101,22 @@ public CompletableFuture delete( return this.rawClient.delete(tenantId, id, request, requestOptions).thenApply(response -> response.body()); } + /** + * A document that is being deleted answers 404. + */ + public CompletableFuture update( + String tenantId, String id, DocumentsUpdateRequest request) { + return this.rawClient.update(tenantId, id, request).thenApply(response -> response.body()); + } + + /** + * A document that is being deleted answers 404. + */ + public CompletableFuture update( + String tenantId, String id, DocumentsUpdateRequest request, RequestOptions requestOptions) { + return this.rawClient.update(tenantId, id, request, requestOptions).thenApply(response -> response.body()); + } + public CompletableFuture commit( String tenantId, String id, DocumentsCommitRequest request) { return this.rawClient.commit(tenantId, id, request).thenApply(response -> response.body()); diff --git a/src/main/java/api/resources/documents/AsyncRawDocumentsClient.java b/src/main/java/api/resources/documents/AsyncRawDocumentsClient.java index bdedfbc..6e2db7c 100644 --- a/src/main/java/api/resources/documents/AsyncRawDocumentsClient.java +++ b/src/main/java/api/resources/documents/AsyncRawDocumentsClient.java @@ -23,6 +23,7 @@ import com.cloudpdf.api.resources.documents.requests.DocumentsCommitRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsImportFromRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsInitRequest; +import com.cloudpdf.api.resources.documents.requests.DocumentsUpdateRequest; import com.cloudpdf.api.resources.documents.requests.DownloadDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.GetDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.ListDocumentsRequest; @@ -34,6 +35,7 @@ import com.cloudpdf.api.types.DocumentsImportFrom200Response; import com.cloudpdf.api.types.DocumentsInit200Response; import com.cloudpdf.api.types.DocumentsList200Response; +import com.cloudpdf.api.types.DocumentsUpdate200Response; import com.cloudpdf.api.types.DocumentsUploadProxy200Response; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.File; @@ -94,6 +96,21 @@ public CompletableFuture> l QueryStringMapper.addQueryParameter( httpUrl, "state", request.getState().get(), false); } + if (request.getQ().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + } + if (request.getFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "folderId", request.getFolderId().get(), false); + } + if (request.getSort().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().get(), false); + } + if (request.getOrder().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order", request.getOrder().get(), false); + } if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { httpUrl.addQueryParameter(_key, _value); @@ -345,6 +362,111 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { return future; } + /** + * A document that is being deleted answers 404. + */ + public CompletableFuture> update( + String tenantId, String id, DocumentsUpdateRequest request) { + return update(tenantId, id, request, null); + } + + /** + * A document that is being deleted answers 404. + */ + public CompletableFuture> update( + String tenantId, String id, DocumentsUpdateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("documents") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, DocumentsUpdate200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + 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> commit( String tenantId, String id, DocumentsCommitRequest request) { return commit(tenantId, id, request, null); diff --git a/src/main/java/api/resources/documents/DocumentsClient.java b/src/main/java/api/resources/documents/DocumentsClient.java index 1ba8a01..5f0761b 100644 --- a/src/main/java/api/resources/documents/DocumentsClient.java +++ b/src/main/java/api/resources/documents/DocumentsClient.java @@ -11,6 +11,7 @@ import com.cloudpdf.api.resources.documents.requests.DocumentsCommitRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsImportFromRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsInitRequest; +import com.cloudpdf.api.resources.documents.requests.DocumentsUpdateRequest; import com.cloudpdf.api.resources.documents.requests.DownloadDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.GetDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.ListDocumentsRequest; @@ -21,6 +22,7 @@ import com.cloudpdf.api.types.DocumentsImportFrom200Response; import com.cloudpdf.api.types.DocumentsInit200Response; import com.cloudpdf.api.types.DocumentsList200Response; +import com.cloudpdf.api.types.DocumentsUpdate200Response; import com.cloudpdf.api.types.DocumentsUploadProxy200Response; import java.io.File; import java.io.InputStream; @@ -96,6 +98,21 @@ public void delete(String tenantId, String id, DeleteDocumentsRequest request, R this.rawClient.delete(tenantId, id, request, requestOptions).body(); } + /** + * A document that is being deleted answers 404. + */ + public DocumentsUpdate200Response update(String tenantId, String id, DocumentsUpdateRequest request) { + return this.rawClient.update(tenantId, id, request).body(); + } + + /** + * A document that is being deleted answers 404. + */ + public DocumentsUpdate200Response update( + String tenantId, String id, DocumentsUpdateRequest request, RequestOptions requestOptions) { + return this.rawClient.update(tenantId, id, request, requestOptions).body(); + } + public DocumentsCommit200Response commit(String tenantId, String id, DocumentsCommitRequest request) { return this.rawClient.commit(tenantId, id, request).body(); } diff --git a/src/main/java/api/resources/documents/RawDocumentsClient.java b/src/main/java/api/resources/documents/RawDocumentsClient.java index 1e4fcf7..1643daa 100644 --- a/src/main/java/api/resources/documents/RawDocumentsClient.java +++ b/src/main/java/api/resources/documents/RawDocumentsClient.java @@ -23,6 +23,7 @@ import com.cloudpdf.api.resources.documents.requests.DocumentsCommitRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsImportFromRequest; import com.cloudpdf.api.resources.documents.requests.DocumentsInitRequest; +import com.cloudpdf.api.resources.documents.requests.DocumentsUpdateRequest; import com.cloudpdf.api.resources.documents.requests.DownloadDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.GetDocumentsRequest; import com.cloudpdf.api.resources.documents.requests.ListDocumentsRequest; @@ -34,6 +35,7 @@ import com.cloudpdf.api.types.DocumentsImportFrom200Response; import com.cloudpdf.api.types.DocumentsInit200Response; import com.cloudpdf.api.types.DocumentsList200Response; +import com.cloudpdf.api.types.DocumentsUpdate200Response; import com.cloudpdf.api.types.DocumentsUploadProxy200Response; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.File; @@ -88,6 +90,21 @@ public CloudPDFClientHttpResponse list( QueryStringMapper.addQueryParameter( httpUrl, "state", request.getState().get(), false); } + if (request.getQ().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "q", request.getQ().get(), false); + } + if (request.getFolderId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "folderId", request.getFolderId().get(), false); + } + if (request.getSort().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "sort", request.getSort().get(), false); + } + if (request.getOrder().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order", request.getOrder().get(), false); + } if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { httpUrl.addQueryParameter(_key, _value); @@ -286,6 +303,90 @@ public CloudPDFClientHttpResponse delete( } } + /** + * A document that is being deleted answers 404. + */ + public CloudPDFClientHttpResponse update( + String tenantId, String id, DocumentsUpdateRequest request) { + return update(tenantId, id, request, null); + } + + /** + * A document that is being deleted answers 404. + */ + public CloudPDFClientHttpResponse update( + String tenantId, String id, DocumentsUpdateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("documents") + .addPathSegment(id); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, DocumentsUpdate200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + 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 commit( String tenantId, String id, DocumentsCommitRequest request) { return commit(tenantId, id, request, null); diff --git a/src/main/java/api/resources/documents/requests/DocumentsImportFromRequest.java b/src/main/java/api/resources/documents/requests/DocumentsImportFromRequest.java index f8855f7..089cc33 100644 --- a/src/main/java/api/resources/documents/requests/DocumentsImportFromRequest.java +++ b/src/main/java/api/resources/documents/requests/DocumentsImportFromRequest.java @@ -29,6 +29,10 @@ public final class DocumentsImportFromRequest { private final Optional expected; + private final Optional name; + + private final Optional folderId; + private final Optional> metadata; private final Optional idempotencyKey; @@ -44,6 +48,8 @@ public final class DocumentsImportFromRequest { private DocumentsImportFromRequest( DocumentsImportFromRequestSource source, Optional expected, + Optional name, + Optional folderId, Optional> metadata, Optional idempotencyKey, Optional dedupMode, @@ -52,6 +58,8 @@ private DocumentsImportFromRequest( Map additionalProperties) { this.source = source; this.expected = expected; + this.name = name; + this.folderId = folderId; this.metadata = metadata; this.idempotencyKey = idempotencyKey; this.dedupMode = dedupMode; @@ -76,6 +84,22 @@ public Optional getExpected() { return expected; } + /** + * @return What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return A folder id, or root for the top level. + */ + @JsonProperty("folderId") + public Optional getFolderId() { + return folderId; + } + @JsonProperty("metadata") public Optional> getMetadata() { return metadata; @@ -124,6 +148,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsImportFromRequest other) { return source.equals(other.source) && expected.equals(other.expected) + && name.equals(other.name) + && folderId.equals(other.folderId) && metadata.equals(other.metadata) && idempotencyKey.equals(other.idempotencyKey) && dedupMode.equals(other.dedupMode) @@ -134,7 +160,15 @@ private boolean equalTo(DocumentsImportFromRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.source, this.expected, this.metadata, this.idempotencyKey, this.dedupMode, this.docId, this.mode); + this.source, + this.expected, + this.name, + this.folderId, + this.metadata, + this.idempotencyKey, + this.dedupMode, + this.docId, + this.mode); } @java.lang.Override @@ -169,6 +203,20 @@ public interface _FinalStage { _FinalStage expected(DocumentsImportFromRequestExpected expected); + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

A folder id, or root for the top level.

+ */ + _FinalStage folderId(Optional folderId); + + _FinalStage folderId(String folderId); + _FinalStage metadata(Optional> metadata); _FinalStage metadata(Map metadata); @@ -213,6 +261,10 @@ public static final class Builder implements SourceStage, _FinalStage { private Optional> metadata = Optional.empty(); + private Optional folderId = Optional.empty(); + + private Optional name = Optional.empty(); + private Optional expected = Optional.empty(); @JsonAnySetter @@ -224,6 +276,8 @@ private Builder() {} public Builder from(DocumentsImportFromRequest other) { source(other.getSource()); expected(other.getExpected()); + name(other.getName()); + folderId(other.getFolderId()); metadata(other.getMetadata()); idempotencyKey(other.getIdempotencyKey()); dedupMode(other.getDedupMode()); @@ -329,6 +383,46 @@ public _FinalStage metadata(Optional> metadata) { return this; } + /** + *

A folder id, or root for the top level.

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

A folder id, or root for the top level.

+ */ + @java.lang.Override + @JsonSetter(value = "folderId", nulls = Nulls.SKIP) + public _FinalStage folderId(Optional folderId) { + this.folderId = folderId; + return this; + } + + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

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

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + /** *

Integrity pins, enforced when present. When absent, the server-observed values become authoritative.

* @return Reference to {@code this} so that method calls can be chained together. @@ -352,7 +446,16 @@ public _FinalStage expected(Optional expecte @java.lang.Override public DocumentsImportFromRequest build() { return new DocumentsImportFromRequest( - source, expected, metadata, idempotencyKey, dedupMode, docId, mode, additionalProperties); + source, + expected, + name, + folderId, + metadata, + idempotencyKey, + dedupMode, + docId, + mode, + additionalProperties); } @java.lang.Override diff --git a/src/main/java/api/resources/documents/requests/DocumentsInitRequest.java b/src/main/java/api/resources/documents/requests/DocumentsInitRequest.java index 2b6e23b..e53fc6d 100644 --- a/src/main/java/api/resources/documents/requests/DocumentsInitRequest.java +++ b/src/main/java/api/resources/documents/requests/DocumentsInitRequest.java @@ -27,6 +27,10 @@ public final class DocumentsInitRequest { private final String contentSha256; + private final Optional name; + + private final Optional folderId; + private final Optional> metadata; private final Optional idempotencyKey; @@ -44,6 +48,8 @@ public final class DocumentsInitRequest { private DocumentsInitRequest( double contentLength, String contentSha256, + Optional name, + Optional folderId, Optional> metadata, Optional idempotencyKey, Optional dedupMode, @@ -53,6 +59,8 @@ private DocumentsInitRequest( Map additionalProperties) { this.contentLength = contentLength; this.contentSha256 = contentSha256; + this.name = name; + this.folderId = folderId; this.metadata = metadata; this.idempotencyKey = idempotencyKey; this.dedupMode = dedupMode; @@ -72,6 +80,22 @@ public String getContentSha256() { return contentSha256; } + /** + * @return What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return A folder id, or root for the top level. + */ + @JsonProperty("folderId") + public Optional getFolderId() { + return folderId; + } + @JsonProperty("metadata") public Optional> getMetadata() { return metadata; @@ -119,6 +143,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsInitRequest other) { return contentLength == other.contentLength && contentSha256.equals(other.contentSha256) + && name.equals(other.name) + && folderId.equals(other.folderId) && metadata.equals(other.metadata) && idempotencyKey.equals(other.idempotencyKey) && dedupMode.equals(other.dedupMode) @@ -132,6 +158,8 @@ public int hashCode() { return Objects.hash( this.contentLength, this.contentSha256, + this.name, + this.folderId, this.metadata, this.idempotencyKey, this.dedupMode, @@ -166,6 +194,20 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ */ + _FinalStage name(Optional name); + + _FinalStage name(String name); + + /** + *

A folder id, or root for the top level.

+ */ + _FinalStage folderId(Optional folderId); + + _FinalStage folderId(String folderId); + _FinalStage metadata(Optional> metadata); _FinalStage metadata(Map metadata); @@ -212,6 +254,10 @@ public static final class Builder implements ContentLengthStage, ContentSha256St private Optional> metadata = Optional.empty(); + private Optional folderId = Optional.empty(); + + private Optional name = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -221,6 +267,8 @@ private Builder() {} public Builder from(DocumentsInitRequest other) { contentLength(other.getContentLength()); contentSha256(other.getContentSha256()); + name(other.getName()); + folderId(other.getFolderId()); metadata(other.getMetadata()); idempotencyKey(other.getIdempotencyKey()); dedupMode(other.getDedupMode()); @@ -329,11 +377,53 @@ public _FinalStage metadata(Optional> metadata) { return this; } + /** + *

A folder id, or root for the top level.

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

A folder id, or root for the top level.

+ */ + @java.lang.Override + @JsonSetter(value = "folderId", nulls = Nulls.SKIP) + public _FinalStage folderId(Optional folderId) { + this.folderId = folderId; + return this; + } + + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

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

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ */ + @java.lang.Override + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public _FinalStage name(Optional name) { + this.name = name; + return this; + } + @java.lang.Override public DocumentsInitRequest build() { return new DocumentsInitRequest( contentLength, contentSha256, + name, + folderId, metadata, idempotencyKey, dedupMode, diff --git a/src/main/java/api/resources/documents/requests/DocumentsUpdateRequest.java b/src/main/java/api/resources/documents/requests/DocumentsUpdateRequest.java new file mode 100644 index 0000000..a9fd1e9 --- /dev/null +++ b/src/main/java/api/resources/documents/requests/DocumentsUpdateRequest.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.documents.requests; + +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 = DocumentsUpdateRequest.Builder.class) +public final class DocumentsUpdateRequest { + private final String name; + + private final Map additionalProperties; + + private DocumentsUpdateRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocumentsUpdateRequest && equalTo((DocumentsUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocumentsUpdateRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(DocumentsUpdateRequest other); + } + + public interface _FinalStage { + DocumentsUpdateRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocumentsUpdateRequest other) { + name(other.getName()); + return this; + } + + /** + *

What people call the document: shown in dashboards, searched and sorted by. 1 to 255 characters, no control characters, no leading or trailing whitespace. Names need not be unique.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public DocumentsUpdateRequest build() { + return new DocumentsUpdateRequest(name, 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/resources/documents/requests/ListDocumentsRequest.java b/src/main/java/api/resources/documents/requests/ListDocumentsRequest.java index 6612e01..d81df52 100644 --- a/src/main/java/api/resources/documents/requests/ListDocumentsRequest.java +++ b/src/main/java/api/resources/documents/requests/ListDocumentsRequest.java @@ -4,6 +4,8 @@ package com.cloudpdf.api.resources.documents.requests; import com.cloudpdf.api.core.ObjectMappers; +import com.cloudpdf.api.resources.documents.types.ListDocumentsRequestOrder; +import com.cloudpdf.api.resources.documents.types.ListDocumentsRequestSort; import com.cloudpdf.api.resources.documents.types.ListDocumentsRequestState; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -27,16 +29,32 @@ public final class ListDocumentsRequest { private final Optional state; + private final Optional q; + + private final Optional folderId; + + private final Optional sort; + + private final Optional order; + private final Map additionalProperties; private ListDocumentsRequest( Optional limit, Optional cursor, Optional state, + Optional q, + Optional folderId, + Optional sort, + Optional order, Map additionalProperties) { this.limit = limit; this.cursor = cursor; this.state = state; + this.q = q; + this.folderId = folderId; + this.sort = sort; + this.order = order; this.additionalProperties = additionalProperties; } @@ -50,11 +68,46 @@ public Optional getCursor() { return cursor; } + /** + * @return Only documents in this state. Without it, every state except deleting. + */ @JsonProperty("state") public Optional getState() { return state; } + /** + * @return Only documents whose name contains this text, ignoring case. + */ + @JsonProperty("q") + public Optional getQ() { + return q; + } + + /** + * @return Only documents directly in this folder (root: the top level). Without it, documents in every folder. + */ + @JsonProperty("folderId") + public Optional getFolderId() { + return folderId; + } + + /** + * @return createdAt (default), name (ignoring case), or size (stored bytes; 0 while pending). + */ + @JsonProperty("sort") + public Optional getSort() { + return sort; + } + + /** + * @return Defaults to the reading order of the sort: A to Z for name, newest and largest first otherwise. + */ + @JsonProperty("order") + public Optional getOrder() { + return order; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -67,12 +120,18 @@ public Map getAdditionalProperties() { } private boolean equalTo(ListDocumentsRequest other) { - return limit.equals(other.limit) && cursor.equals(other.cursor) && state.equals(other.state); + return limit.equals(other.limit) + && cursor.equals(other.cursor) + && state.equals(other.state) + && q.equals(other.q) + && folderId.equals(other.folderId) + && sort.equals(other.sort) + && order.equals(other.order); } @java.lang.Override public int hashCode() { - return Objects.hash(this.limit, this.cursor, this.state); + return Objects.hash(this.limit, this.cursor, this.state, this.q, this.folderId, this.sort, this.order); } @java.lang.Override @@ -92,6 +151,14 @@ public static final class Builder { private Optional state = Optional.empty(); + private Optional q = Optional.empty(); + + private Optional folderId = Optional.empty(); + + private Optional sort = Optional.empty(); + + private Optional order = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -101,6 +168,10 @@ public Builder from(ListDocumentsRequest other) { limit(other.getLimit()); cursor(other.getCursor()); state(other.getState()); + q(other.getQ()); + folderId(other.getFolderId()); + sort(other.getSort()); + order(other.getOrder()); return this; } @@ -126,6 +197,9 @@ public Builder cursor(String cursor) { return this; } + /** + *

Only documents in this state. Without it, every state except deleting.

+ */ @JsonSetter(value = "state", nulls = Nulls.SKIP) public Builder state(Optional state) { this.state = state; @@ -137,8 +211,64 @@ public Builder state(ListDocumentsRequestState state) { return this; } + /** + *

Only documents whose name contains this text, ignoring case.

+ */ + @JsonSetter(value = "q", nulls = Nulls.SKIP) + public Builder q(Optional q) { + this.q = q; + return this; + } + + public Builder q(String q) { + this.q = Optional.ofNullable(q); + return this; + } + + /** + *

Only documents directly in this folder (root: the top level). Without it, documents in every folder.

+ */ + @JsonSetter(value = "folderId", nulls = Nulls.SKIP) + public Builder folderId(Optional folderId) { + this.folderId = folderId; + return this; + } + + public Builder folderId(String folderId) { + this.folderId = Optional.ofNullable(folderId); + return this; + } + + /** + *

createdAt (default), name (ignoring case), or size (stored bytes; 0 while pending).

+ */ + @JsonSetter(value = "sort", nulls = Nulls.SKIP) + public Builder sort(Optional sort) { + this.sort = sort; + return this; + } + + public Builder sort(ListDocumentsRequestSort sort) { + this.sort = Optional.ofNullable(sort); + return this; + } + + /** + *

Defaults to the reading order of the sort: A to Z for name, newest and largest first otherwise.

+ */ + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; + return this; + } + + public Builder order(ListDocumentsRequestOrder order) { + this.order = Optional.ofNullable(order); + return this; + } + public ListDocumentsRequest build() { - return new ListDocumentsRequest(limit, cursor, state, additionalProperties); + return new ListDocumentsRequest(limit, cursor, state, q, folderId, sort, order, additionalProperties); } public Builder additionalProperty(String key, Object value) { diff --git a/src/main/java/api/types/TokensIssueRequestTenantScopeItemZero.java b/src/main/java/api/resources/documents/types/ListDocumentsRequestOrder.java similarity index 53% rename from src/main/java/api/types/TokensIssueRequestTenantScopeItemZero.java rename to src/main/java/api/resources/documents/types/ListDocumentsRequestOrder.java index f24862d..39405b2 100644 --- a/src/main/java/api/types/TokensIssueRequestTenantScopeItemZero.java +++ b/src/main/java/api/resources/documents/types/ListDocumentsRequestOrder.java @@ -1,20 +1,21 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.cloudpdf.api.types; +package com.cloudpdf.api.resources.documents.types; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -public final class TokensIssueRequestTenantScopeItemZero { - public static final TokensIssueRequestTenantScopeItemZero ALL = - new TokensIssueRequestTenantScopeItemZero(Value.ALL, "*"); +public final class ListDocumentsRequestOrder { + public static final ListDocumentsRequestOrder ASC = new ListDocumentsRequestOrder(Value.ASC, "asc"); + + public static final ListDocumentsRequestOrder DESC = new ListDocumentsRequestOrder(Value.DESC, "desc"); private final Value value; private final String string; - TokensIssueRequestTenantScopeItemZero(Value value, String string) { + ListDocumentsRequestOrder(Value value, String string) { this.value = value; this.string = string; } @@ -32,8 +33,8 @@ public String toString() { @java.lang.Override public boolean equals(Object other) { return (this == other) - || (other instanceof TokensIssueRequestTenantScopeItemZero - && this.string.equals(((TokensIssueRequestTenantScopeItemZero) other).string)); + || (other instanceof ListDocumentsRequestOrder + && this.string.equals(((ListDocumentsRequestOrder) other).string)); } @java.lang.Override @@ -43,8 +44,10 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case ALL: - return visitor.visitAll(); + case ASC: + return visitor.visitAsc(); + case DESC: + return visitor.visitDesc(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -52,23 +55,29 @@ public T visit(Visitor visitor) { } @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static TokensIssueRequestTenantScopeItemZero valueOf(String value) { + public static ListDocumentsRequestOrder valueOf(String value) { switch (value) { - case "*": - return ALL; + case "asc": + return ASC; + case "desc": + return DESC; default: - return new TokensIssueRequestTenantScopeItemZero(Value.UNKNOWN, value); + return new ListDocumentsRequestOrder(Value.UNKNOWN, value); } } public enum Value { - ALL, + ASC, + + DESC, UNKNOWN } public interface Visitor { - T visitAll(); + T visitAsc(); + + T visitDesc(); T visitUnknown(String unknownType); } diff --git a/src/main/java/api/resources/documents/types/ListDocumentsRequestSort.java b/src/main/java/api/resources/documents/types/ListDocumentsRequestSort.java new file mode 100644 index 0000000..759df23 --- /dev/null +++ b/src/main/java/api/resources/documents/types/ListDocumentsRequestSort.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.documents.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ListDocumentsRequestSort { + public static final ListDocumentsRequestSort SIZE = new ListDocumentsRequestSort(Value.SIZE, "size"); + + public static final ListDocumentsRequestSort NAME = new ListDocumentsRequestSort(Value.NAME, "name"); + + public static final ListDocumentsRequestSort CREATED_AT = + new ListDocumentsRequestSort(Value.CREATED_AT, "createdAt"); + + private final Value value; + + private final String string; + + ListDocumentsRequestSort(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 ListDocumentsRequestSort + && this.string.equals(((ListDocumentsRequestSort) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SIZE: + return visitor.visitSize(); + case NAME: + return visitor.visitName(); + case CREATED_AT: + return visitor.visitCreatedAt(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ListDocumentsRequestSort valueOf(String value) { + switch (value) { + case "size": + return SIZE; + case "name": + return NAME; + case "createdAt": + return CREATED_AT; + default: + return new ListDocumentsRequestSort(Value.UNKNOWN, value); + } + } + + public enum Value { + CREATED_AT, + + NAME, + + SIZE, + + UNKNOWN + } + + public interface Visitor { + T visitCreatedAt(); + + T visitName(); + + T visitSize(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/resources/folders/AsyncFoldersClient.java b/src/main/java/api/resources/folders/AsyncFoldersClient.java new file mode 100644 index 0000000..d7a3683 --- /dev/null +++ b/src/main/java/api/resources/folders/AsyncFoldersClient.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders; + +import com.cloudpdf.api.core.ClientOptions; +import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.resources.folders.requests.DeleteFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersCreateRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersMoveIntoRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersUpdateRequest; +import com.cloudpdf.api.resources.folders.requests.GetFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.ListFoldersRequest; +import com.cloudpdf.api.types.FoldersCreate200Response; +import com.cloudpdf.api.types.FoldersGet200Response; +import com.cloudpdf.api.types.FoldersList200Response; +import com.cloudpdf.api.types.FoldersUpdate200Response; +import java.util.concurrent.CompletableFuture; + +public class AsyncFoldersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFoldersClient rawClient; + + public AsyncFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFoldersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFoldersClient withRawResponse() { + return this.rawClient; + } + + public CompletableFuture list(String tenantId) { + return this.rawClient.list(tenantId).thenApply(response -> response.body()); + } + + public CompletableFuture list(String tenantId, RequestOptions requestOptions) { + return this.rawClient.list(tenantId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture list(String tenantId, ListFoldersRequest request) { + return this.rawClient.list(tenantId, request).thenApply(response -> response.body()); + } + + public CompletableFuture list( + String tenantId, ListFoldersRequest request, RequestOptions requestOptions) { + return this.rawClient.list(tenantId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CompletableFuture create(String tenantId, FoldersCreateRequest request) { + return this.rawClient.create(tenantId, request).thenApply(response -> response.body()); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CompletableFuture create( + String tenantId, FoldersCreateRequest request, RequestOptions requestOptions) { + return this.rawClient.create(tenantId, request, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String tenantId, String folderId) { + return this.rawClient.get(tenantId, folderId).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String tenantId, String folderId, RequestOptions requestOptions) { + return this.rawClient.get(tenantId, folderId, requestOptions).thenApply(response -> response.body()); + } + + public CompletableFuture get(String tenantId, String folderId, GetFoldersRequest request) { + return this.rawClient.get(tenantId, folderId, request).thenApply(response -> response.body()); + } + + public CompletableFuture get( + String tenantId, String folderId, GetFoldersRequest request, RequestOptions requestOptions) { + return this.rawClient.get(tenantId, folderId, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture delete(String tenantId, String folderId) { + return this.rawClient.delete(tenantId, folderId).thenApply(response -> response.body()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture delete(String tenantId, String folderId, RequestOptions requestOptions) { + return this.rawClient.delete(tenantId, folderId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture delete(String tenantId, String folderId, DeleteFoldersRequest request) { + return this.rawClient.delete(tenantId, folderId, request).thenApply(response -> response.body()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture delete( + String tenantId, String folderId, DeleteFoldersRequest request, RequestOptions requestOptions) { + return this.rawClient + .delete(tenantId, folderId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CompletableFuture update( + String tenantId, String folderId, FoldersUpdateRequest request) { + return this.rawClient.update(tenantId, folderId, request).thenApply(response -> response.body()); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CompletableFuture update( + String tenantId, String folderId, FoldersUpdateRequest request, RequestOptions requestOptions) { + return this.rawClient + .update(tenantId, folderId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture moveInto(String tenantId, String folderId) { + return this.rawClient.moveInto(tenantId, folderId).thenApply(response -> response.body()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture moveInto(String tenantId, String folderId, RequestOptions requestOptions) { + return this.rawClient.moveInto(tenantId, folderId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture moveInto(String tenantId, String folderId, FoldersMoveIntoRequest request) { + return this.rawClient.moveInto(tenantId, folderId, request).thenApply(response -> response.body()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture moveInto( + String tenantId, String folderId, FoldersMoveIntoRequest request, RequestOptions requestOptions) { + return this.rawClient + .moveInto(tenantId, folderId, request, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/api/resources/folders/AsyncRawFoldersClient.java b/src/main/java/api/resources/folders/AsyncRawFoldersClient.java new file mode 100644 index 0000000..bc95db0 --- /dev/null +++ b/src/main/java/api/resources/folders/AsyncRawFoldersClient.java @@ -0,0 +1,706 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders; + +import com.cloudpdf.api.core.ClientOptions; +import com.cloudpdf.api.core.CloudPDFApiException; +import com.cloudpdf.api.core.CloudPDFClientHttpResponse; +import com.cloudpdf.api.core.CloudPDFException; +import com.cloudpdf.api.core.MediaTypes; +import com.cloudpdf.api.core.ObjectMappers; +import com.cloudpdf.api.core.QueryStringMapper; +import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.core.RetryInterceptor; +import com.cloudpdf.api.errors.BadRequestError; +import com.cloudpdf.api.errors.ConflictError; +import com.cloudpdf.api.errors.ForbiddenError; +import com.cloudpdf.api.errors.NotFoundError; +import com.cloudpdf.api.resources.folders.requests.DeleteFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersCreateRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersMoveIntoRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersUpdateRequest; +import com.cloudpdf.api.resources.folders.requests.GetFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.ListFoldersRequest; +import com.cloudpdf.api.types.FoldersCreate200Response; +import com.cloudpdf.api.types.FoldersGet200Response; +import com.cloudpdf.api.types.FoldersList200Response; +import com.cloudpdf.api.types.FoldersUpdate200Response; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFoldersClient { + protected final ClientOptions clientOptions; + + public AsyncRawFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CompletableFuture> list(String tenantId) { + return list(tenantId, ListFoldersRequest.builder().build()); + } + + public CompletableFuture> list( + String tenantId, RequestOptions requestOptions) { + return list(tenantId, ListFoldersRequest.builder().build(), requestOptions); + } + + public CompletableFuture> list( + String tenantId, ListFoldersRequest request) { + return list(tenantId, request, null); + } + + public CompletableFuture> list( + String tenantId, ListFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getParentId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parentId", request.getParentId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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, FoldersList200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + 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; + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CompletableFuture> create( + String tenantId, FoldersCreateRequest request) { + return create(tenantId, request, null); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CompletableFuture> create( + String tenantId, FoldersCreateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, FoldersCreate200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + 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> get(String tenantId, String folderId) { + return get(tenantId, folderId, GetFoldersRequest.builder().build()); + } + + public CompletableFuture> get( + String tenantId, String folderId, RequestOptions requestOptions) { + return get(tenantId, folderId, GetFoldersRequest.builder().build(), requestOptions); + } + + public CompletableFuture> get( + String tenantId, String folderId, GetFoldersRequest request) { + return get(tenantId, folderId, request, null); + } + + public CompletableFuture> get( + String tenantId, String folderId, GetFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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, FoldersGet200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 403: + future.completeExceptionally(new ForbiddenError( + 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; + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture> delete(String tenantId, String folderId) { + return delete(tenantId, folderId, DeleteFoldersRequest.builder().build()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture> delete( + String tenantId, String folderId, RequestOptions requestOptions) { + return delete(tenantId, folderId, DeleteFoldersRequest.builder().build(), requestOptions); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture> delete( + String tenantId, String folderId, DeleteFoldersRequest request) { + return delete(tenantId, folderId, request, null); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CompletableFuture> delete( + String tenantId, String folderId, DeleteFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (request.getRecursive().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "recursive", request.getRecursive().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + 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; + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CompletableFuture> update( + String tenantId, String folderId, FoldersUpdateRequest request) { + return update(tenantId, folderId, request, null); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CompletableFuture> update( + String tenantId, String folderId, FoldersUpdateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, FoldersUpdate200Response.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + 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; + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture> moveInto(String tenantId, String folderId) { + return moveInto(tenantId, folderId, FoldersMoveIntoRequest.builder().build()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture> moveInto( + String tenantId, String folderId, RequestOptions requestOptions) { + return moveInto(tenantId, folderId, FoldersMoveIntoRequest.builder().build(), requestOptions); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture> moveInto( + String tenantId, String folderId, FoldersMoveIntoRequest request) { + return moveInto(tenantId, folderId, request, null); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CompletableFuture> moveInto( + String tenantId, String folderId, FoldersMoveIntoRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId) + .addPathSegments("move-into"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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<>(null, 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 403: + future.completeExceptionally(new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + 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; + } +} diff --git a/src/main/java/api/resources/folders/FoldersClient.java b/src/main/java/api/resources/folders/FoldersClient.java new file mode 100644 index 0000000..d20b99f --- /dev/null +++ b/src/main/java/api/resources/folders/FoldersClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders; + +import com.cloudpdf.api.core.ClientOptions; +import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.resources.folders.requests.DeleteFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersCreateRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersMoveIntoRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersUpdateRequest; +import com.cloudpdf.api.resources.folders.requests.GetFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.ListFoldersRequest; +import com.cloudpdf.api.types.FoldersCreate200Response; +import com.cloudpdf.api.types.FoldersGet200Response; +import com.cloudpdf.api.types.FoldersList200Response; +import com.cloudpdf.api.types.FoldersUpdate200Response; + +public class FoldersClient { + protected final ClientOptions clientOptions; + + private final RawFoldersClient rawClient; + + public FoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFoldersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFoldersClient withRawResponse() { + return this.rawClient; + } + + public FoldersList200Response list(String tenantId) { + return this.rawClient.list(tenantId).body(); + } + + public FoldersList200Response list(String tenantId, RequestOptions requestOptions) { + return this.rawClient.list(tenantId, requestOptions).body(); + } + + public FoldersList200Response list(String tenantId, ListFoldersRequest request) { + return this.rawClient.list(tenantId, request).body(); + } + + public FoldersList200Response list(String tenantId, ListFoldersRequest request, RequestOptions requestOptions) { + return this.rawClient.list(tenantId, request, requestOptions).body(); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public FoldersCreate200Response create(String tenantId, FoldersCreateRequest request) { + return this.rawClient.create(tenantId, request).body(); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public FoldersCreate200Response create( + String tenantId, FoldersCreateRequest request, RequestOptions requestOptions) { + return this.rawClient.create(tenantId, request, requestOptions).body(); + } + + public FoldersGet200Response get(String tenantId, String folderId) { + return this.rawClient.get(tenantId, folderId).body(); + } + + public FoldersGet200Response get(String tenantId, String folderId, RequestOptions requestOptions) { + return this.rawClient.get(tenantId, folderId, requestOptions).body(); + } + + public FoldersGet200Response get(String tenantId, String folderId, GetFoldersRequest request) { + return this.rawClient.get(tenantId, folderId, request).body(); + } + + public FoldersGet200Response get( + String tenantId, String folderId, GetFoldersRequest request, RequestOptions requestOptions) { + return this.rawClient.get(tenantId, folderId, request, requestOptions).body(); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public void delete(String tenantId, String folderId) { + this.rawClient.delete(tenantId, folderId).body(); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public void delete(String tenantId, String folderId, RequestOptions requestOptions) { + this.rawClient.delete(tenantId, folderId, requestOptions).body(); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public void delete(String tenantId, String folderId, DeleteFoldersRequest request) { + this.rawClient.delete(tenantId, folderId, request).body(); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public void delete(String tenantId, String folderId, DeleteFoldersRequest request, RequestOptions requestOptions) { + this.rawClient.delete(tenantId, folderId, request, requestOptions).body(); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public FoldersUpdate200Response update(String tenantId, String folderId, FoldersUpdateRequest request) { + return this.rawClient.update(tenantId, folderId, request).body(); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public FoldersUpdate200Response update( + String tenantId, String folderId, FoldersUpdateRequest request, RequestOptions requestOptions) { + return this.rawClient + .update(tenantId, folderId, request, requestOptions) + .body(); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public void moveInto(String tenantId, String folderId) { + this.rawClient.moveInto(tenantId, folderId).body(); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public void moveInto(String tenantId, String folderId, RequestOptions requestOptions) { + this.rawClient.moveInto(tenantId, folderId, requestOptions).body(); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public void moveInto(String tenantId, String folderId, FoldersMoveIntoRequest request) { + this.rawClient.moveInto(tenantId, folderId, request).body(); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public void moveInto( + String tenantId, String folderId, FoldersMoveIntoRequest request, RequestOptions requestOptions) { + this.rawClient.moveInto(tenantId, folderId, request, requestOptions).body(); + } +} diff --git a/src/main/java/api/resources/folders/RawFoldersClient.java b/src/main/java/api/resources/folders/RawFoldersClient.java new file mode 100644 index 0000000..4a549b8 --- /dev/null +++ b/src/main/java/api/resources/folders/RawFoldersClient.java @@ -0,0 +1,570 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders; + +import com.cloudpdf.api.core.ClientOptions; +import com.cloudpdf.api.core.CloudPDFApiException; +import com.cloudpdf.api.core.CloudPDFClientHttpResponse; +import com.cloudpdf.api.core.CloudPDFException; +import com.cloudpdf.api.core.MediaTypes; +import com.cloudpdf.api.core.ObjectMappers; +import com.cloudpdf.api.core.QueryStringMapper; +import com.cloudpdf.api.core.RequestOptions; +import com.cloudpdf.api.core.RetryInterceptor; +import com.cloudpdf.api.errors.BadRequestError; +import com.cloudpdf.api.errors.ConflictError; +import com.cloudpdf.api.errors.ForbiddenError; +import com.cloudpdf.api.errors.NotFoundError; +import com.cloudpdf.api.resources.folders.requests.DeleteFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersCreateRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersMoveIntoRequest; +import com.cloudpdf.api.resources.folders.requests.FoldersUpdateRequest; +import com.cloudpdf.api.resources.folders.requests.GetFoldersRequest; +import com.cloudpdf.api.resources.folders.requests.ListFoldersRequest; +import com.cloudpdf.api.types.FoldersCreate200Response; +import com.cloudpdf.api.types.FoldersGet200Response; +import com.cloudpdf.api.types.FoldersList200Response; +import com.cloudpdf.api.types.FoldersUpdate200Response; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFoldersClient { + protected final ClientOptions clientOptions; + + public RawFoldersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + public CloudPDFClientHttpResponse list(String tenantId) { + return list(tenantId, ListFoldersRequest.builder().build()); + } + + public CloudPDFClientHttpResponse list(String tenantId, RequestOptions requestOptions) { + return list(tenantId, ListFoldersRequest.builder().build(), requestOptions); + } + + public CloudPDFClientHttpResponse list(String tenantId, ListFoldersRequest request) { + return list(tenantId, request, null); + } + + public CloudPDFClientHttpResponse list( + String tenantId, ListFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders"); + if (request.getLimit().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "limit", request.getLimit().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getParentId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parentId", request.getParentId().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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, FoldersList200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + 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); + } + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CloudPDFClientHttpResponse create(String tenantId, FoldersCreateRequest request) { + return create(tenantId, request, null); + } + + /** + * 409 Conflict carries details.reason: name-taken (a sibling has the name, ignoring case; details.name) or too-deep (folders nest at most 100 levels; details.maxDepth). 404 when the parent folder does not exist. + */ + public CloudPDFClientHttpResponse create( + String tenantId, FoldersCreateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, FoldersCreate200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + 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 get(String tenantId, String folderId) { + return get(tenantId, folderId, GetFoldersRequest.builder().build()); + } + + public CloudPDFClientHttpResponse get( + String tenantId, String folderId, RequestOptions requestOptions) { + return get(tenantId, folderId, GetFoldersRequest.builder().build(), requestOptions); + } + + public CloudPDFClientHttpResponse get( + String tenantId, String folderId, GetFoldersRequest request) { + return get(tenantId, folderId, request, null); + } + + public CloudPDFClientHttpResponse get( + String tenantId, String folderId, GetFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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, FoldersGet200Response.class), response); + } + try { + switch (response.code()) { + case 403: + throw new ForbiddenError( + 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); + } + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CloudPDFClientHttpResponse delete(String tenantId, String folderId) { + return delete(tenantId, folderId, DeleteFoldersRequest.builder().build()); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CloudPDFClientHttpResponse delete(String tenantId, String folderId, RequestOptions requestOptions) { + return delete(tenantId, folderId, DeleteFoldersRequest.builder().build(), requestOptions); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CloudPDFClientHttpResponse delete(String tenantId, String folderId, DeleteFoldersRequest request) { + return delete(tenantId, folderId, request, null); + } + + /** + * Without recursive, a folder with anything inside is refused: 409 Conflict with details.reason not-empty and what it holds, counted over every level below, in details.folders and details.documents. With recursive=true, the folder and every folder under it go at once, and every document in them stops opening, leaves every list and stops answering its share links at once; their stored files and links are removed in the background. Uploads into those folders that have not committed cannot commit. + */ + public CloudPDFClientHttpResponse delete( + String tenantId, String folderId, DeleteFoldersRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (request.getRecursive().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "recursive", request.getRecursive().get(), false); + } + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + 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<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + try { + switch (response.code()) { + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + 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); + } + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CloudPDFClientHttpResponse update( + String tenantId, String folderId, FoldersUpdateRequest request) { + return update(tenantId, folderId, request, null); + } + + /** + * 409 Conflict with details.reason name-taken when a sibling has the name, ignoring case. + */ + public CloudPDFClientHttpResponse update( + String tenantId, String folderId, FoldersUpdateRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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, FoldersUpdate200Response.class), + response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + 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); + } + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CloudPDFClientHttpResponse moveInto(String tenantId, String folderId) { + return moveInto(tenantId, folderId, FoldersMoveIntoRequest.builder().build()); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CloudPDFClientHttpResponse moveInto(String tenantId, String folderId, RequestOptions requestOptions) { + return moveInto(tenantId, folderId, FoldersMoveIntoRequest.builder().build(), requestOptions); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CloudPDFClientHttpResponse moveInto(String tenantId, String folderId, FoldersMoveIntoRequest request) { + return moveInto(tenantId, folderId, request, null); + } + + /** + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in details.documentIds and details.folderIds. 409 Conflict carries details.reason: cycle (the destination is a moved folder or inside one; details.folderId), too-deep (the move would nest folders deeper than 100 levels; details.maxDepth) or name-taken (a moved folder's name is taken in the destination, ignoring case; details.name). + */ + public CloudPDFClientHttpResponse moveInto( + String tenantId, String folderId, FoldersMoveIntoRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("v1/tenants") + .addPathSegment(tenantId) + .addPathSegments("folders") + .addPathSegment(folderId) + .addPathSegments("move-into"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new CloudPDFException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .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<>(null, 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 403: + throw new ForbiddenError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + 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); + } + } +} diff --git a/src/main/java/api/resources/folders/requests/DeleteFoldersRequest.java b/src/main/java/api/resources/folders/requests/DeleteFoldersRequest.java new file mode 100644 index 0000000..a3b728f --- /dev/null +++ b/src/main/java/api/resources/folders/requests/DeleteFoldersRequest.java @@ -0,0 +1,111 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DeleteFoldersRequest.Builder.class) +public final class DeleteFoldersRequest { + private final Optional recursive; + + private final Map additionalProperties; + + private DeleteFoldersRequest(Optional recursive, Map additionalProperties) { + this.recursive = recursive; + this.additionalProperties = additionalProperties; + } + + /** + * @return true deletes everything in the folder too. Never the default. + */ + @JsonProperty("recursive") + public Optional getRecursive() { + return recursive; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DeleteFoldersRequest && equalTo((DeleteFoldersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DeleteFoldersRequest other) { + return recursive.equals(other.recursive); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.recursive); + } + + @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 recursive = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(DeleteFoldersRequest other) { + recursive(other.getRecursive()); + return this; + } + + /** + *

true deletes everything in the folder too. Never the default.

+ */ + @JsonSetter(value = "recursive", nulls = Nulls.SKIP) + public Builder recursive(Optional recursive) { + this.recursive = recursive; + return this; + } + + public Builder recursive(Boolean recursive) { + this.recursive = Optional.ofNullable(recursive); + return this; + } + + public DeleteFoldersRequest build() { + return new DeleteFoldersRequest(recursive, 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/folders/requests/FoldersCreateRequest.java b/src/main/java/api/resources/folders/requests/FoldersCreateRequest.java new file mode 100644 index 0000000..f463d53 --- /dev/null +++ b/src/main/java/api/resources/folders/requests/FoldersCreateRequest.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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 = FoldersCreateRequest.Builder.class) +public final class FoldersCreateRequest { + private final String name; + + private final Optional parentId; + + private final Map additionalProperties; + + private FoldersCreateRequest(String name, Optional parentId, Map additionalProperties) { + this.name = name; + this.parentId = parentId; + this.additionalProperties = additionalProperties; + } + + /** + * @return What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return A folder id, or root for the top level. + */ + @JsonProperty("parentId") + public Optional getParentId() { + return parentId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersCreateRequest && equalTo((FoldersCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersCreateRequest other) { + return name.equals(other.name) && parentId.equals(other.parentId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.parentId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(FoldersCreateRequest other); + } + + public interface _FinalStage { + FoldersCreateRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

A folder id, or root for the top level.

+ */ + _FinalStage parentId(Optional parentId); + + _FinalStage parentId(String parentId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional parentId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersCreateRequest other) { + name(other.getName()); + parentId(other.getParentId()); + return this; + } + + /** + *

What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

A folder id, or root for the top level.

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

A folder id, or root for the top level.

+ */ + @java.lang.Override + @JsonSetter(value = "parentId", nulls = Nulls.SKIP) + public _FinalStage parentId(Optional parentId) { + this.parentId = parentId; + return this; + } + + @java.lang.Override + public FoldersCreateRequest build() { + return new FoldersCreateRequest(name, parentId, 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/resources/folders/requests/FoldersMoveIntoRequest.java b/src/main/java/api/resources/folders/requests/FoldersMoveIntoRequest.java new file mode 100644 index 0000000..c066331 --- /dev/null +++ b/src/main/java/api/resources/folders/requests/FoldersMoveIntoRequest.java @@ -0,0 +1,131 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FoldersMoveIntoRequest.Builder.class) +public final class FoldersMoveIntoRequest { + private final Optional> documentIds; + + private final Optional> folderIds; + + private final Map additionalProperties; + + private FoldersMoveIntoRequest( + Optional> documentIds, + Optional> folderIds, + Map additionalProperties) { + this.documentIds = documentIds; + this.folderIds = folderIds; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("documentIds") + public Optional> getDocumentIds() { + return documentIds; + } + + @JsonProperty("folderIds") + public Optional> getFolderIds() { + return folderIds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersMoveIntoRequest && equalTo((FoldersMoveIntoRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersMoveIntoRequest other) { + return documentIds.equals(other.documentIds) && folderIds.equals(other.folderIds); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.documentIds, this.folderIds); + } + + @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> documentIds = Optional.empty(); + + private Optional> folderIds = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FoldersMoveIntoRequest other) { + documentIds(other.getDocumentIds()); + folderIds(other.getFolderIds()); + return this; + } + + @JsonSetter(value = "documentIds", nulls = Nulls.SKIP) + public Builder documentIds(Optional> documentIds) { + this.documentIds = documentIds; + return this; + } + + public Builder documentIds(List documentIds) { + this.documentIds = Optional.ofNullable(documentIds); + return this; + } + + @JsonSetter(value = "folderIds", nulls = Nulls.SKIP) + public Builder folderIds(Optional> folderIds) { + this.folderIds = folderIds; + return this; + } + + public Builder folderIds(List folderIds) { + this.folderIds = Optional.ofNullable(folderIds); + return this; + } + + public FoldersMoveIntoRequest build() { + return new FoldersMoveIntoRequest(documentIds, folderIds, 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/folders/requests/FoldersUpdateRequest.java b/src/main/java/api/resources/folders/requests/FoldersUpdateRequest.java new file mode 100644 index 0000000..a14f049 --- /dev/null +++ b/src/main/java/api/resources/folders/requests/FoldersUpdateRequest.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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 = FoldersUpdateRequest.Builder.class) +public final class FoldersUpdateRequest { + private final String name; + + private final Map additionalProperties; + + private FoldersUpdateRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersUpdateRequest && equalTo((FoldersUpdateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersUpdateRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case.

+ */ + _FinalStage name(@NotNull String name); + + Builder from(FoldersUpdateRequest other); + } + + public interface _FinalStage { + FoldersUpdateRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersUpdateRequest other) { + name(other.getName()); + return this; + } + + /** + *

What people call the folder: 1 to 255 characters, no control characters, no leading or trailing whitespace, and unique among the folder's siblings, ignoring case.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public FoldersUpdateRequest build() { + return new FoldersUpdateRequest(name, 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/resources/folders/requests/GetFoldersRequest.java b/src/main/java/api/resources/folders/requests/GetFoldersRequest.java new file mode 100644 index 0000000..d2c025b --- /dev/null +++ b/src/main/java/api/resources/folders/requests/GetFoldersRequest.java @@ -0,0 +1,69 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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 = GetFoldersRequest.Builder.class) +public final class GetFoldersRequest { + private final Map additionalProperties; + + private GetFoldersRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GetFoldersRequest; + } + + @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(GetFoldersRequest other) { + return this; + } + + public GetFoldersRequest build() { + return new GetFoldersRequest(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/folders/requests/ListFoldersRequest.java b/src/main/java/api/resources/folders/requests/ListFoldersRequest.java new file mode 100644 index 0000000..3ceb8f4 --- /dev/null +++ b/src/main/java/api/resources/folders/requests/ListFoldersRequest.java @@ -0,0 +1,159 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.cloudpdf.api.resources.folders.requests; + +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; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ListFoldersRequest.Builder.class) +public final class ListFoldersRequest { + private final Optional limit; + + private final Optional cursor; + + private final Optional parentId; + + private final Map additionalProperties; + + private ListFoldersRequest( + Optional limit, + Optional cursor, + Optional parentId, + Map additionalProperties) { + this.limit = limit; + this.cursor = cursor; + this.parentId = parentId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("limit") + public Optional getLimit() { + return limit; + } + + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Only the folders directly in this folder (root: the top level). Without it, every folder. + */ + @JsonProperty("parentId") + public Optional getParentId() { + return parentId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ListFoldersRequest && equalTo((ListFoldersRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ListFoldersRequest other) { + return limit.equals(other.limit) && cursor.equals(other.cursor) && parentId.equals(other.parentId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.limit, this.cursor, this.parentId); + } + + @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 limit = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional parentId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ListFoldersRequest other) { + limit(other.getLimit()); + cursor(other.getCursor()); + parentId(other.getParentId()); + return this; + } + + @JsonSetter(value = "limit", nulls = Nulls.SKIP) + public Builder limit(Optional limit) { + this.limit = limit; + return this; + } + + public Builder limit(Integer limit) { + this.limit = Optional.ofNullable(limit); + return this; + } + + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

Only the folders directly in this folder (root: the top level). Without it, every folder.

+ */ + @JsonSetter(value = "parentId", nulls = Nulls.SKIP) + public Builder parentId(Optional parentId) { + this.parentId = parentId; + return this; + } + + public Builder parentId(String parentId) { + this.parentId = Optional.ofNullable(parentId); + return this; + } + + public ListFoldersRequest build() { + return new ListFoldersRequest(limit, cursor, parentId, 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/shares/requests/SharesCreateRequest.java b/src/main/java/api/resources/shares/requests/SharesCreateRequest.java index 6beb901..a4fe4b9 100644 --- a/src/main/java/api/resources/shares/requests/SharesCreateRequest.java +++ b/src/main/java/api/resources/shares/requests/SharesCreateRequest.java @@ -8,6 +8,7 @@ import com.cloudpdf.api.core.ObjectMappers; import com.cloudpdf.api.resources.shares.types.SharesCreateRequestLayerMode; import com.cloudpdf.api.resources.shares.types.SharesCreateRequestVisitorIdentity; +import com.cloudpdf.api.types.Identity; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -40,6 +41,8 @@ public final class SharesCreateRequest { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -59,6 +62,7 @@ private SharesCreateRequest( Optional keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, Optional password, @@ -71,6 +75,7 @@ private SharesCreateRequest( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.password = password; @@ -115,6 +120,14 @@ public Optional getVisitorIdentity() { return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -152,6 +165,12 @@ private Optional _getVisitorIdentity() { return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -170,6 +189,7 @@ private boolean equalTo(SharesCreateRequest other) { && keepVisitorLayers.equals(other.keepVisitorLayers) && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && password.equals(other.password) @@ -186,6 +206,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.password, @@ -239,6 +260,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -276,6 +303,8 @@ public static final class Builder implements DocIdStage, _FinalStage { private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -299,6 +328,7 @@ public Builder from(SharesCreateRequest other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); password(other.getPassword()); @@ -390,6 +420,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -488,6 +543,7 @@ public SharesCreateRequest build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, password, diff --git a/src/main/java/api/resources/shares/requests/SharesUpdateRequest.java b/src/main/java/api/resources/shares/requests/SharesUpdateRequest.java index 0954c52..98a6a57 100644 --- a/src/main/java/api/resources/shares/requests/SharesUpdateRequest.java +++ b/src/main/java/api/resources/shares/requests/SharesUpdateRequest.java @@ -8,6 +8,7 @@ import com.cloudpdf.api.core.ObjectMappers; import com.cloudpdf.api.resources.shares.types.SharesUpdateRequestLayerMode; import com.cloudpdf.api.resources.shares.types.SharesUpdateRequestVisitorIdentity; +import com.cloudpdf.api.types.Identity; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -36,6 +37,8 @@ public final class SharesUpdateRequest { private final Optional visitorIdentity; + private final Optional identity; + private final Optional> scope; private final Optional> origins; @@ -56,6 +59,7 @@ private SharesUpdateRequest( Optional keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, Optional> scope, Optional> origins, Optional password, @@ -68,6 +72,7 @@ private SharesUpdateRequest( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.password = password; @@ -108,6 +113,14 @@ public Optional getVisitorIdentity() { return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public Optional> getScope() { return scope; @@ -159,6 +172,12 @@ private Optional _getVisitorIdentity() { return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -194,6 +213,7 @@ private boolean equalTo(SharesUpdateRequest other) { && keepVisitorLayers.equals(other.keepVisitorLayers) && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && password.equals(other.password) @@ -210,6 +230,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.password, @@ -239,6 +260,8 @@ public static final class Builder { private Optional visitorIdentity = Optional.empty(); + private Optional identity = Optional.empty(); + private Optional> scope = Optional.empty(); private Optional> origins = Optional.empty(); @@ -262,6 +285,7 @@ public Builder from(SharesUpdateRequest other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); password(other.getPassword()); @@ -348,6 +372,28 @@ public Builder visitorIdentity(Nullable visi return this; } + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public Builder identity(Optional identity) { + this.identity = identity; + return this; + } + + public Builder identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + public Builder identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + @JsonSetter(value = "scope", nulls = Nulls.SKIP) public Builder scope(Optional> scope) { this.scope = scope; @@ -454,6 +500,7 @@ public SharesUpdateRequest build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, password, diff --git a/src/main/java/api/types/DocVersionsList200Response.java b/src/main/java/api/types/DocVersionsList200Response.java index c9a2a8e..33abbcd 100644 --- a/src/main/java/api/types/DocVersionsList200Response.java +++ b/src/main/java/api/types/DocVersionsList200Response.java @@ -22,24 +22,24 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = DocVersionsList200Response.Builder.class) public final class DocVersionsList200Response { - private final String head; + private final String baseSha; private final List versions; private final Map additionalProperties; private DocVersionsList200Response( - String head, + String baseSha, List versions, Map additionalProperties) { - this.head = head; + this.baseSha = baseSha; this.versions = versions; this.additionalProperties = additionalProperties; } - @JsonProperty("head") - public String getHead() { - return head; + @JsonProperty("baseSha") + public String getBaseSha() { + return baseSha; } @JsonProperty("versions") @@ -59,12 +59,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(DocVersionsList200Response other) { - return head.equals(other.head) && versions.equals(other.versions); + return baseSha.equals(other.baseSha) && versions.equals(other.versions); } @java.lang.Override public int hashCode() { - return Objects.hash(this.head, this.versions); + return Objects.hash(this.baseSha, this.versions); } @java.lang.Override @@ -72,12 +72,12 @@ public String toString() { return ObjectMappers.stringify(this); } - public static HeadStage builder() { + public static BaseShaStage builder() { return new Builder(); } - public interface HeadStage { - _FinalStage head(@NotNull String head); + public interface BaseShaStage { + _FinalStage baseSha(@NotNull String baseSha); Builder from(DocVersionsList200Response other); } @@ -97,8 +97,8 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements HeadStage, _FinalStage { - private String head; + public static final class Builder implements BaseShaStage, _FinalStage { + private String baseSha; private List versions = new ArrayList<>(); @@ -109,15 +109,15 @@ private Builder() {} @java.lang.Override public Builder from(DocVersionsList200Response other) { - head(other.getHead()); + baseSha(other.getBaseSha()); versions(other.getVersions()); return this; } @java.lang.Override - @JsonSetter("head") - public _FinalStage head(@NotNull String head) { - this.head = Objects.requireNonNull(head, "head must not be null"); + @JsonSetter("baseSha") + public _FinalStage baseSha(@NotNull String baseSha) { + this.baseSha = Objects.requireNonNull(baseSha, "baseSha must not be null"); return this; } @@ -147,7 +147,7 @@ public _FinalStage versions(List version @java.lang.Override public DocVersionsList200Response build() { - return new DocVersionsList200Response(head, versions, additionalProperties); + return new DocVersionsList200Response(baseSha, versions, additionalProperties); } @java.lang.Override diff --git a/src/main/java/api/types/DocumentsCommit200ResponseDocument.java b/src/main/java/api/types/DocumentsCommit200ResponseDocument.java index 5101706..d5e0844 100644 --- a/src/main/java/api/types/DocumentsCommit200ResponseDocument.java +++ b/src/main/java/api/types/DocumentsCommit200ResponseDocument.java @@ -28,6 +28,10 @@ public final class DocumentsCommit200ResponseDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsCommit200ResponseDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsCommit200ResponseDocument { private DocumentsCommit200ResponseDocument( String id, String tenantId, + String name, + String folderId, DocumentsCommit200ResponseDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsCommit200ResponseDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsCommit200ResponseDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsCommit200ResponseDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsCommit200ResponseDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsCommit200ResponseDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsCommit200ResponseDocumentState state) { @@ -622,6 +689,8 @@ public DocumentsCommit200ResponseDocument build() { return new DocumentsCommit200ResponseDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsGet200ResponseDocument.java b/src/main/java/api/types/DocumentsGet200ResponseDocument.java index 7c74cb1..93ad12c 100644 --- a/src/main/java/api/types/DocumentsGet200ResponseDocument.java +++ b/src/main/java/api/types/DocumentsGet200ResponseDocument.java @@ -28,6 +28,10 @@ public final class DocumentsGet200ResponseDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsGet200ResponseDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsGet200ResponseDocument { private DocumentsGet200ResponseDocument( String id, String tenantId, + String name, + String folderId, DocumentsGet200ResponseDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsGet200ResponseDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsGet200ResponseDocumentState getState() { return state; @@ -225,6 +246,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsGet200ResponseDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -243,6 +266,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -272,7 +297,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -343,11 +379,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsGet200ResponseDocumentState state; private double createdAt; @@ -379,6 +426,8 @@ private Builder() {} public Builder from(DocumentsGet200ResponseDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -402,11 +451,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsGet200ResponseDocumentState state) { @@ -621,6 +688,8 @@ public DocumentsGet200ResponseDocument build() { return new DocumentsGet200ResponseDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsImportFrom200ResponseDocument.java b/src/main/java/api/types/DocumentsImportFrom200ResponseDocument.java index 6dbd16e..cace3e9 100644 --- a/src/main/java/api/types/DocumentsImportFrom200ResponseDocument.java +++ b/src/main/java/api/types/DocumentsImportFrom200ResponseDocument.java @@ -28,6 +28,10 @@ public final class DocumentsImportFrom200ResponseDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsImportFrom200ResponseDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsImportFrom200ResponseDocument { private DocumentsImportFrom200ResponseDocument( String id, String tenantId, + String name, + String folderId, DocumentsImportFrom200ResponseDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsImportFrom200ResponseDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsImportFrom200ResponseDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsImportFrom200ResponseDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsImportFrom200ResponseDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsImportFrom200ResponseDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsImportFrom200ResponseDocumentState state) { @@ -623,6 +690,8 @@ public DocumentsImportFrom200ResponseDocument build() { return new DocumentsImportFrom200ResponseDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsImportFrom202ResponseDocument.java b/src/main/java/api/types/DocumentsImportFrom202ResponseDocument.java index 1541632..7197845 100644 --- a/src/main/java/api/types/DocumentsImportFrom202ResponseDocument.java +++ b/src/main/java/api/types/DocumentsImportFrom202ResponseDocument.java @@ -28,6 +28,10 @@ public final class DocumentsImportFrom202ResponseDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsImportFrom202ResponseDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsImportFrom202ResponseDocument { private DocumentsImportFrom202ResponseDocument( String id, String tenantId, + String name, + String folderId, DocumentsImportFrom202ResponseDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsImportFrom202ResponseDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsImportFrom202ResponseDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsImportFrom202ResponseDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsImportFrom202ResponseDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsImportFrom202ResponseDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsImportFrom202ResponseDocumentState state) { @@ -623,6 +690,8 @@ public DocumentsImportFrom202ResponseDocument build() { return new DocumentsImportFrom202ResponseDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsInit200ResponseCreatedDocument.java b/src/main/java/api/types/DocumentsInit200ResponseCreatedDocument.java index 752c003..0146adf 100644 --- a/src/main/java/api/types/DocumentsInit200ResponseCreatedDocument.java +++ b/src/main/java/api/types/DocumentsInit200ResponseCreatedDocument.java @@ -28,6 +28,10 @@ public final class DocumentsInit200ResponseCreatedDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsInit200ResponseCreatedDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsInit200ResponseCreatedDocument { private DocumentsInit200ResponseCreatedDocument( String id, String tenantId, + String name, + String folderId, DocumentsInit200ResponseCreatedDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsInit200ResponseCreatedDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsInit200ResponseCreatedDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsInit200ResponseCreatedDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsInit200ResponseCreatedDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsInit200ResponseCreatedDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsInit200ResponseCreatedDocumentState state) { @@ -623,6 +690,8 @@ public DocumentsInit200ResponseCreatedDocument build() { return new DocumentsInit200ResponseCreatedDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsInit200ResponseDedupedDocument.java b/src/main/java/api/types/DocumentsInit200ResponseDedupedDocument.java index 14efdab..6e4f3de 100644 --- a/src/main/java/api/types/DocumentsInit200ResponseDedupedDocument.java +++ b/src/main/java/api/types/DocumentsInit200ResponseDedupedDocument.java @@ -28,6 +28,10 @@ public final class DocumentsInit200ResponseDedupedDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsInit200ResponseDedupedDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsInit200ResponseDedupedDocument { private DocumentsInit200ResponseDedupedDocument( String id, String tenantId, + String name, + String folderId, DocumentsInit200ResponseDedupedDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsInit200ResponseDedupedDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsInit200ResponseDedupedDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsInit200ResponseDedupedDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsInit200ResponseDedupedDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsInit200ResponseDedupedDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsInit200ResponseDedupedDocumentState state) { @@ -623,6 +690,8 @@ public DocumentsInit200ResponseDedupedDocument build() { return new DocumentsInit200ResponseDedupedDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsInit200ResponseResumedDocument.java b/src/main/java/api/types/DocumentsInit200ResponseResumedDocument.java index 491c41d..628b179 100644 --- a/src/main/java/api/types/DocumentsInit200ResponseResumedDocument.java +++ b/src/main/java/api/types/DocumentsInit200ResponseResumedDocument.java @@ -28,6 +28,10 @@ public final class DocumentsInit200ResponseResumedDocument { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsInit200ResponseResumedDocumentState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsInit200ResponseResumedDocument { private DocumentsInit200ResponseResumedDocument( String id, String tenantId, + String name, + String folderId, DocumentsInit200ResponseResumedDocumentState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsInit200ResponseResumedDocument( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsInit200ResponseResumedDocumentState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsInit200ResponseResumedDocument other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsInit200ResponseResumedDocumentState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsInit200ResponseResumedDocument other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsInit200ResponseResumedDocumentState state) { @@ -623,6 +690,8 @@ public DocumentsInit200ResponseResumedDocument build() { return new DocumentsInit200ResponseResumedDocument( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsList200ResponseDocumentsItem.java b/src/main/java/api/types/DocumentsList200ResponseDocumentsItem.java index e2318c5..58c6eb9 100644 --- a/src/main/java/api/types/DocumentsList200ResponseDocumentsItem.java +++ b/src/main/java/api/types/DocumentsList200ResponseDocumentsItem.java @@ -28,6 +28,10 @@ public final class DocumentsList200ResponseDocumentsItem { private final String tenantId; + private final String name; + + private final String folderId; + private final DocumentsList200ResponseDocumentsItemState state; private final Optional baseSha; @@ -55,6 +59,8 @@ public final class DocumentsList200ResponseDocumentsItem { private DocumentsList200ResponseDocumentsItem( String id, String tenantId, + String name, + String folderId, DocumentsList200ResponseDocumentsItemState state, Optional baseSha, Optional storageSizeBytes, @@ -69,6 +75,8 @@ private DocumentsList200ResponseDocumentsItem( Map additionalProperties) { this.id = id; this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; this.state = state; this.baseSha = baseSha; this.storageSizeBytes = storageSizeBytes; @@ -93,6 +101,19 @@ public String getTenantId() { return tenantId; } + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + @JsonProperty("state") public DocumentsList200ResponseDocumentsItemState getState() { return state; @@ -226,6 +247,8 @@ public Map getAdditionalProperties() { private boolean equalTo(DocumentsList200ResponseDocumentsItem other) { return id.equals(other.id) && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) && state.equals(other.state) && baseSha.equals(other.baseSha) && storageSizeBytes.equals(other.storageSizeBytes) @@ -244,6 +267,8 @@ public int hashCode() { return Objects.hash( this.id, this.tenantId, + this.name, + this.folderId, this.state, this.baseSha, this.storageSizeBytes, @@ -273,7 +298,18 @@ public interface IdStage { } public interface TenantIdStage { - StateStage tenantId(@NotNull String tenantId); + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); } public interface StateStage { @@ -344,11 +380,22 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder - implements IdStage, TenantIdStage, StateStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { private String id; private String tenantId; + private String name; + + private String folderId; + private DocumentsList200ResponseDocumentsItemState state; private double createdAt; @@ -380,6 +427,8 @@ private Builder() {} public Builder from(DocumentsList200ResponseDocumentsItem other) { id(other.getId()); tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); state(other.getState()); baseSha(other.getBaseSha()); storageSizeBytes(other.getStorageSizeBytes()); @@ -403,11 +452,29 @@ public TenantIdStage id(@NotNull String id) { @java.lang.Override @JsonSetter("tenantId") - public StateStage tenantId(@NotNull String tenantId) { + public NameStage tenantId(@NotNull String tenantId) { this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); return this; } + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + @java.lang.Override @JsonSetter("state") public CreatedAtStage state(@NotNull DocumentsList200ResponseDocumentsItemState state) { @@ -623,6 +690,8 @@ public DocumentsList200ResponseDocumentsItem build() { return new DocumentsList200ResponseDocumentsItem( id, tenantId, + name, + folderId, state, baseSha, storageSizeBytes, diff --git a/src/main/java/api/types/DocumentsUpdate200Response.java b/src/main/java/api/types/DocumentsUpdate200Response.java new file mode 100644 index 0000000..8995c6d --- /dev/null +++ b/src/main/java/api/types/DocumentsUpdate200Response.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 = DocumentsUpdate200Response.Builder.class) +public final class DocumentsUpdate200Response { + private final DocumentsUpdate200ResponseDocument document; + + private final Map additionalProperties; + + private DocumentsUpdate200Response( + DocumentsUpdate200ResponseDocument document, Map additionalProperties) { + this.document = document; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("document") + public DocumentsUpdate200ResponseDocument getDocument() { + return document; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocumentsUpdate200Response && equalTo((DocumentsUpdate200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocumentsUpdate200Response other) { + return document.equals(other.document); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.document); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static DocumentStage builder() { + return new Builder(); + } + + public interface DocumentStage { + _FinalStage document(@NotNull DocumentsUpdate200ResponseDocument document); + + Builder from(DocumentsUpdate200Response other); + } + + public interface _FinalStage { + DocumentsUpdate200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements DocumentStage, _FinalStage { + private DocumentsUpdate200ResponseDocument document; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocumentsUpdate200Response other) { + document(other.getDocument()); + return this; + } + + @java.lang.Override + @JsonSetter("document") + public _FinalStage document(@NotNull DocumentsUpdate200ResponseDocument document) { + this.document = Objects.requireNonNull(document, "document must not be null"); + return this; + } + + @java.lang.Override + public DocumentsUpdate200Response build() { + return new DocumentsUpdate200Response(document, 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/DocumentsUpdate200ResponseDocument.java b/src/main/java/api/types/DocumentsUpdate200ResponseDocument.java new file mode 100644 index 0000000..9b73706 --- /dev/null +++ b/src/main/java/api/types/DocumentsUpdate200ResponseDocument.java @@ -0,0 +1,720 @@ +/** + * 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.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 = DocumentsUpdate200ResponseDocument.Builder.class) +public final class DocumentsUpdate200ResponseDocument { + private final String id; + + private final String tenantId; + + private final String name; + + private final String folderId; + + private final DocumentsUpdate200ResponseDocumentState state; + + private final Optional baseSha; + + private final Optional storageSizeBytes; + + private final Optional> metadata; + + private final Optional idempotencyKey; + + private final Optional failureReason; + + private final Optional thumbnailState; + + private final Optional thumbnailUrl; + + private final double createdAt; + + private final double updatedAt; + + private final Optional createdBy; + + private final Map additionalProperties; + + private DocumentsUpdate200ResponseDocument( + String id, + String tenantId, + String name, + String folderId, + DocumentsUpdate200ResponseDocumentState state, + Optional baseSha, + Optional storageSizeBytes, + Optional> metadata, + Optional idempotencyKey, + Optional failureReason, + Optional thumbnailState, + Optional thumbnailUrl, + double createdAt, + double updatedAt, + Optional createdBy, + Map additionalProperties) { + this.id = id; + this.tenantId = tenantId; + this.name = name; + this.folderId = folderId; + this.state = state; + this.baseSha = baseSha; + this.storageSizeBytes = storageSizeBytes; + this.metadata = metadata; + this.idempotencyKey = idempotencyKey; + this.failureReason = failureReason; + this.thumbnailState = thumbnailState; + this.thumbnailUrl = thumbnailUrl; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.createdBy = createdBy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("tenantId") + public String getTenantId() { + return tenantId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The folder the document is in, or root. + */ + @JsonProperty("folderId") + public String getFolderId() { + return folderId; + } + + @JsonProperty("state") + public DocumentsUpdate200ResponseDocumentState getState() { + return state; + } + + @JsonIgnore + public Optional getBaseSha() { + if (baseSha == null) { + return Optional.empty(); + } + return baseSha; + } + + @JsonIgnore + public Optional getStorageSizeBytes() { + if (storageSizeBytes == null) { + return Optional.empty(); + } + return storageSizeBytes; + } + + @JsonIgnore + public Optional> getMetadata() { + if (metadata == null) { + return Optional.empty(); + } + return metadata; + } + + @JsonIgnore + public Optional getIdempotencyKey() { + if (idempotencyKey == null) { + return Optional.empty(); + } + return idempotencyKey; + } + + @JsonIgnore + public Optional getFailureReason() { + if (failureReason == null) { + return Optional.empty(); + } + return failureReason; + } + + @JsonProperty("thumbnailState") + public Optional getThumbnailState() { + return thumbnailState; + } + + @JsonIgnore + public Optional getThumbnailUrl() { + if (thumbnailUrl == null) { + return Optional.empty(); + } + return thumbnailUrl; + } + + @JsonProperty("createdAt") + public double getCreatedAt() { + return createdAt; + } + + @JsonProperty("updatedAt") + public double getUpdatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional getCreatedBy() { + if (createdBy == null) { + return Optional.empty(); + } + return createdBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("baseSha") + private Optional _getBaseSha() { + return baseSha; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("storageSizeBytes") + private Optional _getStorageSizeBytes() { + return storageSizeBytes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("metadata") + private Optional> _getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("idempotencyKey") + private Optional _getIdempotencyKey() { + return idempotencyKey; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("failureReason") + private Optional _getFailureReason() { + return failureReason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("thumbnailUrl") + private Optional _getThumbnailUrl() { + return thumbnailUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("createdBy") + private Optional _getCreatedBy() { + return createdBy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DocumentsUpdate200ResponseDocument + && equalTo((DocumentsUpdate200ResponseDocument) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DocumentsUpdate200ResponseDocument other) { + return id.equals(other.id) + && tenantId.equals(other.tenantId) + && name.equals(other.name) + && folderId.equals(other.folderId) + && state.equals(other.state) + && baseSha.equals(other.baseSha) + && storageSizeBytes.equals(other.storageSizeBytes) + && metadata.equals(other.metadata) + && idempotencyKey.equals(other.idempotencyKey) + && failureReason.equals(other.failureReason) + && thumbnailState.equals(other.thumbnailState) + && thumbnailUrl.equals(other.thumbnailUrl) + && createdAt == other.createdAt + && updatedAt == other.updatedAt + && createdBy.equals(other.createdBy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.tenantId, + this.name, + this.folderId, + this.state, + this.baseSha, + this.storageSizeBytes, + this.metadata, + this.idempotencyKey, + this.failureReason, + this.thumbnailState, + this.thumbnailUrl, + this.createdAt, + this.updatedAt, + this.createdBy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TenantIdStage id(@NotNull String id); + + Builder from(DocumentsUpdate200ResponseDocument other); + } + + public interface TenantIdStage { + NameStage tenantId(@NotNull String tenantId); + } + + public interface NameStage { + FolderIdStage name(@NotNull String name); + } + + public interface FolderIdStage { + /** + *

The folder the document is in, or root.

+ */ + StateStage folderId(@NotNull String folderId); + } + + public interface StateStage { + CreatedAtStage state(@NotNull DocumentsUpdate200ResponseDocumentState state); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(double createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(double updatedAt); + } + + public interface _FinalStage { + DocumentsUpdate200ResponseDocument build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage baseSha(Optional baseSha); + + _FinalStage baseSha(String baseSha); + + _FinalStage baseSha(Nullable baseSha); + + _FinalStage storageSizeBytes(Optional storageSizeBytes); + + _FinalStage storageSizeBytes(Double storageSizeBytes); + + _FinalStage storageSizeBytes(Nullable storageSizeBytes); + + _FinalStage metadata(Optional> metadata); + + _FinalStage metadata(Map metadata); + + _FinalStage metadata(Nullable> metadata); + + _FinalStage idempotencyKey(Optional idempotencyKey); + + _FinalStage idempotencyKey(String idempotencyKey); + + _FinalStage idempotencyKey(Nullable idempotencyKey); + + _FinalStage failureReason(Optional failureReason); + + _FinalStage failureReason(String failureReason); + + _FinalStage failureReason(Nullable failureReason); + + _FinalStage thumbnailState(Optional thumbnailState); + + _FinalStage thumbnailState(DocumentsUpdate200ResponseDocumentThumbnailState thumbnailState); + + _FinalStage thumbnailUrl(Optional thumbnailUrl); + + _FinalStage thumbnailUrl(String thumbnailUrl); + + _FinalStage thumbnailUrl(Nullable thumbnailUrl); + + _FinalStage createdBy(Optional createdBy); + + _FinalStage createdBy(String createdBy); + + _FinalStage createdBy(Nullable createdBy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + TenantIdStage, + NameStage, + FolderIdStage, + StateStage, + CreatedAtStage, + UpdatedAtStage, + _FinalStage { + private String id; + + private String tenantId; + + private String name; + + private String folderId; + + private DocumentsUpdate200ResponseDocumentState state; + + private double createdAt; + + private double updatedAt; + + private Optional createdBy = Optional.empty(); + + private Optional thumbnailUrl = Optional.empty(); + + private Optional thumbnailState = Optional.empty(); + + private Optional failureReason = Optional.empty(); + + private Optional idempotencyKey = Optional.empty(); + + private Optional> metadata = Optional.empty(); + + private Optional storageSizeBytes = Optional.empty(); + + private Optional baseSha = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DocumentsUpdate200ResponseDocument other) { + id(other.getId()); + tenantId(other.getTenantId()); + name(other.getName()); + folderId(other.getFolderId()); + state(other.getState()); + baseSha(other.getBaseSha()); + storageSizeBytes(other.getStorageSizeBytes()); + metadata(other.getMetadata()); + idempotencyKey(other.getIdempotencyKey()); + failureReason(other.getFailureReason()); + thumbnailState(other.getThumbnailState()); + thumbnailUrl(other.getThumbnailUrl()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + createdBy(other.getCreatedBy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TenantIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("tenantId") + public NameStage tenantId(@NotNull String tenantId) { + this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public FolderIdStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The folder the document is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("folderId") + public StateStage folderId(@NotNull String folderId) { + this.folderId = Objects.requireNonNull(folderId, "folderId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("state") + public CreatedAtStage state(@NotNull DocumentsUpdate200ResponseDocumentState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("createdAt") + public UpdatedAtStage createdAt(double createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(double updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + @java.lang.Override + public _FinalStage createdBy(Nullable createdBy) { + if (createdBy.isNull()) { + this.createdBy = null; + } else if (createdBy.isEmpty()) { + this.createdBy = Optional.empty(); + } else { + this.createdBy = Optional.of(createdBy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage createdBy(String createdBy) { + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "createdBy", nulls = Nulls.SKIP) + public _FinalStage createdBy(Optional createdBy) { + this.createdBy = createdBy; + return this; + } + + @java.lang.Override + public _FinalStage thumbnailUrl(Nullable thumbnailUrl) { + if (thumbnailUrl.isNull()) { + this.thumbnailUrl = null; + } else if (thumbnailUrl.isEmpty()) { + this.thumbnailUrl = Optional.empty(); + } else { + this.thumbnailUrl = Optional.of(thumbnailUrl.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage thumbnailUrl(String thumbnailUrl) { + this.thumbnailUrl = Optional.ofNullable(thumbnailUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "thumbnailUrl", nulls = Nulls.SKIP) + public _FinalStage thumbnailUrl(Optional thumbnailUrl) { + this.thumbnailUrl = thumbnailUrl; + return this; + } + + @java.lang.Override + public _FinalStage thumbnailState(DocumentsUpdate200ResponseDocumentThumbnailState thumbnailState) { + this.thumbnailState = Optional.ofNullable(thumbnailState); + return this; + } + + @java.lang.Override + @JsonSetter(value = "thumbnailState", nulls = Nulls.SKIP) + public _FinalStage thumbnailState(Optional thumbnailState) { + this.thumbnailState = thumbnailState; + return this; + } + + @java.lang.Override + public _FinalStage failureReason(Nullable failureReason) { + if (failureReason.isNull()) { + this.failureReason = null; + } else if (failureReason.isEmpty()) { + this.failureReason = Optional.empty(); + } else { + this.failureReason = Optional.of(failureReason.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage failureReason(String failureReason) { + this.failureReason = Optional.ofNullable(failureReason); + return this; + } + + @java.lang.Override + @JsonSetter(value = "failureReason", nulls = Nulls.SKIP) + public _FinalStage failureReason(Optional failureReason) { + this.failureReason = failureReason; + return this; + } + + @java.lang.Override + public _FinalStage idempotencyKey(Nullable idempotencyKey) { + if (idempotencyKey.isNull()) { + this.idempotencyKey = null; + } else if (idempotencyKey.isEmpty()) { + this.idempotencyKey = Optional.empty(); + } else { + this.idempotencyKey = Optional.of(idempotencyKey.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage idempotencyKey(String idempotencyKey) { + this.idempotencyKey = Optional.ofNullable(idempotencyKey); + return this; + } + + @java.lang.Override + @JsonSetter(value = "idempotencyKey", nulls = Nulls.SKIP) + public _FinalStage idempotencyKey(Optional idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + @java.lang.Override + public _FinalStage metadata(Nullable> metadata) { + if (metadata.isNull()) { + this.metadata = null; + } else if (metadata.isEmpty()) { + this.metadata = Optional.empty(); + } else { + this.metadata = Optional.of(metadata.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage metadata(Map metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional> metadata) { + this.metadata = metadata; + return this; + } + + @java.lang.Override + public _FinalStage storageSizeBytes(Nullable storageSizeBytes) { + if (storageSizeBytes.isNull()) { + this.storageSizeBytes = null; + } else if (storageSizeBytes.isEmpty()) { + this.storageSizeBytes = Optional.empty(); + } else { + this.storageSizeBytes = Optional.of(storageSizeBytes.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage storageSizeBytes(Double storageSizeBytes) { + this.storageSizeBytes = Optional.ofNullable(storageSizeBytes); + return this; + } + + @java.lang.Override + @JsonSetter(value = "storageSizeBytes", nulls = Nulls.SKIP) + public _FinalStage storageSizeBytes(Optional storageSizeBytes) { + this.storageSizeBytes = storageSizeBytes; + return this; + } + + @java.lang.Override + public _FinalStage baseSha(Nullable baseSha) { + if (baseSha.isNull()) { + this.baseSha = null; + } else if (baseSha.isEmpty()) { + this.baseSha = Optional.empty(); + } else { + this.baseSha = Optional.of(baseSha.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage baseSha(String baseSha) { + this.baseSha = Optional.ofNullable(baseSha); + return this; + } + + @java.lang.Override + @JsonSetter(value = "baseSha", nulls = Nulls.SKIP) + public _FinalStage baseSha(Optional baseSha) { + this.baseSha = baseSha; + return this; + } + + @java.lang.Override + public DocumentsUpdate200ResponseDocument build() { + return new DocumentsUpdate200ResponseDocument( + id, + tenantId, + name, + folderId, + state, + baseSha, + storageSizeBytes, + metadata, + idempotencyKey, + failureReason, + thumbnailState, + thumbnailUrl, + createdAt, + updatedAt, + createdBy, + 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/DocumentsUpdate200ResponseDocumentState.java b/src/main/java/api/types/DocumentsUpdate200ResponseDocumentState.java new file mode 100644 index 0000000..b09200f --- /dev/null +++ b/src/main/java/api/types/DocumentsUpdate200ResponseDocumentState.java @@ -0,0 +1,108 @@ +/** + * 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 DocumentsUpdate200ResponseDocumentState { + public static final DocumentsUpdate200ResponseDocumentState FAILED = + new DocumentsUpdate200ResponseDocumentState(Value.FAILED, "failed"); + + public static final DocumentsUpdate200ResponseDocumentState DELETING = + new DocumentsUpdate200ResponseDocumentState(Value.DELETING, "deleting"); + + public static final DocumentsUpdate200ResponseDocumentState PENDING = + new DocumentsUpdate200ResponseDocumentState(Value.PENDING, "pending"); + + public static final DocumentsUpdate200ResponseDocumentState READY = + new DocumentsUpdate200ResponseDocumentState(Value.READY, "ready"); + + private final Value value; + + private final String string; + + DocumentsUpdate200ResponseDocumentState(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 DocumentsUpdate200ResponseDocumentState + && this.string.equals(((DocumentsUpdate200ResponseDocumentState) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case DELETING: + return visitor.visitDeleting(); + case PENDING: + return visitor.visitPending(); + case READY: + return visitor.visitReady(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocumentsUpdate200ResponseDocumentState valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "deleting": + return DELETING; + case "pending": + return PENDING; + case "ready": + return READY; + default: + return new DocumentsUpdate200ResponseDocumentState(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + READY, + + FAILED, + + DELETING, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitReady(); + + T visitFailed(); + + T visitDeleting(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/DocumentsUpdate200ResponseDocumentThumbnailState.java b/src/main/java/api/types/DocumentsUpdate200ResponseDocumentThumbnailState.java new file mode 100644 index 0000000..045aa57 --- /dev/null +++ b/src/main/java/api/types/DocumentsUpdate200ResponseDocumentThumbnailState.java @@ -0,0 +1,108 @@ +/** + * 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 DocumentsUpdate200ResponseDocumentThumbnailState { + public static final DocumentsUpdate200ResponseDocumentThumbnailState FAILED = + new DocumentsUpdate200ResponseDocumentThumbnailState(Value.FAILED, "failed"); + + public static final DocumentsUpdate200ResponseDocumentThumbnailState PENDING = + new DocumentsUpdate200ResponseDocumentThumbnailState(Value.PENDING, "pending"); + + public static final DocumentsUpdate200ResponseDocumentThumbnailState READY = + new DocumentsUpdate200ResponseDocumentThumbnailState(Value.READY, "ready"); + + public static final DocumentsUpdate200ResponseDocumentThumbnailState LOCKED = + new DocumentsUpdate200ResponseDocumentThumbnailState(Value.LOCKED, "locked"); + + private final Value value; + + private final String string; + + DocumentsUpdate200ResponseDocumentThumbnailState(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 DocumentsUpdate200ResponseDocumentThumbnailState + && this.string.equals(((DocumentsUpdate200ResponseDocumentThumbnailState) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case READY: + return visitor.visitReady(); + case LOCKED: + return visitor.visitLocked(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DocumentsUpdate200ResponseDocumentThumbnailState valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "ready": + return READY; + case "locked": + return LOCKED; + default: + return new DocumentsUpdate200ResponseDocumentThumbnailState(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + READY, + + LOCKED, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitReady(); + + T visitLocked(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/api/types/EngineErrorPayloadCode.java b/src/main/java/api/types/EngineErrorPayloadCode.java index f20934e..7630876 100644 --- a/src/main/java/api/types/EngineErrorPayloadCode.java +++ b/src/main/java/api/types/EngineErrorPayloadCode.java @@ -9,8 +9,6 @@ public final class EngineErrorPayloadCode { public static final EngineErrorPayloadCode UNKNOWN = new EngineErrorPayloadCode(Value.UNKNOWN, "Unknown"); - public static final EngineErrorPayloadCode STALE_BASE = new EngineErrorPayloadCode(Value.STALE_BASE, "StaleBase"); - public static final EngineErrorPayloadCode RUNTIME_UNAVAILABLE = new EngineErrorPayloadCode(Value.RUNTIME_UNAVAILABLE, "RuntimeUnavailable"); @@ -128,8 +126,6 @@ public T visit(Visitor visitor) { switch (value) { case UNKNOWN: return visitor.visitUnknown(); - case STALE_BASE: - return visitor.visitStaleBase(); case RUNTIME_UNAVAILABLE: return visitor.visitRuntimeUnavailable(); case UNAUTHENTICATED: @@ -199,8 +195,6 @@ public static EngineErrorPayloadCode valueOf(String value) { switch (value) { case "Unknown": return UNKNOWN; - case "StaleBase": - return STALE_BASE; case "RuntimeUnavailable": return RUNTIME_UNAVAILABLE; case "Unauthenticated": @@ -309,8 +303,6 @@ public enum Value { PROTECTED_DOCUMENT, - STALE_BASE, - PAYLOAD_TOO_LARGE, OBJECT_NUMBER_UNAVAILABLE, @@ -375,8 +367,6 @@ public interface Visitor { T visitProtectedDocument(); - T visitStaleBase(); - T visitPayloadTooLarge(); T visitObjectNumberUnavailable(); diff --git a/src/main/java/api/types/FoldersCreate200Response.java b/src/main/java/api/types/FoldersCreate200Response.java new file mode 100644 index 0000000..ceeb322 --- /dev/null +++ b/src/main/java/api/types/FoldersCreate200Response.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 = FoldersCreate200Response.Builder.class) +public final class FoldersCreate200Response { + private final FoldersCreate200ResponseFolder folder; + + private final Map additionalProperties; + + private FoldersCreate200Response(FoldersCreate200ResponseFolder folder, Map additionalProperties) { + this.folder = folder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("folder") + public FoldersCreate200ResponseFolder getFolder() { + return folder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersCreate200Response && equalTo((FoldersCreate200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersCreate200Response other) { + return folder.equals(other.folder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.folder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FolderStage builder() { + return new Builder(); + } + + public interface FolderStage { + _FinalStage folder(@NotNull FoldersCreate200ResponseFolder folder); + + Builder from(FoldersCreate200Response other); + } + + public interface _FinalStage { + FoldersCreate200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FolderStage, _FinalStage { + private FoldersCreate200ResponseFolder folder; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersCreate200Response other) { + folder(other.getFolder()); + return this; + } + + @java.lang.Override + @JsonSetter("folder") + public _FinalStage folder(@NotNull FoldersCreate200ResponseFolder folder) { + this.folder = Objects.requireNonNull(folder, "folder must not be null"); + return this; + } + + @java.lang.Override + public FoldersCreate200Response build() { + return new FoldersCreate200Response(folder, 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/FoldersCreate200ResponseFolder.java b/src/main/java/api/types/FoldersCreate200ResponseFolder.java new file mode 100644 index 0000000..fbeb36c --- /dev/null +++ b/src/main/java/api/types/FoldersCreate200ResponseFolder.java @@ -0,0 +1,311 @@ +/** + * 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.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 = FoldersCreate200ResponseFolder.Builder.class) +public final class FoldersCreate200ResponseFolder { + private final String id; + + private final String tenantId; + + private final String parentId; + + private final String name; + + private final double createdAt; + + private final double updatedAt; + + private final Optional createdBy; + + private final Map additionalProperties; + + private FoldersCreate200ResponseFolder( + String id, + String tenantId, + String parentId, + String name, + double createdAt, + double updatedAt, + Optional createdBy, + Map additionalProperties) { + this.id = id; + this.tenantId = tenantId; + this.parentId = parentId; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.createdBy = createdBy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("tenantId") + public String getTenantId() { + return tenantId; + } + + /** + * @return The folder it is in, or root. + */ + @JsonProperty("parentId") + public String getParentId() { + return parentId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("createdAt") + public double getCreatedAt() { + return createdAt; + } + + @JsonProperty("updatedAt") + public double getUpdatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional getCreatedBy() { + if (createdBy == null) { + return Optional.empty(); + } + return createdBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("createdBy") + private Optional _getCreatedBy() { + return createdBy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersCreate200ResponseFolder && equalTo((FoldersCreate200ResponseFolder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersCreate200ResponseFolder other) { + return id.equals(other.id) + && tenantId.equals(other.tenantId) + && parentId.equals(other.parentId) + && name.equals(other.name) + && createdAt == other.createdAt + && updatedAt == other.updatedAt + && createdBy.equals(other.createdBy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.tenantId, this.parentId, this.name, this.createdAt, this.updatedAt, this.createdBy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TenantIdStage id(@NotNull String id); + + Builder from(FoldersCreate200ResponseFolder other); + } + + public interface TenantIdStage { + ParentIdStage tenantId(@NotNull String tenantId); + } + + public interface ParentIdStage { + /** + *

The folder it is in, or root.

+ */ + NameStage parentId(@NotNull String parentId); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(double createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(double updatedAt); + } + + public interface _FinalStage { + FoldersCreate200ResponseFolder build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage createdBy(Optional createdBy); + + _FinalStage createdBy(String createdBy); + + _FinalStage createdBy(Nullable createdBy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TenantIdStage, ParentIdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String tenantId; + + private String parentId; + + private String name; + + private double createdAt; + + private double updatedAt; + + private Optional createdBy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersCreate200ResponseFolder other) { + id(other.getId()); + tenantId(other.getTenantId()); + parentId(other.getParentId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + createdBy(other.getCreatedBy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TenantIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("tenantId") + public ParentIdStage tenantId(@NotNull String tenantId) { + this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); + return this; + } + + /** + *

The folder it is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parentId") + public NameStage parentId(@NotNull String parentId) { + this.parentId = Objects.requireNonNull(parentId, "parentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("createdAt") + public UpdatedAtStage createdAt(double createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(double updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + @java.lang.Override + public _FinalStage createdBy(Nullable createdBy) { + if (createdBy.isNull()) { + this.createdBy = null; + } else if (createdBy.isEmpty()) { + this.createdBy = Optional.empty(); + } else { + this.createdBy = Optional.of(createdBy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage createdBy(String createdBy) { + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "createdBy", nulls = Nulls.SKIP) + public _FinalStage createdBy(Optional createdBy) { + this.createdBy = createdBy; + return this; + } + + @java.lang.Override + public FoldersCreate200ResponseFolder build() { + return new FoldersCreate200ResponseFolder( + id, tenantId, parentId, name, createdAt, updatedAt, createdBy, 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/FoldersGet200Response.java b/src/main/java/api/types/FoldersGet200Response.java new file mode 100644 index 0000000..192cc6b --- /dev/null +++ b/src/main/java/api/types/FoldersGet200Response.java @@ -0,0 +1,182 @@ +/** + * 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; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FoldersGet200Response.Builder.class) +public final class FoldersGet200Response { + private final FoldersGet200ResponseFolder folder; + + private final List path; + + private final Map additionalProperties; + + private FoldersGet200Response( + FoldersGet200ResponseFolder folder, + List path, + Map additionalProperties) { + this.folder = folder; + this.path = path; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("folder") + public FoldersGet200ResponseFolder getFolder() { + return folder; + } + + /** + * @return The folders above this one, from the top level down. Neither root nor the folder itself. + */ + @JsonProperty("path") + public List getPath() { + return path; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersGet200Response && equalTo((FoldersGet200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersGet200Response other) { + return folder.equals(other.folder) && path.equals(other.path); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.folder, this.path); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FolderStage builder() { + return new Builder(); + } + + public interface FolderStage { + _FinalStage folder(@NotNull FoldersGet200ResponseFolder folder); + + Builder from(FoldersGet200Response other); + } + + public interface _FinalStage { + FoldersGet200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The folders above this one, from the top level down. Neither root nor the folder itself.

+ */ + _FinalStage path(List path); + + _FinalStage addPath(FoldersGet200ResponsePathItem path); + + _FinalStage addAllPath(List path); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FolderStage, _FinalStage { + private FoldersGet200ResponseFolder folder; + + private List path = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersGet200Response other) { + folder(other.getFolder()); + path(other.getPath()); + return this; + } + + @java.lang.Override + @JsonSetter("folder") + public _FinalStage folder(@NotNull FoldersGet200ResponseFolder folder) { + this.folder = Objects.requireNonNull(folder, "folder must not be null"); + return this; + } + + /** + *

The folders above this one, from the top level down. Neither root nor the folder itself.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllPath(List path) { + if (path != null) { + this.path.addAll(path); + } + return this; + } + + /** + *

The folders above this one, from the top level down. Neither root nor the folder itself.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addPath(FoldersGet200ResponsePathItem path) { + this.path.add(path); + return this; + } + + /** + *

The folders above this one, from the top level down. Neither root nor the folder itself.

+ */ + @java.lang.Override + @JsonSetter(value = "path", nulls = Nulls.SKIP) + public _FinalStage path(List path) { + this.path.clear(); + if (path != null) { + this.path.addAll(path); + } + return this; + } + + @java.lang.Override + public FoldersGet200Response build() { + return new FoldersGet200Response(folder, path, 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/FoldersGet200ResponseFolder.java b/src/main/java/api/types/FoldersGet200ResponseFolder.java new file mode 100644 index 0000000..467c898 --- /dev/null +++ b/src/main/java/api/types/FoldersGet200ResponseFolder.java @@ -0,0 +1,311 @@ +/** + * 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.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 = FoldersGet200ResponseFolder.Builder.class) +public final class FoldersGet200ResponseFolder { + private final String id; + + private final String tenantId; + + private final String parentId; + + private final String name; + + private final double createdAt; + + private final double updatedAt; + + private final Optional createdBy; + + private final Map additionalProperties; + + private FoldersGet200ResponseFolder( + String id, + String tenantId, + String parentId, + String name, + double createdAt, + double updatedAt, + Optional createdBy, + Map additionalProperties) { + this.id = id; + this.tenantId = tenantId; + this.parentId = parentId; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.createdBy = createdBy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("tenantId") + public String getTenantId() { + return tenantId; + } + + /** + * @return The folder it is in, or root. + */ + @JsonProperty("parentId") + public String getParentId() { + return parentId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("createdAt") + public double getCreatedAt() { + return createdAt; + } + + @JsonProperty("updatedAt") + public double getUpdatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional getCreatedBy() { + if (createdBy == null) { + return Optional.empty(); + } + return createdBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("createdBy") + private Optional _getCreatedBy() { + return createdBy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersGet200ResponseFolder && equalTo((FoldersGet200ResponseFolder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersGet200ResponseFolder other) { + return id.equals(other.id) + && tenantId.equals(other.tenantId) + && parentId.equals(other.parentId) + && name.equals(other.name) + && createdAt == other.createdAt + && updatedAt == other.updatedAt + && createdBy.equals(other.createdBy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.tenantId, this.parentId, this.name, this.createdAt, this.updatedAt, this.createdBy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TenantIdStage id(@NotNull String id); + + Builder from(FoldersGet200ResponseFolder other); + } + + public interface TenantIdStage { + ParentIdStage tenantId(@NotNull String tenantId); + } + + public interface ParentIdStage { + /** + *

The folder it is in, or root.

+ */ + NameStage parentId(@NotNull String parentId); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(double createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(double updatedAt); + } + + public interface _FinalStage { + FoldersGet200ResponseFolder build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage createdBy(Optional createdBy); + + _FinalStage createdBy(String createdBy); + + _FinalStage createdBy(Nullable createdBy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TenantIdStage, ParentIdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String tenantId; + + private String parentId; + + private String name; + + private double createdAt; + + private double updatedAt; + + private Optional createdBy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersGet200ResponseFolder other) { + id(other.getId()); + tenantId(other.getTenantId()); + parentId(other.getParentId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + createdBy(other.getCreatedBy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TenantIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("tenantId") + public ParentIdStage tenantId(@NotNull String tenantId) { + this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); + return this; + } + + /** + *

The folder it is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parentId") + public NameStage parentId(@NotNull String parentId) { + this.parentId = Objects.requireNonNull(parentId, "parentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("createdAt") + public UpdatedAtStage createdAt(double createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(double updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + @java.lang.Override + public _FinalStage createdBy(Nullable createdBy) { + if (createdBy.isNull()) { + this.createdBy = null; + } else if (createdBy.isEmpty()) { + this.createdBy = Optional.empty(); + } else { + this.createdBy = Optional.of(createdBy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage createdBy(String createdBy) { + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "createdBy", nulls = Nulls.SKIP) + public _FinalStage createdBy(Optional createdBy) { + this.createdBy = createdBy; + return this; + } + + @java.lang.Override + public FoldersGet200ResponseFolder build() { + return new FoldersGet200ResponseFolder( + id, tenantId, parentId, name, createdAt, updatedAt, createdBy, 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/FoldersGet200ResponsePathItem.java b/src/main/java/api/types/FoldersGet200ResponsePathItem.java new file mode 100644 index 0000000..def592f --- /dev/null +++ b/src/main/java/api/types/FoldersGet200ResponsePathItem.java @@ -0,0 +1,140 @@ +/** + * 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 = FoldersGet200ResponsePathItem.Builder.class) +public final class FoldersGet200ResponsePathItem { + private final String id; + + private final String name; + + private final Map additionalProperties; + + private FoldersGet200ResponsePathItem(String id, String name, Map additionalProperties) { + this.id = id; + this.name = name; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersGet200ResponsePathItem && equalTo((FoldersGet200ResponsePathItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersGet200ResponsePathItem other) { + return id.equals(other.id) && name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + NameStage id(@NotNull String id); + + Builder from(FoldersGet200ResponsePathItem other); + } + + public interface NameStage { + _FinalStage name(@NotNull String name); + } + + public interface _FinalStage { + FoldersGet200ResponsePathItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, NameStage, _FinalStage { + private String id; + + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersGet200ResponsePathItem other) { + id(other.getId()); + name(other.getName()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + public FoldersGet200ResponsePathItem build() { + return new FoldersGet200ResponsePathItem(id, name, 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/FoldersList200Response.java b/src/main/java/api/types/FoldersList200Response.java new file mode 100644 index 0000000..30f54e4 --- /dev/null +++ b/src/main/java/api/types/FoldersList200Response.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 = FoldersList200Response.Builder.class) +public final class FoldersList200Response { + private final List folders; + + private final Optional nextCursor; + + private final Map additionalProperties; + + private FoldersList200Response( + List folders, + Optional nextCursor, + Map additionalProperties) { + this.folders = folders; + this.nextCursor = nextCursor; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("folders") + public List getFolders() { + return folders; + } + + @JsonIgnore + public Optional getNextCursor() { + if (nextCursor == null) { + return Optional.empty(); + } + return nextCursor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("nextCursor") + private Optional _getNextCursor() { + return nextCursor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersList200Response && equalTo((FoldersList200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersList200Response other) { + return folders.equals(other.folders) && nextCursor.equals(other.nextCursor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.folders, this.nextCursor); + } + + @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 folders = new ArrayList<>(); + + private Optional nextCursor = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FoldersList200Response other) { + folders(other.getFolders()); + nextCursor(other.getNextCursor()); + return this; + } + + @JsonSetter(value = "folders", nulls = Nulls.SKIP) + public Builder folders(List folders) { + this.folders.clear(); + if (folders != null) { + this.folders.addAll(folders); + } + return this; + } + + public Builder addFolders(FoldersList200ResponseFoldersItem folders) { + this.folders.add(folders); + return this; + } + + public Builder addAllFolders(List folders) { + if (folders != null) { + this.folders.addAll(folders); + } + return this; + } + + @JsonSetter(value = "nextCursor", nulls = Nulls.SKIP) + public Builder nextCursor(Optional nextCursor) { + this.nextCursor = nextCursor; + return this; + } + + public Builder nextCursor(String nextCursor) { + this.nextCursor = Optional.ofNullable(nextCursor); + return this; + } + + public Builder nextCursor(Nullable nextCursor) { + if (nextCursor.isNull()) { + this.nextCursor = null; + } else if (nextCursor.isEmpty()) { + this.nextCursor = Optional.empty(); + } else { + this.nextCursor = Optional.of(nextCursor.get()); + } + return this; + } + + public FoldersList200Response build() { + return new FoldersList200Response(folders, nextCursor, 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/FoldersList200ResponseFoldersItem.java b/src/main/java/api/types/FoldersList200ResponseFoldersItem.java new file mode 100644 index 0000000..47e8ac6 --- /dev/null +++ b/src/main/java/api/types/FoldersList200ResponseFoldersItem.java @@ -0,0 +1,311 @@ +/** + * 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.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 = FoldersList200ResponseFoldersItem.Builder.class) +public final class FoldersList200ResponseFoldersItem { + private final String id; + + private final String tenantId; + + private final String parentId; + + private final String name; + + private final double createdAt; + + private final double updatedAt; + + private final Optional createdBy; + + private final Map additionalProperties; + + private FoldersList200ResponseFoldersItem( + String id, + String tenantId, + String parentId, + String name, + double createdAt, + double updatedAt, + Optional createdBy, + Map additionalProperties) { + this.id = id; + this.tenantId = tenantId; + this.parentId = parentId; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.createdBy = createdBy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("tenantId") + public String getTenantId() { + return tenantId; + } + + /** + * @return The folder it is in, or root. + */ + @JsonProperty("parentId") + public String getParentId() { + return parentId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("createdAt") + public double getCreatedAt() { + return createdAt; + } + + @JsonProperty("updatedAt") + public double getUpdatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional getCreatedBy() { + if (createdBy == null) { + return Optional.empty(); + } + return createdBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("createdBy") + private Optional _getCreatedBy() { + return createdBy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersList200ResponseFoldersItem && equalTo((FoldersList200ResponseFoldersItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersList200ResponseFoldersItem other) { + return id.equals(other.id) + && tenantId.equals(other.tenantId) + && parentId.equals(other.parentId) + && name.equals(other.name) + && createdAt == other.createdAt + && updatedAt == other.updatedAt + && createdBy.equals(other.createdBy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.tenantId, this.parentId, this.name, this.createdAt, this.updatedAt, this.createdBy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TenantIdStage id(@NotNull String id); + + Builder from(FoldersList200ResponseFoldersItem other); + } + + public interface TenantIdStage { + ParentIdStage tenantId(@NotNull String tenantId); + } + + public interface ParentIdStage { + /** + *

The folder it is in, or root.

+ */ + NameStage parentId(@NotNull String parentId); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(double createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(double updatedAt); + } + + public interface _FinalStage { + FoldersList200ResponseFoldersItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage createdBy(Optional createdBy); + + _FinalStage createdBy(String createdBy); + + _FinalStage createdBy(Nullable createdBy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TenantIdStage, ParentIdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String tenantId; + + private String parentId; + + private String name; + + private double createdAt; + + private double updatedAt; + + private Optional createdBy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersList200ResponseFoldersItem other) { + id(other.getId()); + tenantId(other.getTenantId()); + parentId(other.getParentId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + createdBy(other.getCreatedBy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TenantIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("tenantId") + public ParentIdStage tenantId(@NotNull String tenantId) { + this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); + return this; + } + + /** + *

The folder it is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parentId") + public NameStage parentId(@NotNull String parentId) { + this.parentId = Objects.requireNonNull(parentId, "parentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("createdAt") + public UpdatedAtStage createdAt(double createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(double updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + @java.lang.Override + public _FinalStage createdBy(Nullable createdBy) { + if (createdBy.isNull()) { + this.createdBy = null; + } else if (createdBy.isEmpty()) { + this.createdBy = Optional.empty(); + } else { + this.createdBy = Optional.of(createdBy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage createdBy(String createdBy) { + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "createdBy", nulls = Nulls.SKIP) + public _FinalStage createdBy(Optional createdBy) { + this.createdBy = createdBy; + return this; + } + + @java.lang.Override + public FoldersList200ResponseFoldersItem build() { + return new FoldersList200ResponseFoldersItem( + id, tenantId, parentId, name, createdAt, updatedAt, createdBy, 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/FoldersUpdate200Response.java b/src/main/java/api/types/FoldersUpdate200Response.java new file mode 100644 index 0000000..5951436 --- /dev/null +++ b/src/main/java/api/types/FoldersUpdate200Response.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 = FoldersUpdate200Response.Builder.class) +public final class FoldersUpdate200Response { + private final FoldersUpdate200ResponseFolder folder; + + private final Map additionalProperties; + + private FoldersUpdate200Response(FoldersUpdate200ResponseFolder folder, Map additionalProperties) { + this.folder = folder; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("folder") + public FoldersUpdate200ResponseFolder getFolder() { + return folder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersUpdate200Response && equalTo((FoldersUpdate200Response) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersUpdate200Response other) { + return folder.equals(other.folder); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.folder); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FolderStage builder() { + return new Builder(); + } + + public interface FolderStage { + _FinalStage folder(@NotNull FoldersUpdate200ResponseFolder folder); + + Builder from(FoldersUpdate200Response other); + } + + public interface _FinalStage { + FoldersUpdate200Response build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FolderStage, _FinalStage { + private FoldersUpdate200ResponseFolder folder; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersUpdate200Response other) { + folder(other.getFolder()); + return this; + } + + @java.lang.Override + @JsonSetter("folder") + public _FinalStage folder(@NotNull FoldersUpdate200ResponseFolder folder) { + this.folder = Objects.requireNonNull(folder, "folder must not be null"); + return this; + } + + @java.lang.Override + public FoldersUpdate200Response build() { + return new FoldersUpdate200Response(folder, 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/FoldersUpdate200ResponseFolder.java b/src/main/java/api/types/FoldersUpdate200ResponseFolder.java new file mode 100644 index 0000000..b796c83 --- /dev/null +++ b/src/main/java/api/types/FoldersUpdate200ResponseFolder.java @@ -0,0 +1,311 @@ +/** + * 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.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 = FoldersUpdate200ResponseFolder.Builder.class) +public final class FoldersUpdate200ResponseFolder { + private final String id; + + private final String tenantId; + + private final String parentId; + + private final String name; + + private final double createdAt; + + private final double updatedAt; + + private final Optional createdBy; + + private final Map additionalProperties; + + private FoldersUpdate200ResponseFolder( + String id, + String tenantId, + String parentId, + String name, + double createdAt, + double updatedAt, + Optional createdBy, + Map additionalProperties) { + this.id = id; + this.tenantId = tenantId; + this.parentId = parentId; + this.name = name; + this.createdAt = createdAt; + this.updatedAt = updatedAt; + this.createdBy = createdBy; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("tenantId") + public String getTenantId() { + return tenantId; + } + + /** + * @return The folder it is in, or root. + */ + @JsonProperty("parentId") + public String getParentId() { + return parentId; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("createdAt") + public double getCreatedAt() { + return createdAt; + } + + @JsonProperty("updatedAt") + public double getUpdatedAt() { + return updatedAt; + } + + @JsonIgnore + public Optional getCreatedBy() { + if (createdBy == null) { + return Optional.empty(); + } + return createdBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("createdBy") + private Optional _getCreatedBy() { + return createdBy; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FoldersUpdate200ResponseFolder && equalTo((FoldersUpdate200ResponseFolder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FoldersUpdate200ResponseFolder other) { + return id.equals(other.id) + && tenantId.equals(other.tenantId) + && parentId.equals(other.parentId) + && name.equals(other.name) + && createdAt == other.createdAt + && updatedAt == other.updatedAt + && createdBy.equals(other.createdBy); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.tenantId, this.parentId, this.name, this.createdAt, this.updatedAt, this.createdBy); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + TenantIdStage id(@NotNull String id); + + Builder from(FoldersUpdate200ResponseFolder other); + } + + public interface TenantIdStage { + ParentIdStage tenantId(@NotNull String tenantId); + } + + public interface ParentIdStage { + /** + *

The folder it is in, or root.

+ */ + NameStage parentId(@NotNull String parentId); + } + + public interface NameStage { + CreatedAtStage name(@NotNull String name); + } + + public interface CreatedAtStage { + UpdatedAtStage createdAt(double createdAt); + } + + public interface UpdatedAtStage { + _FinalStage updatedAt(double updatedAt); + } + + public interface _FinalStage { + FoldersUpdate200ResponseFolder build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage createdBy(Optional createdBy); + + _FinalStage createdBy(String createdBy); + + _FinalStage createdBy(Nullable createdBy); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, TenantIdStage, ParentIdStage, NameStage, CreatedAtStage, UpdatedAtStage, _FinalStage { + private String id; + + private String tenantId; + + private String parentId; + + private String name; + + private double createdAt; + + private double updatedAt; + + private Optional createdBy = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FoldersUpdate200ResponseFolder other) { + id(other.getId()); + tenantId(other.getTenantId()); + parentId(other.getParentId()); + name(other.getName()); + createdAt(other.getCreatedAt()); + updatedAt(other.getUpdatedAt()); + createdBy(other.getCreatedBy()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public TenantIdStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("tenantId") + public ParentIdStage tenantId(@NotNull String tenantId) { + this.tenantId = Objects.requireNonNull(tenantId, "tenantId must not be null"); + return this; + } + + /** + *

The folder it is in, or root.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("parentId") + public NameStage parentId(@NotNull String parentId) { + this.parentId = Objects.requireNonNull(parentId, "parentId must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public CreatedAtStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("createdAt") + public UpdatedAtStage createdAt(double createdAt) { + this.createdAt = createdAt; + return this; + } + + @java.lang.Override + @JsonSetter("updatedAt") + public _FinalStage updatedAt(double updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + @java.lang.Override + public _FinalStage createdBy(Nullable createdBy) { + if (createdBy.isNull()) { + this.createdBy = null; + } else if (createdBy.isEmpty()) { + this.createdBy = Optional.empty(); + } else { + this.createdBy = Optional.of(createdBy.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage createdBy(String createdBy) { + this.createdBy = Optional.ofNullable(createdBy); + return this; + } + + @java.lang.Override + @JsonSetter(value = "createdBy", nulls = Nulls.SKIP) + public _FinalStage createdBy(Optional createdBy) { + this.createdBy = createdBy; + return this; + } + + @java.lang.Override + public FoldersUpdate200ResponseFolder build() { + return new FoldersUpdate200ResponseFolder( + id, tenantId, parentId, name, createdAt, updatedAt, createdBy, 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/TokensIssueRequestDocIdentity.java b/src/main/java/api/types/Identity.java similarity index 93% rename from src/main/java/api/types/TokensIssueRequestDocIdentity.java rename to src/main/java/api/types/Identity.java index cd5867c..b6454f8 100644 --- a/src/main/java/api/types/TokensIssueRequestDocIdentity.java +++ b/src/main/java/api/types/Identity.java @@ -18,8 +18,8 @@ import java.util.Optional; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TokensIssueRequestDocIdentity.Builder.class) -public final class TokensIssueRequestDocIdentity { +@JsonDeserialize(builder = Identity.Builder.class) +public final class Identity { private final Optional userId; private final Optional displayName; @@ -36,7 +36,7 @@ public final class TokensIssueRequestDocIdentity { private final Map additionalProperties; - private TokensIssueRequestDocIdentity( + private Identity( Optional userId, Optional displayName, Optional email, @@ -93,7 +93,7 @@ public Optional getGroupId() { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TokensIssueRequestDocIdentity && equalTo((TokensIssueRequestDocIdentity) other); + return other instanceof Identity && equalTo((Identity) other); } @JsonAnyGetter @@ -101,7 +101,7 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TokensIssueRequestDocIdentity other) { + private boolean equalTo(Identity other) { return userId.equals(other.userId) && displayName.equals(other.displayName) && email.equals(other.email) @@ -153,7 +153,7 @@ public static final class Builder { private Builder() {} - public Builder from(TokensIssueRequestDocIdentity other) { + public Builder from(Identity other) { userId(other.getUserId()); displayName(other.getDisplayName()); email(other.getEmail()); @@ -241,8 +241,8 @@ public Builder groupId(String groupId) { return this; } - public TokensIssueRequestDocIdentity build() { - return new TokensIssueRequestDocIdentity( + public Identity build() { + return new Identity( userId, displayName, email, title, organization, organizationalUnit, groupId, additionalProperties); } diff --git a/src/main/java/api/types/SharesArchive200ResponseShare.java b/src/main/java/api/types/SharesArchive200ResponseShare.java index 5989ae9..57ccfd8 100644 --- a/src/main/java/api/types/SharesArchive200ResponseShare.java +++ b/src/main/java/api/types/SharesArchive200ResponseShare.java @@ -42,6 +42,8 @@ public final class SharesArchive200ResponseShare { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -77,6 +79,7 @@ private SharesArchive200ResponseShare( boolean keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, boolean passwordProtected, @@ -98,6 +101,7 @@ private SharesArchive200ResponseShare( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.passwordProtected = passwordProtected; @@ -162,6 +166,14 @@ public Optional getVisitorIdentity return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -252,6 +264,12 @@ private Optional _getVisitorIdenti return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -296,6 +314,7 @@ private boolean equalTo(SharesArchive200ResponseShare other) { && keepVisitorLayers == other.keepVisitorLayers && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && passwordProtected == other.passwordProtected @@ -321,6 +340,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.passwordProtected, @@ -419,6 +439,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -499,6 +525,8 @@ public static final class Builder private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -520,6 +548,7 @@ public Builder from(SharesArchive200ResponseShare other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); passwordProtected(other.getPasswordProtected()); @@ -743,6 +772,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -829,6 +883,7 @@ public SharesArchive200ResponseShare build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, passwordProtected, diff --git a/src/main/java/api/types/SharesCreate200ResponseShare.java b/src/main/java/api/types/SharesCreate200ResponseShare.java index 4fa50f3..f198be2 100644 --- a/src/main/java/api/types/SharesCreate200ResponseShare.java +++ b/src/main/java/api/types/SharesCreate200ResponseShare.java @@ -42,6 +42,8 @@ public final class SharesCreate200ResponseShare { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -77,6 +79,7 @@ private SharesCreate200ResponseShare( boolean keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, boolean passwordProtected, @@ -98,6 +101,7 @@ private SharesCreate200ResponseShare( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.passwordProtected = passwordProtected; @@ -162,6 +166,14 @@ public Optional getVisitorIdentity( return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -252,6 +264,12 @@ private Optional _getVisitorIdentit return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -296,6 +314,7 @@ private boolean equalTo(SharesCreate200ResponseShare other) { && keepVisitorLayers == other.keepVisitorLayers && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && passwordProtected == other.passwordProtected @@ -321,6 +340,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.passwordProtected, @@ -419,6 +439,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -499,6 +525,8 @@ public static final class Builder private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -520,6 +548,7 @@ public Builder from(SharesCreate200ResponseShare other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); passwordProtected(other.getPasswordProtected()); @@ -743,6 +772,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -829,6 +883,7 @@ public SharesCreate200ResponseShare build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, passwordProtected, diff --git a/src/main/java/api/types/SharesGet200ResponseShare.java b/src/main/java/api/types/SharesGet200ResponseShare.java index 65b5c76..bbe84b8 100644 --- a/src/main/java/api/types/SharesGet200ResponseShare.java +++ b/src/main/java/api/types/SharesGet200ResponseShare.java @@ -42,6 +42,8 @@ public final class SharesGet200ResponseShare { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -77,6 +79,7 @@ private SharesGet200ResponseShare( boolean keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, boolean passwordProtected, @@ -98,6 +101,7 @@ private SharesGet200ResponseShare( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.passwordProtected = passwordProtected; @@ -162,6 +166,14 @@ public Optional getVisitorIdentity() { return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -252,6 +264,12 @@ private Optional _getVisitorIdentity() return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -296,6 +314,7 @@ private boolean equalTo(SharesGet200ResponseShare other) { && keepVisitorLayers == other.keepVisitorLayers && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && passwordProtected == other.passwordProtected @@ -321,6 +340,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.passwordProtected, @@ -419,6 +439,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -499,6 +525,8 @@ public static final class Builder private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -520,6 +548,7 @@ public Builder from(SharesGet200ResponseShare other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); passwordProtected(other.getPasswordProtected()); @@ -743,6 +772,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -829,6 +883,7 @@ public SharesGet200ResponseShare build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, passwordProtected, diff --git a/src/main/java/api/types/SharesList200ResponseSharesItem.java b/src/main/java/api/types/SharesList200ResponseSharesItem.java index 1ab5d26..8831b99 100644 --- a/src/main/java/api/types/SharesList200ResponseSharesItem.java +++ b/src/main/java/api/types/SharesList200ResponseSharesItem.java @@ -42,6 +42,8 @@ public final class SharesList200ResponseSharesItem { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -77,6 +79,7 @@ private SharesList200ResponseSharesItem( boolean keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, boolean passwordProtected, @@ -98,6 +101,7 @@ private SharesList200ResponseSharesItem( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.passwordProtected = passwordProtected; @@ -162,6 +166,14 @@ public Optional getVisitorIdenti return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -252,6 +264,12 @@ private Optional _getVisitorIden return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -296,6 +314,7 @@ private boolean equalTo(SharesList200ResponseSharesItem other) { && keepVisitorLayers == other.keepVisitorLayers && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && passwordProtected == other.passwordProtected @@ -321,6 +340,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.passwordProtected, @@ -419,6 +439,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -499,6 +525,8 @@ public static final class Builder private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -520,6 +548,7 @@ public Builder from(SharesList200ResponseSharesItem other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); passwordProtected(other.getPasswordProtected()); @@ -743,6 +772,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -829,6 +883,7 @@ public SharesList200ResponseSharesItem build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, passwordProtected, diff --git a/src/main/java/api/types/SharesUpdate200ResponseShare.java b/src/main/java/api/types/SharesUpdate200ResponseShare.java index a4680a0..8562d12 100644 --- a/src/main/java/api/types/SharesUpdate200ResponseShare.java +++ b/src/main/java/api/types/SharesUpdate200ResponseShare.java @@ -42,6 +42,8 @@ public final class SharesUpdate200ResponseShare { private final Optional visitorIdentity; + private final Optional identity; + private final List scope; private final Optional> origins; @@ -77,6 +79,7 @@ private SharesUpdate200ResponseShare( boolean keepVisitorLayers, Optional visitorIdleSeconds, Optional visitorIdentity, + Optional identity, List scope, Optional> origins, boolean passwordProtected, @@ -98,6 +101,7 @@ private SharesUpdate200ResponseShare( this.keepVisitorLayers = keepVisitorLayers; this.visitorIdleSeconds = visitorIdleSeconds; this.visitorIdentity = visitorIdentity; + this.identity = identity; this.scope = scope; this.origins = origins; this.passwordProtected = passwordProtected; @@ -162,6 +166,14 @@ public Optional getVisitorIdentity( return visitorIdentity; } + @JsonIgnore + public Optional getIdentity() { + if (identity == null) { + return Optional.empty(); + } + return identity; + } + @JsonProperty("scope") public List getScope() { return scope; @@ -252,6 +264,12 @@ private Optional _getVisitorIdentit return visitorIdentity; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("identity") + private Optional _getIdentity() { + return identity; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("origins") private Optional> _getOrigins() { @@ -296,6 +314,7 @@ private boolean equalTo(SharesUpdate200ResponseShare other) { && keepVisitorLayers == other.keepVisitorLayers && visitorIdleSeconds.equals(other.visitorIdleSeconds) && visitorIdentity.equals(other.visitorIdentity) + && identity.equals(other.identity) && scope.equals(other.scope) && origins.equals(other.origins) && passwordProtected == other.passwordProtected @@ -321,6 +340,7 @@ public int hashCode() { this.keepVisitorLayers, this.visitorIdleSeconds, this.visitorIdentity, + this.identity, this.scope, this.origins, this.passwordProtected, @@ -419,6 +439,12 @@ public interface _FinalStage { _FinalStage visitorIdentity(Nullable visitorIdentity); + _FinalStage identity(Optional identity); + + _FinalStage identity(Identity identity); + + _FinalStage identity(Nullable identity); + _FinalStage scope(List scope); _FinalStage addScope(String scope); @@ -499,6 +525,8 @@ public static final class Builder private List scope = new ArrayList<>(); + private Optional identity = Optional.empty(); + private Optional visitorIdentity = Optional.empty(); private Optional visitorIdleSeconds = Optional.empty(); @@ -520,6 +548,7 @@ public Builder from(SharesUpdate200ResponseShare other) { keepVisitorLayers(other.getKeepVisitorLayers()); visitorIdleSeconds(other.getVisitorIdleSeconds()); visitorIdentity(other.getVisitorIdentity()); + identity(other.getIdentity()); scope(other.getScope()); origins(other.getOrigins()); passwordProtected(other.getPasswordProtected()); @@ -743,6 +772,31 @@ public _FinalStage scope(List scope) { return this; } + @java.lang.Override + public _FinalStage identity(Nullable identity) { + if (identity.isNull()) { + this.identity = null; + } else if (identity.isEmpty()) { + this.identity = Optional.empty(); + } else { + this.identity = Optional.of(identity.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage identity(Identity identity) { + this.identity = Optional.ofNullable(identity); + return this; + } + + @java.lang.Override + @JsonSetter(value = "identity", nulls = Nulls.SKIP) + public _FinalStage identity(Optional identity) { + this.identity = identity; + return this; + } + @java.lang.Override public _FinalStage visitorIdentity(Nullable visitorIdentity) { if (visitorIdentity.isNull()) { @@ -829,6 +883,7 @@ public SharesUpdate200ResponseShare build() { keepVisitorLayers, visitorIdleSeconds, visitorIdentity, + identity, scope, origins, passwordProtected, diff --git a/src/main/java/api/types/TokensIssueRequestDoc.java b/src/main/java/api/types/TokensIssueRequestDoc.java index e7ecb7a..5c537d9 100644 --- a/src/main/java/api/types/TokensIssueRequestDoc.java +++ b/src/main/java/api/types/TokensIssueRequestDoc.java @@ -31,7 +31,7 @@ public final class TokensIssueRequestDoc { private final List scope; - private final Optional identity; + private final Optional identity; private final Optional> origins; @@ -44,7 +44,7 @@ private TokensIssueRequestDoc( String docId, Optional layerName, List scope, - Optional identity, + Optional identity, Optional> origins, int expiresIn, Map additionalProperties) { @@ -79,7 +79,7 @@ public List getScope() { } @JsonProperty("identity") - public Optional getIdentity() { + public Optional getIdentity() { return identity; } @@ -160,9 +160,9 @@ public interface _FinalStage { _FinalStage addAllScope(List scope); - _FinalStage identity(Optional identity); + _FinalStage identity(Optional identity); - _FinalStage identity(TokensIssueRequestDocIdentity identity); + _FinalStage identity(Identity identity); _FinalStage origins(Optional> origins); @@ -179,7 +179,7 @@ public static final class Builder implements SubStage, DocIdStage, ExpiresInStag private Optional> origins = Optional.empty(); - private Optional identity = Optional.empty(); + private Optional identity = Optional.empty(); private List scope = new ArrayList<>(); @@ -237,14 +237,14 @@ public _FinalStage origins(Optional> origins) { } @java.lang.Override - public _FinalStage identity(TokensIssueRequestDocIdentity identity) { + public _FinalStage identity(Identity identity) { this.identity = Optional.ofNullable(identity); return this; } @java.lang.Override @JsonSetter(value = "identity", nulls = Nulls.SKIP) - public _FinalStage identity(Optional identity) { + public _FinalStage identity(Optional identity) { this.identity = identity; return this; } diff --git a/src/main/java/api/types/TokensIssueRequestTenant.java b/src/main/java/api/types/TokensIssueRequestTenant.java index 512f0ef..8977e01 100644 --- a/src/main/java/api/types/TokensIssueRequestTenant.java +++ b/src/main/java/api/types/TokensIssueRequestTenant.java @@ -24,17 +24,14 @@ public final class TokensIssueRequestTenant { private final String sub; - private final List scope; + private final List scope; private final int expiresIn; private final Map additionalProperties; private TokensIssueRequestTenant( - String sub, - List scope, - int expiresIn, - Map additionalProperties) { + String sub, List scope, int expiresIn, Map additionalProperties) { this.sub = sub; this.scope = scope; this.expiresIn = expiresIn; @@ -47,7 +44,7 @@ public String getSub() { } @JsonProperty("scope") - public List getScope() { + public List getScope() { return scope; } @@ -102,11 +99,11 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); - _FinalStage scope(List scope); + _FinalStage scope(List scope); - _FinalStage addScope(TokensIssueRequestTenantScopeItem scope); + _FinalStage addScope(String scope); - _FinalStage addAllScope(List scope); + _FinalStage addAllScope(List scope); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,7 +112,7 @@ public static final class Builder implements SubStage, ExpiresInStage, _FinalSta private int expiresIn; - private List scope = new ArrayList<>(); + private List scope = new ArrayList<>(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -145,7 +142,7 @@ public _FinalStage expiresIn(int expiresIn) { } @java.lang.Override - public _FinalStage addAllScope(List scope) { + public _FinalStage addAllScope(List scope) { if (scope != null) { this.scope.addAll(scope); } @@ -153,14 +150,14 @@ public _FinalStage addAllScope(List scope) { } @java.lang.Override - public _FinalStage addScope(TokensIssueRequestTenantScopeItem scope) { + public _FinalStage addScope(String scope) { this.scope.add(scope); return this; } @java.lang.Override @JsonSetter(value = "scope", nulls = Nulls.SKIP) - public _FinalStage scope(List scope) { + public _FinalStage scope(List scope) { this.scope.clear(); if (scope != null) { this.scope.addAll(scope); diff --git a/src/main/java/api/types/TokensIssueRequestTenantScopeItem.java b/src/main/java/api/types/TokensIssueRequestTenantScopeItem.java deleted file mode 100644 index 5b3f2f5..0000000 --- a/src/main/java/api/types/TokensIssueRequestTenantScopeItem.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.JsonValue; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.deser.std.StdDeserializer; -import java.io.IOException; -import java.util.Objects; - -@JsonDeserialize(using = TokensIssueRequestTenantScopeItem.Deserializer.class) -public final class TokensIssueRequestTenantScopeItem { - private final Object value; - - private final int type; - - private TokensIssueRequestTenantScopeItem(Object value, int type) { - this.value = value; - this.type = type; - } - - @JsonValue - public Object get() { - return this.value; - } - - @SuppressWarnings("unchecked") - public T visit(Visitor visitor) { - if (this.type == 0) { - return visitor.visit((TokensIssueRequestTenantScopeItemZero) this.value); - } else if (this.type == 1) { - return visitor.visit((TokensIssueRequestTenantScopeItemOne) this.value); - } - throw new IllegalStateException("Failed to visit value. This should never happen."); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TokensIssueRequestTenantScopeItem && equalTo((TokensIssueRequestTenantScopeItem) other); - } - - private boolean equalTo(TokensIssueRequestTenantScopeItem other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return this.value.toString(); - } - - public static TokensIssueRequestTenantScopeItem of(TokensIssueRequestTenantScopeItemZero value) { - return new TokensIssueRequestTenantScopeItem(value, 0); - } - - public static TokensIssueRequestTenantScopeItem of(TokensIssueRequestTenantScopeItemOne value) { - return new TokensIssueRequestTenantScopeItem(value, 1); - } - - public interface Visitor { - T visit(TokensIssueRequestTenantScopeItemZero value); - - T visit(TokensIssueRequestTenantScopeItemOne value); - } - - static final class Deserializer extends StdDeserializer { - Deserializer() { - super(TokensIssueRequestTenantScopeItem.class); - } - - @java.lang.Override - public TokensIssueRequestTenantScopeItem deserialize(JsonParser p, DeserializationContext context) - throws IOException { - Object value = p.readValueAs(Object.class); - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TokensIssueRequestTenantScopeItemZero.class)); - } catch (RuntimeException e) { - } - try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TokensIssueRequestTenantScopeItemOne.class)); - } catch (RuntimeException e) { - } - throw new JsonParseException(p, "Failed to deserialize"); - } - } -} diff --git a/src/main/java/api/types/TokensIssueRequestTenantScopeItemOne.java b/src/main/java/api/types/TokensIssueRequestTenantScopeItemOne.java deleted file mode 100644 index d23ec0e..0000000 --- a/src/main/java/api/types/TokensIssueRequestTenantScopeItemOne.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * 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 TokensIssueRequestTenantScopeItemOne { - public static final TokensIssueRequestTenantScopeItemOne SHARES_MANAGE = - new TokensIssueRequestTenantScopeItemOne(Value.SHARES_MANAGE, "shares.manage"); - - public static final TokensIssueRequestTenantScopeItemOne TOKENS_REVOKE = - new TokensIssueRequestTenantScopeItemOne(Value.TOKENS_REVOKE, "tokens.revoke"); - - public static final TokensIssueRequestTenantScopeItemOne DOCS_CREATE = - new TokensIssueRequestTenantScopeItemOne(Value.DOCS_CREATE, "docs.create"); - - public static final TokensIssueRequestTenantScopeItemOne DOCS_DELETE = - new TokensIssueRequestTenantScopeItemOne(Value.DOCS_DELETE, "docs.delete"); - - public static final TokensIssueRequestTenantScopeItemOne TOKENS_ISSUE_DOC = - new TokensIssueRequestTenantScopeItemOne(Value.TOKENS_ISSUE_DOC, "tokens.issue-doc"); - - public static final TokensIssueRequestTenantScopeItemOne DOCS_READ = - new TokensIssueRequestTenantScopeItemOne(Value.DOCS_READ, "docs.read"); - - private final Value value; - - private final String string; - - TokensIssueRequestTenantScopeItemOne(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 TokensIssueRequestTenantScopeItemOne - && this.string.equals(((TokensIssueRequestTenantScopeItemOne) other).string)); - } - - @java.lang.Override - public int hashCode() { - return this.string.hashCode(); - } - - public T visit(Visitor visitor) { - switch (value) { - case SHARES_MANAGE: - return visitor.visitSharesManage(); - case TOKENS_REVOKE: - return visitor.visitTokensRevoke(); - case DOCS_CREATE: - return visitor.visitDocsCreate(); - case DOCS_DELETE: - return visitor.visitDocsDelete(); - case TOKENS_ISSUE_DOC: - return visitor.visitTokensIssueDoc(); - case DOCS_READ: - return visitor.visitDocsRead(); - case UNKNOWN: - default: - return visitor.visitUnknown(string); - } - } - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - public static TokensIssueRequestTenantScopeItemOne valueOf(String value) { - switch (value) { - case "shares.manage": - return SHARES_MANAGE; - case "tokens.revoke": - return TOKENS_REVOKE; - case "docs.create": - return DOCS_CREATE; - case "docs.delete": - return DOCS_DELETE; - case "tokens.issue-doc": - return TOKENS_ISSUE_DOC; - case "docs.read": - return DOCS_READ; - default: - return new TokensIssueRequestTenantScopeItemOne(Value.UNKNOWN, value); - } - } - - public enum Value { - DOCS_CREATE, - - DOCS_READ, - - DOCS_DELETE, - - TOKENS_ISSUE_DOC, - - TOKENS_REVOKE, - - SHARES_MANAGE, - - UNKNOWN - } - - public interface Visitor { - T visitDocsCreate(); - - T visitDocsRead(); - - T visitDocsDelete(); - - T visitTokensIssueDoc(); - - T visitTokensRevoke(); - - T visitSharesManage(); - - T visitUnknown(String unknownType); - } -}