diff --git a/.fern/metadata.json b/.fern/metadata.json
index 3765a34f..5a79a16f 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -10,10 +10,10 @@
"base-exception-class-name": "CloudPDFException",
"base-api-exception-class-name": "CloudPDFApiException"
},
- "originGitCommit": "c6f87eecf9636e7ef367946a7fd7f3729401ce90",
+ "originGitCommit": "7ded7de29f4cc0dc9da18042fca6afd5c9557bfc",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
- "requestedVersion": "3.0.0-next.15",
+ "requestedVersion": "3.0.0-next.16",
"ciProvider": "github",
- "sdkVersion": "3.0.0-next.15"
+ "sdkVersion": "3.0.0-next.16"
}
\ No newline at end of file
diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json
index 754064ae..d87ef92b 100644
--- a/cloudpdf-generation.json
+++ b/cloudpdf-generation.json
@@ -1,12 +1,12 @@
{
"language": "csharp",
- "canonicalVersion": "3.0.0-next.15",
- "sdkVersion": "3.0.0-next.15",
+ "canonicalVersion": "3.0.0-next.16",
+ "sdkVersion": "3.0.0-next.16",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
- "openapiSha256": "9d70deca638cc7a80b0e670ec47fc45710d6603eb8f493d5fac95a38d7e5f8b3",
- "gitCommit": "c6f87eecf9636e7ef367946a7fd7f3729401ce90",
+ "openapiSha256": "06543c26918bd79d426bf242c5a3091cdb7d298d3ac3296addabee2be80edb15",
+ "gitCommit": "7ded7de29f4cc0dc9da18042fca6afd5c9557bfc",
"gitCommitIsDirty": false
},
"fern": {
diff --git a/reference.md b/reference.md
index 4616173a..190f32ad 100644
--- a/reference.md
+++ b/reference.md
@@ -78,7 +78,7 @@ await client.Doc.HeadAsync(new HeadDocRequest { DocId = "docId" });
-Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { : '' }`, and each file as the part `resource:`. At most 64 changes per request and 512 ops per change.
+Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`, outline `doc.outline.modify`, pages `doc.pages.assemble`, embedded files `doc.attachments.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork, a PDF whose pages come in) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { : '' }`, and each file as the part `resource:`. At most 64 changes per request and 512 ops per change.
@@ -1772,6 +1772,68 @@ await client.Doc.Annotations.ReadAppearanceAsync(
+
+
+
+
+client.Doc.Annotations.ReadFileAsync (ReadFileAnnotationsRequest { ... }) -> WithRawResponseTask<Stream>
+
+
+
+#### 📝 Description
+
+
+
+
+
+
+
+A file that decodes past the server's limit is refused (PayloadTooLarge).
+
+
+
+
+
+#### 🔌 Usage
+
+
+
+
+
+
+
+```csharp
+await client.Doc.Annotations.ReadFileAsync(
+ new ReadFileAnnotationsRequest
+ {
+ DocId = "docId",
+ LayerName = "layerName",
+ PageKey = "pageKey",
+ AnnotKey = "annotKey",
+ }
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+
+
+
+
+
+**request:** `ReadFileAnnotationsRequest`
+
+
+
+
+
+
+
@@ -1938,28 +2000,12 @@ await client.Doc.Annotations.ReorderAsync(
-## Doc Forms
-client.Doc.Forms.ListAsync (ListFormsRequest { ... }) -> WithRawResponseTask<DocFormsList200Response>
-
-
-
-#### 🔌 Usage
-
-
-
-
+## Doc Attachments
+client.Doc.Attachments.DownloadAsync (DownloadAttachmentsRequest { ... }) -> WithRawResponseTask<Stream>
-```csharp
-await client.Doc.Forms.ListAsync(new ListFormsRequest { DocId = "docId", LayerName = "layerName" });
-```
-
-
-
-
-
-#### ⚙️ Parameters
+#### 📝 Description
@@ -1967,22 +2013,12 @@ await client.Doc.Forms.ListAsync(new ListFormsRequest { DocId = "docId", LayerNa
-**request:** `ListFormsRequest`
-
+A file that decodes past the server's limit is refused (PayloadTooLarge).
-
-
-
-
-
-client.Doc.Forms.ReorderCalculationsAsync (DocFormsReorderCalculationsRequest { ... }) -> WithRawResponseTask<DocFormsReorderCalculations200Response>
-
-
-
#### 🔌 Usage
@@ -1992,18 +2028,12 @@ await client.Doc.Forms.ListAsync(new ListFormsRequest { DocId = "docId", LayerNa
```csharp
-await client.Doc.Forms.ReorderCalculationsAsync(
- new DocFormsReorderCalculationsRequest
+await client.Doc.Attachments.DownloadAsync(
+ new DownloadAttachmentsRequest
{
DocId = "docId",
LayerName = "layerName",
- Fields = new List()
- {
- new FormFieldRef(
- new FormFieldRef.ObjectNumber(new FormFieldRefObjectNumber { ObjectNumber = 1 })
- ),
- },
- Position = FieldPositionZero.Start,
+ FileKey = "fileKey",
}
);
```
@@ -2020,7 +2050,7 @@ await client.Doc.Forms.ReorderCalculationsAsync(
-**request:** `DocFormsReorderCalculationsRequest`
+**request:** `DownloadAttachmentsRequest`
@@ -2032,35 +2062,11 @@ await client.Doc.Forms.ReorderCalculationsAsync(
-client.Doc.Forms.SetValueAsync (SetValueFormsRequest { ... }) -> WithRawResponseTask<DocFormsSetValue200Response>
-
-
-
-#### 🔌 Usage
-
-
-
-
+client.Doc.Attachments.ListAsync (ListAttachmentsRequest { ... }) -> WithRawResponseTask<AttachmentList>
-```csharp
-await client.Doc.Forms.SetValueAsync(
- new SetValueFormsRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- FieldKey = "fieldKey",
- Body = new Dictionary() { { "key", "value" } },
- }
-);
-```
-
-
-
-
-
-#### ⚙️ Parameters
+#### 📝 Description
@@ -2068,22 +2074,12 @@ await client.Doc.Forms.SetValueAsync(
-**request:** `SetValueFormsRequest`
-
+A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`.
-
-
-
-
-
-client.Doc.Forms.ResetAsync (DocFormsResetRequest { ... }) -> WithRawResponseTask<DocFormsReset200Response>
-
-
-
#### 🔌 Usage
@@ -2093,8 +2089,8 @@ await client.Doc.Forms.SetValueAsync(
```csharp
-await client.Doc.Forms.ResetAsync(
- new DocFormsResetRequest { DocId = "docId", LayerName = "layerName" }
+await client.Doc.Attachments.ListAsync(
+ new ListAttachmentsRequest { DocId = "docId", LayerName = "layerName" }
);
```
@@ -2110,7 +2106,7 @@ await client.Doc.Forms.ResetAsync(
-**request:** `DocFormsResetRequest`
+**request:** `ListAttachmentsRequest`
@@ -2122,7 +2118,8 @@ await client.Doc.Forms.ResetAsync(
-client.Doc.Forms.DeleteWidgetAsync (DeleteWidgetFormsRequest { ... }) -> WithRawResponseTask<DocFormsDeleteWidget200Response>
+## Doc Forms
+client.Doc.Forms.ListAsync (ListFormsRequest { ... }) -> WithRawResponseTask<DocFormsList200Response>
@@ -2135,15 +2132,7 @@ await client.Doc.Forms.ResetAsync(
```csharp
-await client.Doc.Forms.DeleteWidgetAsync(
- new DeleteWidgetFormsRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- PageKey = "pageKey",
- AnnotKey = "annotKey",
- }
-);
+await client.Doc.Forms.ListAsync(new ListFormsRequest { DocId = "docId", LayerName = "layerName" });
```
@@ -2158,7 +2147,7 @@ await client.Doc.Forms.DeleteWidgetAsync(
-**request:** `DeleteWidgetFormsRequest`
+**request:** `ListFormsRequest`
@@ -2170,7 +2159,7 @@ await client.Doc.Forms.DeleteWidgetAsync(
-client.Doc.Forms.UpdateWidgetAsync (DocFormsUpdateWidgetRequest { ... }) -> WithRawResponseTask<DocFormsUpdateWidget200Response>
+client.Doc.Forms.ReorderCalculationsAsync (DocFormsReorderCalculationsRequest { ... }) -> WithRawResponseTask<DocFormsReorderCalculations200Response>
@@ -2183,14 +2172,18 @@ await client.Doc.Forms.DeleteWidgetAsync(
```csharp
-await client.Doc.Forms.UpdateWidgetAsync(
- new DocFormsUpdateWidgetRequest
+await client.Doc.Forms.ReorderCalculationsAsync(
+ new DocFormsReorderCalculationsRequest
{
DocId = "docId",
LayerName = "layerName",
- PageKey = "pageKey",
- AnnotKey = "annotKey",
- Patch = new WidgetPatch(),
+ Fields = new List()
+ {
+ new FormFieldRef(
+ new FormFieldRef.ObjectNumber(new FormFieldRefObjectNumber { ObjectNumber = 1 })
+ ),
+ },
+ Position = FieldPositionZero.Start,
}
);
```
@@ -2207,7 +2200,7 @@ await client.Doc.Forms.UpdateWidgetAsync(
-**request:** `DocFormsUpdateWidgetRequest`
+**request:** `DocFormsReorderCalculationsRequest`
@@ -2219,7 +2212,7 @@ await client.Doc.Forms.UpdateWidgetAsync(
-client.Doc.Forms.ReorderWidgetsAsync (DocFormsReorderWidgetsRequest { ... }) -> WithRawResponseTask<DocFormsReorderWidgets200Response>
+client.Doc.Forms.SetValueAsync (SetValueFormsRequest { ... }) -> WithRawResponseTask<DocFormsSetValue200Response>
@@ -2232,25 +2225,13 @@ await client.Doc.Forms.UpdateWidgetAsync(
```csharp
-await client.Doc.Forms.ReorderWidgetsAsync(
- new DocFormsReorderWidgetsRequest
+await client.Doc.Forms.SetValueAsync(
+ new SetValueFormsRequest
{
DocId = "docId",
LayerName = "layerName",
- PageKey = "pageKey",
- Widgets = new List()
- {
- new AnnotationRef(
- new AnnotationRef.ObjectNumber(
- new AnnotationRefObjectNumber
- {
- Page = new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- ObjectNumber = 1,
- }
- )
- ),
- },
- Position = AnnotationPositionZero.Start,
+ FieldKey = "fieldKey",
+ Body = new Dictionary() { { "key", "value" } },
}
);
```
@@ -2267,7 +2248,7 @@ await client.Doc.Forms.ReorderWidgetsAsync(
-**request:** `DocFormsReorderWidgetsRequest`
+**request:** `SetValueFormsRequest`
@@ -2279,8 +2260,7 @@ await client.Doc.Forms.ReorderWidgetsAsync(
-## Doc Metadata
-client.Doc.Metadata.GetAsync (GetMetadataRequest { ... }) -> WithRawResponseTask<DocumentMetadata>
+client.Doc.Forms.ResetAsync (DocFormsResetRequest { ... }) -> WithRawResponseTask<DocFormsReset200Response>
@@ -2293,8 +2273,8 @@ await client.Doc.Forms.ReorderWidgetsAsync(
```csharp
-await client.Doc.Metadata.GetAsync(
- new GetMetadataRequest { DocId = "docId", LayerName = "layerName" }
+await client.Doc.Forms.ResetAsync(
+ new DocFormsResetRequest { DocId = "docId", LayerName = "layerName" }
);
```
@@ -2310,7 +2290,7 @@ await client.Doc.Metadata.GetAsync(
-**request:** `GetMetadataRequest`
+**request:** `DocFormsResetRequest`
@@ -2322,8 +2302,7 @@ await client.Doc.Metadata.GetAsync(
-## Doc Pages
-client.Doc.Pages.SetScaleAsync (DocPagesSetScaleRequest { ... }) -> WithRawResponseTask<DocPagesSetScale200Response>
+client.Doc.Forms.DeleteWidgetAsync (DeleteWidgetFormsRequest { ... }) -> WithRawResponseTask<DocFormsDeleteWidget200Response>
@@ -2336,12 +2315,13 @@ await client.Doc.Metadata.GetAsync(
```csharp
-await client.Doc.Pages.SetScaleAsync(
- new DocPagesSetScaleRequest
+await client.Doc.Forms.DeleteWidgetAsync(
+ new DeleteWidgetFormsRequest
{
DocId = "docId",
LayerName = "layerName",
PageKey = "pageKey",
+ AnnotKey = "annotKey",
}
);
```
@@ -2358,7 +2338,7 @@ await client.Doc.Pages.SetScaleAsync(
-**request:** `DocPagesSetScaleRequest`
+**request:** `DeleteWidgetFormsRequest`
@@ -2370,7 +2350,7 @@ await client.Doc.Pages.SetScaleAsync(
-client.Doc.Pages.ViewportsAsync (ViewportsPagesRequest { ... }) -> WithRawResponseTask<DocPagesViewports200Response>
+client.Doc.Forms.UpdateWidgetAsync (DocFormsUpdateWidgetRequest { ... }) -> WithRawResponseTask<DocFormsUpdateWidget200Response>
@@ -2383,12 +2363,14 @@ await client.Doc.Pages.SetScaleAsync(
```csharp
-await client.Doc.Pages.ViewportsAsync(
- new ViewportsPagesRequest
+await client.Doc.Forms.UpdateWidgetAsync(
+ new DocFormsUpdateWidgetRequest
{
DocId = "docId",
LayerName = "layerName",
PageKey = "pageKey",
+ AnnotKey = "annotKey",
+ Patch = new WidgetPatch(),
}
);
```
@@ -2405,7 +2387,7 @@ await client.Doc.Pages.ViewportsAsync(
-**request:** `ViewportsPagesRequest`
+**request:** `DocFormsUpdateWidgetRequest`
@@ -2417,7 +2399,7 @@ await client.Doc.Pages.ViewportsAsync(
-client.Doc.Pages.DeleteAsync (DeletePagesRequest { ... }) -> WithRawResponseTask<DocPagesDelete200Response>
+client.Doc.Forms.ReorderWidgetsAsync (DocFormsReorderWidgetsRequest { ... }) -> WithRawResponseTask<DocFormsReorderWidgets200Response>
@@ -2430,12 +2412,25 @@ await client.Doc.Pages.ViewportsAsync(
```csharp
-await client.Doc.Pages.DeleteAsync(
- new DeletePagesRequest
+await client.Doc.Forms.ReorderWidgetsAsync(
+ new DocFormsReorderWidgetsRequest
{
DocId = "docId",
LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
+ PageKey = "pageKey",
+ Widgets = new List()
+ {
+ new AnnotationRef(
+ new AnnotationRef.ObjectNumber(
+ new AnnotationRefObjectNumber
+ {
+ Page = new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
+ ObjectNumber = 1,
+ }
+ )
+ ),
+ },
+ Position = AnnotationPositionZero.Start,
}
);
```
@@ -2452,7 +2447,7 @@ await client.Doc.Pages.DeleteAsync(
-**request:** `DeletePagesRequest`
+**request:** `DocFormsReorderWidgetsRequest`
@@ -2464,24 +2459,11 @@ await client.Doc.Pages.DeleteAsync(
-client.Doc.Pages.ExtractAsync (ExtractPagesRequest { ... }) -> WithRawResponseTask<Stream>
-
-
-
-#### 📝 Description
-
-
-
-
+## Doc Metadata
+client.Doc.Metadata.GetAsync (GetMetadataRequest { ... }) -> WithRawResponseTask<DocumentMetadata>
-A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[]}`; the response body is the new PDF.
-
-
-
-
-
#### 🔌 Usage
@@ -2491,19 +2473,8 @@ A read, not a mutation: the source document is untouched and no event is publish
```csharp
-await client.Doc.Pages.ExtractAsync(
- new ExtractPagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary()
- {
- {
- "string",
- new Dictionary() { { "key", "value" } }
- },
- },
- }
+await client.Doc.Metadata.GetAsync(
+ new GetMetadataRequest { DocId = "docId", LayerName = "layerName" }
);
```
@@ -2519,7 +2490,7 @@ await client.Doc.Pages.ExtractAsync(
-**request:** `ExtractPagesRequest`
+**request:** `GetMetadataRequest`
@@ -2531,7 +2502,8 @@ await client.Doc.Pages.ExtractAsync(
-client.Doc.Pages.FlattenAsync (FlattenPagesRequest { ... }) -> WithRawResponseTask<DocPagesFlatten200Response>
+## Doc Outline
+client.Doc.Outline.GetAsync (GetOutlineRequest { ... }) -> WithRawResponseTask<DocumentOutline>
@@ -2544,13 +2516,8 @@ await client.Doc.Pages.ExtractAsync(
```csharp
-await client.Doc.Pages.FlattenAsync(
- new FlattenPagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
- }
+await client.Doc.Outline.GetAsync(
+ new GetOutlineRequest { DocId = "docId", LayerName = "layerName" }
);
```
@@ -2566,7 +2533,7 @@ await client.Doc.Pages.FlattenAsync(
-**request:** `FlattenPagesRequest`
+**request:** `GetOutlineRequest`
@@ -2578,24 +2545,11 @@ await client.Doc.Pages.FlattenAsync(
-client.Doc.Pages.InsertAsync (InsertPagesRequest { ... }) -> WithRawResponseTask<DocPagesInsert200Response>
-
-
-
-#### 📝 Description
-
-
-
-
+## Doc Pages
+client.Doc.Pages.SetScaleAsync (DocPagesSetScaleRequest { ... }) -> WithRawResponseTask<DocPagesSetScale200Response>
-Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source": ""}}` (position omitted → the end), and the standalone PDF whose pages are copied in as the part `resource:`. The inserted copies get fresh page object numbers, returned in insertion order.
-
-
-
-
-
#### 🔌 Usage
@@ -2605,8 +2559,13 @@ Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source
```csharp
-await client.Doc.Pages.InsertAsync(
- new InsertPagesRequest { DocId = "docId", LayerName = "layerName" }
+await client.Doc.Pages.SetScaleAsync(
+ new DocPagesSetScaleRequest
+ {
+ DocId = "docId",
+ LayerName = "layerName",
+ PageKey = "pageKey",
+ }
);
```
@@ -2622,7 +2581,7 @@ await client.Doc.Pages.InsertAsync(
-**request:** `InsertPagesRequest`
+**request:** `DocPagesSetScaleRequest`
@@ -2634,24 +2593,10 @@ await client.Doc.Pages.InsertAsync(
-client.Doc.Pages.InsertBlankAsync (InsertBlankPagesRequest { ... }) -> WithRawResponseTask<DocPagesInsertBlank200Response>
-
-
-
-#### 📝 Description
-
-
-
-
+client.Doc.Pages.ViewportsAsync (ViewportsPagesRequest { ... }) -> WithRawResponseTask<DocPagesViewports200Response>
-Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end).
-
-
-
-
-
#### 🔌 Usage
@@ -2661,12 +2606,12 @@ Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF p
```csharp
-await client.Doc.Pages.InsertBlankAsync(
- new InsertBlankPagesRequest
+await client.Doc.Pages.ViewportsAsync(
+ new ViewportsPagesRequest
{
DocId = "docId",
LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
+ PageKey = "pageKey",
}
);
```
@@ -2683,7 +2628,7 @@ await client.Doc.Pages.InsertBlankAsync(
-**request:** `InsertBlankPagesRequest`
+**request:** `ViewportsPagesRequest`
@@ -2695,10 +2640,24 @@ await client.Doc.Pages.InsertBlankAsync(
-client.Doc.Pages.SetNameAsync (SetNamePagesRequest { ... }) -> WithRawResponseTask<DocPagesSetName200Response>
+client.Doc.Pages.ExtractAsync (ExtractPagesRequest { ... }) -> WithRawResponseTask<Stream>
+
+
+
+#### 📝 Description
+
+
+
+
+A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[], "flatten"?: {"usage"?: "display" | "print"}, "includeAnnotations"?: boolean, "includeFormFields"?: boolean}`; the response body is the new PDF. With `flatten` the copy is the pages as they draw for `usage` (`"print"`: a print copy): the annotations and form fields painted in, nothing interactive left, layers in their state for the usage. A flattened copy takes `doc.download` or `doc.download.flattened`, and paints only what the caller may read; `includeAnnotations` and `includeFormFields` choose what it paints, and are refused without `flatten`.
+
+
+
+
+
#### 🔌 Usage
@@ -2708,12 +2667,18 @@ await client.Doc.Pages.InsertBlankAsync(
```csharp
-await client.Doc.Pages.SetNameAsync(
- new SetNamePagesRequest
+await client.Doc.Pages.ExtractAsync(
+ new ExtractPagesRequest
{
DocId = "docId",
LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
+ Body = new Dictionary()
+ {
+ {
+ "string",
+ new Dictionary() { { "key", "value" } }
+ },
+ },
}
);
```
@@ -2730,7 +2695,7 @@ await client.Doc.Pages.SetNameAsync(
-**request:** `SetNamePagesRequest`
+**request:** `ExtractPagesRequest`
@@ -2742,7 +2707,7 @@ await client.Doc.Pages.SetNameAsync(
-client.Doc.Pages.RemoveNameAsync (RemoveNamePagesRequest { ... }) -> WithRawResponseTask<DocPagesRemoveName200Response>
+client.Doc.Pages.FlattenAsync (FlattenPagesRequest { ... }) -> WithRawResponseTask<DocPagesFlatten200Response>
@@ -2755,8 +2720,8 @@ await client.Doc.Pages.SetNameAsync(
```csharp
-await client.Doc.Pages.RemoveNameAsync(
- new RemoveNamePagesRequest
+await client.Doc.Pages.FlattenAsync(
+ new FlattenPagesRequest
{
DocId = "docId",
LayerName = "layerName",
@@ -2777,7 +2742,7 @@ await client.Doc.Pages.RemoveNameAsync(
-**request:** `RemoveNamePagesRequest`
+**request:** `FlattenPagesRequest`
@@ -2789,7 +2754,7 @@ await client.Doc.Pages.RemoveNameAsync(
-client.Doc.Pages.ReorderAsync (DocPagesReorderRequest { ... }) -> WithRawResponseTask<DocPagesReorder200Response>
+client.Doc.Pages.SetNameAsync (SetNamePagesRequest { ... }) -> WithRawResponseTask<DocPagesSetName200Response>
@@ -2802,16 +2767,12 @@ await client.Doc.Pages.RemoveNameAsync(
```csharp
-await client.Doc.Pages.ReorderAsync(
- new DocPagesReorderRequest
+await client.Doc.Pages.SetNameAsync(
+ new SetNamePagesRequest
{
DocId = "docId",
LayerName = "layerName",
- Pages = new List()
- {
- new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- },
- Position = PagePositionZero.Start,
+ Body = new Dictionary() { { "key", "value" } },
}
);
```
@@ -2828,7 +2789,7 @@ await client.Doc.Pages.ReorderAsync(
-**request:** `DocPagesReorderRequest`
+**request:** `SetNamePagesRequest`
@@ -2840,7 +2801,7 @@ await client.Doc.Pages.ReorderAsync(
-client.Doc.Pages.RotateAsync (RotatePagesRequest { ... }) -> WithRawResponseTask<DocPagesRotate200Response>
+client.Doc.Pages.RemoveNameAsync (RemoveNamePagesRequest { ... }) -> WithRawResponseTask<DocPagesRemoveName200Response>
@@ -2853,8 +2814,8 @@ await client.Doc.Pages.ReorderAsync(
```csharp
-await client.Doc.Pages.RotateAsync(
- new RotatePagesRequest
+await client.Doc.Pages.RemoveNameAsync(
+ new RemoveNamePagesRequest
{
DocId = "docId",
LayerName = "layerName",
@@ -2875,7 +2836,7 @@ await client.Doc.Pages.RotateAsync(
-**request:** `RotatePagesRequest`
+**request:** `RemoveNamePagesRequest`
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs
index f9553eca..9d057813 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/CreateTest.cs
@@ -378,6 +378,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -654,6 +655,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs
index d73680ad..9b49b021 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/DeleteTest.cs
@@ -33,6 +33,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -132,6 +133,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs
index 2b4c5f74..7e8f8a15 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/FlattenTest.cs
@@ -70,6 +70,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -183,6 +184,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/ReorderTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/ReorderTest.cs
index 4cc46430..ee705605 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/ReorderTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/ReorderTest.cs
@@ -76,6 +76,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -232,6 +233,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs
index cc7d516e..fc6ac4db 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Annotations/UpdateTest.cs
@@ -382,6 +382,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -665,6 +666,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Attachments/ListTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Attachments/ListTest.cs
new file mode 100644
index 00000000..a25d8597
--- /dev/null
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Attachments/ListTest.cs
@@ -0,0 +1,113 @@
+using CloudPDF.Doc;
+using CloudPDF.Test.Unit.MockServer;
+using CloudPDF.Test.Utils;
+using NUnit.Framework;
+
+namespace CloudPDF.Test.Unit.MockServer.Doc.Attachments;
+
+[TestFixture]
+[Parallelizable(ParallelScope.Self)]
+public class ListTest : BaseMockServerTest
+{
+ [NUnit.Framework.Test]
+ public async Task MockServerTest_1()
+ {
+ const string mockResponse = """
+ {
+ "attachments": [
+ {
+ "ref": {
+ "kind": "key",
+ "key": "key"
+ },
+ "name": "name",
+ "mimeType": "mimeType",
+ "description": "description",
+ "size": 1,
+ "checksum": "checksum",
+ "createdAt": "2024-01-15T09:30:00.000Z",
+ "modifiedAt": "2024-01-15T09:30:00.000Z",
+ "index": 1
+ },
+ {
+ "ref": {
+ "kind": "key",
+ "key": "key"
+ },
+ "name": "name",
+ "mimeType": "mimeType",
+ "description": "description",
+ "size": 1,
+ "checksum": "checksum",
+ "createdAt": "2024-01-15T09:30:00.000Z",
+ "modifiedAt": "2024-01-15T09:30:00.000Z",
+ "index": 1
+ }
+ ]
+ }
+ """;
+
+ Server
+ .Given(
+ WireMock
+ .RequestBuilders.Request.Create()
+ .WithPath("/v1/docs/docId/layers/layerName/attachments")
+ .UsingGet()
+ )
+ .RespondWith(
+ WireMock
+ .ResponseBuilders.Response.Create()
+ .WithStatusCode(200)
+ .WithBody(mockResponse)
+ );
+
+ var response = await Client.Doc.Attachments.ListAsync(
+ new ListAttachmentsRequest { DocId = "docId", LayerName = "layerName" }
+ );
+ JsonAssert.AreEqual(response, mockResponse);
+ }
+
+ [NUnit.Framework.Test]
+ public async Task MockServerTest_2()
+ {
+ const string mockResponse = """
+ {
+ "attachments": [
+ {
+ "ref": {
+ "kind": "key",
+ "key": "key"
+ },
+ "name": "name",
+ "mimeType": "mimeType",
+ "description": "description",
+ "size": 1,
+ "checksum": "checksum",
+ "createdAt": "2024-01-15T09:30:00.000Z",
+ "modifiedAt": "2024-01-15T09:30:00.000Z",
+ "index": 1
+ }
+ ]
+ }
+ """;
+
+ Server
+ .Given(
+ WireMock
+ .RequestBuilders.Request.Create()
+ .WithPath("/v1/docs/docId/layers/layerName/attachments")
+ .UsingGet()
+ )
+ .RespondWith(
+ WireMock
+ .ResponseBuilders.Response.Create()
+ .WithStatusCode(200)
+ .WithBody(mockResponse)
+ );
+
+ var response = await Client.Doc.Attachments.ListAsync(
+ new ListAttachmentsRequest { DocId = "docId", LayerName = "layerName" }
+ );
+ JsonAssert.AreEqual(response, mockResponse);
+ }
+}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/ChangesTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/ChangesTest.cs
index 759ec9f2..581445c4 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/ChangesTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/ChangesTest.cs
@@ -55,6 +55,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": []
@@ -85,6 +86,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": []
@@ -113,6 +115,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -172,6 +175,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": []
@@ -202,6 +206,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": []
@@ -230,6 +235,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/DeleteWidgetTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/DeleteWidgetTest.cs
index c9f150bc..236c4be8 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/DeleteWidgetTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/DeleteWidgetTest.cs
@@ -196,6 +196,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -429,6 +430,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderCalculationsTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderCalculationsTest.cs
index 576fd9e7..08cfd451 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderCalculationsTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderCalculationsTest.cs
@@ -60,6 +60,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -245,6 +246,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderWidgetsTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderWidgetsTest.cs
index f4db6781..9d22e2ba 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderWidgetsTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ReorderWidgetsTest.cs
@@ -80,6 +80,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -294,6 +295,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs
index b7560c6f..3ffbc26b 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/ResetTest.cs
@@ -989,6 +989,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -1279,6 +1280,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs
index 6cabaeab..7042156c 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/SetValueTest.cs
@@ -840,6 +840,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -1167,6 +1168,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/UpdateWidgetTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/UpdateWidgetTest.cs
index c79531d9..2cb21577 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/UpdateWidgetTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Forms/UpdateWidgetTest.cs
@@ -367,6 +367,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -749,6 +750,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs
index c4a0ede4..3b5ecd88 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/ManifestTest.cs
@@ -21,6 +21,7 @@ public async Task MockServerTest_1()
"attachmentsVersion": 1,
"annotationsVersion": 1,
"formsVersion": 1,
+ "outlineVersion": 1,
"auditHead": 1,
"baseSha": "baseSha",
"layerVersion": 1,
@@ -33,7 +34,8 @@ public async Task MockServerTest_1()
"layout": "base",
"attachments": "base",
"metadata": "base",
- "actions": "base"
+ "actions": "base",
+ "outline": "base"
},
"protection": {
"enforced": "none",
@@ -129,6 +131,7 @@ public async Task MockServerTest_2()
"attachmentsVersion": 1,
"annotationsVersion": 1,
"formsVersion": 1,
+ "outlineVersion": 1,
"auditHead": 1,
"baseSha": "baseSha",
"layerVersion": 1,
@@ -141,7 +144,8 @@ public async Task MockServerTest_2()
"layout": "base",
"attachments": "base",
"metadata": "base",
- "actions": "base"
+ "actions": "base",
+ "outline": "base"
},
"protection": {
"enforced": "none",
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Outline/GetTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Outline/GetTest.cs
new file mode 100644
index 00000000..df070836
--- /dev/null
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Outline/GetTest.cs
@@ -0,0 +1,203 @@
+using CloudPDF.Doc;
+using CloudPDF.Test.Unit.MockServer;
+using CloudPDF.Test.Utils;
+using NUnit.Framework;
+
+namespace CloudPDF.Test.Unit.MockServer.Doc.Outline;
+
+[TestFixture]
+[Parallelizable(ParallelScope.Self)]
+public class GetTest : BaseMockServerTest
+{
+ [NUnit.Framework.Test]
+ public async Task MockServerTest_1()
+ {
+ const string mockResponse = """
+ {
+ "items": [
+ {
+ "ref": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "parent": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "title": "title",
+ "target": {
+ "kind": "goto",
+ "destination": {
+ "kind": "xyz",
+ "page": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "x": 1.1,
+ "y": 1.1,
+ "zoom": 1.1
+ }
+ },
+ "action": {
+ "root": {
+ "type": "javascript",
+ "subtype": "subtype",
+ "next": [
+ {
+ "key": "value"
+ },
+ {
+ "key": "value"
+ }
+ ],
+ "script": "script"
+ },
+ "incomplete": true,
+ "warningFlags": 1,
+ "warnings": [
+ "cycle-dropped",
+ "cycle-dropped"
+ ]
+ },
+ "open": true,
+ "color": "color",
+ "bold": true,
+ "italic": true
+ },
+ {
+ "ref": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "parent": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "title": "title",
+ "target": {
+ "kind": "goto",
+ "destination": {
+ "kind": "xyz",
+ "page": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "x": 1.1,
+ "y": 1.1,
+ "zoom": 1.1
+ }
+ },
+ "action": {
+ "root": {
+ "type": "javascript",
+ "subtype": "subtype",
+ "next": [
+ {
+ "key": "value"
+ },
+ {
+ "key": "value"
+ }
+ ],
+ "script": "script"
+ },
+ "incomplete": true,
+ "warningFlags": 1,
+ "warnings": [
+ "cycle-dropped",
+ "cycle-dropped"
+ ]
+ },
+ "open": true,
+ "color": "color",
+ "bold": true,
+ "italic": true
+ }
+ ],
+ "incomplete": true
+ }
+ """;
+
+ Server
+ .Given(
+ WireMock
+ .RequestBuilders.Request.Create()
+ .WithPath("/v1/docs/docId/layers/layerName/outline")
+ .UsingGet()
+ )
+ .RespondWith(
+ WireMock
+ .ResponseBuilders.Response.Create()
+ .WithStatusCode(200)
+ .WithBody(mockResponse)
+ );
+
+ var response = await Client.Doc.Outline.GetAsync(
+ new GetOutlineRequest { DocId = "docId", LayerName = "layerName" }
+ );
+ JsonAssert.AreEqual(response, mockResponse);
+ }
+
+ [NUnit.Framework.Test]
+ public async Task MockServerTest_2()
+ {
+ const string mockResponse = """
+ {
+ "items": [
+ {
+ "ref": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "parent": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ },
+ "title": "title",
+ "target": {
+ "kind": "goto",
+ "destination": {
+ "kind": "xyz",
+ "page": {
+ "kind": "objectNumber",
+ "objectNumber": 1
+ }
+ }
+ },
+ "action": {
+ "incomplete": true,
+ "warningFlags": 1,
+ "warnings": [
+ "cycle-dropped"
+ ]
+ },
+ "open": true,
+ "color": "color",
+ "bold": true,
+ "italic": true
+ }
+ ],
+ "incomplete": true
+ }
+ """;
+
+ Server
+ .Given(
+ WireMock
+ .RequestBuilders.Request.Create()
+ .WithPath("/v1/docs/docId/layers/layerName/outline")
+ .UsingGet()
+ )
+ .RespondWith(
+ WireMock
+ .ResponseBuilders.Response.Create()
+ .WithStatusCode(200)
+ .WithBody(mockResponse)
+ );
+
+ var response = await Client.Doc.Outline.GetAsync(
+ new GetOutlineRequest { DocId = "docId", LayerName = "layerName" }
+ );
+ JsonAssert.AreEqual(response, mockResponse);
+ }
+}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs
deleted file mode 100644
index d1d0462c..00000000
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/DeleteTest.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-using CloudPDF.Doc;
-using CloudPDF.Test.Unit.MockServer;
-using CloudPDF.Test.Utils;
-using NUnit.Framework;
-
-namespace CloudPDF.Test.Unit.MockServer.Doc.Pages;
-
-[TestFixture]
-[Parallelizable(ParallelScope.Self)]
-public class DeleteTest : BaseMockServerTest
-{
- [NUnit.Framework.Test]
- public async Task MockServerTest_1()
- {
- const string requestJson = """
- {
- "string": {
- "key": "value"
- }
- }
- """;
-
- const string mockResponse = """
- {
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- },
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- },
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- },
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/delete")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.DeleteAsync(
- new DeletePagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary()
- {
- {
- "string",
- new Dictionary() { { "key", "value" } }
- },
- },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-
- [NUnit.Framework.Test]
- public async Task MockServerTest_2()
- {
- const string requestJson = """
- {
- "key": "value"
- }
- """;
-
- const string mockResponse = """
- {
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/delete")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.DeleteAsync(
- new DeletePagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs
index e2573242..d0be61b0 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/FlattenTest.cs
@@ -68,6 +68,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -176,6 +177,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs
deleted file mode 100644
index 4b503aae..00000000
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/InsertBlankTest.cs
+++ /dev/null
@@ -1,461 +0,0 @@
-using CloudPDF.Doc;
-using CloudPDF.Test.Unit.MockServer;
-using CloudPDF.Test.Utils;
-using NUnit.Framework;
-
-namespace CloudPDF.Test.Unit.MockServer.Doc.Pages;
-
-[TestFixture]
-[Parallelizable(ParallelScope.Self)]
-public class InsertBlankTest : BaseMockServerTest
-{
- [NUnit.Framework.Test]
- public async Task MockServerTest_1()
- {
- const string requestJson = """
- {
- "string": {
- "key": "value"
- }
- }
- """;
-
- const string mockResponse = """
- {
- "insertedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- },
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- },
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- },
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/insert-blank")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.InsertBlankAsync(
- new InsertBlankPagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary()
- {
- {
- "string",
- new Dictionary() { { "key", "value" } }
- },
- },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-
- [NUnit.Framework.Test]
- public async Task MockServerTest_2()
- {
- const string requestJson = """
- {
- "key": "value"
- }
- """;
-
- const string mockResponse = """
- {
- "insertedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/insert-blank")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.InsertBlankAsync(
- new InsertBlankPagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs
index 86fbaa1b..bf59a2ed 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RemoveNameTest.cs
@@ -234,6 +234,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -394,6 +395,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/ReorderTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/ReorderTest.cs
deleted file mode 100644
index 6f70a74b..00000000
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/ReorderTest.cs
+++ /dev/null
@@ -1,479 +0,0 @@
-using CloudPDF;
-using CloudPDF.Doc;
-using CloudPDF.Test.Unit.MockServer;
-using CloudPDF.Test.Utils;
-using NUnit.Framework;
-
-namespace CloudPDF.Test.Unit.MockServer.Doc.Pages;
-
-[TestFixture]
-[Parallelizable(ParallelScope.Self)]
-public class ReorderTest : BaseMockServerTest
-{
- [NUnit.Framework.Test]
- public async Task MockServerTest_1()
- {
- const string requestJson = """
- {
- "pages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "position": "start"
- }
- """;
-
- const string mockResponse = """
- {
- "pages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- },
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- },
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- },
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/reorder")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.ReorderAsync(
- new DocPagesReorderRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Pages = new List()
- {
- new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- },
- Position = PagePositionZero.Start,
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-
- [NUnit.Framework.Test]
- public async Task MockServerTest_2()
- {
- const string requestJson = """
- {
- "pages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "position": "start"
- }
- """;
-
- const string mockResponse = """
- {
- "pages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/reorder")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.ReorderAsync(
- new DocPagesReorderRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Pages = new List()
- {
- new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- },
- Position = PagePositionZero.Start,
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs
deleted file mode 100644
index 32135c03..00000000
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/RotateTest.cs
+++ /dev/null
@@ -1,445 +0,0 @@
-using CloudPDF.Doc;
-using CloudPDF.Test.Unit.MockServer;
-using CloudPDF.Test.Utils;
-using NUnit.Framework;
-
-namespace CloudPDF.Test.Unit.MockServer.Doc.Pages;
-
-[TestFixture]
-[Parallelizable(ParallelScope.Self)]
-public class RotateTest : BaseMockServerTest
-{
- [NUnit.Framework.Test]
- public async Task MockServerTest_1()
- {
- const string requestJson = """
- {
- "string": {
- "key": "value"
- }
- }
- """;
-
- const string mockResponse = """
- {
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- },
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "label": "label",
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "tabOrder": "rows",
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- },
- "actions": {
- "open": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- },
- "close": {
- "root": {
- "type": "javascript",
- "subtype": "subtype",
- "next": [],
- "script": "script"
- },
- "incomplete": true,
- "warningFlags": 1,
- "warnings": [
- "cycle-dropped",
- "cycle-dropped"
- ]
- }
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- },
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- },
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/rotate")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.RotateAsync(
- new RotatePagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary()
- {
- {
- "string",
- new Dictionary() { { "key", "value" } }
- },
- },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-
- [NUnit.Framework.Test]
- public async Task MockServerTest_2()
- {
- const string requestJson = """
- {
- "key": "value"
- }
- """;
-
- const string mockResponse = """
- {
- "layout": {
- "pageCount": 1,
- "pages": [
- {
- "index": 1,
- "ref": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "size": {
- "width": 1.1,
- "height": 1.1
- },
- "rotation": 1.1,
- "userUnit": 1.1,
- "boxes": {
- "media": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "crop": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "bleed": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "trim": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- },
- "art": {
- "x": 1.1,
- "y": 1.1,
- "width": 1.1,
- "height": 1.1
- }
- },
- "pdfCropBox": {
- "left": 1.1,
- "bottom": 1.1,
- "right": 1.1,
- "top": 1.1
- }
- }
- ],
- "namedPages": [
- {
- "name": "name",
- "target": {
- "kind": "page",
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- }
- }
- ]
- },
- "meta": {
- "affectedPages": [
- {
- "kind": "objectNumber",
- "objectNumber": 1
- }
- ],
- "cacheDelta": {
- "previousDocVersion": 1,
- "docVersion": 1,
- "annotationsVersion": 1,
- "formsVersion": 1,
- "layoutVersion": 1,
- "metadataVersion": 1,
- "attachmentsVersion": 1,
- "layerVersion": 1,
- "working": true,
- "pages": [
- {
- "page": {
- "kind": "objectNumber",
- "objectNumber": 1
- },
- "cache": {
- "contentVersion": 1,
- "annotationVersion": 1,
- "widgetVersion": 1
- }
- }
- ]
- },
- "opId": "opId",
- "undoable": true
- }
- }
- """;
-
- Server
- .Given(
- WireMock
- .RequestBuilders.Request.Create()
- .WithPath("/v1/docs/docId/layers/layerName/pages/rotate")
- .WithHeader("Content-Type", "application/json")
- .UsingPost()
- .WithBodyAsJson(requestJson)
- )
- .RespondWith(
- WireMock
- .ResponseBuilders.Response.Create()
- .WithStatusCode(200)
- .WithBody(mockResponse)
- );
-
- var response = await Client.Doc.Pages.RotateAsync(
- new RotatePagesRequest
- {
- DocId = "docId",
- LayerName = "layerName",
- Body = new Dictionary() { { "key", "value" } },
- }
- );
- JsonAssert.AreEqual(response, mockResponse);
- }
-}
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs
index f880a3f4..1a0faf43 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetNameTest.cs
@@ -234,6 +234,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -394,6 +395,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetScaleTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetScaleTest.cs
index 5c1264b4..06551368 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetScaleTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Pages/SetScaleTest.cs
@@ -41,6 +41,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -130,6 +131,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs
index e3c6e1c8..de9c2312 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Redactions/ApplyTest.cs
@@ -86,6 +86,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -200,6 +201,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs
index 543202fb..b0b42370 100644
--- a/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs
+++ b/src/CloudPDF.Test/Unit/MockServer/Doc/Signatures/CompleteTest.cs
@@ -170,6 +170,7 @@ public async Task MockServerTest_1()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
@@ -365,6 +366,7 @@ public async Task MockServerTest_2()
"layoutVersion": 1,
"metadataVersion": 1,
"attachmentsVersion": 1,
+ "outlineVersion": 1,
"layerVersion": 1,
"working": true,
"pages": [
diff --git a/src/CloudPDF/CloudPDF.csproj b/src/CloudPDF/CloudPDF.csproj
index 938ecc1f..0631730a 100644
--- a/src/CloudPDF/CloudPDF.csproj
+++ b/src/CloudPDF/CloudPDF.csproj
@@ -11,7 +11,7 @@
enable
12
enable
- 3.0.0-next.15
+ 3.0.0-next.16
3.0.0.0
3.0.0.0
README.md
diff --git a/src/CloudPDF/Core/Public/Version.cs b/src/CloudPDF/Core/Public/Version.cs
index 7a05053c..d8d2bd10 100644
--- a/src/CloudPDF/Core/Public/Version.cs
+++ b/src/CloudPDF/Core/Public/Version.cs
@@ -3,5 +3,5 @@ namespace CloudPDF;
[Serializable]
internal class Version
{
- public const string Current = "3.0.0-next.15";
+ public const string Current = "3.0.0-next.16";
}
diff --git a/src/CloudPDF/Doc/Annotations/AnnotationsClient.cs b/src/CloudPDF/Doc/Annotations/AnnotationsClient.cs
index 254bc531..5e974e21 100644
--- a/src/CloudPDF/Doc/Annotations/AnnotationsClient.cs
+++ b/src/CloudPDF/Doc/Annotations/AnnotationsClient.cs
@@ -709,6 +709,119 @@ private async Task> UpdateAsync
}
}
+ private async Task> ReadFileAsyncCore(
+ ReadFileAnnotationsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
+ .MergeAdditional(options?.AdditionalQueryParameters)
+ .Build();
+ var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
+ .Add("X-Document-Password", request.DocumentPassword)
+ .Add(_client.Options.Headers)
+ .Add(_client.Options.AdditionalHeaders)
+ .Add(options?.AdditionalHeaders)
+ .BuildAsync()
+ .ConfigureAwait(false);
+ var response = await _client
+ .SendRequestAsync(
+ new JsonRequest
+ {
+ Method = HttpMethod.Get,
+ Path = string.Format(
+ "v1/docs/{0}/layers/{1}/annotations/pages/{2}/items/{3}/resources/file",
+ ValueConvert.ToPathParameterString(request.DocId),
+ ValueConvert.ToPathParameterString(request.LayerName),
+ ValueConvert.ToPathParameterString(request.PageKey),
+ ValueConvert.ToPathParameterString(request.AnnotKey)
+ ),
+ QueryString = _queryString,
+ Headers = _headers,
+ Options = options,
+ },
+ cancellationToken
+ )
+ .ConfigureAwait(false);
+ if (response.StatusCode is >= 200 and < 400)
+ {
+ var stream = await response.Raw.Content.ReadAsStreamAsync();
+ return new WithRawResponse()
+ {
+ Data = stream,
+ RawResponse = new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ },
+ };
+ }
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ switch (response.StatusCode)
+ {
+ case 400:
+ throw new BadRequestError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ case 404:
+ throw new NotFoundError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ case 413:
+ throw new ContentTooLargeError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ catch (JsonException)
+ {
+ // unable to map error response, throwing generic error
+ }
+ throw new CloudPDFApiException(
+ $"Error with status code {response.StatusCode}",
+ response.StatusCode,
+ responseBody,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+
private async Task> ExportAppearanceAsyncCore(
ExportAppearanceAnnotationsRequest request,
RequestOptions? options = null,
@@ -1195,6 +1308,31 @@ public WithRawResponseTask UpdateAsync(
);
}
+ ///
+ /// A file that decodes past the server's limit is refused (PayloadTooLarge).
+ ///
+ ///
+ /// await client.Doc.Annotations.ReadFileAsync(
+ /// new ReadFileAnnotationsRequest
+ /// {
+ /// DocId = "docId",
+ /// LayerName = "layerName",
+ /// PageKey = "pageKey",
+ /// AnnotKey = "annotKey",
+ /// }
+ /// );
+ ///
+ public WithRawResponseTask ReadFileAsync(
+ ReadFileAnnotationsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ return new WithRawResponseTask(
+ ReadFileAsyncCore(request, options, cancellationToken)
+ );
+ }
+
///
/// await client.Doc.Annotations.ExportAppearanceAsync(
/// new ExportAppearanceAnnotationsRequest
diff --git a/src/CloudPDF/Doc/Annotations/IAnnotationsClient.cs b/src/CloudPDF/Doc/Annotations/IAnnotationsClient.cs
index 85155785..f87535e1 100644
--- a/src/CloudPDF/Doc/Annotations/IAnnotationsClient.cs
+++ b/src/CloudPDF/Doc/Annotations/IAnnotationsClient.cs
@@ -46,6 +46,15 @@ WithRawResponseTask UpdateAsync(
CancellationToken cancellationToken = default
);
+ ///
+ /// A file that decodes past the server's limit is refused (PayloadTooLarge).
+ ///
+ WithRawResponseTask ReadFileAsync(
+ ReadFileAnnotationsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ );
+
WithRawResponseTask ExportAppearanceAsync(
ExportAppearanceAnnotationsRequest request,
RequestOptions? options = null,
diff --git a/src/CloudPDF/Doc/Pages/Requests/InsertBlankPagesRequest.cs b/src/CloudPDF/Doc/Annotations/Requests/ReadFileAnnotationsRequest.cs
similarity index 55%
rename from src/CloudPDF/Doc/Pages/Requests/InsertBlankPagesRequest.cs
rename to src/CloudPDF/Doc/Annotations/Requests/ReadFileAnnotationsRequest.cs
index a9075f2b..56b176f9 100644
--- a/src/CloudPDF/Doc/Pages/Requests/InsertBlankPagesRequest.cs
+++ b/src/CloudPDF/Doc/Annotations/Requests/ReadFileAnnotationsRequest.cs
@@ -4,7 +4,7 @@
namespace CloudPDF.Doc;
[Serializable]
-public record InsertBlankPagesRequest
+public record ReadFileAnnotationsRequest
{
[JsonIgnore]
public required string DocId { get; set; }
@@ -13,19 +13,22 @@ public record InsertBlankPagesRequest
public required string LayerName { get; set; }
///
- /// 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.
+ /// The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
///
[JsonIgnore]
- public string? DocumentPassword { get; set; }
+ public required string PageKey { get; set; }
///
- /// Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
+ /// The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
///
[JsonIgnore]
- public string? IdempotencyKey { get; set; }
+ public required string AnnotKey { get; set; }
+ ///
+ /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
+ ///
[JsonIgnore]
- public Dictionary Body { get; set; } = new Dictionary();
+ public string? DocumentPassword { get; set; }
///
public override string ToString()
diff --git a/src/CloudPDF/Doc/Attachments/AttachmentsClient.cs b/src/CloudPDF/Doc/Attachments/AttachmentsClient.cs
new file mode 100644
index 00000000..38226fbb
--- /dev/null
+++ b/src/CloudPDF/Doc/Attachments/AttachmentsClient.cs
@@ -0,0 +1,278 @@
+using CloudPDF;
+using CloudPDF.Core;
+using global::System.Text.Json;
+
+namespace CloudPDF.Doc;
+
+public partial class AttachmentsClient : IAttachmentsClient
+{
+ private readonly RawClient _client;
+
+ internal AttachmentsClient(RawClient client)
+ {
+ _client = client;
+ }
+
+ private async Task> DownloadAsyncCore(
+ DownloadAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
+ .MergeAdditional(options?.AdditionalQueryParameters)
+ .Build();
+ var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
+ .Add("X-Document-Password", request.DocumentPassword)
+ .Add(_client.Options.Headers)
+ .Add(_client.Options.AdditionalHeaders)
+ .Add(options?.AdditionalHeaders)
+ .BuildAsync()
+ .ConfigureAwait(false);
+ var response = await _client
+ .SendRequestAsync(
+ new JsonRequest
+ {
+ Method = HttpMethod.Get,
+ Path = string.Format(
+ "v1/docs/{0}/layers/{1}/attachment-files/{2}/data",
+ ValueConvert.ToPathParameterString(request.DocId),
+ ValueConvert.ToPathParameterString(request.LayerName),
+ ValueConvert.ToPathParameterString(request.FileKey)
+ ),
+ QueryString = _queryString,
+ Headers = _headers,
+ Options = options,
+ },
+ cancellationToken
+ )
+ .ConfigureAwait(false);
+ if (response.StatusCode is >= 200 and < 400)
+ {
+ var stream = await response.Raw.Content.ReadAsStreamAsync();
+ return new WithRawResponse()
+ {
+ Data = stream,
+ RawResponse = new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ },
+ };
+ }
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ switch (response.StatusCode)
+ {
+ case 400:
+ throw new BadRequestError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ case 404:
+ throw new NotFoundError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ case 413:
+ throw new ContentTooLargeError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ catch (JsonException)
+ {
+ // unable to map error response, throwing generic error
+ }
+ throw new CloudPDFApiException(
+ $"Error with status code {response.StatusCode}",
+ response.StatusCode,
+ responseBody,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+
+ private async Task> ListAsyncCore(
+ ListAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
+ .MergeAdditional(options?.AdditionalQueryParameters)
+ .Build();
+ var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
+ .Add("X-Document-Password", request.DocumentPassword)
+ .Add(_client.Options.Headers)
+ .Add(_client.Options.AdditionalHeaders)
+ .Add(options?.AdditionalHeaders)
+ .BuildAsync()
+ .ConfigureAwait(false);
+ var response = await _client
+ .SendRequestAsync(
+ new JsonRequest
+ {
+ Method = HttpMethod.Get,
+ Path = string.Format(
+ "v1/docs/{0}/layers/{1}/attachments",
+ ValueConvert.ToPathParameterString(request.DocId),
+ ValueConvert.ToPathParameterString(request.LayerName)
+ ),
+ QueryString = _queryString,
+ Headers = _headers,
+ Options = options,
+ },
+ cancellationToken
+ )
+ .ConfigureAwait(false);
+ if (response.StatusCode is >= 200 and < 400)
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ var responseData = JsonUtils.Deserialize(responseBody)!;
+ return new WithRawResponse()
+ {
+ Data = responseData,
+ RawResponse = new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ },
+ };
+ }
+ catch (JsonException e)
+ {
+ throw new CloudPDFApiException(
+ "Failed to deserialize response",
+ response.StatusCode,
+ responseBody,
+ e,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ switch (response.StatusCode)
+ {
+ case 404:
+ throw new NotFoundError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ catch (JsonException)
+ {
+ // unable to map error response, throwing generic error
+ }
+ throw new CloudPDFApiException(
+ $"Error with status code {response.StatusCode}",
+ response.StatusCode,
+ responseBody,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+
+ ///
+ /// A file that decodes past the server's limit is refused (PayloadTooLarge).
+ ///
+ ///
+ /// await client.Doc.Attachments.DownloadAsync(
+ /// new DownloadAttachmentsRequest
+ /// {
+ /// DocId = "docId",
+ /// LayerName = "layerName",
+ /// FileKey = "fileKey",
+ /// }
+ /// );
+ ///
+ public WithRawResponseTask DownloadAsync(
+ DownloadAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ return new WithRawResponseTask(
+ DownloadAsyncCore(request, options, cancellationToken)
+ );
+ }
+
+ ///
+ /// A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`.
+ ///
+ ///
+ /// await client.Doc.Attachments.ListAsync(
+ /// new ListAttachmentsRequest { DocId = "docId", LayerName = "layerName" }
+ /// );
+ ///
+ public WithRawResponseTask ListAsync(
+ ListAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ return new WithRawResponseTask(
+ ListAsyncCore(request, options, cancellationToken)
+ );
+ }
+}
diff --git a/src/CloudPDF/Doc/Attachments/IAttachmentsClient.cs b/src/CloudPDF/Doc/Attachments/IAttachmentsClient.cs
new file mode 100644
index 00000000..ba2c377f
--- /dev/null
+++ b/src/CloudPDF/Doc/Attachments/IAttachmentsClient.cs
@@ -0,0 +1,24 @@
+using CloudPDF;
+
+namespace CloudPDF.Doc;
+
+public partial interface IAttachmentsClient
+{
+ ///
+ /// A file that decodes past the server's limit is refused (PayloadTooLarge).
+ ///
+ WithRawResponseTask DownloadAsync(
+ DownloadAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ );
+
+ ///
+ /// A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`.
+ ///
+ WithRawResponseTask ListAsync(
+ ListAttachmentsRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ );
+}
diff --git a/src/CloudPDF/Doc/Pages/Requests/InsertPagesRequest.cs b/src/CloudPDF/Doc/Attachments/Requests/DownloadAttachmentsRequest.cs
similarity index 70%
rename from src/CloudPDF/Doc/Pages/Requests/InsertPagesRequest.cs
rename to src/CloudPDF/Doc/Attachments/Requests/DownloadAttachmentsRequest.cs
index 1fb4c0f1..571b81bb 100644
--- a/src/CloudPDF/Doc/Pages/Requests/InsertPagesRequest.cs
+++ b/src/CloudPDF/Doc/Attachments/Requests/DownloadAttachmentsRequest.cs
@@ -1,11 +1,10 @@
-using CloudPDF;
using CloudPDF.Core;
using global::System.Text.Json.Serialization;
namespace CloudPDF.Doc;
[Serializable]
-public record InsertPagesRequest
+public record DownloadAttachmentsRequest
{
[JsonIgnore]
public required string DocId { get; set; }
@@ -14,18 +13,16 @@ public record InsertPagesRequest
public required string LayerName { get; set; }
///
- /// 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.
+ /// The embedded file's name-tree key (its `ref.key`), token-text encoded, as `fieldKey` is.
///
[JsonIgnore]
- public string? DocumentPassword { get; set; }
+ public required string FileKey { get; set; }
///
- /// Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
+ /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
///
[JsonIgnore]
- public string? IdempotencyKey { get; set; }
-
- public required FileParameter File { get; set; }
+ public string? DocumentPassword { get; set; }
///
public override string ToString()
diff --git a/src/CloudPDF/Doc/Pages/Requests/DeletePagesRequest.cs b/src/CloudPDF/Doc/Attachments/Requests/ListAttachmentsRequest.cs
similarity index 62%
rename from src/CloudPDF/Doc/Pages/Requests/DeletePagesRequest.cs
rename to src/CloudPDF/Doc/Attachments/Requests/ListAttachmentsRequest.cs
index 4da44749..f1862f0d 100644
--- a/src/CloudPDF/Doc/Pages/Requests/DeletePagesRequest.cs
+++ b/src/CloudPDF/Doc/Attachments/Requests/ListAttachmentsRequest.cs
@@ -4,7 +4,7 @@
namespace CloudPDF.Doc;
[Serializable]
-public record DeletePagesRequest
+public record ListAttachmentsRequest
{
[JsonIgnore]
public required string DocId { get; set; }
@@ -18,15 +18,6 @@ public record DeletePagesRequest
[JsonIgnore]
public string? DocumentPassword { get; set; }
- ///
- /// Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
- ///
- [JsonIgnore]
- public string? IdempotencyKey { get; set; }
-
- [JsonIgnore]
- public Dictionary Body { get; set; } = new Dictionary();
-
///
public override string ToString()
{
diff --git a/src/CloudPDF/Doc/DocClient.cs b/src/CloudPDF/Doc/DocClient.cs
index 15f5dabd..cc305990 100644
--- a/src/CloudPDF/Doc/DocClient.cs
+++ b/src/CloudPDF/Doc/DocClient.cs
@@ -12,8 +12,10 @@ internal DocClient(RawClient client)
{
_client = client;
Annotations = new AnnotationsClient(_client);
+ Attachments = new AttachmentsClient(_client);
Forms = new FormsClient(_client);
Metadata = new MetadataClient(_client);
+ Outline = new OutlineClient(_client);
Pages = new PagesClient(_client);
Redactions = new RedactionsClient(_client);
Signatures = new SignaturesClient(_client);
@@ -22,10 +24,14 @@ internal DocClient(RawClient client)
public IAnnotationsClient Annotations { get; }
+ public IAttachmentsClient Attachments { get; }
+
public IFormsClient Forms { get; }
public IMetadataClient Metadata { get; }
+ public IOutlineClient Outline { get; }
+
public IPagesClient Pages { get; }
public IRedactionsClient Redactions { get; }
@@ -257,7 +263,7 @@ private async Task> ChangesAsyncCore(
);
case 413:
throw new ContentTooLargeError(
- JsonUtils.Deserialize(responseBody),
+ JsonUtils.Deserialize(responseBody),
rawResponse: new CloudPDF.RawResponse()
{
StatusCode = response.Raw.StatusCode,
@@ -694,7 +700,7 @@ public WithRawResponseTask HeadAsync(
}
///
- /// Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { <role>: '<key>' }`, and each file as the part `resource:<key>`. At most 64 changes per request and 512 ops per change.
+ /// Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`, outline `doc.outline.modify`, pages `doc.pages.assemble`, embedded files `doc.attachments.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork, a PDF whose pages come in) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { <role>: '<key>' }`, and each file as the part `resource:<key>`. At most 64 changes per request and 512 ops per change.
///
///
/// await client.Doc.ChangesAsync(
diff --git a/src/CloudPDF/Doc/IDocClient.cs b/src/CloudPDF/Doc/IDocClient.cs
index bdbd4ff5..adb59c71 100644
--- a/src/CloudPDF/Doc/IDocClient.cs
+++ b/src/CloudPDF/Doc/IDocClient.cs
@@ -5,8 +5,10 @@ namespace CloudPDF;
public partial interface IDocClient
{
public IAnnotationsClient Annotations { get; }
+ public IAttachmentsClient Attachments { get; }
public IFormsClient Forms { get; }
public IMetadataClient Metadata { get; }
+ public IOutlineClient Outline { get; }
public IPagesClient Pages { get; }
public IRedactionsClient Redactions { get; }
public ISignaturesClient Signatures { get; }
@@ -18,7 +20,7 @@ WithRawResponseTask HeadAsync(
);
///
- /// Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { <role>: '<key>' }`, and each file as the part `resource:<key>`. At most 64 changes per request and 512 ops per change.
+ /// Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`, outline `doc.outline.modify`, pages `doc.pages.assemble`, embedded files `doc.attachments.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork, a PDF whose pages come in) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { <role>: '<key>' }`, and each file as the part `resource:<key>`. At most 64 changes per request and 512 ops per change.
///
WithRawResponseTask ChangesAsync(
DocChangesRequest request,
diff --git a/src/CloudPDF/Doc/Outline/IOutlineClient.cs b/src/CloudPDF/Doc/Outline/IOutlineClient.cs
new file mode 100644
index 00000000..40f8eb28
--- /dev/null
+++ b/src/CloudPDF/Doc/Outline/IOutlineClient.cs
@@ -0,0 +1,12 @@
+using CloudPDF;
+
+namespace CloudPDF.Doc;
+
+public partial interface IOutlineClient
+{
+ WithRawResponseTask GetAsync(
+ GetOutlineRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ );
+}
diff --git a/src/CloudPDF/Doc/Outline/OutlineClient.cs b/src/CloudPDF/Doc/Outline/OutlineClient.cs
new file mode 100644
index 00000000..dad14fea
--- /dev/null
+++ b/src/CloudPDF/Doc/Outline/OutlineClient.cs
@@ -0,0 +1,139 @@
+using CloudPDF;
+using CloudPDF.Core;
+using global::System.Text.Json;
+
+namespace CloudPDF.Doc;
+
+public partial class OutlineClient : IOutlineClient
+{
+ private readonly RawClient _client;
+
+ internal OutlineClient(RawClient client)
+ {
+ _client = client;
+ }
+
+ private async Task> GetAsyncCore(
+ GetOutlineRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
+ .MergeAdditional(options?.AdditionalQueryParameters)
+ .Build();
+ var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
+ .Add("X-Document-Password", request.DocumentPassword)
+ .Add(_client.Options.Headers)
+ .Add(_client.Options.AdditionalHeaders)
+ .Add(options?.AdditionalHeaders)
+ .BuildAsync()
+ .ConfigureAwait(false);
+ var response = await _client
+ .SendRequestAsync(
+ new JsonRequest
+ {
+ Method = HttpMethod.Get,
+ Path = string.Format(
+ "v1/docs/{0}/layers/{1}/outline",
+ ValueConvert.ToPathParameterString(request.DocId),
+ ValueConvert.ToPathParameterString(request.LayerName)
+ ),
+ QueryString = _queryString,
+ Headers = _headers,
+ Options = options,
+ },
+ cancellationToken
+ )
+ .ConfigureAwait(false);
+ if (response.StatusCode is >= 200 and < 400)
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ var responseData = JsonUtils.Deserialize(responseBody)!;
+ return new WithRawResponse()
+ {
+ Data = responseData,
+ RawResponse = new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ },
+ };
+ }
+ catch (JsonException e)
+ {
+ throw new CloudPDFApiException(
+ "Failed to deserialize response",
+ response.StatusCode,
+ responseBody,
+ e,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ {
+ var responseBody = await response
+ .Raw.Content.ReadAsStringAsync(cancellationToken)
+ .ConfigureAwait(false);
+ try
+ {
+ switch (response.StatusCode)
+ {
+ case 404:
+ throw new NotFoundError(
+ JsonUtils.Deserialize(responseBody),
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url =
+ response.Raw.RequestMessage?.RequestUri
+ ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+ catch (JsonException)
+ {
+ // unable to map error response, throwing generic error
+ }
+ throw new CloudPDFApiException(
+ $"Error with status code {response.StatusCode}",
+ response.StatusCode,
+ responseBody,
+ rawResponse: new CloudPDF.RawResponse()
+ {
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ }
+ );
+ }
+ }
+
+ ///
+ /// await client.Doc.Outline.GetAsync(
+ /// new GetOutlineRequest { DocId = "docId", LayerName = "layerName" }
+ /// );
+ ///
+ public WithRawResponseTask GetAsync(
+ GetOutlineRequest request,
+ RequestOptions? options = null,
+ CancellationToken cancellationToken = default
+ )
+ {
+ return new WithRawResponseTask(
+ GetAsyncCore(request, options, cancellationToken)
+ );
+ }
+}
diff --git a/src/CloudPDF/Doc/Pages/Requests/RotatePagesRequest.cs b/src/CloudPDF/Doc/Outline/Requests/GetOutlineRequest.cs
similarity index 62%
rename from src/CloudPDF/Doc/Pages/Requests/RotatePagesRequest.cs
rename to src/CloudPDF/Doc/Outline/Requests/GetOutlineRequest.cs
index f5293eed..793ce484 100644
--- a/src/CloudPDF/Doc/Pages/Requests/RotatePagesRequest.cs
+++ b/src/CloudPDF/Doc/Outline/Requests/GetOutlineRequest.cs
@@ -4,7 +4,7 @@
namespace CloudPDF.Doc;
[Serializable]
-public record RotatePagesRequest
+public record GetOutlineRequest
{
[JsonIgnore]
public required string DocId { get; set; }
@@ -18,15 +18,6 @@ public record RotatePagesRequest
[JsonIgnore]
public string? DocumentPassword { get; set; }
- ///
- /// Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
- ///
- [JsonIgnore]
- public string? IdempotencyKey { get; set; }
-
- [JsonIgnore]
- public Dictionary Body { get; set; } = new Dictionary();
-
///
public override string ToString()
{
diff --git a/src/CloudPDF/Doc/Pages/IPagesClient.cs b/src/CloudPDF/Doc/Pages/IPagesClient.cs
index faac9251..5b813312 100644
--- a/src/CloudPDF/Doc/Pages/IPagesClient.cs
+++ b/src/CloudPDF/Doc/Pages/IPagesClient.cs
@@ -16,14 +16,8 @@ WithRawResponseTask ViewportsAsync(
CancellationToken cancellationToken = default
);
- WithRawResponseTask DeleteAsync(
- DeletePagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- );
-
///
- /// A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[]}`; the response body is the new PDF.
+ /// A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[], "flatten"?: {"usage"?: "display" | "print"}, "includeAnnotations"?: boolean, "includeFormFields"?: boolean}`; the response body is the new PDF. With `flatten` the copy is the pages as they draw for `usage` (`"print"`: a print copy): the annotations and form fields painted in, nothing interactive left, layers in their state for the usage. A flattened copy takes `doc.download` or `doc.download.flattened`, and paints only what the caller may read; `includeAnnotations` and `includeFormFields` choose what it paints, and are refused without `flatten`.
///
WithRawResponseTask ExtractAsync(
ExtractPagesRequest request,
@@ -37,24 +31,6 @@ WithRawResponseTask FlattenAsync(
CancellationToken cancellationToken = default
);
- ///
- /// Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source": "<key>"}}` (position omitted → the end), and the standalone PDF whose pages are copied in as the part `resource:<key>`. The inserted copies get fresh page object numbers, returned in insertion order.
- ///
- WithRawResponseTask InsertAsync(
- InsertPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- );
-
- ///
- /// Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end).
- ///
- WithRawResponseTask InsertBlankAsync(
- InsertBlankPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- );
-
WithRawResponseTask SetNameAsync(
SetNamePagesRequest request,
RequestOptions? options = null,
@@ -66,16 +42,4 @@ WithRawResponseTask RemoveNameAsync(
RequestOptions? options = null,
CancellationToken cancellationToken = default
);
-
- WithRawResponseTask ReorderAsync(
- DocPagesReorderRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- );
-
- WithRawResponseTask RotateAsync(
- RotatePagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- );
}
diff --git a/src/CloudPDF/Doc/Pages/PagesClient.cs b/src/CloudPDF/Doc/Pages/PagesClient.cs
index 20b68a14..dcad154f 100644
--- a/src/CloudPDF/Doc/Pages/PagesClient.cs
+++ b/src/CloudPDF/Doc/Pages/PagesClient.cs
@@ -250,600 +250,8 @@ private async Task> ViewportsAsync
}
}
- private async Task> DeleteAsyncCore(
- DeletePagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
- .MergeAdditional(options?.AdditionalQueryParameters)
- .Build();
- var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
- .Add("X-Document-Password", request.DocumentPassword)
- .Add("Idempotency-Key", request.IdempotencyKey)
- .Add(_client.Options.Headers)
- .Add(_client.Options.AdditionalHeaders)
- .Add(options?.AdditionalHeaders)
- .BuildAsync()
- .ConfigureAwait(false);
- var response = await _client
- .SendRequestAsync(
- new JsonRequest
- {
- Method = HttpMethod.Post,
- Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/delete",
- ValueConvert.ToPathParameterString(request.DocId),
- ValueConvert.ToPathParameterString(request.LayerName)
- ),
- Body = request.Body,
- QueryString = _queryString,
- Headers = _headers,
- ContentType = "application/json",
- Options = options,
- },
- cancellationToken
- )
- .ConfigureAwait(false);
- if (response.StatusCode is >= 200 and < 400)
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
- {
- Data = responseData,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- catch (JsonException e)
- {
- throw new CloudPDFApiException(
- "Failed to deserialize response",
- response.StatusCode,
- responseBody,
- e,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- switch (response.StatusCode)
- {
- case 400:
- throw new BadRequestError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- case 404:
- throw new NotFoundError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- catch (JsonException)
- {
- // unable to map error response, throwing generic error
- }
- throw new CloudPDFApiException(
- $"Error with status code {response.StatusCode}",
- response.StatusCode,
- responseBody,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
-
- private async Task> ExtractAsyncCore(
- ExtractPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
- .MergeAdditional(options?.AdditionalQueryParameters)
- .Build();
- var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
- .Add("X-Document-Password", request.DocumentPassword)
- .Add(_client.Options.Headers)
- .Add(_client.Options.AdditionalHeaders)
- .Add(options?.AdditionalHeaders)
- .BuildAsync()
- .ConfigureAwait(false);
- var response = await _client
- .SendRequestAsync(
- new JsonRequest
- {
- Method = HttpMethod.Post,
- Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/extract",
- ValueConvert.ToPathParameterString(request.DocId),
- ValueConvert.ToPathParameterString(request.LayerName)
- ),
- Body = request.Body,
- QueryString = _queryString,
- Headers = _headers,
- ContentType = "application/json",
- Options = options,
- },
- cancellationToken
- )
- .ConfigureAwait(false);
- if (response.StatusCode is >= 200 and < 400)
- {
- var stream = await response.Raw.Content.ReadAsStreamAsync();
- return new WithRawResponse()
- {
- Data = stream,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- switch (response.StatusCode)
- {
- case 400:
- throw new BadRequestError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- case 404:
- throw new NotFoundError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- catch (JsonException)
- {
- // unable to map error response, throwing generic error
- }
- throw new CloudPDFApiException(
- $"Error with status code {response.StatusCode}",
- response.StatusCode,
- responseBody,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
-
- private async Task> FlattenAsyncCore(
- FlattenPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
- .MergeAdditional(options?.AdditionalQueryParameters)
- .Build();
- var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
- .Add("X-Document-Password", request.DocumentPassword)
- .Add("Idempotency-Key", request.IdempotencyKey)
- .Add(_client.Options.Headers)
- .Add(_client.Options.AdditionalHeaders)
- .Add(options?.AdditionalHeaders)
- .BuildAsync()
- .ConfigureAwait(false);
- var response = await _client
- .SendRequestAsync(
- new JsonRequest
- {
- Method = HttpMethod.Post,
- Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/flatten",
- ValueConvert.ToPathParameterString(request.DocId),
- ValueConvert.ToPathParameterString(request.LayerName)
- ),
- Body = request.Body,
- QueryString = _queryString,
- Headers = _headers,
- ContentType = "application/json",
- Options = options,
- },
- cancellationToken
- )
- .ConfigureAwait(false);
- if (response.StatusCode is >= 200 and < 400)
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
- {
- Data = responseData,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- catch (JsonException e)
- {
- throw new CloudPDFApiException(
- "Failed to deserialize response",
- response.StatusCode,
- responseBody,
- e,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- switch (response.StatusCode)
- {
- case 400:
- throw new BadRequestError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- case 404:
- throw new NotFoundError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- catch (JsonException)
- {
- // unable to map error response, throwing generic error
- }
- throw new CloudPDFApiException(
- $"Error with status code {response.StatusCode}",
- response.StatusCode,
- responseBody,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
-
- private async Task> InsertAsyncCore(
- InsertPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
- .MergeAdditional(options?.AdditionalQueryParameters)
- .Build();
- var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
- .Add("X-Document-Password", request.DocumentPassword)
- .Add("Idempotency-Key", request.IdempotencyKey)
- .Add(_client.Options.Headers)
- .Add(_client.Options.AdditionalHeaders)
- .Add(options?.AdditionalHeaders)
- .BuildAsync()
- .ConfigureAwait(false);
- var multipartFormRequest_ = new MultipartFormRequest
- {
- Method = HttpMethod.Post,
- Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/insert",
- ValueConvert.ToPathParameterString(request.DocId),
- ValueConvert.ToPathParameterString(request.LayerName)
- ),
- QueryString = _queryString,
- Headers = _headers,
- Options = options,
- };
- multipartFormRequest_.AddFileParameterPart("file", request.File);
- var response = await _client
- .SendRequestAsync(multipartFormRequest_, cancellationToken)
- .ConfigureAwait(false);
- if (response.StatusCode is >= 200 and < 400)
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
- {
- Data = responseData,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- catch (JsonException e)
- {
- throw new CloudPDFApiException(
- "Failed to deserialize response",
- response.StatusCode,
- responseBody,
- e,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- switch (response.StatusCode)
- {
- case 400:
- throw new BadRequestError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- case 404:
- throw new NotFoundError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- catch (JsonException)
- {
- // unable to map error response, throwing generic error
- }
- throw new CloudPDFApiException(
- $"Error with status code {response.StatusCode}",
- response.StatusCode,
- responseBody,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
-
- private async Task> InsertBlankAsyncCore(
- InsertBlankPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- var _queryString = new CloudPDF.Core.QueryStringBuilder.Builder(capacity: 0)
- .MergeAdditional(options?.AdditionalQueryParameters)
- .Build();
- var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
- .Add("X-Document-Password", request.DocumentPassword)
- .Add("Idempotency-Key", request.IdempotencyKey)
- .Add(_client.Options.Headers)
- .Add(_client.Options.AdditionalHeaders)
- .Add(options?.AdditionalHeaders)
- .BuildAsync()
- .ConfigureAwait(false);
- var response = await _client
- .SendRequestAsync(
- new JsonRequest
- {
- Method = HttpMethod.Post,
- Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/insert-blank",
- ValueConvert.ToPathParameterString(request.DocId),
- ValueConvert.ToPathParameterString(request.LayerName)
- ),
- Body = request.Body,
- QueryString = _queryString,
- Headers = _headers,
- ContentType = "application/json",
- Options = options,
- },
- cancellationToken
- )
- .ConfigureAwait(false);
- if (response.StatusCode is >= 200 and < 400)
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- var responseData = JsonUtils.Deserialize(
- responseBody
- )!;
- return new WithRawResponse()
- {
- Data = responseData,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- catch (JsonException e)
- {
- throw new CloudPDFApiException(
- "Failed to deserialize response",
- response.StatusCode,
- responseBody,
- e,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- {
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
- {
- switch (response.StatusCode)
- {
- case 400:
- throw new BadRequestError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- case 404:
- throw new NotFoundError(
- JsonUtils.Deserialize(responseBody),
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url =
- response.Raw.RequestMessage?.RequestUri
- ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
- catch (JsonException)
- {
- // unable to map error response, throwing generic error
- }
- throw new CloudPDFApiException(
- $"Error with status code {response.StatusCode}",
- response.StatusCode,
- responseBody,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
- }
-
- private async Task> SetNameAsyncCore(
- SetNamePagesRequest request,
+ private async Task> ExtractAsyncCore(
+ ExtractPagesRequest request,
RequestOptions? options = null,
CancellationToken cancellationToken = default
)
@@ -853,7 +261,6 @@ private async Task> SetNameAsyncCore
.Build();
var _headers = await new CloudPDF.Core.HeadersBuilder.Builder()
.Add("X-Document-Password", request.DocumentPassword)
- .Add("Idempotency-Key", request.IdempotencyKey)
.Add(_client.Options.Headers)
.Add(_client.Options.AdditionalHeaders)
.Add(options?.AdditionalHeaders)
@@ -865,7 +272,7 @@ private async Task> SetNameAsyncCore
{
Method = HttpMethod.Post,
Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/names",
+ "v1/docs/{0}/layers/{1}/pages/extract",
ValueConvert.ToPathParameterString(request.DocId),
ValueConvert.ToPathParameterString(request.LayerName)
),
@@ -880,38 +287,17 @@ private async Task> SetNameAsyncCore
.ConfigureAwait(false);
if (response.StatusCode is >= 200 and < 400)
{
- var responseBody = await response
- .Raw.Content.ReadAsStringAsync(cancellationToken)
- .ConfigureAwait(false);
- try
+ var stream = await response.Raw.Content.ReadAsStreamAsync();
+ return new WithRawResponse()
{
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
+ Data = stream,
+ RawResponse = new CloudPDF.RawResponse()
{
- Data = responseData,
- RawResponse = new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- },
- };
- }
- catch (JsonException e)
- {
- throw new CloudPDFApiException(
- "Failed to deserialize response",
- response.StatusCode,
- responseBody,
- e,
- rawResponse: new CloudPDF.RawResponse()
- {
- StatusCode = response.Raw.StatusCode,
- Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
- Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
- }
- );
- }
+ StatusCode = response.Raw.StatusCode,
+ Url = response.Raw.RequestMessage?.RequestUri ?? new Uri("about:blank"),
+ Headers = ResponseHeaders.FromHttpResponseMessage(response.Raw),
+ },
+ };
}
{
var responseBody = await response
@@ -965,8 +351,8 @@ private async Task> SetNameAsyncCore
}
}
- private async Task> RemoveNameAsyncCore(
- RemoveNamePagesRequest request,
+ private async Task> FlattenAsyncCore(
+ FlattenPagesRequest request,
RequestOptions? options = null,
CancellationToken cancellationToken = default
)
@@ -988,7 +374,7 @@ private async Task> RemoveNameAsy
{
Method = HttpMethod.Post,
Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/names/delete",
+ "v1/docs/{0}/layers/{1}/pages/flatten",
ValueConvert.ToPathParameterString(request.DocId),
ValueConvert.ToPathParameterString(request.LayerName)
),
@@ -1008,10 +394,8 @@ private async Task> RemoveNameAsy
.ConfigureAwait(false);
try
{
- var responseData = JsonUtils.Deserialize(
- responseBody
- )!;
- return new WithRawResponse()
+ var responseData = JsonUtils.Deserialize(responseBody)!;
+ return new WithRawResponse()
{
Data = responseData,
RawResponse = new CloudPDF.RawResponse()
@@ -1090,8 +474,8 @@ private async Task> RemoveNameAsy
}
}
- private async Task> ReorderAsyncCore(
- DocPagesReorderRequest request,
+ private async Task> SetNameAsyncCore(
+ SetNamePagesRequest request,
RequestOptions? options = null,
CancellationToken cancellationToken = default
)
@@ -1113,11 +497,11 @@ private async Task> ReorderAsyncCore
{
Method = HttpMethod.Post,
Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/reorder",
+ "v1/docs/{0}/layers/{1}/pages/names",
ValueConvert.ToPathParameterString(request.DocId),
ValueConvert.ToPathParameterString(request.LayerName)
),
- Body = request,
+ Body = request.Body,
QueryString = _queryString,
Headers = _headers,
ContentType = "application/json",
@@ -1133,8 +517,8 @@ private async Task> ReorderAsyncCore
.ConfigureAwait(false);
try
{
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
+ var responseData = JsonUtils.Deserialize(responseBody)!;
+ return new WithRawResponse()
{
Data = responseData,
RawResponse = new CloudPDF.RawResponse()
@@ -1213,8 +597,8 @@ private async Task> ReorderAsyncCore
}
}
- private async Task> RotateAsyncCore(
- RotatePagesRequest request,
+ private async Task> RemoveNameAsyncCore(
+ RemoveNamePagesRequest request,
RequestOptions? options = null,
CancellationToken cancellationToken = default
)
@@ -1236,7 +620,7 @@ private async Task> RotateAsyncCore(
{
Method = HttpMethod.Post,
Path = string.Format(
- "v1/docs/{0}/layers/{1}/pages/rotate",
+ "v1/docs/{0}/layers/{1}/pages/names/delete",
ValueConvert.ToPathParameterString(request.DocId),
ValueConvert.ToPathParameterString(request.LayerName)
),
@@ -1256,8 +640,10 @@ private async Task> RotateAsyncCore(
.ConfigureAwait(false);
try
{
- var responseData = JsonUtils.Deserialize(responseBody)!;
- return new WithRawResponse()
+ var responseData = JsonUtils.Deserialize(
+ responseBody
+ )!;
+ return new WithRawResponse()
{
Data = responseData,
RawResponse = new CloudPDF.RawResponse()
@@ -1378,29 +764,8 @@ public WithRawResponseTask ViewportsAsync(
);
}
- ///
- /// await client.Doc.Pages.DeleteAsync(
- /// new DeletePagesRequest
- /// {
- /// DocId = "docId",
- /// LayerName = "layerName",
- /// Body = new Dictionary<string, object?>() { { "key", "value" } },
- /// }
- /// );
- ///
- public WithRawResponseTask DeleteAsync(
- DeletePagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- return new WithRawResponseTask(
- DeleteAsyncCore(request, options, cancellationToken)
- );
- }
-
///
- /// A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[]}`; the response body is the new PDF.
+ /// A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[], "flatten"?: {"usage"?: "display" | "print"}, "includeAnnotations"?: boolean, "includeFormFields"?: boolean}`; the response body is the new PDF. With `flatten` the copy is the pages as they draw for `usage` (`"print"`: a print copy): the annotations and form fields painted in, nothing interactive left, layers in their state for the usage. A flattened copy takes `doc.download` or `doc.download.flattened`, and paints only what the caller may read; `includeAnnotations` and `includeFormFields` choose what it paints, and are refused without `flatten`.
///
///
/// await client.Doc.Pages.ExtractAsync(
@@ -1450,49 +815,6 @@ public WithRawResponseTask FlattenAsync(
);
}
- ///
- /// Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source": "<key>"}}` (position omitted → the end), and the standalone PDF whose pages are copied in as the part `resource:<key>`. The inserted copies get fresh page object numbers, returned in insertion order.
- ///
- ///
- /// await client.Doc.Pages.InsertAsync(
- /// new InsertPagesRequest { DocId = "docId", LayerName = "layerName" }
- /// );
- ///
- public WithRawResponseTask InsertAsync(
- InsertPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- return new WithRawResponseTask(
- InsertAsyncCore(request, options, cancellationToken)
- );
- }
-
- ///
- /// Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end).
- ///
- ///
- /// await client.Doc.Pages.InsertBlankAsync(
- /// new InsertBlankPagesRequest
- /// {
- /// DocId = "docId",
- /// LayerName = "layerName",
- /// Body = new Dictionary<string, object?>() { { "key", "value" } },
- /// }
- /// );
- ///
- public WithRawResponseTask InsertBlankAsync(
- InsertBlankPagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- return new WithRawResponseTask(
- InsertBlankAsyncCore(request, options, cancellationToken)
- );
- }
-
///
/// await client.Doc.Pages.SetNameAsync(
/// new SetNamePagesRequest
@@ -1534,50 +856,4 @@ public WithRawResponseTask RemoveNameAsync(
RemoveNameAsyncCore(request, options, cancellationToken)
);
}
-
- ///
- /// await client.Doc.Pages.ReorderAsync(
- /// new DocPagesReorderRequest
- /// {
- /// DocId = "docId",
- /// LayerName = "layerName",
- /// Pages = new List<PageRef>()
- /// {
- /// new PageRef { Kind = PageRefKind.ObjectNumber, ObjectNumber = 1 },
- /// },
- /// Position = PagePositionZero.Start,
- /// }
- /// );
- ///
- public WithRawResponseTask ReorderAsync(
- DocPagesReorderRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- return new WithRawResponseTask(
- ReorderAsyncCore(request, options, cancellationToken)
- );
- }
-
- ///
- /// await client.Doc.Pages.RotateAsync(
- /// new RotatePagesRequest
- /// {
- /// DocId = "docId",
- /// LayerName = "layerName",
- /// Body = new Dictionary<string, object?>() { { "key", "value" } },
- /// }
- /// );
- ///
- public WithRawResponseTask RotateAsync(
- RotatePagesRequest request,
- RequestOptions? options = null,
- CancellationToken cancellationToken = default
- )
- {
- return new WithRawResponseTask(
- RotateAsyncCore(request, options, cancellationToken)
- );
- }
}
diff --git a/src/CloudPDF/Doc/Pages/Requests/DocPagesReorderRequest.cs b/src/CloudPDF/Doc/Pages/Requests/DocPagesReorderRequest.cs
deleted file mode 100644
index 55fd5ab5..00000000
--- a/src/CloudPDF/Doc/Pages/Requests/DocPagesReorderRequest.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using CloudPDF;
-using CloudPDF.Core;
-using global::System.Text.Json.Serialization;
-using OneOf;
-
-namespace CloudPDF.Doc;
-
-[Serializable]
-public record DocPagesReorderRequest
-{
- [JsonIgnore]
- public required string DocId { get; set; }
-
- [JsonIgnore]
- public required string LayerName { get; set; }
-
- ///
- /// Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
- ///
- [JsonIgnore]
- public string? DocumentPassword { get; set; }
-
- ///
- /// Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
- ///
- [JsonIgnore]
- public string? IdempotencyKey { get; set; }
-
- [JsonPropertyName("pages")]
- public IEnumerable Pages { get; set; } = new List();
-
- [JsonPropertyName("position")]
- public required OneOf Position { get; set; }
-
- ///
- public override string ToString()
- {
- return JsonUtils.Serialize(this);
- }
-}
diff --git a/src/CloudPDF/Exceptions/ContentTooLargeError.cs b/src/CloudPDF/Exceptions/ContentTooLargeError.cs
index df782576..4559ac0f 100644
--- a/src/CloudPDF/Exceptions/ContentTooLargeError.cs
+++ b/src/CloudPDF/Exceptions/ContentTooLargeError.cs
@@ -4,11 +4,5 @@ namespace CloudPDF;
/// This exception type will be thrown for any non-2XX API responses.
///
[Serializable]
-public class ContentTooLargeError(EngineErrorPayload body, CloudPDF.RawResponse? rawResponse = null)
- : CloudPDFApiException("ContentTooLargeError", 413, body, rawResponse: rawResponse)
-{
- ///
- /// The body of the response that triggered the exception.
- ///
- public new EngineErrorPayload Body => body;
-}
+public class ContentTooLargeError(object body, CloudPDF.RawResponse? rawResponse = null)
+ : CloudPDFApiException("ContentTooLargeError", 413, body, rawResponse: rawResponse);
diff --git a/src/CloudPDF/Types/AnnotationFileAttachment.cs b/src/CloudPDF/Types/AnnotationFileAttachment.cs
index 2fdab3c0..d122f6a6 100644
--- a/src/CloudPDF/Types/AnnotationFileAttachment.cs
+++ b/src/CloudPDF/Types/AnnotationFileAttachment.cs
@@ -111,7 +111,7 @@ public record AnnotationFileAttachment : IJsonOnDeserialized
public required AnnotationFileAttachmentIcon Icon { get; set; }
[JsonPropertyName("file")]
- public AnnotationFileAttachmentFile? File { get; set; }
+ public AttachmentFileInfo? File { get; set; }
[JsonIgnore]
public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
diff --git a/src/CloudPDF/Types/Attachment.cs b/src/CloudPDF/Types/Attachment.cs
new file mode 100644
index 00000000..7ce637e5
--- /dev/null
+++ b/src/CloudPDF/Types/Attachment.cs
@@ -0,0 +1,52 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record Attachment : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("ref")]
+ public required AttachmentRef Ref { get; set; }
+
+ [JsonPropertyName("name")]
+ public required string Name { get; set; }
+
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+
+ [JsonPropertyName("size")]
+ public int? Size { get; set; }
+
+ [JsonPropertyName("checksum")]
+ public string? Checksum { get; set; }
+
+ [JsonPropertyName("createdAt")]
+ public DateTime? CreatedAt { get; set; }
+
+ [JsonPropertyName("modifiedAt")]
+ public DateTime? ModifiedAt { get; set; }
+
+ [JsonPropertyName("index")]
+ public required int Index { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/AttachmentFileBase.cs b/src/CloudPDF/Types/AttachmentFileBase.cs
new file mode 100644
index 00000000..56c55bff
--- /dev/null
+++ b/src/CloudPDF/Types/AttachmentFileBase.cs
@@ -0,0 +1,34 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record AttachmentFileBase : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("name")]
+ public required string Name { get; set; }
+
+ [JsonPropertyName("mimeType")]
+ public string? MimeType { get; set; }
+
+ [JsonPropertyName("description")]
+ public string? Description { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/AnnotationFileAttachmentFile.cs b/src/CloudPDF/Types/AttachmentFileInfo.cs
similarity index 94%
rename from src/CloudPDF/Types/AnnotationFileAttachmentFile.cs
rename to src/CloudPDF/Types/AttachmentFileInfo.cs
index a50c1a52..1e4476b0 100644
--- a/src/CloudPDF/Types/AnnotationFileAttachmentFile.cs
+++ b/src/CloudPDF/Types/AttachmentFileInfo.cs
@@ -5,7 +5,7 @@
namespace CloudPDF;
[Serializable]
-public record AnnotationFileAttachmentFile : IJsonOnDeserialized
+public record AttachmentFileInfo : IJsonOnDeserialized
{
[JsonExtensionData]
private readonly IDictionary _extensionData =
diff --git a/src/CloudPDF/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.cs b/src/CloudPDF/Types/AttachmentList.cs
similarity index 78%
rename from src/CloudPDF/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.cs
rename to src/CloudPDF/Types/AttachmentList.cs
index 960e7e77..bb397e06 100644
--- a/src/CloudPDF/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.cs
+++ b/src/CloudPDF/Types/AttachmentList.cs
@@ -5,14 +5,14 @@
namespace CloudPDF;
[Serializable]
-public record DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage : IJsonOnDeserialized
+public record AttachmentList : IJsonOnDeserialized
{
[JsonExtensionData]
private readonly IDictionary _extensionData =
new Dictionary();
- [JsonPropertyName("page")]
- public required PageRef Page { get; set; }
+ [JsonPropertyName("attachments")]
+ public IEnumerable Attachments { get; set; } = new List();
[JsonIgnore]
public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
diff --git a/src/CloudPDF/Types/AttachmentMutationMeta.cs b/src/CloudPDF/Types/AttachmentMutationMeta.cs
new file mode 100644
index 00000000..d66ebcb8
--- /dev/null
+++ b/src/CloudPDF/Types/AttachmentMutationMeta.cs
@@ -0,0 +1,40 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record AttachmentMutationMeta : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("affectedPages")]
+ public IEnumerable AffectedPages { get; set; } = new List();
+
+ [JsonPropertyName("cacheDelta")]
+ public CacheDelta? CacheDelta { get; set; }
+
+ [JsonPropertyName("opId")]
+ public required string OpId { get; set; }
+
+ [JsonPropertyName("undoable")]
+ public required bool Undoable { get; set; }
+
+ [JsonPropertyName("changed")]
+ public IEnumerable Changed { get; set; } = new List();
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/AttachmentRef.cs b/src/CloudPDF/Types/AttachmentRef.cs
new file mode 100644
index 00000000..b6fe0ef5
--- /dev/null
+++ b/src/CloudPDF/Types/AttachmentRef.cs
@@ -0,0 +1,31 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record AttachmentRef : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("kind")]
+ public required AttachmentRefKind Kind { get; set; }
+
+ [JsonPropertyName("key")]
+ public required string Key { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/AttachmentRefKind.cs b/src/CloudPDF/Types/AttachmentRefKind.cs
new file mode 100644
index 00000000..71ce4245
--- /dev/null
+++ b/src/CloudPDF/Types/AttachmentRefKind.cs
@@ -0,0 +1,111 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[JsonConverter(typeof(AttachmentRefKind.AttachmentRefKindSerializer))]
+[Serializable]
+public readonly record struct AttachmentRefKind : IStringEnum
+{
+ public static readonly AttachmentRefKind Key = new(Values.Key);
+
+ public AttachmentRefKind(string value)
+ {
+ Value = value;
+ }
+
+ ///
+ /// The string value of the enum.
+ ///
+ public string Value { get; }
+
+ ///
+ /// Create a string enum with the given value.
+ ///
+ public static AttachmentRefKind FromCustom(string value)
+ {
+ return new AttachmentRefKind(value);
+ }
+
+ public bool Equals(string? other)
+ {
+ return Value.Equals(other);
+ }
+
+ ///
+ /// Returns the string value of the enum.
+ ///
+ public override string ToString()
+ {
+ return Value;
+ }
+
+ public static bool operator ==(AttachmentRefKind value1, string value2) =>
+ value1.Value.Equals(value2);
+
+ public static bool operator !=(AttachmentRefKind value1, string value2) =>
+ !value1.Value.Equals(value2);
+
+ public static explicit operator string(AttachmentRefKind value) => value.Value;
+
+ public static explicit operator AttachmentRefKind(string value) => new(value);
+
+ internal class AttachmentRefKindSerializer : JsonConverter
+ {
+ public override AttachmentRefKind Read(
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ var stringValue =
+ reader.GetString()
+ ?? throw new global::System.Exception(
+ "The JSON value could not be read as a string."
+ );
+ return new AttachmentRefKind(stringValue);
+ }
+
+ public override void Write(
+ Utf8JsonWriter writer,
+ AttachmentRefKind value,
+ JsonSerializerOptions options
+ )
+ {
+ writer.WriteStringValue(value.Value);
+ }
+
+ public override AttachmentRefKind ReadAsPropertyName(
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options
+ )
+ {
+ var stringValue =
+ reader.GetString()
+ ?? throw new global::System.Exception(
+ "The JSON property name could not be read as a string."
+ );
+ return new AttachmentRefKind(stringValue);
+ }
+
+ public override void WriteAsPropertyName(
+ Utf8JsonWriter writer,
+ AttachmentRefKind value,
+ JsonSerializerOptions options
+ )
+ {
+ writer.WritePropertyName(value.Value);
+ }
+ }
+
+ ///
+ /// Constant strings for enum values
+ ///
+ [Serializable]
+ public static class Values
+ {
+ public const string Key = "key";
+ }
+}
diff --git a/src/CloudPDF/Types/CacheDelta.cs b/src/CloudPDF/Types/CacheDelta.cs
index a4614b35..f1583de1 100644
--- a/src/CloudPDF/Types/CacheDelta.cs
+++ b/src/CloudPDF/Types/CacheDelta.cs
@@ -32,6 +32,9 @@ public record CacheDelta : IJsonOnDeserialized
[JsonPropertyName("attachmentsVersion")]
public int? AttachmentsVersion { get; set; }
+ [JsonPropertyName("outlineVersion")]
+ public int? OutlineVersion { get; set; }
+
[JsonPropertyName("layerVersion")]
public int? LayerVersion { get; set; }
diff --git a/src/CloudPDF/Types/ChangeItem.cs b/src/CloudPDF/Types/ChangeItem.cs
index e09f4daf..219f15cc 100644
--- a/src/CloudPDF/Types/ChangeItem.cs
+++ b/src/CloudPDF/Types/ChangeItem.cs
@@ -234,6 +234,132 @@ public ChangeItem(ChangeItem.MetadataUpdateCustom value)
Value = value.Value;
}
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.OutlineCreate value)
+ {
+ Type = "outline.create";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.OutlineUpdate value)
+ {
+ Type = "outline.update";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.OutlineMove value)
+ {
+ Type = "outline.move";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.OutlineDelete value)
+ {
+ Type = "outline.delete";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.OutlineRestore value)
+ {
+ Type = "outline.restore";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesRotate value)
+ {
+ Type = "pages.rotate";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesReorder value)
+ {
+ Type = "pages.reorder";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesDelete value)
+ {
+ Type = "pages.delete";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesInsertBlank value)
+ {
+ Type = "pages.insertBlank";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesInsert value)
+ {
+ Type = "pages.insert";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.PagesRestore value)
+ {
+ Type = "pages.restore";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.AttachmentsCreate value)
+ {
+ Type = "attachments.create";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.AttachmentsDelete value)
+ {
+ Type = "attachments.delete";
+ Value = value.Value;
+ }
+
+ ///
+ /// Create an instance of ChangeItem with .
+ ///
+ public ChangeItem(ChangeItem.AttachmentsRestore value)
+ {
+ Type = "attachments.restore";
+ Value = value.Value;
+ }
+
///
/// Discriminant value
///
@@ -365,6 +491,76 @@ public ChangeItem(ChangeItem.MetadataUpdateCustom value)
///
public bool IsMetadataUpdateCustom => Type == "metadata.updateCustom";
+ ///
+ /// Returns true if is "outline.create"
+ ///
+ public bool IsOutlineCreate => Type == "outline.create";
+
+ ///
+ /// Returns true if is "outline.update"
+ ///
+ public bool IsOutlineUpdate => Type == "outline.update";
+
+ ///
+ /// Returns true if is "outline.move"
+ ///
+ public bool IsOutlineMove => Type == "outline.move";
+
+ ///
+ /// Returns true if is "outline.delete"
+ ///
+ public bool IsOutlineDelete => Type == "outline.delete";
+
+ ///
+ /// Returns true if is "outline.restore"
+ ///
+ public bool IsOutlineRestore => Type == "outline.restore";
+
+ ///
+ /// Returns true if is "pages.rotate"
+ ///
+ public bool IsPagesRotate => Type == "pages.rotate";
+
+ ///
+ /// Returns true if is "pages.reorder"
+ ///
+ public bool IsPagesReorder => Type == "pages.reorder";
+
+ ///
+ /// Returns true if is "pages.delete"
+ ///
+ public bool IsPagesDelete => Type == "pages.delete";
+
+ ///
+ /// Returns true if is "pages.insertBlank"
+ ///
+ public bool IsPagesInsertBlank => Type == "pages.insertBlank";
+
+ ///
+ /// Returns true if is "pages.insert"
+ ///
+ public bool IsPagesInsert => Type == "pages.insert";
+
+ ///
+ /// Returns true if is "pages.restore"
+ ///
+ public bool IsPagesRestore => Type == "pages.restore";
+
+ ///
+ /// Returns true if is "attachments.create"
+ ///
+ public bool IsAttachmentsCreate => Type == "attachments.create";
+
+ ///
+ /// Returns true if is "attachments.delete"
+ ///
+ public bool IsAttachmentsDelete => Type == "attachments.delete";
+
+ ///
+ /// Returns true if is "attachments.restore"
+ ///
+ public bool IsAttachmentsRestore => Type == "attachments.restore";
+
///
/// Returns the value as a if is 'skipped', otherwise throws an exception.
///
@@ -587,6 +783,132 @@ public CloudPDF.ChangeItemMetadataUpdateCustom AsMetadataUpdateCustom() =>
? (CloudPDF.ChangeItemMetadataUpdateCustom)Value!
: throw new global::System.Exception("ChangeItem.Type is not 'metadata.updateCustom'");
+ ///
+ /// Returns the value as a if is 'outline.create', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'outline.create'.
+ public CloudPDF.ChangeItemOutlineCreate AsOutlineCreate() =>
+ IsOutlineCreate
+ ? (CloudPDF.ChangeItemOutlineCreate)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'outline.create'");
+
+ ///
+ /// Returns the value as a if is 'outline.update', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'outline.update'.
+ public CloudPDF.ChangeItemOutlineUpdate AsOutlineUpdate() =>
+ IsOutlineUpdate
+ ? (CloudPDF.ChangeItemOutlineUpdate)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'outline.update'");
+
+ ///
+ /// Returns the value as a if is 'outline.move', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'outline.move'.
+ public CloudPDF.ChangeItemOutlineMove AsOutlineMove() =>
+ IsOutlineMove
+ ? (CloudPDF.ChangeItemOutlineMove)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'outline.move'");
+
+ ///
+ /// Returns the value as a if is 'outline.delete', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'outline.delete'.
+ public CloudPDF.ChangeItemOutlineDelete AsOutlineDelete() =>
+ IsOutlineDelete
+ ? (CloudPDF.ChangeItemOutlineDelete)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'outline.delete'");
+
+ ///
+ /// Returns the value as a if is 'outline.restore', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'outline.restore'.
+ public CloudPDF.ChangeItemOutlineRestore AsOutlineRestore() =>
+ IsOutlineRestore
+ ? (CloudPDF.ChangeItemOutlineRestore)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'outline.restore'");
+
+ ///
+ /// Returns the value as a if is 'pages.rotate', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.rotate'.
+ public CloudPDF.ChangeItemPagesRotate AsPagesRotate() =>
+ IsPagesRotate
+ ? (CloudPDF.ChangeItemPagesRotate)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.rotate'");
+
+ ///
+ /// Returns the value as a if is 'pages.reorder', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.reorder'.
+ public CloudPDF.ChangeItemPagesReorder AsPagesReorder() =>
+ IsPagesReorder
+ ? (CloudPDF.ChangeItemPagesReorder)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.reorder'");
+
+ ///
+ /// Returns the value as a if is 'pages.delete', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.delete'.
+ public CloudPDF.ChangeItemPagesDelete AsPagesDelete() =>
+ IsPagesDelete
+ ? (CloudPDF.ChangeItemPagesDelete)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.delete'");
+
+ ///
+ /// Returns the value as a if is 'pages.insertBlank', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.insertBlank'.
+ public CloudPDF.ChangeItemPagesInsertBlank AsPagesInsertBlank() =>
+ IsPagesInsertBlank
+ ? (CloudPDF.ChangeItemPagesInsertBlank)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.insertBlank'");
+
+ ///
+ /// Returns the value as a if is 'pages.insert', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.insert'.
+ public CloudPDF.ChangeItemPagesInsert AsPagesInsert() =>
+ IsPagesInsert
+ ? (CloudPDF.ChangeItemPagesInsert)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.insert'");
+
+ ///
+ /// Returns the value as a if is 'pages.restore', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'pages.restore'.
+ public CloudPDF.ChangeItemPagesRestore AsPagesRestore() =>
+ IsPagesRestore
+ ? (CloudPDF.ChangeItemPagesRestore)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'pages.restore'");
+
+ ///
+ /// Returns the value as a if is 'attachments.create', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'attachments.create'.
+ public CloudPDF.ChangeItemAttachmentsCreate AsAttachmentsCreate() =>
+ IsAttachmentsCreate
+ ? (CloudPDF.ChangeItemAttachmentsCreate)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'attachments.create'");
+
+ ///
+ /// Returns the value as a if is 'attachments.delete', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'attachments.delete'.
+ public CloudPDF.ChangeItemAttachmentsDelete AsAttachmentsDelete() =>
+ IsAttachmentsDelete
+ ? (CloudPDF.ChangeItemAttachmentsDelete)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'attachments.delete'");
+
+ ///
+ /// Returns the value as a if is 'attachments.restore', otherwise throws an exception.
+ ///
+ /// Thrown when is not 'attachments.restore'.
+ public CloudPDF.ChangeItemAttachmentsRestore AsAttachmentsRestore() =>
+ IsAttachmentsRestore
+ ? (CloudPDF.ChangeItemAttachmentsRestore)Value!
+ : throw new global::System.Exception("ChangeItem.Type is not 'attachments.restore'");
+
public T Match(
Func onSkipped,
Func onAnnotationsCreate,
@@ -612,6 +934,20 @@ public T Match(
Func onFormsUpdateWidget,
Func onMetadataUpdate,
Func onMetadataUpdateCustom,
+ Func onOutlineCreate,
+ Func onOutlineUpdate,
+ Func onOutlineMove,
+ Func onOutlineDelete,
+ Func onOutlineRestore,
+ Func onPagesRotate,
+ Func onPagesReorder,
+ Func onPagesDelete,
+ Func onPagesInsertBlank,
+ Func onPagesInsert,
+ Func onPagesRestore,
+ Func onAttachmentsCreate,
+ Func onAttachmentsDelete,
+ Func onAttachmentsRestore,
Func onUnknown_
)
{
@@ -643,6 +979,20 @@ public T Match(
"forms.updateWidget" => onFormsUpdateWidget(AsFormsUpdateWidget()),
"metadata.update" => onMetadataUpdate(AsMetadataUpdate()),
"metadata.updateCustom" => onMetadataUpdateCustom(AsMetadataUpdateCustom()),
+ "outline.create" => onOutlineCreate(AsOutlineCreate()),
+ "outline.update" => onOutlineUpdate(AsOutlineUpdate()),
+ "outline.move" => onOutlineMove(AsOutlineMove()),
+ "outline.delete" => onOutlineDelete(AsOutlineDelete()),
+ "outline.restore" => onOutlineRestore(AsOutlineRestore()),
+ "pages.rotate" => onPagesRotate(AsPagesRotate()),
+ "pages.reorder" => onPagesReorder(AsPagesReorder()),
+ "pages.delete" => onPagesDelete(AsPagesDelete()),
+ "pages.insertBlank" => onPagesInsertBlank(AsPagesInsertBlank()),
+ "pages.insert" => onPagesInsert(AsPagesInsert()),
+ "pages.restore" => onPagesRestore(AsPagesRestore()),
+ "attachments.create" => onAttachmentsCreate(AsAttachmentsCreate()),
+ "attachments.delete" => onAttachmentsDelete(AsAttachmentsDelete()),
+ "attachments.restore" => onAttachmentsRestore(AsAttachmentsRestore()),
_ => onUnknown_(Type, Value),
};
}
@@ -672,6 +1022,20 @@ public void Visit(
Action onFormsUpdateWidget,
Action onMetadataUpdate,
Action onMetadataUpdateCustom,
+ Action onOutlineCreate,
+ Action onOutlineUpdate,
+ Action onOutlineMove,
+ Action onOutlineDelete,
+ Action onOutlineRestore,
+ Action onPagesRotate,
+ Action onPagesReorder,
+ Action onPagesDelete,
+ Action onPagesInsertBlank,
+ Action onPagesInsert,
+ Action onPagesRestore,
+ Action onAttachmentsCreate,
+ Action onAttachmentsDelete,
+ Action onAttachmentsRestore,
Action onUnknown_
)
{
@@ -749,6 +1113,48 @@ public void Visit(
case "metadata.updateCustom":
onMetadataUpdateCustom(AsMetadataUpdateCustom());
break;
+ case "outline.create":
+ onOutlineCreate(AsOutlineCreate());
+ break;
+ case "outline.update":
+ onOutlineUpdate(AsOutlineUpdate());
+ break;
+ case "outline.move":
+ onOutlineMove(AsOutlineMove());
+ break;
+ case "outline.delete":
+ onOutlineDelete(AsOutlineDelete());
+ break;
+ case "outline.restore":
+ onOutlineRestore(AsOutlineRestore());
+ break;
+ case "pages.rotate":
+ onPagesRotate(AsPagesRotate());
+ break;
+ case "pages.reorder":
+ onPagesReorder(AsPagesReorder());
+ break;
+ case "pages.delete":
+ onPagesDelete(AsPagesDelete());
+ break;
+ case "pages.insertBlank":
+ onPagesInsertBlank(AsPagesInsertBlank());
+ break;
+ case "pages.insert":
+ onPagesInsert(AsPagesInsert());
+ break;
+ case "pages.restore":
+ onPagesRestore(AsPagesRestore());
+ break;
+ case "attachments.create":
+ onAttachmentsCreate(AsAttachmentsCreate());
+ break;
+ case "attachments.delete":
+ onAttachmentsDelete(AsAttachmentsDelete());
+ break;
+ case "attachments.restore":
+ onAttachmentsRestore(AsAttachmentsRestore());
+ break;
default:
onUnknown_(Type, Value);
break;
@@ -1095,23 +1501,219 @@ public bool TryAsMetadataUpdateCustom(out CloudPDF.ChangeItemMetadataUpdateCusto
return false;
}
- public override string ToString() => JsonUtils.Serialize(this);
-
- public static implicit operator ChangeItem(ChangeItem.Skipped value) => new(value);
-
- public static implicit operator ChangeItem(ChangeItem.AnnotationsCreate value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsOutlineCreate(out CloudPDF.ChangeItemOutlineCreate? value)
+ {
+ if (Type == "outline.create")
+ {
+ value = (CloudPDF.ChangeItemOutlineCreate)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.AnnotationsUpdate value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsOutlineUpdate(out CloudPDF.ChangeItemOutlineUpdate? value)
+ {
+ if (Type == "outline.update")
+ {
+ value = (CloudPDF.ChangeItemOutlineUpdate)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.AnnotationsDelete value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsOutlineMove(out CloudPDF.ChangeItemOutlineMove? value)
+ {
+ if (Type == "outline.move")
+ {
+ value = (CloudPDF.ChangeItemOutlineMove)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.AnnotationsReorder value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsOutlineDelete(out CloudPDF.ChangeItemOutlineDelete? value)
+ {
+ if (Type == "outline.delete")
+ {
+ value = (CloudPDF.ChangeItemOutlineDelete)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.AnnotationsRestore value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsOutlineRestore(out CloudPDF.ChangeItemOutlineRestore? value)
+ {
+ if (Type == "outline.restore")
+ {
+ value = (CloudPDF.ChangeItemOutlineRestore)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.FormsSetValue value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesRotate(out CloudPDF.ChangeItemPagesRotate? value)
+ {
+ if (Type == "pages.rotate")
+ {
+ value = (CloudPDF.ChangeItemPagesRotate)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
- public static implicit operator ChangeItem(ChangeItem.FormsSetDisplay value) => new(value);
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesReorder(out CloudPDF.ChangeItemPagesReorder? value)
+ {
+ if (Type == "pages.reorder")
+ {
+ value = (CloudPDF.ChangeItemPagesReorder)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesDelete(out CloudPDF.ChangeItemPagesDelete? value)
+ {
+ if (Type == "pages.delete")
+ {
+ value = (CloudPDF.ChangeItemPagesDelete)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesInsertBlank(out CloudPDF.ChangeItemPagesInsertBlank? value)
+ {
+ if (Type == "pages.insertBlank")
+ {
+ value = (CloudPDF.ChangeItemPagesInsertBlank)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesInsert(out CloudPDF.ChangeItemPagesInsert? value)
+ {
+ if (Type == "pages.insert")
+ {
+ value = (CloudPDF.ChangeItemPagesInsert)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsPagesRestore(out CloudPDF.ChangeItemPagesRestore? value)
+ {
+ if (Type == "pages.restore")
+ {
+ value = (CloudPDF.ChangeItemPagesRestore)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsAttachmentsCreate(out CloudPDF.ChangeItemAttachmentsCreate? value)
+ {
+ if (Type == "attachments.create")
+ {
+ value = (CloudPDF.ChangeItemAttachmentsCreate)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsAttachmentsDelete(out CloudPDF.ChangeItemAttachmentsDelete? value)
+ {
+ if (Type == "attachments.delete")
+ {
+ value = (CloudPDF.ChangeItemAttachmentsDelete)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ ///
+ /// Attempts to cast the value to a and returns true if successful.
+ ///
+ public bool TryAsAttachmentsRestore(out CloudPDF.ChangeItemAttachmentsRestore? value)
+ {
+ if (Type == "attachments.restore")
+ {
+ value = (CloudPDF.ChangeItemAttachmentsRestore)Value!;
+ return true;
+ }
+ value = null;
+ return false;
+ }
+
+ public override string ToString() => JsonUtils.Serialize(this);
+
+ public static implicit operator ChangeItem(ChangeItem.Skipped value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AnnotationsCreate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AnnotationsUpdate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AnnotationsDelete value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AnnotationsReorder value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AnnotationsRestore value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.FormsSetValue value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.FormsSetDisplay value) => new(value);
public static implicit operator ChangeItem(ChangeItem.FormsSetAppearanceText value) =>
new(value);
@@ -1148,6 +1750,34 @@ public static implicit operator ChangeItem(ChangeItem.FormsReorderCalculations v
public static implicit operator ChangeItem(ChangeItem.MetadataUpdateCustom value) => new(value);
+ public static implicit operator ChangeItem(ChangeItem.OutlineCreate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.OutlineUpdate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.OutlineMove value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.OutlineDelete value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.OutlineRestore value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesRotate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesReorder value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesDelete value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesInsertBlank value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesInsert value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.PagesRestore value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AttachmentsCreate value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AttachmentsDelete value) => new(value);
+
+ public static implicit operator ChangeItem(ChangeItem.AttachmentsRestore value) => new(value);
+
[Serializable]
internal sealed class JsonConverter : JsonConverter
{
@@ -1341,6 +1971,86 @@ JsonSerializerOptions options
?? throw new JsonException(
"Failed to deserialize CloudPDF.ChangeItemMetadataUpdateCustom"
),
+ "outline.create" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemOutlineCreate"
+ ),
+ "outline.update" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemOutlineUpdate"
+ ),
+ "outline.move" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemOutlineMove"
+ ),
+ "outline.delete" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemOutlineDelete"
+ ),
+ "outline.restore" =>
+ jsonWithoutDiscriminator.Deserialize(
+ options
+ )
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemOutlineRestore"
+ ),
+ "pages.rotate" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesRotate"
+ ),
+ "pages.reorder" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesReorder"
+ ),
+ "pages.delete" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesDelete"
+ ),
+ "pages.insertBlank" =>
+ jsonWithoutDiscriminator.Deserialize(
+ options
+ )
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesInsertBlank"
+ ),
+ "pages.insert" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesInsert"
+ ),
+ "pages.restore" =>
+ jsonWithoutDiscriminator.Deserialize(options)
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemPagesRestore"
+ ),
+ "attachments.create" =>
+ jsonWithoutDiscriminator.Deserialize(
+ options
+ )
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemAttachmentsCreate"
+ ),
+ "attachments.delete" =>
+ jsonWithoutDiscriminator.Deserialize(
+ options
+ )
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemAttachmentsDelete"
+ ),
+ "attachments.restore" =>
+ jsonWithoutDiscriminator.Deserialize(
+ options
+ )
+ ?? throw new JsonException(
+ "Failed to deserialize CloudPDF.ChangeItemAttachmentsRestore"
+ ),
_ => json.Deserialize(options),
};
return new ChangeItem(discriminator, value);
@@ -1388,6 +2098,20 @@ JsonSerializerOptions options
"forms.updateWidget" => JsonSerializer.SerializeToNode(value.Value, options),
"metadata.update" => JsonSerializer.SerializeToNode(value.Value, options),
"metadata.updateCustom" => JsonSerializer.SerializeToNode(value.Value, options),
+ "outline.create" => JsonSerializer.SerializeToNode(value.Value, options),
+ "outline.update" => JsonSerializer.SerializeToNode(value.Value, options),
+ "outline.move" => JsonSerializer.SerializeToNode(value.Value, options),
+ "outline.delete" => JsonSerializer.SerializeToNode(value.Value, options),
+ "outline.restore" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.rotate" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.reorder" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.delete" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.insertBlank" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.insert" => JsonSerializer.SerializeToNode(value.Value, options),
+ "pages.restore" => JsonSerializer.SerializeToNode(value.Value, options),
+ "attachments.create" => JsonSerializer.SerializeToNode(value.Value, options),
+ "attachments.delete" => JsonSerializer.SerializeToNode(value.Value, options),
+ "attachments.restore" => JsonSerializer.SerializeToNode(value.Value, options),
_ => JsonSerializer.SerializeToNode(value.Value, options),
} ?? new JsonObject();
json["type"] = value.Type;
@@ -1894,4 +2618,284 @@ public static implicit operator ChangeItem.MetadataUpdateCustom(
CloudPDF.ChangeItemMetadataUpdateCustom value
) => new(value);
}
+
+ ///
+ /// Discriminated union type for outline.create
+ ///
+ [Serializable]
+ public struct OutlineCreate
+ {
+ public OutlineCreate(CloudPDF.ChangeItemOutlineCreate value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemOutlineCreate Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.OutlineCreate(
+ CloudPDF.ChangeItemOutlineCreate value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for outline.update
+ ///
+ [Serializable]
+ public struct OutlineUpdate
+ {
+ public OutlineUpdate(CloudPDF.ChangeItemOutlineUpdate value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemOutlineUpdate Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.OutlineUpdate(
+ CloudPDF.ChangeItemOutlineUpdate value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for outline.move
+ ///
+ [Serializable]
+ public struct OutlineMove
+ {
+ public OutlineMove(CloudPDF.ChangeItemOutlineMove value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemOutlineMove Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.OutlineMove(
+ CloudPDF.ChangeItemOutlineMove value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for outline.delete
+ ///
+ [Serializable]
+ public struct OutlineDelete
+ {
+ public OutlineDelete(CloudPDF.ChangeItemOutlineDelete value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemOutlineDelete Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.OutlineDelete(
+ CloudPDF.ChangeItemOutlineDelete value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for outline.restore
+ ///
+ [Serializable]
+ public struct OutlineRestore
+ {
+ public OutlineRestore(CloudPDF.ChangeItemOutlineRestore value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemOutlineRestore Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.OutlineRestore(
+ CloudPDF.ChangeItemOutlineRestore value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.rotate
+ ///
+ [Serializable]
+ public struct PagesRotate
+ {
+ public PagesRotate(CloudPDF.ChangeItemPagesRotate value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesRotate Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesRotate(
+ CloudPDF.ChangeItemPagesRotate value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.reorder
+ ///
+ [Serializable]
+ public struct PagesReorder
+ {
+ public PagesReorder(CloudPDF.ChangeItemPagesReorder value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesReorder Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesReorder(
+ CloudPDF.ChangeItemPagesReorder value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.delete
+ ///
+ [Serializable]
+ public struct PagesDelete
+ {
+ public PagesDelete(CloudPDF.ChangeItemPagesDelete value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesDelete Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesDelete(
+ CloudPDF.ChangeItemPagesDelete value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.insertBlank
+ ///
+ [Serializable]
+ public struct PagesInsertBlank
+ {
+ public PagesInsertBlank(CloudPDF.ChangeItemPagesInsertBlank value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesInsertBlank Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesInsertBlank(
+ CloudPDF.ChangeItemPagesInsertBlank value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.insert
+ ///
+ [Serializable]
+ public struct PagesInsert
+ {
+ public PagesInsert(CloudPDF.ChangeItemPagesInsert value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesInsert Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesInsert(
+ CloudPDF.ChangeItemPagesInsert value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for pages.restore
+ ///
+ [Serializable]
+ public struct PagesRestore
+ {
+ public PagesRestore(CloudPDF.ChangeItemPagesRestore value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemPagesRestore Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.PagesRestore(
+ CloudPDF.ChangeItemPagesRestore value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for attachments.create
+ ///
+ [Serializable]
+ public struct AttachmentsCreate
+ {
+ public AttachmentsCreate(CloudPDF.ChangeItemAttachmentsCreate value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemAttachmentsCreate Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.AttachmentsCreate(
+ CloudPDF.ChangeItemAttachmentsCreate value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for attachments.delete
+ ///
+ [Serializable]
+ public struct AttachmentsDelete
+ {
+ public AttachmentsDelete(CloudPDF.ChangeItemAttachmentsDelete value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemAttachmentsDelete Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.AttachmentsDelete(
+ CloudPDF.ChangeItemAttachmentsDelete value
+ ) => new(value);
+ }
+
+ ///
+ /// Discriminated union type for attachments.restore
+ ///
+ [Serializable]
+ public struct AttachmentsRestore
+ {
+ public AttachmentsRestore(CloudPDF.ChangeItemAttachmentsRestore value)
+ {
+ Value = value;
+ }
+
+ internal CloudPDF.ChangeItemAttachmentsRestore Value { get; set; }
+
+ public override string ToString() => Value.ToString() ?? "null";
+
+ public static implicit operator ChangeItem.AttachmentsRestore(
+ CloudPDF.ChangeItemAttachmentsRestore value
+ ) => new(value);
+ }
}
diff --git a/src/CloudPDF/Types/ChangeItemAttachmentsCreate.cs b/src/CloudPDF/Types/ChangeItemAttachmentsCreate.cs
new file mode 100644
index 00000000..2b05aa7c
--- /dev/null
+++ b/src/CloudPDF/Types/ChangeItemAttachmentsCreate.cs
@@ -0,0 +1,31 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record ChangeItemAttachmentsCreate : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("attachment")]
+ public required Attachment Attachment { get; set; }
+
+ [JsonPropertyName("meta")]
+ public required AttachmentMutationMeta Meta { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/ChangeItemAttachmentsDelete.cs b/src/CloudPDF/Types/ChangeItemAttachmentsDelete.cs
new file mode 100644
index 00000000..72d69687
--- /dev/null
+++ b/src/CloudPDF/Types/ChangeItemAttachmentsDelete.cs
@@ -0,0 +1,28 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record ChangeItemAttachmentsDelete : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("meta")]
+ public required AttachmentMutationMeta Meta { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/ChangeItemAttachmentsRestore.cs b/src/CloudPDF/Types/ChangeItemAttachmentsRestore.cs
new file mode 100644
index 00000000..261d5afc
--- /dev/null
+++ b/src/CloudPDF/Types/ChangeItemAttachmentsRestore.cs
@@ -0,0 +1,31 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record ChangeItemAttachmentsRestore : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("attachment")]
+ public required Attachment Attachment { get; set; }
+
+ [JsonPropertyName("meta")]
+ public required AttachmentMutationMeta Meta { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/ChangeItemOutlineCreate.cs b/src/CloudPDF/Types/ChangeItemOutlineCreate.cs
new file mode 100644
index 00000000..7cfa10fd
--- /dev/null
+++ b/src/CloudPDF/Types/ChangeItemOutlineCreate.cs
@@ -0,0 +1,34 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record ChangeItemOutlineCreate : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("item")]
+ public required OutlineItem Item { get; set; }
+
+ [JsonPropertyName("order")]
+ public required OutlineOrder Order { get; set; }
+
+ [JsonPropertyName("meta")]
+ public required OutlineMutationMeta Meta { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///
+ public override string ToString()
+ {
+ return JsonUtils.Serialize(this);
+ }
+}
diff --git a/src/CloudPDF/Types/ChangeItemOutlineDelete.cs b/src/CloudPDF/Types/ChangeItemOutlineDelete.cs
new file mode 100644
index 00000000..d90ce974
--- /dev/null
+++ b/src/CloudPDF/Types/ChangeItemOutlineDelete.cs
@@ -0,0 +1,28 @@
+using CloudPDF.Core;
+using global::System.Text.Json;
+using global::System.Text.Json.Serialization;
+
+namespace CloudPDF;
+
+[Serializable]
+public record ChangeItemOutlineDelete : IJsonOnDeserialized
+{
+ [JsonExtensionData]
+ private readonly IDictionary _extensionData =
+ new Dictionary();
+
+ [JsonPropertyName("meta")]
+ public required OutlineMutationMeta Meta { get; set; }
+
+ [JsonIgnore]
+ public ReadOnlyAdditionalProperties AdditionalProperties { get; private set; } = new();
+
+ void IJsonOnDeserialized.OnDeserialized() =>
+ AdditionalProperties.CopyFromExtensionData(_extensionData);
+
+ ///