diff --git a/.fern/metadata.json b/.fern/metadata.json index 151657f3..29c44a1e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "c6f87eecf9636e7ef367946a7fd7f3729401ce90", + "originGitCommit": "7ded7de29f4cc0dc9da18042fca6afd5c9557bfc", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.15", + "requestedVersion": "3.0.0-alpha.16", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.15" + "sdkVersion": "3.0.0-alpha.16" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 6c84da27..2f13edb3 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.15", - "sdkVersion": "3.0.0-alpha.15", + "canonicalVersion": "3.0.0-next.16", + "sdkVersion": "3.0.0-alpha.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 bbd13382..c5f923b5 100644 --- a/reference.md +++ b/reference.md @@ -89,7 +89,7 @@ $client->doc->head(
-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.
@@ -2555,6 +2555,98 @@ $client->doc->annotations->readAppearance( + + + + +
$client->doc->annotations->readFile($docId, $layerName, $pageKey, $annotKey, $request) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A file that decodes past the server's limit is refused (PayloadTooLarge). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->annotations->readFile( + 'docId', + 'layerName', + 'pageKey', + 'annotKey', + new ReadFileAnnotationsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ +**$annotKey:** `string` — 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. + +
+
+ +
+
+ +**$documentPassword:** `?string` — 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. + +
+
+
+
+ +
@@ -2831,6 +2923,164 @@ $client->doc->annotations->reorder( + + + + +## Doc Attachments +
$client->doc->attachments->download($docId, $layerName, $fileKey, $request) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A file that decodes past the server's limit is refused (PayloadTooLarge). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->attachments->download( + 'docId', + 'layerName', + 'fileKey', + new DownloadAttachmentsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$fileKey:** `string` — The embedded file's name-tree key (its `ref.key`), token-text encoded, as `fieldKey` is. + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +
$client->doc->attachments->list($docId, $layerName, $request) -> ?AttachmentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->attachments->list( + 'docId', + 'layerName', + new ListAttachmentsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — 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. + +
+
+
+
+ +
@@ -3499,8 +3749,8 @@ $client->doc->metadata->get( -## Doc Pages -
$client->doc->pages->setScale($docId, $layerName, $pageKey, $request) -> ?DocPagesSetScale200Response +## Doc Outline +
$client->doc->outline->get($docId, $layerName, $request) -> ?DocumentOutline
@@ -3513,11 +3763,10 @@ $client->doc->metadata->get(
```php -$client->doc->pages->setScale( +$client->doc->outline->get( 'docId', 'layerName', - 'pageKey', - new DocPagesSetScaleRequest([]), + new GetOutlineRequest([]), ); ```
@@ -3549,47 +3798,24 @@ $client->doc->pages->setScale(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$documentPassword:** `?string` — 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.
+ +
-
-
-**$documentPassword:** `?string` — 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. -
+
+## Doc Pages +
$client->doc->pages->setScale($docId, $layerName, $pageKey, $request) -> ?DocPagesSetScale200Response
-**$idempotencyKey:** `?string` — 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. - -
-
- -
-
- -**$measure:** `?DocPagesSetScaleRequestMeasure` - -
-
- - - - - - -
- -
$client->doc->pages->viewports($docId, $layerName, $pageKey, $request) -> ?DocPagesViewports200Response -
-
- -#### 🔌 Usage +#### 🔌 Usage
@@ -3598,11 +3824,11 @@ $client->doc->pages->setScale(
```php -$client->doc->pages->viewports( +$client->doc->pages->setScale( 'docId', 'layerName', 'pageKey', - new ViewportsPagesRequest([]), + new DocPagesSetScaleRequest([]), ); ```
@@ -3644,70 +3870,6 @@ $client->doc->pages->viewports( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. -
-
- - - - - - -
- -
$client->doc->pages->delete($docId, $layerName, $request) -> ?DocPagesDelete200Response -
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->doc->pages->delete( - 'docId', - 'layerName', - new DeletePagesRequest([ - 'body' => [ - 'key' => "value", - ], - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$docId:** `string` - -
-
- -
-
- -**$layerName:** `string` - -
-
- -
-
- -**$documentPassword:** `?string` — 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. -
@@ -3722,7 +3884,7 @@ $client->doc->pages->delete(
-**$request:** `array` +**$measure:** `?DocPagesSetScaleRequestMeasure`
@@ -3734,24 +3896,10 @@ $client->doc->pages->delete(
-
$client->doc->pages->extract($docId, $layerName, $request) -> string -
-
- -#### 📝 Description - -
-
- +
$client->doc->pages->viewports($docId, $layerName, $pageKey, $request) -> ?DocPagesViewports200Response
-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
@@ -3761,16 +3909,11 @@ A read, not a mutation: the source document is untouched and no event is publish
```php -$client->doc->pages->extract( +$client->doc->pages->viewports( 'docId', 'layerName', - new ExtractPagesRequest([ - 'body' => [ - 'string' => [ - 'key' => "value", - ], - ], - ]), + 'pageKey', + new ViewportsPagesRequest([]), ); ```
@@ -3802,71 +3945,7 @@ $client->doc->pages->extract(
-**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. - -
-
- -
-
- -**$request:** `array` - -
-
-
-
- - - - -
- -
$client->doc->pages->flatten($docId, $layerName, $request) -> ?DocPagesFlatten200Response -
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->doc->pages->flatten( - 'docId', - 'layerName', - new FlattenPagesRequest([ - 'body' => [ - 'key' => "value", - ], - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$docId:** `string` - -
-
- -
-
- -**$layerName:** `string` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -3876,22 +3955,6 @@ $client->doc->pages->flatten( **$documentPassword:** `?string` — 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. -
-
- -
-
- -**$idempotencyKey:** `?string` — 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. - -
-
- -
-
- -**$request:** `array` -
@@ -3902,7 +3965,7 @@ $client->doc->pages->flatten(
-
$client->doc->pages->insert($docId, $layerName, $request) -> ?DocPagesInsert200Response +
$client->doc->pages->extract($docId, $layerName, $request) -> string
@@ -3914,7 +3977,7 @@ $client->doc->pages->flatten(
-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. +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`.
@@ -3929,11 +3992,15 @@ Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source
```php -$client->doc->pages->insert( +$client->doc->pages->extract( 'docId', 'layerName', - new InsertPagesRequest([ - 'file' => File::createFromString("example_file", "example_file"), + new ExtractPagesRequest([ + 'body' => [ + 'string' => [ + 'key' => "value", + ], + ], ]), ); ``` @@ -3974,7 +4041,7 @@ $client->doc->pages->insert(
-**$idempotencyKey:** `?string` — 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. +**$request:** `array`
@@ -3986,24 +4053,10 @@ $client->doc->pages->insert(
-
$client->doc->pages->insertBlank($docId, $layerName, $request) -> ?DocPagesInsertBlank200Response -
-
- -#### 📝 Description - -
-
- +
$client->doc->pages->flatten($docId, $layerName, $request) -> ?DocPagesFlatten200Response
-Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end). -
-
-
-
- #### 🔌 Usage
@@ -4013,10 +4066,10 @@ Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF p
```php -$client->doc->pages->insertBlank( +$client->doc->pages->flatten( 'docId', 'layerName', - new InsertBlankPagesRequest([ + new FlattenPagesRequest([ 'body' => [ 'key' => "value", ], @@ -4236,178 +4289,6 @@ $client->doc->pages->removeName(
-
-
-
- -
$client->doc->pages->reorder($docId, $layerName, $request) -> ?DocPagesReorder200Response -
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->doc->pages->reorder( - 'docId', - 'layerName', - new DocPagesReorderRequest([ - 'pages' => [ - new PageRef([ - 'kind' => PageRefKind::ObjectNumber->value, - 'objectNumber' => 1, - ]), - ], - 'position' => PagePositionZero::Start->value, - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$docId:** `string` - -
-
- -
-
- -**$layerName:** `string` - -
-
- -
-
- -**$documentPassword:** `?string` — 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. - -
-
- -
-
- -**$idempotencyKey:** `?string` — 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. - -
-
- -
-
- -**$pages:** `array` - -
-
- -
-
- -**$position:** `string|PagePositionAfter` - -
-
-
-
- - -
-
-
- -
$client->doc->pages->rotate($docId, $layerName, $request) -> ?DocPagesRotate200Response -
-
- -#### 🔌 Usage - -
-
- -
-
- -```php -$client->doc->pages->rotate( - 'docId', - 'layerName', - new RotatePagesRequest([ - 'body' => [ - 'key' => "value", - ], - ]), -); -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**$docId:** `string` - -
-
- -
-
- -**$layerName:** `string` - -
-
- -
-
- -**$documentPassword:** `?string` — 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. - -
-
- -
-
- -**$idempotencyKey:** `?string` — 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. - -
-
- -
-
- -**$request:** `array` - -
-
-
-
- -
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index ddaff4cc..20bb2e30 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -76,8 +76,8 @@ public function __construct( $defaultHeaders = [ 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0-alpha.15', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.15', + 'X-Fern-SDK-Version' => '3.0.0-alpha.16', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.16', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Doc/Annotations/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php index f6f8f699..5af7d96a 100644 --- a/src/Doc/Annotations/AnnotationsClient.php +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -20,6 +20,7 @@ use CloudPDF\Doc\Annotations\Requests\UpdateAnnotationsRequest; use CloudPDF\Types\DocAnnotationsUpdate200Response; use CloudPDF\Doc\Annotations\Requests\ReadAppearanceAnnotationsRequest; +use CloudPDF\Doc\Annotations\Requests\ReadFileAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\ExportAppearanceAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\FlattenAnnotationsRequest; use CloudPDF\Types\DocAnnotationsFlatten200Response; @@ -467,6 +468,68 @@ public function readAppearance(string $docId, string $layerName, string $pageKey ); } + /** + * A file that decodes past the server's limit is refused (PayloadTooLarge). + * + * Example: + * ```php + * $client->doc->annotations->readFile( + * 'docId', + * 'layerName', + * 'pageKey', + * 'annotKey', + * new ReadFileAnnotationsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey 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. + * @param ReadFileAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function readFile(string $docId, string $layerName, string $pageKey, string $annotKey, ReadFileAnnotationsRequest $request = new ReadFileAnnotationsRequest(), ?array $options = null): string + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/file", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return $response->getBody()->getContents(); + } + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Example: * ```php diff --git a/src/Doc/Annotations/Requests/ReadFileAnnotationsRequest.php b/src/Doc/Annotations/Requests/ReadFileAnnotationsRequest.php new file mode 100644 index 00000000..1dc84c85 --- /dev/null +++ b/src/Doc/Annotations/Requests/ReadFileAnnotationsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Attachments/AttachmentsClient.php b/src/Doc/Attachments/AttachmentsClient.php new file mode 100644 index 00000000..ae213a7d --- /dev/null +++ b/src/Doc/Attachments/AttachmentsClient.php @@ -0,0 +1,176 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * A file that decodes past the server's limit is refused (PayloadTooLarge). + * + * Example: + * ```php + * $client->doc->attachments->download( + * 'docId', + * 'layerName', + * 'fileKey', + * new DownloadAttachmentsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $fileKey The embedded file's name-tree key (its `ref.key`), token-text encoded, as `fieldKey` is. + * @param DownloadAttachmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function download(string $docId, string $layerName, string $fileKey, DownloadAttachmentsRequest $request = new DownloadAttachmentsRequest(), ?array $options = null): string + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/attachment-files/{$fileKey}/data", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return $response->getBody()->getContents(); + } + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * A file-attachment annotation's file is listed with the annotation; read its bytes with `doc.annotations.readFile`. + * + * Example: + * ```php + * $client->doc->attachments->list( + * 'docId', + * 'layerName', + * new ListAttachmentsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ListAttachmentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?AttachmentList + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function list(string $docId, string $layerName, ListAttachmentsRequest $request = new ListAttachmentsRequest(), ?array $options = null): ?AttachmentList + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/attachments", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return AttachmentList::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Doc/Attachments/Requests/DownloadAttachmentsRequest.php b/src/Doc/Attachments/Requests/DownloadAttachmentsRequest.php new file mode 100644 index 00000000..9f1b542b --- /dev/null +++ b/src/Doc/Attachments/Requests/DownloadAttachmentsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Attachments/Requests/ListAttachmentsRequest.php b/src/Doc/Attachments/Requests/ListAttachmentsRequest.php new file mode 100644 index 00000000..7e98cd4c --- /dev/null +++ b/src/Doc/Attachments/Requests/ListAttachmentsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/DocClient.php b/src/Doc/DocClient.php index 8c17d47b..1f1dbf42 100644 --- a/src/Doc/DocClient.php +++ b/src/Doc/DocClient.php @@ -3,8 +3,10 @@ namespace CloudPDF\Doc; use CloudPDF\Doc\Annotations\AnnotationsClient; +use CloudPDF\Doc\Attachments\AttachmentsClient; use CloudPDF\Doc\Forms\FormsClient; use CloudPDF\Doc\Metadata\MetadataClient; +use CloudPDF\Doc\Outline\OutlineClient; use CloudPDF\Doc\Pages\PagesClient; use CloudPDF\Doc\Redactions\RedactionsClient; use CloudPDF\Doc\Signatures\SignaturesClient; @@ -35,6 +37,11 @@ class DocClient */ public AnnotationsClient $annotations; + /** + * @var AttachmentsClient $attachments + */ + public AttachmentsClient $attachments; + /** * @var FormsClient $forms */ @@ -45,6 +52,11 @@ class DocClient */ public MetadataClient $metadata; + /** + * @var OutlineClient $outline + */ + public OutlineClient $outline; + /** * @var PagesClient $pages */ @@ -98,8 +110,10 @@ public function __construct( $this->client = $client; $this->options = $options ?? []; $this->annotations = new AnnotationsClient($this->client, $this->options); + $this->attachments = new AttachmentsClient($this->client, $this->options); $this->forms = new FormsClient($this->client, $this->options); $this->metadata = new MetadataClient($this->client, $this->options); + $this->outline = new OutlineClient($this->client, $this->options); $this->pages = new PagesClient($this->client, $this->options); $this->redactions = new RedactionsClient($this->client, $this->options); $this->signatures = new SignaturesClient($this->client, $this->options); @@ -167,7 +181,7 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest } /** - * 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. * * Example: * ```php diff --git a/src/Doc/Outline/OutlineClient.php b/src/Doc/Outline/OutlineClient.php new file mode 100644 index 00000000..17c9bd26 --- /dev/null +++ b/src/Doc/Outline/OutlineClient.php @@ -0,0 +1,113 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Example: + * ```php + * $client->doc->outline->get( + * 'docId', + * 'layerName', + * new GetOutlineRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param GetOutlineRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentOutline + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function get(string $docId, string $layerName, GetOutlineRequest $request = new GetOutlineRequest(), ?array $options = null): ?DocumentOutline + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/outline", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentOutline::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Doc/Outline/Requests/GetOutlineRequest.php b/src/Doc/Outline/Requests/GetOutlineRequest.php new file mode 100644 index 00000000..1a41c539 --- /dev/null +++ b/src/Doc/Outline/Requests/GetOutlineRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php index da0a7b98..4b46dd28 100644 --- a/src/Doc/Pages/PagesClient.php +++ b/src/Doc/Pages/PagesClient.php @@ -14,25 +14,13 @@ use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Pages\Requests\ViewportsPagesRequest; use CloudPDF\Types\DocPagesViewports200Response; -use CloudPDF\Doc\Pages\Requests\DeletePagesRequest; -use CloudPDF\Types\DocPagesDelete200Response; use CloudPDF\Doc\Pages\Requests\ExtractPagesRequest; use CloudPDF\Doc\Pages\Requests\FlattenPagesRequest; use CloudPDF\Types\DocPagesFlatten200Response; -use CloudPDF\Doc\Pages\Requests\InsertPagesRequest; -use CloudPDF\Types\DocPagesInsert200Response; -use CloudPDF\Core\Multipart\MultipartFormData; -use CloudPDF\Core\Multipart\MultipartApiRequest; -use CloudPDF\Doc\Pages\Requests\InsertBlankPagesRequest; -use CloudPDF\Types\DocPagesInsertBlank200Response; use CloudPDF\Doc\Pages\Requests\SetNamePagesRequest; use CloudPDF\Types\DocPagesSetName200Response; use CloudPDF\Doc\Pages\Requests\RemoveNamePagesRequest; use CloudPDF\Types\DocPagesRemoveName200Response; -use CloudPDF\Doc\Pages\Requests\DocPagesReorderRequest; -use CloudPDF\Types\DocPagesReorder200Response; -use CloudPDF\Doc\Pages\Requests\RotatePagesRequest; -use CloudPDF\Types\DocPagesRotate200Response; class PagesClient { @@ -203,77 +191,7 @@ public function viewports(string $docId, string $layerName, string $pageKey, Vie } /** - * Example: - * ```php - * $client->doc->pages->delete( - * 'docId', - * 'layerName', - * new DeletePagesRequest([ - * 'body' => [ - * 'key' => "value", - * ], - * ]), - * ); - * ``` - * - * @param string $docId - * @param string $layerName - * @param DeletePagesRequest $request - * @param ?array{ - * baseUrl?: string, - * maxRetries?: int, - * timeout?: float, - * headers?: array, - * queryParameters?: array, - * bodyProperties?: array, - * } $options - * @return ?DocPagesDelete200Response - * @throws CloudPDFException - * @throws CloudPDFApiException - */ - public function delete(string $docId, string $layerName, DeletePagesRequest $request, ?array $options = null): ?DocPagesDelete200Response - { - $options = array_merge($this->options, $options ?? []); - $headers = []; - if ($request->documentPassword != null) { - $headers['X-Document-Password'] = $request->documentPassword; - } - if ($request->idempotencyKey != null) { - $headers['Idempotency-Key'] = $request->idempotencyKey; - } - try { - $response = $this->client->sendRequest( - new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/delete", - method: HttpMethod::POST, - headers: $headers, - body: $request->body, - ), - $options, - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - if (empty($json)) { - return null; - } - return DocPagesDelete200Response::fromJson($json); - } - } catch (JsonException $e) { - throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new CloudPDFException(message: $e->getMessage(), previous: $e); - } - throw new CloudPDFApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } - - /** - * 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`. * * Example: * ```php @@ -407,149 +325,6 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r ); } - /** - * 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. - * - * Example: - * ```php - * $client->doc->pages->insert( - * 'docId', - * 'layerName', - * new InsertPagesRequest([ - * 'file' => File::createFromString("example_file", "example_file"), - * ]), - * ); - * ``` - * - * @param string $docId - * @param string $layerName - * @param InsertPagesRequest $request - * @param ?array{ - * baseUrl?: string, - * maxRetries?: int, - * timeout?: float, - * headers?: array, - * queryParameters?: array, - * } $options - * @return ?DocPagesInsert200Response - * @throws CloudPDFException - * @throws CloudPDFApiException - */ - public function insert(string $docId, string $layerName, InsertPagesRequest $request, ?array $options = null): ?DocPagesInsert200Response - { - $options = array_merge($this->options, $options ?? []); - $headers = []; - if ($request->documentPassword != null) { - $headers['X-Document-Password'] = $request->documentPassword; - } - if ($request->idempotencyKey != null) { - $headers['Idempotency-Key'] = $request->idempotencyKey; - } - $body = new MultipartFormData(); - $body->addPart($request->file->toMultipartFormDataPart('file')); - try { - $response = $this->client->sendRequest( - new MultipartApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/insert", - method: HttpMethod::POST, - headers: $headers, - body: $body, - ), - $options, - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - if (empty($json)) { - return null; - } - return DocPagesInsert200Response::fromJson($json); - } - } catch (JsonException $e) { - throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new CloudPDFException(message: $e->getMessage(), previous: $e); - } - throw new CloudPDFApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } - - /** - * Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end). - * - * Example: - * ```php - * $client->doc->pages->insertBlank( - * 'docId', - * 'layerName', - * new InsertBlankPagesRequest([ - * 'body' => [ - * 'key' => "value", - * ], - * ]), - * ); - * ``` - * - * @param string $docId - * @param string $layerName - * @param InsertBlankPagesRequest $request - * @param ?array{ - * baseUrl?: string, - * maxRetries?: int, - * timeout?: float, - * headers?: array, - * queryParameters?: array, - * bodyProperties?: array, - * } $options - * @return ?DocPagesInsertBlank200Response - * @throws CloudPDFException - * @throws CloudPDFApiException - */ - public function insertBlank(string $docId, string $layerName, InsertBlankPagesRequest $request, ?array $options = null): ?DocPagesInsertBlank200Response - { - $options = array_merge($this->options, $options ?? []); - $headers = []; - if ($request->documentPassword != null) { - $headers['X-Document-Password'] = $request->documentPassword; - } - if ($request->idempotencyKey != null) { - $headers['Idempotency-Key'] = $request->idempotencyKey; - } - try { - $response = $this->client->sendRequest( - new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/insert-blank", - method: HttpMethod::POST, - headers: $headers, - body: $request->body, - ), - $options, - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - if (empty($json)) { - return null; - } - return DocPagesInsertBlank200Response::fromJson($json); - } - } catch (JsonException $e) { - throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new CloudPDFException(message: $e->getMessage(), previous: $e); - } - throw new CloudPDFApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } - /** * Example: * ```php @@ -689,148 +464,4 @@ public function removeName(string $docId, string $layerName, RemoveNamePagesRequ body: $response->getBody()->getContents(), ); } - - /** - * Example: - * ```php - * $client->doc->pages->reorder( - * 'docId', - * 'layerName', - * new DocPagesReorderRequest([ - * 'pages' => [ - * new PageRef([ - * 'kind' => PageRefKind::ObjectNumber->value, - * 'objectNumber' => 1, - * ]), - * ], - * 'position' => PagePositionZero::Start->value, - * ]), - * ); - * ``` - * - * @param string $docId - * @param string $layerName - * @param DocPagesReorderRequest $request - * @param ?array{ - * baseUrl?: string, - * maxRetries?: int, - * timeout?: float, - * headers?: array, - * queryParameters?: array, - * bodyProperties?: array, - * } $options - * @return ?DocPagesReorder200Response - * @throws CloudPDFException - * @throws CloudPDFApiException - */ - public function reorder(string $docId, string $layerName, DocPagesReorderRequest $request, ?array $options = null): ?DocPagesReorder200Response - { - $options = array_merge($this->options, $options ?? []); - $headers = []; - if ($request->documentPassword != null) { - $headers['X-Document-Password'] = $request->documentPassword; - } - if ($request->idempotencyKey != null) { - $headers['Idempotency-Key'] = $request->idempotencyKey; - } - try { - $response = $this->client->sendRequest( - new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/reorder", - method: HttpMethod::POST, - headers: $headers, - body: $request, - ), - $options, - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - if (empty($json)) { - return null; - } - return DocPagesReorder200Response::fromJson($json); - } - } catch (JsonException $e) { - throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new CloudPDFException(message: $e->getMessage(), previous: $e); - } - throw new CloudPDFApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } - - /** - * Example: - * ```php - * $client->doc->pages->rotate( - * 'docId', - * 'layerName', - * new RotatePagesRequest([ - * 'body' => [ - * 'key' => "value", - * ], - * ]), - * ); - * ``` - * - * @param string $docId - * @param string $layerName - * @param RotatePagesRequest $request - * @param ?array{ - * baseUrl?: string, - * maxRetries?: int, - * timeout?: float, - * headers?: array, - * queryParameters?: array, - * bodyProperties?: array, - * } $options - * @return ?DocPagesRotate200Response - * @throws CloudPDFException - * @throws CloudPDFApiException - */ - public function rotate(string $docId, string $layerName, RotatePagesRequest $request, ?array $options = null): ?DocPagesRotate200Response - { - $options = array_merge($this->options, $options ?? []); - $headers = []; - if ($request->documentPassword != null) { - $headers['X-Document-Password'] = $request->documentPassword; - } - if ($request->idempotencyKey != null) { - $headers['Idempotency-Key'] = $request->idempotencyKey; - } - try { - $response = $this->client->sendRequest( - new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/rotate", - method: HttpMethod::POST, - headers: $headers, - body: $request->body, - ), - $options, - ); - $statusCode = $response->getStatusCode(); - if ($statusCode >= 200 && $statusCode < 400) { - $json = $response->getBody()->getContents(); - if (empty($json)) { - return null; - } - return DocPagesRotate200Response::fromJson($json); - } - } catch (JsonException $e) { - throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); - } catch (ClientExceptionInterface $e) { - throw new CloudPDFException(message: $e->getMessage(), previous: $e); - } - throw new CloudPDFApiException( - message: 'API request failed', - statusCode: $statusCode, - body: $response->getBody()->getContents(), - ); - } } diff --git a/src/Doc/Pages/Requests/DeletePagesRequest.php b/src/Doc/Pages/Requests/DeletePagesRequest.php deleted file mode 100644 index 243c352e..00000000 --- a/src/Doc/Pages/Requests/DeletePagesRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * idempotencyKey?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Doc/Pages/Requests/DocPagesReorderRequest.php b/src/Doc/Pages/Requests/DocPagesReorderRequest.php deleted file mode 100644 index ebce9750..00000000 --- a/src/Doc/Pages/Requests/DocPagesReorderRequest.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([PageRef::class])] - public array $pages; - - /** - * @var ( - * value-of - * |PagePositionAfter - * ) $position - */ - #[JsonProperty('position'), Union('string', PagePositionAfter::class)] - public string|PagePositionAfter $position; - - /** - * @param array{ - * pages: array, - * position: ( - * value-of - * |PagePositionAfter - * ), - * documentPassword?: ?string, - * idempotencyKey?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->pages = $values['pages']; - $this->position = $values['position']; - } -} diff --git a/src/Doc/Pages/Requests/InsertBlankPagesRequest.php b/src/Doc/Pages/Requests/InsertBlankPagesRequest.php deleted file mode 100644 index 9a991adc..00000000 --- a/src/Doc/Pages/Requests/InsertBlankPagesRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * idempotencyKey?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Doc/Pages/Requests/InsertPagesRequest.php b/src/Doc/Pages/Requests/InsertPagesRequest.php deleted file mode 100644 index aab3842e..00000000 --- a/src/Doc/Pages/Requests/InsertPagesRequest.php +++ /dev/null @@ -1,39 +0,0 @@ -documentPassword = $values['documentPassword'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->file = $values['file']; - } -} diff --git a/src/Doc/Pages/Requests/RotatePagesRequest.php b/src/Doc/Pages/Requests/RotatePagesRequest.php deleted file mode 100644 index 227fca26..00000000 --- a/src/Doc/Pages/Requests/RotatePagesRequest.php +++ /dev/null @@ -1,38 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * idempotencyKey?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Types/AnnotationFileAttachment.php b/src/Types/AnnotationFileAttachment.php index 7daba388..50c441b9 100644 --- a/src/Types/AnnotationFileAttachment.php +++ b/src/Types/AnnotationFileAttachment.php @@ -208,10 +208,10 @@ class AnnotationFileAttachment extends JsonSerializableType public string $icon; /** - * @var ?AnnotationFileAttachmentFile $file + * @var ?AttachmentFileInfo $file */ #[JsonProperty('file')] - public ?AnnotationFileAttachmentFile $file; + public ?AttachmentFileInfo $file; /** * @param array{ @@ -248,7 +248,7 @@ class AnnotationFileAttachment extends JsonSerializableType * modifiedBy?: ?string, * importedBy?: ?string, * actions?: ?PdfAnnotationActions, - * file?: ?AnnotationFileAttachmentFile, + * file?: ?AttachmentFileInfo, * } $values */ public function __construct( diff --git a/src/Types/Attachment.php b/src/Types/Attachment.php new file mode 100644 index 00000000..e54289e8 --- /dev/null +++ b/src/Types/Attachment.php @@ -0,0 +1,100 @@ +ref = $values['ref']; + $this->name = $values['name']; + $this->mimeType = $values['mimeType'] ?? null; + $this->description = $values['description'] ?? null; + $this->size = $values['size'] ?? null; + $this->checksum = $values['checksum'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->index = $values['index']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php b/src/Types/AttachmentFileBase.php similarity index 55% rename from src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php rename to src/Types/AttachmentFileBase.php index b69880d1..7c9b40e7 100644 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php +++ b/src/Types/AttachmentFileBase.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsertBlank200ResponseLayoutNamedPagesItem extends JsonSerializableType +class AttachmentFileBase extends JsonSerializableType { /** * @var string $name @@ -14,22 +14,30 @@ class DocPagesInsertBlank200ResponseLayoutNamedPagesItem extends JsonSerializabl public string $name; /** - * @var DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget $target + * @var ?string $mimeType */ - #[JsonProperty('target')] - public DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget $target; + #[JsonProperty('mimeType')] + public ?string $mimeType; + + /** + * @var ?string $description + */ + #[JsonProperty('description')] + public ?string $description; /** * @param array{ * name: string, - * target: DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget, + * mimeType?: ?string, + * description?: ?string, * } $values */ public function __construct( array $values, ) { $this->name = $values['name']; - $this->target = $values['target']; + $this->mimeType = $values['mimeType'] ?? null; + $this->description = $values['description'] ?? null; } /** diff --git a/src/Types/AnnotationFileAttachmentFile.php b/src/Types/AttachmentFileInfo.php similarity index 96% rename from src/Types/AnnotationFileAttachmentFile.php rename to src/Types/AttachmentFileInfo.php index 37b8cb52..39d96dd9 100644 --- a/src/Types/AnnotationFileAttachmentFile.php +++ b/src/Types/AttachmentFileInfo.php @@ -7,7 +7,7 @@ use DateTime; use CloudPDF\Core\Types\Date; -class AnnotationFileAttachmentFile extends JsonSerializableType +class AttachmentFileInfo extends JsonSerializableType { /** * @var string $name diff --git a/src/Types/AttachmentList.php b/src/Types/AttachmentList.php new file mode 100644 index 00000000..834c84eb --- /dev/null +++ b/src/Types/AttachmentList.php @@ -0,0 +1,35 @@ + $attachments + */ + #[JsonProperty('attachments'), ArrayType([Attachment::class])] + public array $attachments; + + /** + * @param array{ + * attachments: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->attachments = $values['attachments']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AttachmentMutationMeta.php b/src/Types/AttachmentMutationMeta.php new file mode 100644 index 00000000..113aa093 --- /dev/null +++ b/src/Types/AttachmentMutationMeta.php @@ -0,0 +1,67 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([PageRef::class])] + public array $affectedPages; + + /** + * @var ?CacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?CacheDelta $cacheDelta; + + /** + * @var string $opId + */ + #[JsonProperty('opId')] + public string $opId; + + /** + * @var bool $undoable + */ + #[JsonProperty('undoable')] + public bool $undoable; + + /** + * @var array $changed + */ + #[JsonProperty('changed'), ArrayType([AttachmentRef::class])] + public array $changed; + + /** + * @param array{ + * affectedPages: array, + * opId: string, + * undoable: bool, + * changed: array, + * cacheDelta?: ?CacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + $this->opId = $values['opId']; + $this->undoable = $values['undoable']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AttachmentRef.php b/src/Types/AttachmentRef.php new file mode 100644 index 00000000..b96c517b --- /dev/null +++ b/src/Types/AttachmentRef.php @@ -0,0 +1,42 @@ + $kind + */ + #[JsonProperty('kind')] + public string $kind; + + /** + * @var string $key + */ + #[JsonProperty('key')] + public string $key; + + /** + * @param array{ + * kind: value-of, + * key: string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->kind = $values['kind']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AttachmentRefKind.php b/src/Types/AttachmentRefKind.php new file mode 100644 index 00000000..8bdf0e22 --- /dev/null +++ b/src/Types/AttachmentRefKind.php @@ -0,0 +1,8 @@ +layoutVersion = $values['layoutVersion'] ?? null; $this->metadataVersion = $values['metadataVersion'] ?? null; $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; + $this->outlineVersion = $values['outlineVersion'] ?? null; $this->layerVersion = $values['layerVersion'] ?? null; $this->working = $values['working'] ?? null; $this->pages = $values['pages']; diff --git a/src/Types/ChangeItem.php b/src/Types/ChangeItem.php index ad9f8d54..44c9d812 100644 --- a/src/Types/ChangeItem.php +++ b/src/Types/ChangeItem.php @@ -33,6 +33,20 @@ class ChangeItem extends JsonSerializableType * |'forms.updateWidget' * |'metadata.update' * |'metadata.updateCustom' + * |'outline.create' + * |'outline.update' + * |'outline.move' + * |'outline.delete' + * |'outline.restore' + * |'pages.rotate' + * |'pages.reorder' + * |'pages.delete' + * |'pages.insertBlank' + * |'pages.insert' + * |'pages.restore' + * |'attachments.create' + * |'attachments.delete' + * |'attachments.restore' * |'_unknown' * ) $type */ @@ -64,6 +78,20 @@ class ChangeItem extends JsonSerializableType * |ChangeItemFormsUpdateWidget * |ChangeItemMetadataUpdate * |ChangeItemMetadataUpdateCustom + * |ChangeItemOutlineCreate + * |ChangeItemOutlineUpdate + * |ChangeItemOutlineMove + * |ChangeItemOutlineDelete + * |ChangeItemOutlineRestore + * |ChangeItemPagesRotate + * |ChangeItemPagesReorder + * |ChangeItemPagesDelete + * |ChangeItemPagesInsertBlank + * |ChangeItemPagesInsert + * |ChangeItemPagesRestore + * |ChangeItemAttachmentsCreate + * |ChangeItemAttachmentsDelete + * |ChangeItemAttachmentsRestore * |mixed * ) $value */ @@ -96,6 +124,20 @@ class ChangeItem extends JsonSerializableType * |'forms.updateWidget' * |'metadata.update' * |'metadata.updateCustom' + * |'outline.create' + * |'outline.update' + * |'outline.move' + * |'outline.delete' + * |'outline.restore' + * |'pages.rotate' + * |'pages.reorder' + * |'pages.delete' + * |'pages.insertBlank' + * |'pages.insert' + * |'pages.restore' + * |'attachments.create' + * |'attachments.delete' + * |'attachments.restore' * |'_unknown' * ), * value: ( @@ -123,6 +165,20 @@ class ChangeItem extends JsonSerializableType * |ChangeItemFormsUpdateWidget * |ChangeItemMetadataUpdate * |ChangeItemMetadataUpdateCustom + * |ChangeItemOutlineCreate + * |ChangeItemOutlineUpdate + * |ChangeItemOutlineMove + * |ChangeItemOutlineDelete + * |ChangeItemOutlineRestore + * |ChangeItemPagesRotate + * |ChangeItemPagesReorder + * |ChangeItemPagesDelete + * |ChangeItemPagesInsertBlank + * |ChangeItemPagesInsert + * |ChangeItemPagesRestore + * |ChangeItemAttachmentsCreate + * |ChangeItemAttachmentsDelete + * |ChangeItemAttachmentsRestore * |mixed * ), * } $values @@ -422,6 +478,174 @@ public static function metadataUpdateCustom(ChangeItemMetadataUpdateCustom $meta ]); } + /** + * @param ChangeItemOutlineCreate $outlineCreate + * @return ChangeItem + */ + public static function outlineCreate(ChangeItemOutlineCreate $outlineCreate): ChangeItem + { + return new ChangeItem([ + 'type' => 'outline.create', + 'value' => $outlineCreate, + ]); + } + + /** + * @param ChangeItemOutlineUpdate $outlineUpdate + * @return ChangeItem + */ + public static function outlineUpdate(ChangeItemOutlineUpdate $outlineUpdate): ChangeItem + { + return new ChangeItem([ + 'type' => 'outline.update', + 'value' => $outlineUpdate, + ]); + } + + /** + * @param ChangeItemOutlineMove $outlineMove + * @return ChangeItem + */ + public static function outlineMove(ChangeItemOutlineMove $outlineMove): ChangeItem + { + return new ChangeItem([ + 'type' => 'outline.move', + 'value' => $outlineMove, + ]); + } + + /** + * @param ChangeItemOutlineDelete $outlineDelete + * @return ChangeItem + */ + public static function outlineDelete(ChangeItemOutlineDelete $outlineDelete): ChangeItem + { + return new ChangeItem([ + 'type' => 'outline.delete', + 'value' => $outlineDelete, + ]); + } + + /** + * @param ChangeItemOutlineRestore $outlineRestore + * @return ChangeItem + */ + public static function outlineRestore(ChangeItemOutlineRestore $outlineRestore): ChangeItem + { + return new ChangeItem([ + 'type' => 'outline.restore', + 'value' => $outlineRestore, + ]); + } + + /** + * @param ChangeItemPagesRotate $pagesRotate + * @return ChangeItem + */ + public static function pagesRotate(ChangeItemPagesRotate $pagesRotate): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.rotate', + 'value' => $pagesRotate, + ]); + } + + /** + * @param ChangeItemPagesReorder $pagesReorder + * @return ChangeItem + */ + public static function pagesReorder(ChangeItemPagesReorder $pagesReorder): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.reorder', + 'value' => $pagesReorder, + ]); + } + + /** + * @param ChangeItemPagesDelete $pagesDelete + * @return ChangeItem + */ + public static function pagesDelete(ChangeItemPagesDelete $pagesDelete): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.delete', + 'value' => $pagesDelete, + ]); + } + + /** + * @param ChangeItemPagesInsertBlank $pagesInsertBlank + * @return ChangeItem + */ + public static function pagesInsertBlank(ChangeItemPagesInsertBlank $pagesInsertBlank): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.insertBlank', + 'value' => $pagesInsertBlank, + ]); + } + + /** + * @param ChangeItemPagesInsert $pagesInsert + * @return ChangeItem + */ + public static function pagesInsert(ChangeItemPagesInsert $pagesInsert): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.insert', + 'value' => $pagesInsert, + ]); + } + + /** + * @param ChangeItemPagesRestore $pagesRestore + * @return ChangeItem + */ + public static function pagesRestore(ChangeItemPagesRestore $pagesRestore): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.restore', + 'value' => $pagesRestore, + ]); + } + + /** + * @param ChangeItemAttachmentsCreate $attachmentsCreate + * @return ChangeItem + */ + public static function attachmentsCreate(ChangeItemAttachmentsCreate $attachmentsCreate): ChangeItem + { + return new ChangeItem([ + 'type' => 'attachments.create', + 'value' => $attachmentsCreate, + ]); + } + + /** + * @param ChangeItemAttachmentsDelete $attachmentsDelete + * @return ChangeItem + */ + public static function attachmentsDelete(ChangeItemAttachmentsDelete $attachmentsDelete): ChangeItem + { + return new ChangeItem([ + 'type' => 'attachments.delete', + 'value' => $attachmentsDelete, + ]); + } + + /** + * @param ChangeItemAttachmentsRestore $attachmentsRestore + * @return ChangeItem + */ + public static function attachmentsRestore(ChangeItemAttachmentsRestore $attachmentsRestore): ChangeItem + { + return new ChangeItem([ + 'type' => 'attachments.restore', + 'value' => $attachmentsRestore, + ]); + } + /** * @return bool */ @@ -950,6 +1174,314 @@ public function asMetadataUpdateCustom(): ChangeItemMetadataUpdateCustom return $this->value; } + /** + * @return bool + */ + public function isOutlineCreate(): bool + { + return $this->value instanceof ChangeItemOutlineCreate && $this->type === 'outline.create'; + } + + /** + * @return ChangeItemOutlineCreate + */ + public function asOutlineCreate(): ChangeItemOutlineCreate + { + if (!($this->value instanceof ChangeItemOutlineCreate && $this->type === 'outline.create')) { + throw new Exception( + "Expected outline.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineUpdate(): bool + { + return $this->value instanceof ChangeItemOutlineUpdate && $this->type === 'outline.update'; + } + + /** + * @return ChangeItemOutlineUpdate + */ + public function asOutlineUpdate(): ChangeItemOutlineUpdate + { + if (!($this->value instanceof ChangeItemOutlineUpdate && $this->type === 'outline.update')) { + throw new Exception( + "Expected outline.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineMove(): bool + { + return $this->value instanceof ChangeItemOutlineMove && $this->type === 'outline.move'; + } + + /** + * @return ChangeItemOutlineMove + */ + public function asOutlineMove(): ChangeItemOutlineMove + { + if (!($this->value instanceof ChangeItemOutlineMove && $this->type === 'outline.move')) { + throw new Exception( + "Expected outline.move; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineDelete(): bool + { + return $this->value instanceof ChangeItemOutlineDelete && $this->type === 'outline.delete'; + } + + /** + * @return ChangeItemOutlineDelete + */ + public function asOutlineDelete(): ChangeItemOutlineDelete + { + if (!($this->value instanceof ChangeItemOutlineDelete && $this->type === 'outline.delete')) { + throw new Exception( + "Expected outline.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineRestore(): bool + { + return $this->value instanceof ChangeItemOutlineRestore && $this->type === 'outline.restore'; + } + + /** + * @return ChangeItemOutlineRestore + */ + public function asOutlineRestore(): ChangeItemOutlineRestore + { + if (!($this->value instanceof ChangeItemOutlineRestore && $this->type === 'outline.restore')) { + throw new Exception( + "Expected outline.restore; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesRotate(): bool + { + return $this->value instanceof ChangeItemPagesRotate && $this->type === 'pages.rotate'; + } + + /** + * @return ChangeItemPagesRotate + */ + public function asPagesRotate(): ChangeItemPagesRotate + { + if (!($this->value instanceof ChangeItemPagesRotate && $this->type === 'pages.rotate')) { + throw new Exception( + "Expected pages.rotate; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesReorder(): bool + { + return $this->value instanceof ChangeItemPagesReorder && $this->type === 'pages.reorder'; + } + + /** + * @return ChangeItemPagesReorder + */ + public function asPagesReorder(): ChangeItemPagesReorder + { + if (!($this->value instanceof ChangeItemPagesReorder && $this->type === 'pages.reorder')) { + throw new Exception( + "Expected pages.reorder; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesDelete(): bool + { + return $this->value instanceof ChangeItemPagesDelete && $this->type === 'pages.delete'; + } + + /** + * @return ChangeItemPagesDelete + */ + public function asPagesDelete(): ChangeItemPagesDelete + { + if (!($this->value instanceof ChangeItemPagesDelete && $this->type === 'pages.delete')) { + throw new Exception( + "Expected pages.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesInsertBlank(): bool + { + return $this->value instanceof ChangeItemPagesInsertBlank && $this->type === 'pages.insertBlank'; + } + + /** + * @return ChangeItemPagesInsertBlank + */ + public function asPagesInsertBlank(): ChangeItemPagesInsertBlank + { + if (!($this->value instanceof ChangeItemPagesInsertBlank && $this->type === 'pages.insertBlank')) { + throw new Exception( + "Expected pages.insertBlank; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesInsert(): bool + { + return $this->value instanceof ChangeItemPagesInsert && $this->type === 'pages.insert'; + } + + /** + * @return ChangeItemPagesInsert + */ + public function asPagesInsert(): ChangeItemPagesInsert + { + if (!($this->value instanceof ChangeItemPagesInsert && $this->type === 'pages.insert')) { + throw new Exception( + "Expected pages.insert; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesRestore(): bool + { + return $this->value instanceof ChangeItemPagesRestore && $this->type === 'pages.restore'; + } + + /** + * @return ChangeItemPagesRestore + */ + public function asPagesRestore(): ChangeItemPagesRestore + { + if (!($this->value instanceof ChangeItemPagesRestore && $this->type === 'pages.restore')) { + throw new Exception( + "Expected pages.restore; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAttachmentsCreate(): bool + { + return $this->value instanceof ChangeItemAttachmentsCreate && $this->type === 'attachments.create'; + } + + /** + * @return ChangeItemAttachmentsCreate + */ + public function asAttachmentsCreate(): ChangeItemAttachmentsCreate + { + if (!($this->value instanceof ChangeItemAttachmentsCreate && $this->type === 'attachments.create')) { + throw new Exception( + "Expected attachments.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAttachmentsDelete(): bool + { + return $this->value instanceof ChangeItemAttachmentsDelete && $this->type === 'attachments.delete'; + } + + /** + * @return ChangeItemAttachmentsDelete + */ + public function asAttachmentsDelete(): ChangeItemAttachmentsDelete + { + if (!($this->value instanceof ChangeItemAttachmentsDelete && $this->type === 'attachments.delete')) { + throw new Exception( + "Expected attachments.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAttachmentsRestore(): bool + { + return $this->value instanceof ChangeItemAttachmentsRestore && $this->type === 'attachments.restore'; + } + + /** + * @return ChangeItemAttachmentsRestore + */ + public function asAttachmentsRestore(): ChangeItemAttachmentsRestore + { + if (!($this->value instanceof ChangeItemAttachmentsRestore && $this->type === 'attachments.restore')) { + throw new Exception( + "Expected attachments.restore; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return string */ @@ -1066,6 +1598,62 @@ public function jsonSerialize(): array $value = $this->asMetadataUpdateCustom()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'outline.create': + $value = $this->asOutlineCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.update': + $value = $this->asOutlineUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.move': + $value = $this->asOutlineMove()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.delete': + $value = $this->asOutlineDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.restore': + $value = $this->asOutlineRestore()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.rotate': + $value = $this->asPagesRotate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.reorder': + $value = $this->asPagesReorder()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.delete': + $value = $this->asPagesDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.insertBlank': + $value = $this->asPagesInsertBlank()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.insert': + $value = $this->asPagesInsert()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.restore': + $value = $this->asPagesRestore()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'attachments.create': + $value = $this->asAttachmentsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'attachments.delete': + $value = $this->asAttachmentsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'attachments.restore': + $value = $this->asAttachmentsRestore()->jsonSerialize(); + $result = array_merge($value, $result); + break; case '_unknown': default: if (is_null($this->value)) { @@ -1174,6 +1762,48 @@ public static function jsonDeserialize(array $data): static case 'metadata.updateCustom': $args['value'] = ChangeItemMetadataUpdateCustom::jsonDeserialize($data); break; + case 'outline.create': + $args['value'] = ChangeItemOutlineCreate::jsonDeserialize($data); + break; + case 'outline.update': + $args['value'] = ChangeItemOutlineUpdate::jsonDeserialize($data); + break; + case 'outline.move': + $args['value'] = ChangeItemOutlineMove::jsonDeserialize($data); + break; + case 'outline.delete': + $args['value'] = ChangeItemOutlineDelete::jsonDeserialize($data); + break; + case 'outline.restore': + $args['value'] = ChangeItemOutlineRestore::jsonDeserialize($data); + break; + case 'pages.rotate': + $args['value'] = ChangeItemPagesRotate::jsonDeserialize($data); + break; + case 'pages.reorder': + $args['value'] = ChangeItemPagesReorder::jsonDeserialize($data); + break; + case 'pages.delete': + $args['value'] = ChangeItemPagesDelete::jsonDeserialize($data); + break; + case 'pages.insertBlank': + $args['value'] = ChangeItemPagesInsertBlank::jsonDeserialize($data); + break; + case 'pages.insert': + $args['value'] = ChangeItemPagesInsert::jsonDeserialize($data); + break; + case 'pages.restore': + $args['value'] = ChangeItemPagesRestore::jsonDeserialize($data); + break; + case 'attachments.create': + $args['value'] = ChangeItemAttachmentsCreate::jsonDeserialize($data); + break; + case 'attachments.delete': + $args['value'] = ChangeItemAttachmentsDelete::jsonDeserialize($data); + break; + case 'attachments.restore': + $args['value'] = ChangeItemAttachmentsRestore::jsonDeserialize($data); + break; case '_unknown': default: $args['type'] = '_unknown'; diff --git a/src/Types/DocPagesRotate200Response.php b/src/Types/ChangeItemAttachmentsCreate.php similarity index 55% rename from src/Types/DocPagesRotate200Response.php rename to src/Types/ChangeItemAttachmentsCreate.php index 9b794a4b..0bb17739 100644 --- a/src/Types/DocPagesRotate200Response.php +++ b/src/Types/ChangeItemAttachmentsCreate.php @@ -5,30 +5,30 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200Response extends JsonSerializableType +class ChangeItemAttachmentsCreate extends JsonSerializableType { /** - * @var DocPagesRotate200ResponseLayout $layout + * @var Attachment $attachment */ - #[JsonProperty('layout')] - public DocPagesRotate200ResponseLayout $layout; + #[JsonProperty('attachment')] + public Attachment $attachment; /** - * @var MutationMeta $meta + * @var AttachmentMutationMeta $meta */ #[JsonProperty('meta')] - public MutationMeta $meta; + public AttachmentMutationMeta $meta; /** * @param array{ - * layout: DocPagesRotate200ResponseLayout, - * meta: MutationMeta, + * attachment: Attachment, + * meta: AttachmentMutationMeta, * } $values */ public function __construct( array $values, ) { - $this->layout = $values['layout']; + $this->attachment = $values['attachment']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemAttachmentsDelete.php similarity index 60% rename from src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php rename to src/Types/ChangeItemAttachmentsDelete.php index d01324a4..bb7959f9 100644 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php +++ b/src/Types/ChangeItemAttachmentsDelete.php @@ -5,23 +5,23 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage extends JsonSerializableType +class ChangeItemAttachmentsDelete extends JsonSerializableType { /** - * @var PageRef $page + * @var AttachmentMutationMeta $meta */ - #[JsonProperty('page')] - public PageRef $page; + #[JsonProperty('meta')] + public AttachmentMutationMeta $meta; /** * @param array{ - * page: PageRef, + * meta: AttachmentMutationMeta, * } $values */ public function __construct( array $values, ) { - $this->page = $values['page']; + $this->meta = $values['meta']; } /** diff --git a/src/Types/ChangeItemAttachmentsRestore.php b/src/Types/ChangeItemAttachmentsRestore.php new file mode 100644 index 00000000..155bfa04 --- /dev/null +++ b/src/Types/ChangeItemAttachmentsRestore.php @@ -0,0 +1,42 @@ +attachment = $values['attachment']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemOutlineCreate.php b/src/Types/ChangeItemOutlineCreate.php new file mode 100644 index 00000000..8fc4b8bf --- /dev/null +++ b/src/Types/ChangeItemOutlineCreate.php @@ -0,0 +1,50 @@ +item = $values['item']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemOutlineDelete.php b/src/Types/ChangeItemOutlineDelete.php new file mode 100644 index 00000000..156f9315 --- /dev/null +++ b/src/Types/ChangeItemOutlineDelete.php @@ -0,0 +1,34 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemOutlineMove.php b/src/Types/ChangeItemOutlineMove.php new file mode 100644 index 00000000..5e3ca348 --- /dev/null +++ b/src/Types/ChangeItemOutlineMove.php @@ -0,0 +1,43 @@ + $orders + */ + #[JsonProperty('orders'), ArrayType([OutlineOrder::class])] + public array $orders; + + /** + * @var OutlineMutationMeta $meta + */ + #[JsonProperty('meta')] + public OutlineMutationMeta $meta; + + /** + * @param array{ + * orders: array, + * meta: OutlineMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->orders = $values['orders']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemOutlineRestore.php b/src/Types/ChangeItemOutlineRestore.php new file mode 100644 index 00000000..43349f3c --- /dev/null +++ b/src/Types/ChangeItemOutlineRestore.php @@ -0,0 +1,51 @@ + $items + */ + #[JsonProperty('items'), ArrayType([OutlineItem::class])] + public array $items; + + /** + * @var OutlineOrder $order + */ + #[JsonProperty('order')] + public OutlineOrder $order; + + /** + * @var OutlineMutationMeta $meta + */ + #[JsonProperty('meta')] + public OutlineMutationMeta $meta; + + /** + * @param array{ + * items: array, + * order: OutlineOrder, + * meta: OutlineMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->items = $values['items']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemOutlineUpdate.php b/src/Types/ChangeItemOutlineUpdate.php new file mode 100644 index 00000000..8cc2526c --- /dev/null +++ b/src/Types/ChangeItemOutlineUpdate.php @@ -0,0 +1,51 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var OutlineItem $item + */ + #[JsonProperty('item')] + public OutlineItem $item; + + /** + * @var OutlineMutationMeta $meta + */ + #[JsonProperty('meta')] + public OutlineMutationMeta $meta; + + /** + * @param array{ + * item: OutlineItem, + * meta: OutlineMutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $this->item = $values['item']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200Response.php b/src/Types/ChangeItemPagesDelete.php similarity index 80% rename from src/Types/DocPagesReorder200Response.php rename to src/Types/ChangeItemPagesDelete.php index b674e450..7b6381a7 100644 --- a/src/Types/DocPagesReorder200Response.php +++ b/src/Types/ChangeItemPagesDelete.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesReorder200Response extends JsonSerializableType +class ChangeItemPagesDelete extends JsonSerializableType { /** * @var array $pages @@ -15,10 +15,10 @@ class DocPagesReorder200Response extends JsonSerializableType public array $pages; /** - * @var DocPagesReorder200ResponseLayout $layout + * @var ChangeItemPagesDeleteLayout $layout */ #[JsonProperty('layout')] - public DocPagesReorder200ResponseLayout $layout; + public ChangeItemPagesDeleteLayout $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class DocPagesReorder200Response extends JsonSerializableType /** * @param array{ * pages: array, - * layout: DocPagesReorder200ResponseLayout, + * layout: ChangeItemPagesDeleteLayout, * meta: MutationMeta, * } $values */ diff --git a/src/Types/DocPagesRotate200ResponseLayout.php b/src/Types/ChangeItemPagesDeleteLayout.php similarity index 58% rename from src/Types/DocPagesRotate200ResponseLayout.php rename to src/Types/ChangeItemPagesDeleteLayout.php index 7d30875a..ed6df3d0 100644 --- a/src/Types/DocPagesRotate200ResponseLayout.php +++ b/src/Types/ChangeItemPagesDeleteLayout.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesRotate200ResponseLayout extends JsonSerializableType +class ChangeItemPagesDeleteLayout extends JsonSerializableType { /** * @var int $pageCount @@ -15,22 +15,22 @@ class DocPagesRotate200ResponseLayout extends JsonSerializableType public int $pageCount; /** - * @var array $pages + * @var array $pages */ - #[JsonProperty('pages'), ArrayType([DocPagesRotate200ResponseLayoutPagesItem::class])] + #[JsonProperty('pages'), ArrayType([ChangeItemPagesDeleteLayoutPagesItem::class])] public array $pages; /** - * @var array $namedPages + * @var array $namedPages */ - #[JsonProperty('namedPages'), ArrayType([DocPagesRotate200ResponseLayoutNamedPagesItem::class])] + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesDeleteLayoutNamedPagesItem::class])] public array $namedPages; /** * @param array{ * pageCount: int, - * pages: array, - * namedPages: array, + * pages: array, + * namedPages: array, * } $values */ public function __construct( diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItem.php similarity index 67% rename from src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php rename to src/Types/ChangeItemPagesDeleteLayoutNamedPagesItem.php index 162bd534..d2db1132 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php +++ b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutNamedPagesItem extends JsonSerializableType +class ChangeItemPagesDeleteLayoutNamedPagesItem extends JsonSerializableType { /** * @var string $name @@ -14,15 +14,15 @@ class DocPagesRotate200ResponseLayoutNamedPagesItem extends JsonSerializableType public string $name; /** - * @var DocPagesRotate200ResponseLayoutNamedPagesItemTarget $target + * @var ChangeItemPagesDeleteLayoutNamedPagesItemTarget $target */ #[JsonProperty('target')] - public DocPagesRotate200ResponseLayoutNamedPagesItemTarget $target; + public ChangeItemPagesDeleteLayoutNamedPagesItemTarget $target; /** * @param array{ * name: string, - * target: DocPagesRotate200ResponseLayoutNamedPagesItemTarget, + * target: ChangeItemPagesDeleteLayoutNamedPagesItemTarget, * } $values */ public function __construct( diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php similarity index 57% rename from src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php rename to src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php index 55dca7e0..43babd4e 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php +++ b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; -class DocPagesRotate200ResponseLayoutNamedPagesItemTarget extends JsonSerializableType +class ChangeItemPagesDeleteLayoutNamedPagesItemTarget extends JsonSerializableType { /** * @var ( @@ -19,9 +19,9 @@ class DocPagesRotate200ResponseLayoutNamedPagesItemTarget extends JsonSerializab /** * @var ( - * DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage + * |ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling * |mixed * ) $value */ @@ -36,9 +36,9 @@ class DocPagesRotate200ResponseLayoutNamedPagesItemTarget extends JsonSerializab * |'_unknown' * ), * value: ( - * DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage + * |ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling * |mixed * ), * } $values @@ -51,36 +51,36 @@ private function __construct( } /** - * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget */ - public static function page(DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + public static function page(ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage $page): ChangeItemPagesDeleteLayoutNamedPagesItemTarget { - return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ 'kind' => 'page', 'value' => $page, ]); } /** - * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget */ - public static function template(DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + public static function template(ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesDeleteLayoutNamedPagesItemTarget { - return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ 'kind' => 'template', 'value' => $template, ]); } /** - * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget */ - public static function dangling(DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + public static function dangling(ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesDeleteLayoutNamedPagesItemTarget { - return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ 'kind' => 'dangling', 'value' => $dangling, ]); @@ -91,15 +91,15 @@ public static function dangling(DocPagesRotate200ResponseLayoutNamedPagesItemTar */ public function isPage(): bool { - return $this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage && $this->kind === 'page'; } /** - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage */ - public function asPage(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage + public function asPage(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage { - if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + if (!($this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { throw new Exception( "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -113,15 +113,15 @@ public function asPage(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetPag */ public function isTemplate(): bool { - return $this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; } /** - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate */ - public function asTemplate(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate + public function asTemplate(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate { - if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + if (!($this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { throw new Exception( "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -135,15 +135,15 @@ public function asTemplate(): DocPagesRotate200ResponseLayoutNamedPagesItemTarge */ public function isDangling(): bool { - return $this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; } /** - * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling */ - public function asDangling(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + public function asDangling(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling { - if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + if (!($this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { throw new Exception( "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -221,13 +221,13 @@ public static function jsonDeserialize(array $data): static $args['kind'] = $kind; switch ($kind) { case 'page': - $args['value'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + $args['value'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage::jsonDeserialize($data); break; case 'template': - $args['value'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + $args['value'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); break; case 'dangling': - $args['value'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + $args['value'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); break; case '_unknown': default: diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php similarity index 79% rename from src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php rename to src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php index dff09845..e9efcec5 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php +++ b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php @@ -4,7 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; -class DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling extends JsonSerializableType +class ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling extends JsonSerializableType { /** * @param array{ diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php similarity index 85% rename from src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php rename to src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php index aea7f1d8..21ed674a 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php +++ b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage extends JsonSerializableType +class ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage extends JsonSerializableType { /** * @var PageRef $page diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php similarity index 85% rename from src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php rename to src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php index e880c00b..0b6ef778 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate extends JsonSerializableType { /** * @var int $objectNumber diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItem.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php similarity index 68% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItem.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItem.php index 8a761ace..c2cc134a 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItem extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItem extends JsonSerializableType { /** * @var int $index @@ -26,10 +26,10 @@ class DocPagesInsert200ResponseLayoutPagesItem extends JsonSerializableType public ?string $label; /** - * @var DocPagesInsert200ResponseLayoutPagesItemSize $size + * @var ChangeItemPagesDeleteLayoutPagesItemSize $size */ #[JsonProperty('size')] - public DocPagesInsert200ResponseLayoutPagesItemSize $size; + public ChangeItemPagesDeleteLayoutPagesItemSize $size; /** * @var float $rotation @@ -44,22 +44,22 @@ class DocPagesInsert200ResponseLayoutPagesItem extends JsonSerializableType public float $userUnit; /** - * @var ?value-of $tabOrder + * @var ?value-of $tabOrder */ #[JsonProperty('tabOrder')] public ?string $tabOrder; /** - * @var DocPagesInsert200ResponseLayoutPagesItemBoxes $boxes + * @var ChangeItemPagesDeleteLayoutPagesItemBoxes $boxes */ #[JsonProperty('boxes')] - public DocPagesInsert200ResponseLayoutPagesItemBoxes $boxes; + public ChangeItemPagesDeleteLayoutPagesItemBoxes $boxes; /** - * @var DocPagesInsert200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + * @var ChangeItemPagesDeleteLayoutPagesItemPdfCropBox $pdfCropBox */ #[JsonProperty('pdfCropBox')] - public DocPagesInsert200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + public ChangeItemPagesDeleteLayoutPagesItemPdfCropBox $pdfCropBox; /** * @var ?PdfPageActions $actions @@ -71,13 +71,13 @@ class DocPagesInsert200ResponseLayoutPagesItem extends JsonSerializableType * @param array{ * index: int, * ref: PageRef, - * size: DocPagesInsert200ResponseLayoutPagesItemSize, + * size: ChangeItemPagesDeleteLayoutPagesItemSize, * rotation: float, * userUnit: float, - * boxes: DocPagesInsert200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesInsert200ResponseLayoutPagesItemPdfCropBox, + * boxes: ChangeItemPagesDeleteLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesDeleteLayoutPagesItemPdfCropBox, * label?: ?string, - * tabOrder?: ?value-of, + * tabOrder?: ?value-of, * actions?: ?PdfPageActions, * } $values */ diff --git a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxes.php new file mode 100644 index 00000000..94802dee --- /dev/null +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.php similarity index 92% rename from src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.php index 9829e687..838e5565 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutPagesItemBoxesArt extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemBoxesArt extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.php similarity index 92% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.php index 94a302e4..98f882cf 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItemBoxesArt extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemBoxesBleed extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.php similarity index 92% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.php index c1d8cac3..645a9d8a 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItemBoxesArt extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemBoxesCrop extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.php similarity index 91% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.php index e2e4d0ae..7506ac3a 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItemBoxesTrim extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemBoxesMedia extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..1d35c122 --- /dev/null +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.php similarity index 92% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.php index f5ab108a..fc468af9 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItemPdfCropBox extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemPdfCropBox extends JsonSerializableType { /** * @var float $left diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemSize.php similarity index 89% rename from src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemSize.php index 29992061..52256767 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemSize.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutPagesItemSize extends JsonSerializableType +class ChangeItemPagesDeleteLayoutPagesItemSize extends JsonSerializableType { /** * @var float $width diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php similarity index 75% rename from src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php rename to src/Types/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php index 48502ae7..54e48bad 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum DocPagesRotate200ResponseLayoutPagesItemTabOrder: string +enum ChangeItemPagesDeleteLayoutPagesItemTabOrder: string { case Rows = "rows"; case Columns = "columns"; diff --git a/src/Types/DocPagesInsert200Response.php b/src/Types/ChangeItemPagesInsert.php similarity index 81% rename from src/Types/DocPagesInsert200Response.php rename to src/Types/ChangeItemPagesInsert.php index 1316e011..a318906f 100644 --- a/src/Types/DocPagesInsert200Response.php +++ b/src/Types/ChangeItemPagesInsert.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesInsert200Response extends JsonSerializableType +class ChangeItemPagesInsert extends JsonSerializableType { /** * @var array $insertedPages @@ -15,10 +15,10 @@ class DocPagesInsert200Response extends JsonSerializableType public array $insertedPages; /** - * @var DocPagesInsert200ResponseLayout $layout + * @var ChangeItemPagesInsertLayout $layout */ #[JsonProperty('layout')] - public DocPagesInsert200ResponseLayout $layout; + public ChangeItemPagesInsertLayout $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class DocPagesInsert200Response extends JsonSerializableType /** * @param array{ * insertedPages: array, - * layout: DocPagesInsert200ResponseLayout, + * layout: ChangeItemPagesInsertLayout, * meta: MutationMeta, * } $values */ diff --git a/src/Types/DocPagesInsertBlank200Response.php b/src/Types/ChangeItemPagesInsertBlank.php similarity index 79% rename from src/Types/DocPagesInsertBlank200Response.php rename to src/Types/ChangeItemPagesInsertBlank.php index fc037c5b..308958cd 100644 --- a/src/Types/DocPagesInsertBlank200Response.php +++ b/src/Types/ChangeItemPagesInsertBlank.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesInsertBlank200Response extends JsonSerializableType +class ChangeItemPagesInsertBlank extends JsonSerializableType { /** * @var array $insertedPages @@ -15,10 +15,10 @@ class DocPagesInsertBlank200Response extends JsonSerializableType public array $insertedPages; /** - * @var DocPagesInsertBlank200ResponseLayout $layout + * @var ChangeItemPagesInsertBlankLayout $layout */ #[JsonProperty('layout')] - public DocPagesInsertBlank200ResponseLayout $layout; + public ChangeItemPagesInsertBlankLayout $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class DocPagesInsertBlank200Response extends JsonSerializableType /** * @param array{ * insertedPages: array, - * layout: DocPagesInsertBlank200ResponseLayout, + * layout: ChangeItemPagesInsertBlankLayout, * meta: MutationMeta, * } $values */ diff --git a/src/Types/DocPagesReorder200ResponseLayout.php b/src/Types/ChangeItemPagesInsertBlankLayout.php similarity index 60% rename from src/Types/DocPagesReorder200ResponseLayout.php rename to src/Types/ChangeItemPagesInsertBlankLayout.php index b71e1b16..91b9b2de 100644 --- a/src/Types/DocPagesReorder200ResponseLayout.php +++ b/src/Types/ChangeItemPagesInsertBlankLayout.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesReorder200ResponseLayout extends JsonSerializableType +class ChangeItemPagesInsertBlankLayout extends JsonSerializableType { /** * @var int $pageCount @@ -15,22 +15,22 @@ class DocPagesReorder200ResponseLayout extends JsonSerializableType public int $pageCount; /** - * @var array $pages + * @var array $pages */ - #[JsonProperty('pages'), ArrayType([DocPagesReorder200ResponseLayoutPagesItem::class])] + #[JsonProperty('pages'), ArrayType([ChangeItemPagesInsertBlankLayoutPagesItem::class])] public array $pages; /** - * @var array $namedPages + * @var array $namedPages */ - #[JsonProperty('namedPages'), ArrayType([DocPagesReorder200ResponseLayoutNamedPagesItem::class])] + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesInsertBlankLayoutNamedPagesItem::class])] public array $namedPages; /** * @param array{ * pageCount: int, - * pages: array, - * namedPages: array, + * pages: array, + * namedPages: array, * } $values */ public function __construct( diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItem.php similarity index 72% rename from src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php rename to src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItem.php index a6abac75..8ed54518 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutNamedPagesItem extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutNamedPagesItem extends JsonSerializableType { /** * @var string $name @@ -14,15 +14,15 @@ class DocPagesReorder200ResponseLayoutNamedPagesItem extends JsonSerializableTyp public string $name; /** - * @var DocPagesReorder200ResponseLayoutNamedPagesItemTarget $target + * @var ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget $target */ #[JsonProperty('target')] - public DocPagesReorder200ResponseLayoutNamedPagesItemTarget $target; + public ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget $target; /** * @param array{ * name: string, - * target: DocPagesReorder200ResponseLayoutNamedPagesItemTarget, + * target: ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget, * } $values */ public function __construct( diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php similarity index 65% rename from src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php rename to src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php index adb57a3c..d06db7b6 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; -class DocPagesReorder200ResponseLayoutNamedPagesItemTarget extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget extends JsonSerializableType { /** * @var ( @@ -19,9 +19,9 @@ class DocPagesReorder200ResponseLayoutNamedPagesItemTarget extends JsonSerializa /** * @var ( - * DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage + * |ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling * |mixed * ) $value */ @@ -36,9 +36,9 @@ class DocPagesReorder200ResponseLayoutNamedPagesItemTarget extends JsonSerializa * |'_unknown' * ), * value: ( - * DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage + * |ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling * |mixed * ), * } $values @@ -51,36 +51,36 @@ private function __construct( } /** - * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget */ - public static function page(DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + public static function page(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage $page): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget { - return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ 'kind' => 'page', 'value' => $page, ]); } /** - * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget */ - public static function template(DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + public static function template(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget { - return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ 'kind' => 'template', 'value' => $template, ]); } /** - * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget */ - public static function dangling(DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + public static function dangling(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget { - return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ 'kind' => 'dangling', 'value' => $dangling, ]); @@ -91,15 +91,15 @@ public static function dangling(DocPagesReorder200ResponseLayoutNamedPagesItemTa */ public function isPage(): bool { - return $this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage && $this->kind === 'page'; } /** - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage */ - public function asPage(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage + public function asPage(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage { - if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + if (!($this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { throw new Exception( "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -113,15 +113,15 @@ public function asPage(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetPa */ public function isTemplate(): bool { - return $this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; } /** - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate */ - public function asTemplate(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate + public function asTemplate(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate { - if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + if (!($this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { throw new Exception( "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -135,15 +135,15 @@ public function asTemplate(): DocPagesReorder200ResponseLayoutNamedPagesItemTarg */ public function isDangling(): bool { - return $this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; } /** - * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling */ - public function asDangling(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + public function asDangling(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling { - if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + if (!($this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { throw new Exception( "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -221,13 +221,13 @@ public static function jsonDeserialize(array $data): static $args['kind'] = $kind; switch ($kind) { case 'page': - $args['value'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + $args['value'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage::jsonDeserialize($data); break; case 'template': - $args['value'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + $args['value'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); break; case 'dangling': - $args['value'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + $args['value'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); break; case '_unknown': default: diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php similarity index 85% rename from src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php rename to src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php index d71ab7ea..59c844c7 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php @@ -4,7 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; -class DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling extends JsonSerializableType { /** * @param array{ diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php similarity index 89% rename from src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php rename to src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php index c3865c57..1e859c87 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage extends JsonSerializableType { /** * @var PageRef $page diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php similarity index 90% rename from src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php rename to src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php index 57ac2b06..1ee76154 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate extends JsonSerializableType { /** * @var int $objectNumber diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php similarity index 71% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItem.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php index 64de3bc5..a99ea830 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutPagesItem extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItem extends JsonSerializableType { /** * @var int $index @@ -26,10 +26,10 @@ class DocPagesReorder200ResponseLayoutPagesItem extends JsonSerializableType public ?string $label; /** - * @var DocPagesReorder200ResponseLayoutPagesItemSize $size + * @var ChangeItemPagesInsertBlankLayoutPagesItemSize $size */ #[JsonProperty('size')] - public DocPagesReorder200ResponseLayoutPagesItemSize $size; + public ChangeItemPagesInsertBlankLayoutPagesItemSize $size; /** * @var float $rotation @@ -44,22 +44,22 @@ class DocPagesReorder200ResponseLayoutPagesItem extends JsonSerializableType public float $userUnit; /** - * @var ?value-of $tabOrder + * @var ?value-of $tabOrder */ #[JsonProperty('tabOrder')] public ?string $tabOrder; /** - * @var DocPagesReorder200ResponseLayoutPagesItemBoxes $boxes + * @var ChangeItemPagesInsertBlankLayoutPagesItemBoxes $boxes */ #[JsonProperty('boxes')] - public DocPagesReorder200ResponseLayoutPagesItemBoxes $boxes; + public ChangeItemPagesInsertBlankLayoutPagesItemBoxes $boxes; /** - * @var DocPagesReorder200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + * @var ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox $pdfCropBox */ #[JsonProperty('pdfCropBox')] - public DocPagesReorder200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + public ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox $pdfCropBox; /** * @var ?PdfPageActions $actions @@ -71,13 +71,13 @@ class DocPagesReorder200ResponseLayoutPagesItem extends JsonSerializableType * @param array{ * index: int, * ref: PageRef, - * size: DocPagesReorder200ResponseLayoutPagesItemSize, + * size: ChangeItemPagesInsertBlankLayoutPagesItemSize, * rotation: float, * userUnit: float, - * boxes: DocPagesReorder200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesReorder200ResponseLayoutPagesItemPdfCropBox, + * boxes: ChangeItemPagesInsertBlankLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox, * label?: ?string, - * tabOrder?: ?value-of, + * tabOrder?: ?value-of, * actions?: ?PdfPageActions, * } $values */ diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.php new file mode 100644 index 00000000..e0ff95b9 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.php similarity index 93% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.php index efe06d82..e13ecea0 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItemBoxesCrop extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.php similarity index 93% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.php index b667d46d..8ad901a6 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutPagesItemBoxesBleed extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.php similarity index 93% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.php index da3c582b..065795fb 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItemBoxesBleed extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.php similarity index 93% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.php index 0d258183..3c4aa670 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutPagesItemBoxesMedia extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.php similarity index 93% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.php index 8c347e62..5edcb826 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItemBoxesMedia extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.php similarity index 94% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.php index 5d5bce50..cb8ace3c 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutPagesItemPdfCropBox extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox extends JsonSerializableType { /** * @var float $left diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemSize.php similarity index 91% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemSize.php index ede94684..596f585f 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemSize.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesReorder200ResponseLayoutPagesItemSize extends JsonSerializableType +class ChangeItemPagesInsertBlankLayoutPagesItemSize extends JsonSerializableType { /** * @var float $width diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php similarity index 75% rename from src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php rename to src/Types/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php index b0eea106..723e5cec 100644 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum DocPagesReorder200ResponseLayoutPagesItemTabOrder: string +enum ChangeItemPagesInsertBlankLayoutPagesItemTabOrder: string { case Rows = "rows"; case Columns = "columns"; diff --git a/src/Types/DocPagesInsert200ResponseLayout.php b/src/Types/ChangeItemPagesInsertLayout.php similarity index 58% rename from src/Types/DocPagesInsert200ResponseLayout.php rename to src/Types/ChangeItemPagesInsertLayout.php index cf6dc674..a570fe97 100644 --- a/src/Types/DocPagesInsert200ResponseLayout.php +++ b/src/Types/ChangeItemPagesInsertLayout.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesInsert200ResponseLayout extends JsonSerializableType +class ChangeItemPagesInsertLayout extends JsonSerializableType { /** * @var int $pageCount @@ -15,22 +15,22 @@ class DocPagesInsert200ResponseLayout extends JsonSerializableType public int $pageCount; /** - * @var array $pages + * @var array $pages */ - #[JsonProperty('pages'), ArrayType([DocPagesInsert200ResponseLayoutPagesItem::class])] + #[JsonProperty('pages'), ArrayType([ChangeItemPagesInsertLayoutPagesItem::class])] public array $pages; /** - * @var array $namedPages + * @var array $namedPages */ - #[JsonProperty('namedPages'), ArrayType([DocPagesInsert200ResponseLayoutNamedPagesItem::class])] + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesInsertLayoutNamedPagesItem::class])] public array $namedPages; /** * @param array{ * pageCount: int, - * pages: array, - * namedPages: array, + * pages: array, + * namedPages: array, * } $values */ public function __construct( diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItem.php similarity index 67% rename from src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php rename to src/Types/ChangeItemPagesInsertLayoutNamedPagesItem.php index 2607b30c..03ce1577 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php +++ b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutNamedPagesItem extends JsonSerializableType +class ChangeItemPagesInsertLayoutNamedPagesItem extends JsonSerializableType { /** * @var string $name @@ -14,15 +14,15 @@ class DocPagesDelete200ResponseLayoutNamedPagesItem extends JsonSerializableType public string $name; /** - * @var DocPagesDelete200ResponseLayoutNamedPagesItemTarget $target + * @var ChangeItemPagesInsertLayoutNamedPagesItemTarget $target */ #[JsonProperty('target')] - public DocPagesDelete200ResponseLayoutNamedPagesItemTarget $target; + public ChangeItemPagesInsertLayoutNamedPagesItemTarget $target; /** * @param array{ * name: string, - * target: DocPagesDelete200ResponseLayoutNamedPagesItemTarget, + * target: ChangeItemPagesInsertLayoutNamedPagesItemTarget, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php new file mode 100644 index 00000000..71800a7b --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param ChangeItemPagesInsertLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesInsertLayoutNamedPagesItemTarget + */ + public static function page(ChangeItemPagesInsertLayoutNamedPagesItemTargetPage $page): ChangeItemPagesInsertLayoutNamedPagesItemTarget + { + return new ChangeItemPagesInsertLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesInsertLayoutNamedPagesItemTarget + */ + public static function template(ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesInsertLayoutNamedPagesItemTarget + { + return new ChangeItemPagesInsertLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesInsertLayoutNamedPagesItemTarget + */ + public static function dangling(ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesInsertLayoutNamedPagesItemTarget + { + return new ChangeItemPagesInsertLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return ChangeItemPagesInsertLayoutNamedPagesItemTargetPage + */ + public function asPage(): ChangeItemPagesInsertLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = ChangeItemPagesInsertLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php similarity index 79% rename from src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php rename to src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php index 6775f1ea..758043c1 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php +++ b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php @@ -4,7 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; -class DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling extends JsonSerializableType +class ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling extends JsonSerializableType { /** * @param array{ diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php similarity index 85% rename from src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php rename to src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php index 7401111a..693c4654 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php +++ b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage extends JsonSerializableType +class ChangeItemPagesInsertLayoutNamedPagesItemTargetPage extends JsonSerializableType { /** * @var PageRef $page diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php similarity index 85% rename from src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php rename to src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php index 2e6789f6..2179a8f4 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate extends JsonSerializableType { /** * @var int $objectNumber diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItem.php b/src/Types/ChangeItemPagesInsertLayoutPagesItem.php similarity index 68% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItem.php rename to src/Types/ChangeItemPagesInsertLayoutPagesItem.php index dbf84d97..c5eac391 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItem extends JsonSerializableType +class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType { /** * @var int $index @@ -26,10 +26,10 @@ class DocPagesDelete200ResponseLayoutPagesItem extends JsonSerializableType public ?string $label; /** - * @var DocPagesDelete200ResponseLayoutPagesItemSize $size + * @var ChangeItemPagesInsertLayoutPagesItemSize $size */ #[JsonProperty('size')] - public DocPagesDelete200ResponseLayoutPagesItemSize $size; + public ChangeItemPagesInsertLayoutPagesItemSize $size; /** * @var float $rotation @@ -44,22 +44,22 @@ class DocPagesDelete200ResponseLayoutPagesItem extends JsonSerializableType public float $userUnit; /** - * @var ?value-of $tabOrder + * @var ?value-of $tabOrder */ #[JsonProperty('tabOrder')] public ?string $tabOrder; /** - * @var DocPagesDelete200ResponseLayoutPagesItemBoxes $boxes + * @var ChangeItemPagesInsertLayoutPagesItemBoxes $boxes */ #[JsonProperty('boxes')] - public DocPagesDelete200ResponseLayoutPagesItemBoxes $boxes; + public ChangeItemPagesInsertLayoutPagesItemBoxes $boxes; /** - * @var DocPagesDelete200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + * @var ChangeItemPagesInsertLayoutPagesItemPdfCropBox $pdfCropBox */ #[JsonProperty('pdfCropBox')] - public DocPagesDelete200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + public ChangeItemPagesInsertLayoutPagesItemPdfCropBox $pdfCropBox; /** * @var ?PdfPageActions $actions @@ -71,13 +71,13 @@ class DocPagesDelete200ResponseLayoutPagesItem extends JsonSerializableType * @param array{ * index: int, * ref: PageRef, - * size: DocPagesDelete200ResponseLayoutPagesItemSize, + * size: ChangeItemPagesInsertLayoutPagesItemSize, * rotation: float, * userUnit: float, - * boxes: DocPagesDelete200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesDelete200ResponseLayoutPagesItemPdfCropBox, + * boxes: ChangeItemPagesInsertLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesInsertLayoutPagesItemPdfCropBox, * label?: ?string, - * tabOrder?: ?value-of, + * tabOrder?: ?value-of, * actions?: ?PdfPageActions, * } $values */ diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.php new file mode 100644 index 00000000..40f9436f --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..5806e0f9 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesArt.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..605aa14c --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..b641154d --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..937513cc --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..a3b2dbac --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.php similarity index 92% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php rename to src/Types/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.php index 367dbe80..c2572c5c 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItemPdfCropBox extends JsonSerializableType +class ChangeItemPagesInsertLayoutPagesItemPdfCropBox extends JsonSerializableType { /** * @var float $left diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemSize.php similarity index 89% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php rename to src/Types/ChangeItemPagesInsertLayoutPagesItemSize.php index 135e1528..46b51192 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemSize.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutPagesItemSize extends JsonSerializableType +class ChangeItemPagesInsertLayoutPagesItemSize extends JsonSerializableType { /** * @var float $width diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemTabOrder.php similarity index 75% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php rename to src/Types/ChangeItemPagesInsertLayoutPagesItemTabOrder.php index 8e348410..120307dc 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItemTabOrder.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum DocPagesDelete200ResponseLayoutPagesItemTabOrder: string +enum ChangeItemPagesInsertLayoutPagesItemTabOrder: string { case Rows = "rows"; case Columns = "columns"; diff --git a/src/Types/DocPagesDelete200Response.php b/src/Types/ChangeItemPagesReorder.php similarity index 58% rename from src/Types/DocPagesDelete200Response.php rename to src/Types/ChangeItemPagesReorder.php index ac007f3d..b8b1c7a9 100644 --- a/src/Types/DocPagesDelete200Response.php +++ b/src/Types/ChangeItemPagesReorder.php @@ -4,14 +4,21 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; -class DocPagesDelete200Response extends JsonSerializableType +class ChangeItemPagesReorder extends JsonSerializableType { /** - * @var DocPagesDelete200ResponseLayout $layout + * @var array $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ChangeItemPagesReorderLayout $layout */ #[JsonProperty('layout')] - public DocPagesDelete200ResponseLayout $layout; + public ChangeItemPagesReorderLayout $layout; /** * @var MutationMeta $meta @@ -21,13 +28,15 @@ class DocPagesDelete200Response extends JsonSerializableType /** * @param array{ - * layout: DocPagesDelete200ResponseLayout, + * pages: array, + * layout: ChangeItemPagesReorderLayout, * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->pages = $values['pages']; $this->layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesDelete200ResponseLayout.php b/src/Types/ChangeItemPagesReorderLayout.php similarity index 58% rename from src/Types/DocPagesDelete200ResponseLayout.php rename to src/Types/ChangeItemPagesReorderLayout.php index 6093d671..19d8e273 100644 --- a/src/Types/DocPagesDelete200ResponseLayout.php +++ b/src/Types/ChangeItemPagesReorderLayout.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class DocPagesDelete200ResponseLayout extends JsonSerializableType +class ChangeItemPagesReorderLayout extends JsonSerializableType { /** * @var int $pageCount @@ -15,22 +15,22 @@ class DocPagesDelete200ResponseLayout extends JsonSerializableType public int $pageCount; /** - * @var array $pages + * @var array $pages */ - #[JsonProperty('pages'), ArrayType([DocPagesDelete200ResponseLayoutPagesItem::class])] + #[JsonProperty('pages'), ArrayType([ChangeItemPagesReorderLayoutPagesItem::class])] public array $pages; /** - * @var array $namedPages + * @var array $namedPages */ - #[JsonProperty('namedPages'), ArrayType([DocPagesDelete200ResponseLayoutNamedPagesItem::class])] + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesReorderLayoutNamedPagesItem::class])] public array $namedPages; /** * @param array{ * pageCount: int, - * pages: array, - * namedPages: array, + * pages: array, + * namedPages: array, * } $values */ public function __construct( diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItem.php similarity index 67% rename from src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php rename to src/Types/ChangeItemPagesReorderLayoutNamedPagesItem.php index eea9802b..695b3468 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php +++ b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutNamedPagesItem extends JsonSerializableType +class ChangeItemPagesReorderLayoutNamedPagesItem extends JsonSerializableType { /** * @var string $name @@ -14,15 +14,15 @@ class DocPagesInsert200ResponseLayoutNamedPagesItem extends JsonSerializableType public string $name; /** - * @var DocPagesInsert200ResponseLayoutNamedPagesItemTarget $target + * @var ChangeItemPagesReorderLayoutNamedPagesItemTarget $target */ #[JsonProperty('target')] - public DocPagesInsert200ResponseLayoutNamedPagesItemTarget $target; + public ChangeItemPagesReorderLayoutNamedPagesItemTarget $target; /** * @param array{ * name: string, - * target: DocPagesInsert200ResponseLayoutNamedPagesItemTarget, + * target: ChangeItemPagesReorderLayoutNamedPagesItemTarget, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php new file mode 100644 index 00000000..4eb6c8d4 --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param ChangeItemPagesReorderLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesReorderLayoutNamedPagesItemTarget + */ + public static function page(ChangeItemPagesReorderLayoutNamedPagesItemTargetPage $page): ChangeItemPagesReorderLayoutNamedPagesItemTarget + { + return new ChangeItemPagesReorderLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesReorderLayoutNamedPagesItemTarget + */ + public static function template(ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesReorderLayoutNamedPagesItemTarget + { + return new ChangeItemPagesReorderLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesReorderLayoutNamedPagesItemTarget + */ + public static function dangling(ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesReorderLayoutNamedPagesItemTarget + { + return new ChangeItemPagesReorderLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return ChangeItemPagesReorderLayoutNamedPagesItemTargetPage + */ + public function asPage(): ChangeItemPagesReorderLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = ChangeItemPagesReorderLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php similarity index 79% rename from src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php rename to src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php index 3dfba548..ee321312 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php +++ b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php @@ -4,7 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; -class DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling extends JsonSerializableType +class ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling extends JsonSerializableType { /** * @param array{ diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php similarity index 85% rename from src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php rename to src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php index cf9d82b4..610eb524 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php +++ b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage extends JsonSerializableType +class ChangeItemPagesReorderLayoutNamedPagesItemTargetPage extends JsonSerializableType { /** * @var PageRef $page diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php similarity index 85% rename from src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php rename to src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php index 08473ff4..a576bef4 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate extends JsonSerializableType { /** * @var int $objectNumber diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItem.php b/src/Types/ChangeItemPagesReorderLayoutPagesItem.php similarity index 68% rename from src/Types/DocPagesRotate200ResponseLayoutPagesItem.php rename to src/Types/ChangeItemPagesReorderLayoutPagesItem.php index b9b97ba1..ef58dda2 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutPagesItem extends JsonSerializableType +class ChangeItemPagesReorderLayoutPagesItem extends JsonSerializableType { /** * @var int $index @@ -26,10 +26,10 @@ class DocPagesRotate200ResponseLayoutPagesItem extends JsonSerializableType public ?string $label; /** - * @var DocPagesRotate200ResponseLayoutPagesItemSize $size + * @var ChangeItemPagesReorderLayoutPagesItemSize $size */ #[JsonProperty('size')] - public DocPagesRotate200ResponseLayoutPagesItemSize $size; + public ChangeItemPagesReorderLayoutPagesItemSize $size; /** * @var float $rotation @@ -44,22 +44,22 @@ class DocPagesRotate200ResponseLayoutPagesItem extends JsonSerializableType public float $userUnit; /** - * @var ?value-of $tabOrder + * @var ?value-of $tabOrder */ #[JsonProperty('tabOrder')] public ?string $tabOrder; /** - * @var DocPagesRotate200ResponseLayoutPagesItemBoxes $boxes + * @var ChangeItemPagesReorderLayoutPagesItemBoxes $boxes */ #[JsonProperty('boxes')] - public DocPagesRotate200ResponseLayoutPagesItemBoxes $boxes; + public ChangeItemPagesReorderLayoutPagesItemBoxes $boxes; /** - * @var DocPagesRotate200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + * @var ChangeItemPagesReorderLayoutPagesItemPdfCropBox $pdfCropBox */ #[JsonProperty('pdfCropBox')] - public DocPagesRotate200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + public ChangeItemPagesReorderLayoutPagesItemPdfCropBox $pdfCropBox; /** * @var ?PdfPageActions $actions @@ -71,13 +71,13 @@ class DocPagesRotate200ResponseLayoutPagesItem extends JsonSerializableType * @param array{ * index: int, * ref: PageRef, - * size: DocPagesRotate200ResponseLayoutPagesItemSize, + * size: ChangeItemPagesReorderLayoutPagesItemSize, * rotation: float, * userUnit: float, - * boxes: DocPagesRotate200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesRotate200ResponseLayoutPagesItemPdfCropBox, + * boxes: ChangeItemPagesReorderLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesReorderLayoutPagesItemPdfCropBox, * label?: ?string, - * tabOrder?: ?value-of, + * tabOrder?: ?value-of, * actions?: ?PdfPageActions, * } $values */ diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxes.php new file mode 100644 index 00000000..178b6204 --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..bfc9a67c --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesArt.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..e906bd2b --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..5845eaac --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..1240d2b4 --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..106dcfea --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.php similarity index 92% rename from src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php rename to src/Types/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.php index 6dc0ce01..21d48fb1 100644 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesRotate200ResponseLayoutPagesItemPdfCropBox extends JsonSerializableType +class ChangeItemPagesReorderLayoutPagesItemPdfCropBox extends JsonSerializableType { /** * @var float $left diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemSize.php similarity index 89% rename from src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php rename to src/Types/ChangeItemPagesReorderLayoutPagesItemSize.php index 82371858..e100381d 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemSize.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesDelete200ResponseLayoutPagesItemSize extends JsonSerializableType +class ChangeItemPagesReorderLayoutPagesItemSize extends JsonSerializableType { /** * @var float $width diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemTabOrder.php similarity index 75% rename from src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php rename to src/Types/ChangeItemPagesReorderLayoutPagesItemTabOrder.php index 005b1af9..ed32c822 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItemTabOrder.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum DocPagesInsert200ResponseLayoutPagesItemTabOrder: string +enum ChangeItemPagesReorderLayoutPagesItemTabOrder: string { case Rows = "rows"; case Columns = "columns"; diff --git a/src/Types/ChangeItemPagesRestore.php b/src/Types/ChangeItemPagesRestore.php new file mode 100644 index 00000000..8a863123 --- /dev/null +++ b/src/Types/ChangeItemPagesRestore.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ChangeItemPagesRestoreLayout $layout + */ + #[JsonProperty('layout')] + public ChangeItemPagesRestoreLayout $layout; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * pages: array, + * layout: ChangeItemPagesRestoreLayout, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayout.php b/src/Types/ChangeItemPagesRestoreLayout.php new file mode 100644 index 00000000..30e5b81e --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([ChangeItemPagesRestoreLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesRestoreLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItem.php new file mode 100644 index 00000000..23a54a5a --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php similarity index 58% rename from src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php rename to src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php index dbccc417..871fcea8 100644 --- a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php +++ b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; -class DocPagesInsert200ResponseLayoutNamedPagesItemTarget extends JsonSerializableType +class ChangeItemPagesRestoreLayoutNamedPagesItemTarget extends JsonSerializableType { /** * @var ( @@ -19,9 +19,9 @@ class DocPagesInsert200ResponseLayoutNamedPagesItemTarget extends JsonSerializab /** * @var ( - * DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage + * |ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling * |mixed * ) $value */ @@ -36,9 +36,9 @@ class DocPagesInsert200ResponseLayoutNamedPagesItemTarget extends JsonSerializab * |'_unknown' * ), * value: ( - * DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage + * |ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling * |mixed * ), * } $values @@ -51,36 +51,36 @@ private function __construct( } /** - * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget */ - public static function page(DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + public static function page(ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage $page): ChangeItemPagesRestoreLayoutNamedPagesItemTarget { - return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ 'kind' => 'page', 'value' => $page, ]); } /** - * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget */ - public static function template(DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + public static function template(ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesRestoreLayoutNamedPagesItemTarget { - return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ 'kind' => 'template', 'value' => $template, ]); } /** - * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget */ - public static function dangling(DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + public static function dangling(ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesRestoreLayoutNamedPagesItemTarget { - return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ 'kind' => 'dangling', 'value' => $dangling, ]); @@ -91,15 +91,15 @@ public static function dangling(DocPagesInsert200ResponseLayoutNamedPagesItemTar */ public function isPage(): bool { - return $this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage && $this->kind === 'page'; } /** - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage */ - public function asPage(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage + public function asPage(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage { - if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + if (!($this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { throw new Exception( "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -113,15 +113,15 @@ public function asPage(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetPag */ public function isTemplate(): bool { - return $this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; } /** - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate */ - public function asTemplate(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate + public function asTemplate(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate { - if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + if (!($this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { throw new Exception( "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -135,15 +135,15 @@ public function asTemplate(): DocPagesInsert200ResponseLayoutNamedPagesItemTarge */ public function isDangling(): bool { - return $this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; } /** - * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling */ - public function asDangling(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + public function asDangling(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling { - if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + if (!($this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { throw new Exception( "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -221,13 +221,13 @@ public static function jsonDeserialize(array $data): static $args['kind'] = $kind; switch ($kind) { case 'page': - $args['value'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage::jsonDeserialize($data); break; case 'template': - $args['value'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); break; case 'dangling': - $args['value'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); break; case '_unknown': default: diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 00000000..58f451db --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php new file mode 100644 index 00000000..a24308de --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 00000000..28c863b6 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php new file mode 100644 index 00000000..8321b1e4 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var ChangeItemPagesRestoreLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public ChangeItemPagesRestoreLayoutPagesItemBoxes $boxes; + + /** + * @var ChangeItemPagesRestoreLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public ChangeItemPagesRestoreLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: ChangeItemPagesRestoreLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: ChangeItemPagesRestoreLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesRestoreLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxes.php new file mode 100644 index 00000000..3d747e83 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..b14cc9f3 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..b7eb2524 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..005c89ac --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..3022de26 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..945ab9a1 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.php new file mode 100644 index 00000000..04fbdfcf --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemSize.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemSize.php new file mode 100644 index 00000000..ef396be4 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php new file mode 100644 index 00000000..6e7f3334 --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var float $rotation + */ + #[JsonProperty('rotation')] + public float $rotation; + + /** + * @var ChangeItemPagesRotateLayout $layout + */ + #[JsonProperty('layout')] + public ChangeItemPagesRotateLayout $layout; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * pages: array, + * rotation: float, + * layout: ChangeItemPagesRotateLayout, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->rotation = $values['rotation']; + $this->layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayout.php b/src/Types/ChangeItemPagesRotateLayout.php new file mode 100644 index 00000000..a9e77c17 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([ChangeItemPagesRotateLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesRotateLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItem.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItem.php new file mode 100644 index 00000000..a6bed53d --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php similarity index 58% rename from src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php rename to src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php index ee13a2db..6404fe05 100644 --- a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php +++ b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; -class DocPagesDelete200ResponseLayoutNamedPagesItemTarget extends JsonSerializableType +class ChangeItemPagesRotateLayoutNamedPagesItemTarget extends JsonSerializableType { /** * @var ( @@ -19,9 +19,9 @@ class DocPagesDelete200ResponseLayoutNamedPagesItemTarget extends JsonSerializab /** * @var ( - * DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesRotateLayoutNamedPagesItemTargetPage + * |ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling * |mixed * ) $value */ @@ -36,9 +36,9 @@ class DocPagesDelete200ResponseLayoutNamedPagesItemTarget extends JsonSerializab * |'_unknown' * ), * value: ( - * DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage - * |DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate - * |DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + * ChangeItemPagesRotateLayoutNamedPagesItemTargetPage + * |ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate + * |ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling * |mixed * ), * } $values @@ -51,36 +51,36 @@ private function __construct( } /** - * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget */ - public static function page(DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + public static function page(ChangeItemPagesRotateLayoutNamedPagesItemTargetPage $page): ChangeItemPagesRotateLayoutNamedPagesItemTarget { - return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ 'kind' => 'page', 'value' => $page, ]); } /** - * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget */ - public static function template(DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + public static function template(ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesRotateLayoutNamedPagesItemTarget { - return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ 'kind' => 'template', 'value' => $template, ]); } /** - * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget */ - public static function dangling(DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + public static function dangling(ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesRotateLayoutNamedPagesItemTarget { - return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ 'kind' => 'dangling', 'value' => $dangling, ]); @@ -91,15 +91,15 @@ public static function dangling(DocPagesDelete200ResponseLayoutNamedPagesItemTar */ public function isPage(): bool { - return $this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetPage && $this->kind === 'page'; } /** - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage + * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetPage */ - public function asPage(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage + public function asPage(): ChangeItemPagesRotateLayoutNamedPagesItemTargetPage { - if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + if (!($this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { throw new Exception( "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -113,15 +113,15 @@ public function asPage(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetPag */ public function isTemplate(): bool { - return $this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; } /** - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate + * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate */ - public function asTemplate(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate + public function asTemplate(): ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate { - if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + if (!($this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { throw new Exception( "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -135,15 +135,15 @@ public function asTemplate(): DocPagesDelete200ResponseLayoutNamedPagesItemTarge */ public function isDangling(): bool { - return $this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; } /** - * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling */ - public function asDangling(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + public function asDangling(): ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling { - if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + if (!($this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { throw new Exception( "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); @@ -221,13 +221,13 @@ public static function jsonDeserialize(array $data): static $args['kind'] = $kind; switch ($kind) { case 'page': - $args['value'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetPage::jsonDeserialize($data); break; case 'template': - $args['value'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); break; case 'dangling': - $args['value'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + $args['value'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); break; case '_unknown': default: diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 00000000..00639924 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php new file mode 100644 index 00000000..2c22f3c7 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 00000000..7b7de7f5 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItem.php b/src/Types/ChangeItemPagesRotateLayoutPagesItem.php new file mode 100644 index 00000000..ad773096 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var ChangeItemPagesRotateLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public ChangeItemPagesRotateLayoutPagesItemBoxes $boxes; + + /** + * @var ChangeItemPagesRotateLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public ChangeItemPagesRotateLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: ChangeItemPagesRotateLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: ChangeItemPagesRotateLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesRotateLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxes.php new file mode 100644 index 00000000..51fc9a9a --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..08e9b385 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesArt.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..7486bd15 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..07dc98c7 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..de4d986b --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..7895d530 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.php new file mode 100644 index 00000000..42b281af --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemSize.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemSize.php new file mode 100644 index 00000000..073482a3 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemTabOrder.php new file mode 100644 index 00000000..f2787a32 --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + 'outline.create', + 'value' => $outlineCreate, + ]); + } + + /** + * @param ChangeOpOutlineUpdate $outlineUpdate + * @return ChangeOp + */ + public static function outlineUpdate(ChangeOpOutlineUpdate $outlineUpdate): ChangeOp + { + return new ChangeOp([ + 'type' => 'outline.update', + 'value' => $outlineUpdate, + ]); + } + + /** + * @param ChangeOpOutlineMove $outlineMove + * @return ChangeOp + */ + public static function outlineMove(ChangeOpOutlineMove $outlineMove): ChangeOp + { + return new ChangeOp([ + 'type' => 'outline.move', + 'value' => $outlineMove, + ]); + } + + /** + * @param ChangeOpOutlineDelete $outlineDelete + * @return ChangeOp + */ + public static function outlineDelete(ChangeOpOutlineDelete $outlineDelete): ChangeOp + { + return new ChangeOp([ + 'type' => 'outline.delete', + 'value' => $outlineDelete, + ]); + } + + /** + * @param ChangeOpPagesRotate $pagesRotate + * @return ChangeOp + */ + public static function pagesRotate(ChangeOpPagesRotate $pagesRotate): ChangeOp + { + return new ChangeOp([ + 'type' => 'pages.rotate', + 'value' => $pagesRotate, + ]); + } + + /** + * @param ChangeOpPagesReorder $pagesReorder + * @return ChangeOp + */ + public static function pagesReorder(ChangeOpPagesReorder $pagesReorder): ChangeOp + { + return new ChangeOp([ + 'type' => 'pages.reorder', + 'value' => $pagesReorder, + ]); + } + + /** + * @param ChangeOpPagesDelete $pagesDelete + * @return ChangeOp + */ + public static function pagesDelete(ChangeOpPagesDelete $pagesDelete): ChangeOp + { + return new ChangeOp([ + 'type' => 'pages.delete', + 'value' => $pagesDelete, + ]); + } + + /** + * @param ChangeOpPagesInsertBlank $pagesInsertBlank + * @return ChangeOp + */ + public static function pagesInsertBlank(ChangeOpPagesInsertBlank $pagesInsertBlank): ChangeOp + { + return new ChangeOp([ + 'type' => 'pages.insertBlank', + 'value' => $pagesInsertBlank, + ]); + } + + /** + * @param ChangeOpPagesInsert $pagesInsert + * @return ChangeOp + */ + public static function pagesInsert(ChangeOpPagesInsert $pagesInsert): ChangeOp + { + return new ChangeOp([ + 'type' => 'pages.insert', + 'value' => $pagesInsert, + ]); + } + + /** + * @param ChangeOpAttachmentsCreate $attachmentsCreate + * @return ChangeOp + */ + public static function attachmentsCreate(ChangeOpAttachmentsCreate $attachmentsCreate): ChangeOp + { + return new ChangeOp([ + 'type' => 'attachments.create', + 'value' => $attachmentsCreate, + ]); + } + + /** + * @param ChangeOpAttachmentsDelete $attachmentsDelete + * @return ChangeOp + */ + public static function attachmentsDelete(ChangeOpAttachmentsDelete $attachmentsDelete): ChangeOp + { + return new ChangeOp([ + 'type' => 'attachments.delete', + 'value' => $attachmentsDelete, + ]); + } + /** * @return bool */ @@ -798,6 +974,248 @@ public function asMetadataUpdateCustom(): ChangeOpMetadataUpdateCustom return $this->value; } + /** + * @return bool + */ + public function isOutlineCreate(): bool + { + return $this->value instanceof ChangeOpOutlineCreate && $this->type === 'outline.create'; + } + + /** + * @return ChangeOpOutlineCreate + */ + public function asOutlineCreate(): ChangeOpOutlineCreate + { + if (!($this->value instanceof ChangeOpOutlineCreate && $this->type === 'outline.create')) { + throw new Exception( + "Expected outline.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineUpdate(): bool + { + return $this->value instanceof ChangeOpOutlineUpdate && $this->type === 'outline.update'; + } + + /** + * @return ChangeOpOutlineUpdate + */ + public function asOutlineUpdate(): ChangeOpOutlineUpdate + { + if (!($this->value instanceof ChangeOpOutlineUpdate && $this->type === 'outline.update')) { + throw new Exception( + "Expected outline.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineMove(): bool + { + return $this->value instanceof ChangeOpOutlineMove && $this->type === 'outline.move'; + } + + /** + * @return ChangeOpOutlineMove + */ + public function asOutlineMove(): ChangeOpOutlineMove + { + if (!($this->value instanceof ChangeOpOutlineMove && $this->type === 'outline.move')) { + throw new Exception( + "Expected outline.move; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isOutlineDelete(): bool + { + return $this->value instanceof ChangeOpOutlineDelete && $this->type === 'outline.delete'; + } + + /** + * @return ChangeOpOutlineDelete + */ + public function asOutlineDelete(): ChangeOpOutlineDelete + { + if (!($this->value instanceof ChangeOpOutlineDelete && $this->type === 'outline.delete')) { + throw new Exception( + "Expected outline.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesRotate(): bool + { + return $this->value instanceof ChangeOpPagesRotate && $this->type === 'pages.rotate'; + } + + /** + * @return ChangeOpPagesRotate + */ + public function asPagesRotate(): ChangeOpPagesRotate + { + if (!($this->value instanceof ChangeOpPagesRotate && $this->type === 'pages.rotate')) { + throw new Exception( + "Expected pages.rotate; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesReorder(): bool + { + return $this->value instanceof ChangeOpPagesReorder && $this->type === 'pages.reorder'; + } + + /** + * @return ChangeOpPagesReorder + */ + public function asPagesReorder(): ChangeOpPagesReorder + { + if (!($this->value instanceof ChangeOpPagesReorder && $this->type === 'pages.reorder')) { + throw new Exception( + "Expected pages.reorder; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesDelete(): bool + { + return $this->value instanceof ChangeOpPagesDelete && $this->type === 'pages.delete'; + } + + /** + * @return ChangeOpPagesDelete + */ + public function asPagesDelete(): ChangeOpPagesDelete + { + if (!($this->value instanceof ChangeOpPagesDelete && $this->type === 'pages.delete')) { + throw new Exception( + "Expected pages.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesInsertBlank(): bool + { + return $this->value instanceof ChangeOpPagesInsertBlank && $this->type === 'pages.insertBlank'; + } + + /** + * @return ChangeOpPagesInsertBlank + */ + public function asPagesInsertBlank(): ChangeOpPagesInsertBlank + { + if (!($this->value instanceof ChangeOpPagesInsertBlank && $this->type === 'pages.insertBlank')) { + throw new Exception( + "Expected pages.insertBlank; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPagesInsert(): bool + { + return $this->value instanceof ChangeOpPagesInsert && $this->type === 'pages.insert'; + } + + /** + * @return ChangeOpPagesInsert + */ + public function asPagesInsert(): ChangeOpPagesInsert + { + if (!($this->value instanceof ChangeOpPagesInsert && $this->type === 'pages.insert')) { + throw new Exception( + "Expected pages.insert; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAttachmentsCreate(): bool + { + return $this->value instanceof ChangeOpAttachmentsCreate && $this->type === 'attachments.create'; + } + + /** + * @return ChangeOpAttachmentsCreate + */ + public function asAttachmentsCreate(): ChangeOpAttachmentsCreate + { + if (!($this->value instanceof ChangeOpAttachmentsCreate && $this->type === 'attachments.create')) { + throw new Exception( + "Expected attachments.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAttachmentsDelete(): bool + { + return $this->value instanceof ChangeOpAttachmentsDelete && $this->type === 'attachments.delete'; + } + + /** + * @return ChangeOpAttachmentsDelete + */ + public function asAttachmentsDelete(): ChangeOpAttachmentsDelete + { + if (!($this->value instanceof ChangeOpAttachmentsDelete && $this->type === 'attachments.delete')) { + throw new Exception( + "Expected attachments.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return string */ @@ -898,6 +1316,50 @@ public function jsonSerialize(): array $value = $this->asMetadataUpdateCustom()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'outline.create': + $value = $this->asOutlineCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.update': + $value = $this->asOutlineUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.move': + $value = $this->asOutlineMove()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'outline.delete': + $value = $this->asOutlineDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.rotate': + $value = $this->asPagesRotate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.reorder': + $value = $this->asPagesReorder()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.delete': + $value = $this->asPagesDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.insertBlank': + $value = $this->asPagesInsertBlank()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pages.insert': + $value = $this->asPagesInsert()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'attachments.create': + $value = $this->asAttachmentsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'attachments.delete': + $value = $this->asAttachmentsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; case '_unknown': default: if (is_null($this->value)) { @@ -994,6 +1456,39 @@ public static function jsonDeserialize(array $data): static case 'metadata.updateCustom': $args['value'] = ChangeOpMetadataUpdateCustom::jsonDeserialize($data); break; + case 'outline.create': + $args['value'] = ChangeOpOutlineCreate::jsonDeserialize($data); + break; + case 'outline.update': + $args['value'] = ChangeOpOutlineUpdate::jsonDeserialize($data); + break; + case 'outline.move': + $args['value'] = ChangeOpOutlineMove::jsonDeserialize($data); + break; + case 'outline.delete': + $args['value'] = ChangeOpOutlineDelete::jsonDeserialize($data); + break; + case 'pages.rotate': + $args['value'] = ChangeOpPagesRotate::jsonDeserialize($data); + break; + case 'pages.reorder': + $args['value'] = ChangeOpPagesReorder::jsonDeserialize($data); + break; + case 'pages.delete': + $args['value'] = ChangeOpPagesDelete::jsonDeserialize($data); + break; + case 'pages.insertBlank': + $args['value'] = ChangeOpPagesInsertBlank::jsonDeserialize($data); + break; + case 'pages.insert': + $args['value'] = ChangeOpPagesInsert::jsonDeserialize($data); + break; + case 'attachments.create': + $args['value'] = ChangeOpAttachmentsCreate::jsonDeserialize($data); + break; + case 'attachments.delete': + $args['value'] = ChangeOpAttachmentsDelete::jsonDeserialize($data); + break; case '_unknown': default: $args['type'] = '_unknown'; diff --git a/src/Types/ChangeOpAttachmentsCreate.php b/src/Types/ChangeOpAttachmentsCreate.php new file mode 100644 index 00000000..dd602f0e --- /dev/null +++ b/src/Types/ChangeOpAttachmentsCreate.php @@ -0,0 +1,42 @@ +file = $values['file']; + $this->resources = $values['resources']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAttachmentsCreateResources.php b/src/Types/ChangeOpAttachmentsCreateResources.php new file mode 100644 index 00000000..c2486e80 --- /dev/null +++ b/src/Types/ChangeOpAttachmentsCreateResources.php @@ -0,0 +1,34 @@ +file = $values['file']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAttachmentsDelete.php b/src/Types/ChangeOpAttachmentsDelete.php new file mode 100644 index 00000000..1e1c4f7f --- /dev/null +++ b/src/Types/ChangeOpAttachmentsDelete.php @@ -0,0 +1,34 @@ +ref = $values['ref']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpOutlineCreate.php b/src/Types/ChangeOpOutlineCreate.php new file mode 100644 index 00000000..612464de --- /dev/null +++ b/src/Types/ChangeOpOutlineCreate.php @@ -0,0 +1,65 @@ + + * |OutlinePositionAfter + * )|null $position + */ + #[JsonProperty('position'), Union('string', OutlinePositionAfter::class, 'null')] + public string|OutlinePositionAfter|null $position; + + /** + * @var OutlineItemDraft $data + */ + #[JsonProperty('data')] + public OutlineItemDraft $data; + + /** + * @var ?int $objectNumber + */ + #[JsonProperty('objectNumber')] + public ?int $objectNumber; + + /** + * @param array{ + * data: OutlineItemDraft, + * parent?: ?OutlineItemRef, + * position?: ( + * value-of + * |OutlinePositionAfter + * )|null, + * objectNumber?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->parent = $values['parent'] ?? null; + $this->position = $values['position'] ?? null; + $this->data = $values['data']; + $this->objectNumber = $values['objectNumber'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpOutlineDelete.php b/src/Types/ChangeOpOutlineDelete.php new file mode 100644 index 00000000..940ee291 --- /dev/null +++ b/src/Types/ChangeOpOutlineDelete.php @@ -0,0 +1,42 @@ +ref = $values['ref']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpOutlineMove.php b/src/Types/ChangeOpOutlineMove.php new file mode 100644 index 00000000..618abab0 --- /dev/null +++ b/src/Types/ChangeOpOutlineMove.php @@ -0,0 +1,58 @@ + $refs + */ + #[JsonProperty('refs'), ArrayType([OutlineItemRef::class])] + public array $refs; + + /** + * @var ?OutlineItemRef $parent + */ + #[JsonProperty('parent')] + public ?OutlineItemRef $parent; + + /** + * @var ( + * value-of + * |OutlinePositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', OutlinePositionAfter::class)] + public string|OutlinePositionAfter $position; + + /** + * @param array{ + * refs: array, + * position: ( + * value-of + * |OutlinePositionAfter + * ), + * parent?: ?OutlineItemRef, + * } $values + */ + public function __construct( + array $values, + ) { + $this->refs = $values['refs']; + $this->parent = $values['parent'] ?? null; + $this->position = $values['position']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpOutlineUpdate.php b/src/Types/ChangeOpOutlineUpdate.php new file mode 100644 index 00000000..3291dc54 --- /dev/null +++ b/src/Types/ChangeOpOutlineUpdate.php @@ -0,0 +1,50 @@ +ref = $values['ref']; + $this->patch = $values['patch']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesDelete.php b/src/Types/ChangeOpPagesDelete.php new file mode 100644 index 00000000..8ef9122a --- /dev/null +++ b/src/Types/ChangeOpPagesDelete.php @@ -0,0 +1,35 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @param array{ + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsert.php b/src/Types/ChangeOpPagesInsert.php new file mode 100644 index 00000000..e0b347b3 --- /dev/null +++ b/src/Types/ChangeOpPagesInsert.php @@ -0,0 +1,49 @@ + + * |PagePositionAfter + * )|null $position + */ + #[JsonProperty('position'), Union('string', PagePositionAfter::class, 'null')] + public string|PagePositionAfter|null $position; + + /** + * @param array{ + * resources: ChangeOpPagesInsertResources, + * position?: ( + * value-of + * |PagePositionAfter + * )|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->resources = $values['resources']; + $this->position = $values['position'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsertBlank.php b/src/Types/ChangeOpPagesInsertBlank.php new file mode 100644 index 00000000..dbf2f882 --- /dev/null +++ b/src/Types/ChangeOpPagesInsertBlank.php @@ -0,0 +1,58 @@ + + * |PagePositionAfter + * )|null $position + */ + #[JsonProperty('position'), Union('string', PagePositionAfter::class, 'null')] + public string|PagePositionAfter|null $position; + + /** + * @var ?array $objectNumbers + */ + #[JsonProperty('objectNumbers'), ArrayType(['integer'])] + public ?array $objectNumbers; + + /** + * @param array{ + * spec: ChangeOpPagesInsertBlankSpec, + * position?: ( + * value-of + * |PagePositionAfter + * )|null, + * objectNumbers?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->spec = $values['spec']; + $this->position = $values['position'] ?? null; + $this->objectNumbers = $values['objectNumbers'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsertBlankSpec.php b/src/Types/ChangeOpPagesInsertBlankSpec.php new file mode 100644 index 00000000..1387a37d --- /dev/null +++ b/src/Types/ChangeOpPagesInsertBlankSpec.php @@ -0,0 +1,42 @@ +size = $values['size']; + $this->count = $values['count'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsertBlankSpecSize.php b/src/Types/ChangeOpPagesInsertBlankSpecSize.php new file mode 100644 index 00000000..2f92141a --- /dev/null +++ b/src/Types/ChangeOpPagesInsertBlankSpecSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsertResources.php b/src/Types/ChangeOpPagesInsertResources.php new file mode 100644 index 00000000..7de2c652 --- /dev/null +++ b/src/Types/ChangeOpPagesInsertResources.php @@ -0,0 +1,34 @@ +source = $values['source']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesReorder.php b/src/Types/ChangeOpPagesReorder.php new file mode 100644 index 00000000..84b96328 --- /dev/null +++ b/src/Types/ChangeOpPagesReorder.php @@ -0,0 +1,50 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ( + * value-of + * |PagePositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', PagePositionAfter::class)] + public string|PagePositionAfter $position; + + /** + * @param array{ + * pages: array, + * position: ( + * value-of + * |PagePositionAfter + * ), + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->position = $values['position']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesRotate.php b/src/Types/ChangeOpPagesRotate.php new file mode 100644 index 00000000..59bb698e --- /dev/null +++ b/src/Types/ChangeOpPagesRotate.php @@ -0,0 +1,43 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var float $rotation + */ + #[JsonProperty('rotation')] + public float $rotation; + + /** + * @param array{ + * pages: array, + * rotation: float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->rotation = $values['rotation']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200Response.php b/src/Types/DocManifest200Response.php index 90d2e32a..1cc8b916 100644 --- a/src/Types/DocManifest200Response.php +++ b/src/Types/DocManifest200Response.php @@ -50,6 +50,12 @@ class DocManifest200Response extends JsonSerializableType #[JsonProperty('formsVersion')] public ?int $formsVersion; + /** + * @var ?int $outlineVersion + */ + #[JsonProperty('outlineVersion')] + public ?int $outlineVersion; + /** * @var int $auditHead */ @@ -110,6 +116,7 @@ class DocManifest200Response extends JsonSerializableType * attachmentsVersion?: ?int, * annotationsVersion?: ?int, * formsVersion?: ?int, + * outlineVersion?: ?int, * layerVersion?: ?int, * working?: ?bool, * baseByteLength?: ?int, @@ -127,6 +134,7 @@ public function __construct( $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; $this->annotationsVersion = $values['annotationsVersion'] ?? null; $this->formsVersion = $values['formsVersion'] ?? null; + $this->outlineVersion = $values['outlineVersion'] ?? null; $this->auditHead = $values['auditHead']; $this->baseSha = $values['baseSha']; $this->layerVersion = $values['layerVersion'] ?? null; diff --git a/src/Types/DocManifest200ResponseScopes.php b/src/Types/DocManifest200ResponseScopes.php index 096e2878..4059e892 100644 --- a/src/Types/DocManifest200ResponseScopes.php +++ b/src/Types/DocManifest200ResponseScopes.php @@ -49,6 +49,12 @@ class DocManifest200ResponseScopes extends JsonSerializableType #[JsonProperty('actions')] public string $actions; + /** + * @var value-of $outline + */ + #[JsonProperty('outline')] + public string $outline; + /** * @param array{ * content: value-of, @@ -58,6 +64,7 @@ class DocManifest200ResponseScopes extends JsonSerializableType * attachments: value-of, * metadata: value-of, * actions: value-of, + * outline: value-of, * } $values */ public function __construct( @@ -70,6 +77,7 @@ public function __construct( $this->attachments = $values['attachments']; $this->metadata = $values['metadata']; $this->actions = $values['actions']; + $this->outline = $values['outline']; } /** diff --git a/src/Types/DocManifest200ResponseScopesOutline.php b/src/Types/DocManifest200ResponseScopesOutline.php new file mode 100644 index 00000000..670ea259 --- /dev/null +++ b/src/Types/DocManifest200ResponseScopesOutline.php @@ -0,0 +1,9 @@ +media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 185ac764..00000000 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index ef60cb4d..00000000 --- a/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxes.php deleted file mode 100644 index 15bc69cb..00000000 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxes.php +++ /dev/null @@ -1,66 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 944414b6..00000000 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 9e4efb7f..00000000 --- a/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayout.php b/src/Types/DocPagesInsertBlank200ResponseLayout.php deleted file mode 100644 index 0fe8f6db..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayout.php +++ /dev/null @@ -1,51 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesInsertBlank200ResponseLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([DocPagesInsertBlank200ResponseLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php deleted file mode 100644 index 4317ab40..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - */ - public static function page(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - */ - public static function template(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - */ - public static function dangling(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage - */ - public function asPage(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage - { - if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { - throw new Exception( - "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate - { - if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { - throw new Exception( - "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling - { - if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { - throw new Exception( - "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'page': - $value = $this->asPage()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'template': - $value = $this->asTemplate()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'dangling': - $value = $this->asDangling()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'page': - $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 71b6d857..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php deleted file mode 100644 index 2601d507..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var DocPagesInsertBlank200ResponseLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public DocPagesInsertBlank200ResponseLayoutPagesItemBoxes $boxes; - - /** - * @var DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: DocPagesInsertBlank200ResponseLayoutPagesItemSize, - * rotation: float, - * userUnit: float, - * boxes: DocPagesInsertBlank200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox, - * label?: ?string, - * tabOrder?: ?value-of, - * actions?: ?PdfPageActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->ref = $values['ref']; - $this->label = $values['label'] ?? null; - $this->size = $values['size']; - $this->rotation = $values['rotation']; - $this->userUnit = $values['userUnit']; - $this->tabOrder = $values['tabOrder'] ?? null; - $this->boxes = $values['boxes']; - $this->pdfCropBox = $values['pdfCropBox']; - $this->actions = $values['actions'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.php deleted file mode 100644 index ce883d96..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.php +++ /dev/null @@ -1,66 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index a5ccfb83..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 4e5fa23d..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 902bfb9e..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 5f576f0c..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index b689a111..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php deleted file mode 100644 index dd22bfe5..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->bottom = $values['bottom']; - $this->right = $values['right']; - $this->top = $values['top']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php deleted file mode 100644 index ff834226..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php +++ /dev/null @@ -1,42 +0,0 @@ -width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php deleted file mode 100644 index 03b89045..00000000 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index 51933228..00000000 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 65eb2cec..00000000 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 88523c74..00000000 --- a/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxes.php deleted file mode 100644 index cfdece9b..00000000 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxes.php +++ /dev/null @@ -1,66 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 2c19f9c0..00000000 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index fc62be59..00000000 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 6f5c6270..00000000 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 41dce0cc..00000000 --- a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentOutline.php b/src/Types/DocumentOutline.php new file mode 100644 index 00000000..8c20dc62 --- /dev/null +++ b/src/Types/DocumentOutline.php @@ -0,0 +1,43 @@ + $items + */ + #[JsonProperty('items'), ArrayType([OutlineItem::class])] + public array $items; + + /** + * @var bool $incomplete + */ + #[JsonProperty('incomplete')] + public bool $incomplete; + + /** + * @param array{ + * items: array, + * incomplete: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->items = $values['items']; + $this->incomplete = $values['incomplete']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlineItem.php b/src/Types/OutlineItem.php new file mode 100644 index 00000000..9c5b45b0 --- /dev/null +++ b/src/Types/OutlineItem.php @@ -0,0 +1,98 @@ +ref = $values['ref']; + $this->parent = $values['parent'] ?? null; + $this->title = $values['title']; + $this->target = $values['target'] ?? null; + $this->action = $values['action'] ?? null; + $this->open = $values['open']; + $this->color = $values['color'] ?? null; + $this->bold = $values['bold']; + $this->italic = $values['italic']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlineItemDraft.php b/src/Types/OutlineItemDraft.php new file mode 100644 index 00000000..1d1c6a99 --- /dev/null +++ b/src/Types/OutlineItemDraft.php @@ -0,0 +1,66 @@ +title = $values['title']; + $this->target = $values['target'] ?? null; + $this->color = $values['color'] ?? null; + $this->bold = $values['bold'] ?? null; + $this->italic = $values['italic'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlineItemPatch.php b/src/Types/OutlineItemPatch.php new file mode 100644 index 00000000..f5d8ed96 --- /dev/null +++ b/src/Types/OutlineItemPatch.php @@ -0,0 +1,74 @@ +title = $values['title'] ?? null; + $this->target = $values['target'] ?? null; + $this->color = $values['color'] ?? null; + $this->bold = $values['bold'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->open = $values['open'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/OutlineItemRef.php similarity index 69% rename from src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php rename to src/Types/OutlineItemRef.php index 47b99ce4..2895f341 100644 --- a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/OutlineItemRef.php @@ -5,8 +5,14 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class OutlineItemRef extends JsonSerializableType { + /** + * @var value-of $kind + */ + #[JsonProperty('kind')] + public string $kind; + /** * @var int $objectNumber */ @@ -15,12 +21,14 @@ class DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate extends J /** * @param array{ + * kind: value-of, * objectNumber: int, * } $values */ public function __construct( array $values, ) { + $this->kind = $values['kind']; $this->objectNumber = $values['objectNumber']; } diff --git a/src/Types/OutlineItemRefKind.php b/src/Types/OutlineItemRefKind.php new file mode 100644 index 00000000..5fc7e6bc --- /dev/null +++ b/src/Types/OutlineItemRefKind.php @@ -0,0 +1,8 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([PageRef::class])] + public array $affectedPages; + + /** + * @var ?CacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?CacheDelta $cacheDelta; + + /** + * @var string $opId + */ + #[JsonProperty('opId')] + public string $opId; + + /** + * @var bool $undoable + */ + #[JsonProperty('undoable')] + public bool $undoable; + + /** + * @var array $changed + */ + #[JsonProperty('changed'), ArrayType([OutlineItemRef::class])] + public array $changed; + + /** + * @param array{ + * affectedPages: array, + * opId: string, + * undoable: bool, + * changed: array, + * cacheDelta?: ?CacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + $this->opId = $values['opId']; + $this->undoable = $values['undoable']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlineOrder.php b/src/Types/OutlineOrder.php new file mode 100644 index 00000000..6bdc278f --- /dev/null +++ b/src/Types/OutlineOrder.php @@ -0,0 +1,43 @@ + $children + */ + #[JsonProperty('children'), ArrayType([OutlineItemRef::class])] + public array $children; + + /** + * @param array{ + * children: array, + * parent?: ?OutlineItemRef, + * } $values + */ + public function __construct( + array $values, + ) { + $this->parent = $values['parent'] ?? null; + $this->children = $values['children']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlinePositionAfter.php b/src/Types/OutlinePositionAfter.php new file mode 100644 index 00000000..ac8ca7c5 --- /dev/null +++ b/src/Types/OutlinePositionAfter.php @@ -0,0 +1,42 @@ +before = $values['before'] ?? null; + $this->after = $values['after'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlinePositionZero.php b/src/Types/OutlinePositionZero.php new file mode 100644 index 00000000..eefa11bc --- /dev/null +++ b/src/Types/OutlinePositionZero.php @@ -0,0 +1,9 @@ +