diff --git a/.fern/metadata.json b/.fern/metadata.json index 048ce620..d91dfb8c 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "af7d3403e384b397d49fca3bcf3e8afd5f869325", + "originGitCommit": "37273d7d149f893255344f0f8e9ff7b2dfbc8057", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0", + "requestedVersion": "3.1.0", "ciProvider": "github", - "sdkVersion": "3.0.0" + "sdkVersion": "3.1.0" } \ No newline at end of file diff --git a/README.md b/README.md index 2d351b97..b5e64346 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ use CloudPDF\Doc\Requests\DocChangesRequest; use CloudPDF\Doc\Types\DocChangesRequestChangesItem; $client = new CloudPDFClient( - embedPdfVersion: '3.0', + embedPdfVersion: '3.1', token: '', ); $client->doc->changes( diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index dcdd4bf7..a28cf848 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0", - "sdkVersion": "3.0.0", + "canonicalVersion": "3.1.0", + "sdkVersion": "3.1.0", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "824b5b739971d3e536e9e5db28a67562867e3900df006fc2e77eb15bcb23cd8d", - "gitCommit": "af7d3403e384b397d49fca3bcf3e8afd5f869325", + "openapiSha256": "5e62a5502b502635c63f989110a74f98a9f7f3f3a3696d6f1fccb4ea39e1efe3", + "gitCommit": "37273d7d149f893255344f0f8e9ff7b2dfbc8057", "gitCommitIsDirty": false }, "fern": { diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 55148b84..8a300e33 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -82,11 +82,11 @@ public function __construct( ?array $options = null, ) { $defaultHeaders = [ - 'EmbedPDF-Version' => '3.0', + 'EmbedPDF-Version' => '3.1', 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0', - 'User-Agent' => 'cloudpdf/sdk/3.0.0', + 'X-Fern-SDK-Version' => '3.1.0', + 'User-Agent' => 'cloudpdf/sdk/3.1.0', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Types/CacheDelta.php b/src/Types/CacheDelta.php index 00b8e14e..517264ea 100644 --- a/src/Types/CacheDelta.php +++ b/src/Types/CacheDelta.php @@ -56,6 +56,12 @@ class CacheDelta extends JsonSerializableType #[JsonProperty('outlineVersion')] public ?int $outlineVersion; + /** + * @var ?int $viewportsVersion + */ + #[JsonProperty('viewportsVersion')] + public ?int $viewportsVersion; + /** * @var ?int $fontsVersion */ @@ -97,6 +103,7 @@ class CacheDelta extends JsonSerializableType * metadataVersion?: ?int, * attachmentsVersion?: ?int, * outlineVersion?: ?int, + * viewportsVersion?: ?int, * fontsVersion?: ?int, * contentsVersion?: ?int, * layerVersion?: ?int, @@ -114,6 +121,7 @@ public function __construct( $this->metadataVersion = $values['metadataVersion'] ?? null; $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; $this->outlineVersion = $values['outlineVersion'] ?? null; + $this->viewportsVersion = $values['viewportsVersion'] ?? null; $this->fontsVersion = $values['fontsVersion'] ?? null; $this->contentsVersion = $values['contentsVersion'] ?? null; $this->layerVersion = $values['layerVersion'] ?? null; diff --git a/src/Types/ChangeItem.php b/src/Types/ChangeItem.php index 14fe0ba0..c6bd0341 100644 --- a/src/Types/ChangeItem.php +++ b/src/Types/ChangeItem.php @@ -39,6 +39,7 @@ class ChangeItem extends JsonSerializableType * |'outline.delete' * |'outline.restore' * |'pages.rotate' + * |'pages.setScale' * |'pages.reorder' * |'pages.delete' * |'pages.insertBlank' @@ -85,6 +86,7 @@ class ChangeItem extends JsonSerializableType * |ChangeItemOutlineDelete * |ChangeItemOutlineRestore * |ChangeItemPagesRotate + * |ChangeItemPagesSetScale * |ChangeItemPagesReorder * |ChangeItemPagesDelete * |ChangeItemPagesInsertBlank @@ -132,6 +134,7 @@ class ChangeItem extends JsonSerializableType * |'outline.delete' * |'outline.restore' * |'pages.rotate' + * |'pages.setScale' * |'pages.reorder' * |'pages.delete' * |'pages.insertBlank' @@ -174,6 +177,7 @@ class ChangeItem extends JsonSerializableType * |ChangeItemOutlineDelete * |ChangeItemOutlineRestore * |ChangeItemPagesRotate + * |ChangeItemPagesSetScale * |ChangeItemPagesReorder * |ChangeItemPagesDelete * |ChangeItemPagesInsertBlank @@ -554,6 +558,18 @@ public static function pagesRotate(ChangeItemPagesRotate $pagesRotate): ChangeIt ]); } + /** + * @param ChangeItemPagesSetScale $pagesSetScale + * @return ChangeItem + */ + public static function pagesSetScale(ChangeItemPagesSetScale $pagesSetScale): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.setScale', + 'value' => $pagesSetScale, + ]); + } + /** * @param ChangeItemPagesReorder $pagesReorder * @return ChangeItem @@ -1322,6 +1338,28 @@ public function asPagesRotate(): ChangeItemPagesRotate return $this->value; } + /** + * @return bool + */ + public function isPagesSetScale(): bool + { + return $this->value instanceof ChangeItemPagesSetScale && $this->type === 'pages.setScale'; + } + + /** + * @return ChangeItemPagesSetScale + */ + public function asPagesSetScale(): ChangeItemPagesSetScale + { + if (!($this->value instanceof ChangeItemPagesSetScale && $this->type === 'pages.setScale')) { + throw new Exception( + "Expected pages.setScale; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1660,6 +1698,10 @@ public function jsonSerialize(): array $value = $this->asPagesRotate()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'pages.setScale': + $value = $this->asPagesSetScale()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'pages.reorder': $value = $this->asPagesReorder()->jsonSerialize(); $result = array_merge($value, $result); @@ -1822,6 +1864,9 @@ public static function jsonDeserialize(array $data): static case 'pages.rotate': $args['value'] = ChangeItemPagesRotate::jsonDeserialize($data); break; + case 'pages.setScale': + $args['value'] = ChangeItemPagesSetScale::jsonDeserialize($data); + break; case 'pages.reorder': $args['value'] = ChangeItemPagesReorder::jsonDeserialize($data); break; diff --git a/src/Types/ChangeItemPagesCopy.php b/src/Types/ChangeItemPagesCopy.php index 7269f8df..b17644e1 100644 --- a/src/Types/ChangeItemPagesCopy.php +++ b/src/Types/ChangeItemPagesCopy.php @@ -15,10 +15,10 @@ class ChangeItemPagesCopy extends JsonSerializableType public array $insertedPages; /** - * @var ChangeItemPagesCopyLayout $layout + * @var PageListSnapshot $layout */ #[JsonProperty('layout')] - public ChangeItemPagesCopyLayout $layout; + public PageListSnapshot $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class ChangeItemPagesCopy extends JsonSerializableType /** * @param array{ * insertedPages: array, - * layout: ChangeItemPagesCopyLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItem.php b/src/Types/ChangeItemPagesCopyLayoutPagesItem.php deleted file mode 100644 index 8972948d..00000000 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var ChangeItemPagesCopyLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public ChangeItemPagesCopyLayoutPagesItemBoxes $boxes; - - /** - * @var ChangeItemPagesCopyLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public ChangeItemPagesCopyLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: ChangeItemPagesCopyLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: ChangeItemPagesCopyLayoutPagesItemBoxes, - * pdfCropBox: ChangeItemPagesCopyLayoutPagesItemPdfCropBox, - * 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/ChangeItemPagesCopyLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxes.php deleted file mode 100644 index 8349621a..00000000 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxes.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/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.php deleted file mode 100644 index c50b4c91..00000000 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.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/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 54168baf..00000000 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.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/ChangeItemPagesDelete.php b/src/Types/ChangeItemPagesDelete.php index 7b6381a7..2a91d1bd 100644 --- a/src/Types/ChangeItemPagesDelete.php +++ b/src/Types/ChangeItemPagesDelete.php @@ -15,10 +15,10 @@ class ChangeItemPagesDelete extends JsonSerializableType public array $pages; /** - * @var ChangeItemPagesDeleteLayout $layout + * @var PageListSnapshot $layout */ #[JsonProperty('layout')] - public ChangeItemPagesDeleteLayout $layout; + public PageListSnapshot $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class ChangeItemPagesDelete extends JsonSerializableType /** * @param array{ * pages: array, - * layout: ChangeItemPagesDeleteLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesDeleteLayout.php b/src/Types/ChangeItemPagesDeleteLayout.php deleted file mode 100644 index c945db81..00000000 --- a/src/Types/ChangeItemPagesDeleteLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesDeleteLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesDeleteLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesDeleteLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php b/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php deleted file mode 100644 index a4a05743..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php deleted file mode 100644 index 7b79e191..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php deleted file mode 100644 index 43babd4e..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage $page - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget - */ - public static function page(ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage $page): ChangeItemPagesDeleteLayoutNamedPagesItemTarget - { - return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate $template - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget - */ - public static function template(ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesDeleteLayoutNamedPagesItemTarget - { - return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling $dangling - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTarget - */ - public static function dangling(ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesDeleteLayoutNamedPagesItemTarget - { - return new ChangeItemPagesDeleteLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage - */ - public function asPage(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling - { - 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), - ); - } - - 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'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling::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/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index e9efcec5..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 21ed674a..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 0b6ef778..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php deleted file mode 100644 index 2798487e..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var ChangeItemPagesDeleteLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public ChangeItemPagesDeleteLayoutPagesItemBoxes $boxes; - - /** - * @var ChangeItemPagesDeleteLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public ChangeItemPagesDeleteLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: ChangeItemPagesDeleteLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: ChangeItemPagesDeleteLayoutPagesItemBoxes, - * pdfCropBox: ChangeItemPagesDeleteLayoutPagesItemPdfCropBox, - * 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/ChangeItemPagesDeleteLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxes.php deleted file mode 100644 index 94802dee..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxes.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/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.php deleted file mode 100644 index 838e5565..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesArt.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/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 98f882cf..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesBleed.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/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 645a9d8a..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesCrop.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/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 7506ac3a..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesMedia.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/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 1d35c122..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemBoxesTrim.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/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.php deleted file mode 100644 index fc468af9..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemPdfCropBox.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/ChangeItemPagesDeleteLayoutPagesItemSize.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemSize.php deleted file mode 100644 index 52256767..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemSize.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/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php deleted file mode 100644 index 54e48bad..00000000 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -, - * layout: ChangeItemPagesInsertLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesInsertBlank.php b/src/Types/ChangeItemPagesInsertBlank.php index 308958cd..d7ed122c 100644 --- a/src/Types/ChangeItemPagesInsertBlank.php +++ b/src/Types/ChangeItemPagesInsertBlank.php @@ -15,10 +15,10 @@ class ChangeItemPagesInsertBlank extends JsonSerializableType public array $insertedPages; /** - * @var ChangeItemPagesInsertBlankLayout $layout + * @var PageListSnapshot $layout */ #[JsonProperty('layout')] - public ChangeItemPagesInsertBlankLayout $layout; + public PageListSnapshot $layout; /** * @var MutationMeta $meta @@ -29,7 +29,7 @@ class ChangeItemPagesInsertBlank extends JsonSerializableType /** * @param array{ * insertedPages: array, - * layout: ChangeItemPagesInsertBlankLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesInsertBlankLayout.php b/src/Types/ChangeItemPagesInsertBlankLayout.php deleted file mode 100644 index fcb65e0b..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesInsertBlankLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesInsertBlankLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesInsertBlankLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php deleted file mode 100644 index 1dafaec4..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php deleted file mode 100644 index b0ee7983..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php deleted file mode 100644 index d06db7b6..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage $page - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - */ - public static function page(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage $page): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - { - return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate $template - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - */ - public static function template(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - { - return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling $dangling - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - */ - public static function dangling(ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget - { - return new ChangeItemPagesInsertBlankLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage - */ - public function asPage(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling - { - 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), - ); - } - - 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'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling::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/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 59c844c7..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 1e859c87..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 1ee76154..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php deleted file mode 100644 index 42783999..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var ChangeItemPagesInsertBlankLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public ChangeItemPagesInsertBlankLayoutPagesItemBoxes $boxes; - - /** - * @var ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: ChangeItemPagesInsertBlankLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: ChangeItemPagesInsertBlankLayoutPagesItemBoxes, - * pdfCropBox: ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox, - * 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/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.php deleted file mode 100644 index e0ff95b9..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxes.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/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.php deleted file mode 100644 index e13ecea0..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesArt.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/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 8ad901a6..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesBleed.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/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 065795fb..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesCrop.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/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 3c4aa670..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesMedia.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/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 5edcb826..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemBoxesTrim.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/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.php deleted file mode 100644 index cb8ace3c..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox.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/ChangeItemPagesInsertBlankLayoutPagesItemSize.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemSize.php deleted file mode 100644 index 596f585f..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemSize.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/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php deleted file mode 100644 index 723e5cec..00000000 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesInsertLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesInsertLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesInsertLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php b/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php deleted file mode 100644 index a1a9d9f3..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php deleted file mode 100644 index bc85beb2..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php deleted file mode 100644 index 71800a7b..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -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/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 758043c1..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 693c4654..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 2179a8f4..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.php deleted file mode 100644 index 40f9436f..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxes.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/ChangeItemPagesInsertLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesArt.php deleted file mode 100644 index 5806e0f9..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesArt.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/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 605aa14c..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesBleed.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/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.php deleted file mode 100644 index b641154d..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesCrop.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/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 937513cc..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesMedia.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/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.php deleted file mode 100644 index a3b2dbac..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemBoxesTrim.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/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.php deleted file mode 100644 index c2572c5c..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemPdfCropBox.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/ChangeItemPagesInsertLayoutPagesItemSize.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemSize.php deleted file mode 100644 index 46b51192..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemSize.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/ChangeItemPagesInsertLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesInsertLayoutPagesItemTabOrder.php deleted file mode 100644 index 120307dc..00000000 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -, - * layout: ChangeItemPagesReorderLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesReorderLayout.php b/src/Types/ChangeItemPagesReorderLayout.php deleted file mode 100644 index e4e9785b..00000000 --- a/src/Types/ChangeItemPagesReorderLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesReorderLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesReorderLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesReorderLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php b/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php deleted file mode 100644 index 27561055..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php deleted file mode 100644 index de917a56..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php deleted file mode 100644 index 4eb6c8d4..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -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/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index ee321312..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 610eb524..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index a576bef4..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItem.php b/src/Types/ChangeItemPagesReorderLayoutPagesItem.php deleted file mode 100644 index fbbdef0a..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var ChangeItemPagesReorderLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public ChangeItemPagesReorderLayoutPagesItemBoxes $boxes; - - /** - * @var ChangeItemPagesReorderLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public ChangeItemPagesReorderLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: ChangeItemPagesReorderLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: ChangeItemPagesReorderLayoutPagesItemBoxes, - * pdfCropBox: ChangeItemPagesReorderLayoutPagesItemPdfCropBox, - * 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/ChangeItemPagesReorderLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxes.php deleted file mode 100644 index 178b6204..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxes.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/ChangeItemPagesReorderLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesArt.php deleted file mode 100644 index bfc9a67c..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesArt.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/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.php deleted file mode 100644 index e906bd2b..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesBleed.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/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 5845eaac..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesCrop.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/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 1240d2b4..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesMedia.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/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 106dcfea..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemBoxesTrim.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/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 21d48fb1..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemPdfCropBox.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/ChangeItemPagesReorderLayoutPagesItemSize.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemSize.php deleted file mode 100644 index e100381d..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemSize.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/ChangeItemPagesReorderLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesReorderLayoutPagesItemTabOrder.php deleted file mode 100644 index ed32c822..00000000 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -, - * layout: ChangeItemPagesRestoreLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesRestoreLayout.php b/src/Types/ChangeItemPagesRestoreLayout.php deleted file mode 100644 index 954f1711..00000000 --- a/src/Types/ChangeItemPagesRestoreLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesRestoreLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesRestoreLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesRestoreLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php b/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php deleted file mode 100644 index d6ce7b4a..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php deleted file mode 100644 index 54c0fe3d..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php deleted file mode 100644 index 871fcea8..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage $page - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget - */ - public static function page(ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage $page): ChangeItemPagesRestoreLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate $template - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget - */ - public static function template(ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesRestoreLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling $dangling - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTarget - */ - public static function dangling(ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesRestoreLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRestoreLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage - */ - public function asPage(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling - { - 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), - ); - } - - 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'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling::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/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 58f451db..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index a24308de..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 28c863b6..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php deleted file mode 100644 index 0aadf0ba..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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: int, - * 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 deleted file mode 100644 index 3d747e83..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxes.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/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.php deleted file mode 100644 index b14cc9f3..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesArt.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/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.php deleted file mode 100644 index b7eb2524..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesBleed.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/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 005c89ac..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesCrop.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/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 3022de26..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesMedia.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/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 945ab9a1..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemBoxesTrim.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/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 04fbdfcf..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemPdfCropBox.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/ChangeItemPagesRestoreLayoutPagesItemSize.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemSize.php deleted file mode 100644 index ef396be4..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemSize.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/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php deleted file mode 100644 index 6e7f3334..00000000 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -, * rotation: int, - * layout: ChangeItemPagesRotateLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/ChangeItemPagesRotateLayout.php b/src/Types/ChangeItemPagesRotateLayout.php deleted file mode 100644 index 2d2a94f0..00000000 --- a/src/Types/ChangeItemPagesRotateLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesRotateLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesRotateLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesRotateLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php b/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php deleted file mode 100644 index d356a65b..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php deleted file mode 100644 index 8adcf49a..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php deleted file mode 100644 index 6404fe05..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetPage $page - * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget - */ - public static function page(ChangeItemPagesRotateLayoutNamedPagesItemTargetPage $page): ChangeItemPagesRotateLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate $template - * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget - */ - public static function template(ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesRotateLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling $dangling - * @return ChangeItemPagesRotateLayoutNamedPagesItemTarget - */ - public static function dangling(ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesRotateLayoutNamedPagesItemTarget - { - return new ChangeItemPagesRotateLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetPage - */ - public function asPage(): ChangeItemPagesRotateLayoutNamedPagesItemTargetPage - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate - { - 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), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling - { - 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), - ); - } - - 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'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling::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/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 00639924..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 2c22f3c7..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 7b7de7f5..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItem.php b/src/Types/ChangeItemPagesRotateLayoutPagesItem.php deleted file mode 100644 index ecfa9536..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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: int, - * 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 deleted file mode 100644 index 51fc9a9a..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxes.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/ChangeItemPagesRotateLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesArt.php deleted file mode 100644 index 08e9b385..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesArt.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/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 7486bd15..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesBleed.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/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 07dc98c7..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesCrop.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/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.php deleted file mode 100644 index de4d986b..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesMedia.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/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 7895d530..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemBoxesTrim.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/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 42b281af..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemPdfCropBox.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/ChangeItemPagesRotateLayoutPagesItemSize.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemSize.php deleted file mode 100644 index 073482a3..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemSize.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/ChangeItemPagesRotateLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesRotateLayoutPagesItemTabOrder.php deleted file mode 100644 index f2787a32..00000000 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ - $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ?ChangeItemPagesSetScaleMeasure $measure + */ + #[JsonProperty('measure')] + public ?ChangeItemPagesSetScaleMeasure $measure; + + /** + * @var PageRef $page + */ + #[JsonProperty('page')] + public PageRef $page; + + /** + * @var PageListSnapshot $layout + */ + #[JsonProperty('layout')] + public PageListSnapshot $layout; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * pages: array, + * page: PageRef, + * layout: PageListSnapshot, + * meta: MutationMeta, + * measure?: ?ChangeItemPagesSetScaleMeasure, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->measure = $values['measure'] ?? null; + $this->page = $values['page']; + $this->layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasure.php b/src/Types/ChangeItemPagesSetScaleMeasure.php new file mode 100644 index 00000000..76452cf7 --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasure.php @@ -0,0 +1,107 @@ + $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $ratio + */ + #[JsonProperty('ratio')] + public ?string $ratio; + + /** + * @var array $x + */ + #[JsonProperty('x'), ArrayType([ChangeItemPagesSetScaleMeasureXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([ChangeItemPagesSetScaleMeasureYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([ChangeItemPagesSetScaleMeasureDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([ChangeItemPagesSetScaleMeasureAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([ChangeItemPagesSetScaleMeasureAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([ChangeItemPagesSetScaleMeasureSlopeItem::class])] + public ?array $slope; + + /** + * @var ?ChangeItemPagesSetScaleMeasureOrigin $origin + */ + #[JsonProperty('origin')] + public ?ChangeItemPagesSetScaleMeasureOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * subtype: value-of, + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?ChangeItemPagesSetScaleMeasureOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subtype = $values['subtype']; + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureAngleItem.php b/src/Types/ChangeItemPagesSetScaleMeasureAngleItem.php new file mode 100644 index 00000000..2a1d56bc --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureAngleItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureAngleItemFraction.php new file mode 100644 index 00000000..1fce8507 --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureAreaItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureAreaItemFraction.php new file mode 100644 index 00000000..6e58ebaa --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureDistanceItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureDistanceItemFraction.php new file mode 100644 index 00000000..c6b2a953 --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureSlopeItem.php b/src/Types/ChangeItemPagesSetScaleMeasureSlopeItem.php new file mode 100644 index 00000000..d272935d --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureSlopeItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureSlopeItemFraction.php new file mode 100644 index 00000000..d8a0f00d --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureXItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureXItemFraction.php new file mode 100644 index 00000000..3bc3aeb2 --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesSetScaleMeasureYItemFraction.php b/src/Types/ChangeItemPagesSetScaleMeasureYItemFraction.php new file mode 100644 index 00000000..2e85f170 --- /dev/null +++ b/src/Types/ChangeItemPagesSetScaleMeasureYItemFraction.php @@ -0,0 +1,11 @@ + 'pages.setScale', + 'value' => $pagesSetScale, + ]); + } + /** * @param ChangeOpPagesReorder $pagesReorder * @return ChangeOp @@ -1100,6 +1116,28 @@ public function asPagesRotate(): ChangeOpPagesRotate return $this->value; } + /** + * @return bool + */ + public function isPagesSetScale(): bool + { + return $this->value instanceof ChangeOpPagesSetScale && $this->type === 'pages.setScale'; + } + + /** + * @return ChangeOpPagesSetScale + */ + public function asPagesSetScale(): ChangeOpPagesSetScale + { + if (!($this->value instanceof ChangeOpPagesSetScale && $this->type === 'pages.setScale')) { + throw new Exception( + "Expected pages.setScale; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1374,6 +1412,10 @@ public function jsonSerialize(): array $value = $this->asPagesRotate()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'pages.setScale': + $value = $this->asPagesSetScale()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'pages.reorder': $value = $this->asPagesReorder()->jsonSerialize(); $result = array_merge($value, $result); @@ -1513,6 +1555,9 @@ public static function jsonDeserialize(array $data): static case 'pages.rotate': $args['value'] = ChangeOpPagesRotate::jsonDeserialize($data); break; + case 'pages.setScale': + $args['value'] = ChangeOpPagesSetScale::jsonDeserialize($data); + break; case 'pages.reorder': $args['value'] = ChangeOpPagesReorder::jsonDeserialize($data); break; diff --git a/src/Types/ChangeOpPagesSetScale.php b/src/Types/ChangeOpPagesSetScale.php new file mode 100644 index 00000000..b0c7af91 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScale.php @@ -0,0 +1,43 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ?ChangeOpPagesSetScaleMeasure $measure + */ + #[JsonProperty('measure')] + public ?ChangeOpPagesSetScaleMeasure $measure; + + /** + * @param array{ + * pages: array, + * measure?: ?ChangeOpPagesSetScaleMeasure, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->measure = $values['measure'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasure.php b/src/Types/ChangeOpPagesSetScaleMeasure.php new file mode 100644 index 00000000..b05e3c8a --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasure.php @@ -0,0 +1,107 @@ + $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $ratio + */ + #[JsonProperty('ratio')] + public ?string $ratio; + + /** + * @var array $x + */ + #[JsonProperty('x'), ArrayType([ChangeOpPagesSetScaleMeasureXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([ChangeOpPagesSetScaleMeasureYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([ChangeOpPagesSetScaleMeasureDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([ChangeOpPagesSetScaleMeasureAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([ChangeOpPagesSetScaleMeasureAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([ChangeOpPagesSetScaleMeasureSlopeItem::class])] + public ?array $slope; + + /** + * @var ?ChangeOpPagesSetScaleMeasureOrigin $origin + */ + #[JsonProperty('origin')] + public ?ChangeOpPagesSetScaleMeasureOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * subtype: value-of, + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?ChangeOpPagesSetScaleMeasureOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subtype = $values['subtype']; + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureAngleItem.php b/src/Types/ChangeOpPagesSetScaleMeasureAngleItem.php new file mode 100644 index 00000000..f204c232 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureAngleItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureAngleItemFraction.php new file mode 100644 index 00000000..6be6454c --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureAreaItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureAreaItemFraction.php new file mode 100644 index 00000000..cadf76b0 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureDistanceItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureDistanceItemFraction.php new file mode 100644 index 00000000..da2e3248 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureSlopeItem.php b/src/Types/ChangeOpPagesSetScaleMeasureSlopeItem.php new file mode 100644 index 00000000..e82a2b40 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureSlopeItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureSlopeItemFraction.php new file mode 100644 index 00000000..fe2e8db9 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureXItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureXItemFraction.php new file mode 100644 index 00000000..41ecfd0d --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesSetScaleMeasureYItemFraction.php b/src/Types/ChangeOpPagesSetScaleMeasureYItemFraction.php new file mode 100644 index 00000000..77832a38 --- /dev/null +++ b/src/Types/ChangeOpPagesSetScaleMeasureYItemFraction.php @@ -0,0 +1,11 @@ +annotationsVersion = $values['annotationsVersion'] ?? null; $this->formsVersion = $values['formsVersion'] ?? null; $this->outlineVersion = $values['outlineVersion'] ?? null; + $this->viewportsVersion = $values['viewportsVersion'] ?? null; $this->fontsVersion = $values['fontsVersion'] ?? null; $this->contentsVersion = $values['contentsVersion'] ?? null; $this->auditHead = $values['auditHead']; diff --git a/src/Types/DocPagesRemoveNameResponse.php b/src/Types/DocPagesRemoveNameResponse.php index 02e72b40..4eb228e2 100644 --- a/src/Types/DocPagesRemoveNameResponse.php +++ b/src/Types/DocPagesRemoveNameResponse.php @@ -8,10 +8,10 @@ class DocPagesRemoveNameResponse extends JsonSerializableType { /** - * @var DocPagesRemoveNameResponseLayout $layout + * @var PageListSnapshot $layout */ #[JsonProperty('layout')] - public DocPagesRemoveNameResponseLayout $layout; + public PageListSnapshot $layout; /** * @var MutationMeta $meta @@ -21,7 +21,7 @@ class DocPagesRemoveNameResponse extends JsonSerializableType /** * @param array{ - * layout: DocPagesRemoveNameResponseLayout, + * layout: PageListSnapshot, * meta: MutationMeta, * } $values */ diff --git a/src/Types/DocPagesRemoveNameResponseLayout.php b/src/Types/DocPagesRemoveNameResponseLayout.php deleted file mode 100644 index a31f140f..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesRemoveNameResponseLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([DocPagesRemoveNameResponseLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([DocPagesRemoveNameResponseLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.php b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.php deleted file mode 100644 index bcb59369..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItemStyle.php deleted file mode 100644 index a6344cd3..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php deleted file mode 100644 index ecea2277..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - */ - public static function page(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage $page): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - */ - public static function template(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - */ - public static function dangling(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage - */ - public function asPage(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage - { - if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage && $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 DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate - { - if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling - { - if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling::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/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index beac77f3..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 9dfc12e9..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 2cbd4fcc..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php deleted file mode 100644 index ace5c75b..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var DocPagesRemoveNameResponseLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public DocPagesRemoveNameResponseLayoutPagesItemBoxes $boxes; - - /** - * @var DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: DocPagesRemoveNameResponseLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: DocPagesRemoveNameResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox, - * 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/DocPagesRemoveNameResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxes.php deleted file mode 100644 index e745bb08..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxes.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index c7f9b5a7..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 75749b30..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 6e31d9d6..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index a587f8d7..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 30dffad0..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.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/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 746af310..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.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/DocPagesRemoveNameResponseLayoutPagesItemSize.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemSize.php deleted file mode 100644 index ae0758d1..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemSize.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/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php deleted file mode 100644 index c5c3d7d1..00000000 --- a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesSetNameResponseLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([DocPagesSetNameResponseLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([DocPagesSetNameResponseLayoutNamedPagesItem::class])] - public array $namedPages; - - /** - * @param array{ - * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageCount = $values['pageCount']; - $this->pages = $values['pages']; - $this->labels = $values['labels']; - $this->namedPages = $values['namedPages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutLabelsItem.php b/src/Types/DocPagesSetNameResponseLayoutLabelsItem.php deleted file mode 100644 index 701f8f19..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesSetNameResponseLayoutLabelsItemStyle.php deleted file mode 100644 index c8abc99e..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php deleted file mode 100644 index a8f06dbe..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget - */ - public static function page(DocPagesSetNameResponseLayoutNamedPagesItemTargetPage $page): DocPagesSetNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget - */ - public static function template(DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesSetNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget - */ - public static function dangling(DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesSetNameResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetPage - */ - public function asPage(): DocPagesSetNameResponseLayoutNamedPagesItemTargetPage - { - if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetPage && $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 DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate - { - if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling - { - if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling::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/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index c31c00d8..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index a25cfe71..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 9659bf01..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetNameResponseLayoutPagesItem.php b/src/Types/DocPagesSetNameResponseLayoutPagesItem.php deleted file mode 100644 index c83d8a5f..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var DocPagesSetNameResponseLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public DocPagesSetNameResponseLayoutPagesItemBoxes $boxes; - - /** - * @var DocPagesSetNameResponseLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public DocPagesSetNameResponseLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: DocPagesSetNameResponseLayoutPagesItemSize, - * rotation: int, - * userUnit: float, - * boxes: DocPagesSetNameResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesSetNameResponseLayoutPagesItemPdfCropBox, - * 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/DocPagesSetNameResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxes.php deleted file mode 100644 index b82caa40..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxes.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/DocPagesSetNameResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index d4f214c3..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesArt.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/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 25bc3446..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.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/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index 9e50b168..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.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/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index c52dad08..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.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/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 109b9333..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.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/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 9c755930..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.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/DocPagesSetNameResponseLayoutPagesItemSize.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemSize.php deleted file mode 100644 index b63b0ab8..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemSize.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/DocPagesSetNameResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemTabOrder.php deleted file mode 100644 index fb7c0647..00000000 --- a/src/Types/DocPagesSetNameResponseLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -page = $values['page']; + $this->layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesViewportsResponse.php b/src/Types/DocPagesViewportsResponse.php index e0e45835..3925548c 100644 --- a/src/Types/DocPagesViewportsResponse.php +++ b/src/Types/DocPagesViewportsResponse.php @@ -9,14 +9,14 @@ class DocPagesViewportsResponse extends JsonSerializableType { /** - * @var array $viewports + * @var array $viewports */ - #[JsonProperty('viewports'), ArrayType([DocPagesViewportsResponseViewportsItem::class])] + #[JsonProperty('viewports'), ArrayType([PageMeasurementViewport::class])] public array $viewports; /** * @param array{ - * viewports: array, + * viewports: array, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesCopyLayout.php b/src/Types/PageListSnapshot.php similarity index 54% rename from src/Types/ChangeItemPagesCopyLayout.php rename to src/Types/PageListSnapshot.php index 80f33aa0..96a55b94 100644 --- a/src/Types/ChangeItemPagesCopyLayout.php +++ b/src/Types/PageListSnapshot.php @@ -6,7 +6,7 @@ use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; -class ChangeItemPagesCopyLayout extends JsonSerializableType +class PageListSnapshot extends JsonSerializableType { /** * @var int $pageCount @@ -15,29 +15,29 @@ class ChangeItemPagesCopyLayout extends JsonSerializableType public int $pageCount; /** - * @var array $pages + * @var array $pages */ - #[JsonProperty('pages'), ArrayType([ChangeItemPagesCopyLayoutPagesItem::class])] + #[JsonProperty('pages'), ArrayType([PageListSnapshotPagesItem::class])] public array $pages; /** - * @var array $labels + * @var array $labels */ - #[JsonProperty('labels'), ArrayType([ChangeItemPagesCopyLayoutLabelsItem::class])] + #[JsonProperty('labels'), ArrayType([PageListSnapshotLabelsItem::class])] public array $labels; /** - * @var array $namedPages + * @var array $namedPages */ - #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesCopyLayoutNamedPagesItem::class])] + #[JsonProperty('namedPages'), ArrayType([PageListSnapshotNamedPagesItem::class])] public array $namedPages; /** * @param array{ * pageCount: int, - * pages: array, - * labels: array, - * namedPages: array, + * pages: array, + * labels: array, + * namedPages: array, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesCopyLayoutLabelsItem.php b/src/Types/PageListSnapshotLabelsItem.php similarity index 82% rename from src/Types/ChangeItemPagesCopyLayoutLabelsItem.php rename to src/Types/PageListSnapshotLabelsItem.php index 4362c73c..bd044dc2 100644 --- a/src/Types/ChangeItemPagesCopyLayoutLabelsItem.php +++ b/src/Types/PageListSnapshotLabelsItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutLabelsItem extends JsonSerializableType +class PageListSnapshotLabelsItem extends JsonSerializableType { /** * @var int $firstPage @@ -14,7 +14,7 @@ class ChangeItemPagesCopyLayoutLabelsItem extends JsonSerializableType public int $firstPage; /** - * @var ?value-of $style + * @var ?value-of $style */ #[JsonProperty('style')] public ?string $style; @@ -36,7 +36,7 @@ class ChangeItemPagesCopyLayoutLabelsItem extends JsonSerializableType * firstPage: int, * firstNumber: int, * prefix: string, - * style?: ?value-of, + * style?: ?value-of, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php b/src/Types/PageListSnapshotLabelsItemStyle.php similarity index 80% rename from src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php rename to src/Types/PageListSnapshotLabelsItemStyle.php index e45c8801..c08b7f8b 100644 --- a/src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php +++ b/src/Types/PageListSnapshotLabelsItemStyle.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum ChangeItemPagesCopyLayoutLabelsItemStyle: string +enum PageListSnapshotLabelsItemStyle: string { case Decimal = "decimal"; case UpperRoman = "upperRoman"; diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItem.php b/src/Types/PageListSnapshotNamedPagesItem.php similarity index 69% rename from src/Types/ChangeItemPagesCopyLayoutNamedPagesItem.php rename to src/Types/PageListSnapshotNamedPagesItem.php index b8df11df..e1037293 100644 --- a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItem.php +++ b/src/Types/PageListSnapshotNamedPagesItem.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutNamedPagesItem extends JsonSerializableType +class PageListSnapshotNamedPagesItem extends JsonSerializableType { /** * @var string $name @@ -14,15 +14,15 @@ class ChangeItemPagesCopyLayoutNamedPagesItem extends JsonSerializableType public string $name; /** - * @var ChangeItemPagesCopyLayoutNamedPagesItemTarget $target + * @var PageListSnapshotNamedPagesItemTarget $target */ #[JsonProperty('target')] - public ChangeItemPagesCopyLayoutNamedPagesItemTarget $target; + public PageListSnapshotNamedPagesItemTarget $target; /** * @param array{ * name: string, - * target: ChangeItemPagesCopyLayoutNamedPagesItemTarget, + * target: PageListSnapshotNamedPagesItemTarget, * } $values */ public function __construct( diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php b/src/Types/PageListSnapshotNamedPagesItemTarget.php similarity index 59% rename from src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php rename to src/Types/PageListSnapshotNamedPagesItemTarget.php index e224cf4e..c0f029bc 100644 --- a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php +++ b/src/Types/PageListSnapshotNamedPagesItemTarget.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; -class ChangeItemPagesCopyLayoutNamedPagesItemTarget extends JsonSerializableType +class PageListSnapshotNamedPagesItemTarget extends JsonSerializableType { /** * @var ( @@ -19,9 +19,9 @@ class ChangeItemPagesCopyLayoutNamedPagesItemTarget extends JsonSerializableType /** * @var ( - * ChangeItemPagesCopyLayoutNamedPagesItemTargetPage - * |ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate - * |ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + * PageListSnapshotNamedPagesItemTargetPage + * |PageListSnapshotNamedPagesItemTargetTemplate + * |PageListSnapshotNamedPagesItemTargetDangling * |mixed * ) $value */ @@ -36,9 +36,9 @@ class ChangeItemPagesCopyLayoutNamedPagesItemTarget extends JsonSerializableType * |'_unknown' * ), * value: ( - * ChangeItemPagesCopyLayoutNamedPagesItemTargetPage - * |ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate - * |ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + * PageListSnapshotNamedPagesItemTargetPage + * |PageListSnapshotNamedPagesItemTargetTemplate + * |PageListSnapshotNamedPagesItemTargetDangling * |mixed * ), * } $values @@ -51,36 +51,36 @@ private function __construct( } /** - * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetPage $page - * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + * @param PageListSnapshotNamedPagesItemTargetPage $page + * @return PageListSnapshotNamedPagesItemTarget */ - public static function page(ChangeItemPagesCopyLayoutNamedPagesItemTargetPage $page): ChangeItemPagesCopyLayoutNamedPagesItemTarget + public static function page(PageListSnapshotNamedPagesItemTargetPage $page): PageListSnapshotNamedPagesItemTarget { - return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + return new PageListSnapshotNamedPagesItemTarget([ 'kind' => 'page', 'value' => $page, ]); } /** - * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate $template - * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + * @param PageListSnapshotNamedPagesItemTargetTemplate $template + * @return PageListSnapshotNamedPagesItemTarget */ - public static function template(ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesCopyLayoutNamedPagesItemTarget + public static function template(PageListSnapshotNamedPagesItemTargetTemplate $template): PageListSnapshotNamedPagesItemTarget { - return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + return new PageListSnapshotNamedPagesItemTarget([ 'kind' => 'template', 'value' => $template, ]); } /** - * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling $dangling - * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + * @param PageListSnapshotNamedPagesItemTargetDangling $dangling + * @return PageListSnapshotNamedPagesItemTarget */ - public static function dangling(ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesCopyLayoutNamedPagesItemTarget + public static function dangling(PageListSnapshotNamedPagesItemTargetDangling $dangling): PageListSnapshotNamedPagesItemTarget { - return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + return new PageListSnapshotNamedPagesItemTarget([ 'kind' => 'dangling', 'value' => $dangling, ]); @@ -91,15 +91,15 @@ public static function dangling(ChangeItemPagesCopyLayoutNamedPagesItemTargetDan */ public function isPage(): bool { - return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + return $this->value instanceof PageListSnapshotNamedPagesItemTargetPage && $this->kind === 'page'; } /** - * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetPage + * @return PageListSnapshotNamedPagesItemTargetPage */ - public function asPage(): ChangeItemPagesCopyLayoutNamedPagesItemTargetPage + public function asPage(): PageListSnapshotNamedPagesItemTargetPage { - if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + if (!($this->value instanceof PageListSnapshotNamedPagesItemTargetPage && $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(): ChangeItemPagesCopyLayoutNamedPagesItemTargetPage */ public function isTemplate(): bool { - return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + return $this->value instanceof PageListSnapshotNamedPagesItemTargetTemplate && $this->kind === 'template'; } /** - * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate + * @return PageListSnapshotNamedPagesItemTargetTemplate */ - public function asTemplate(): ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate + public function asTemplate(): PageListSnapshotNamedPagesItemTargetTemplate { - if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + if (!($this->value instanceof PageListSnapshotNamedPagesItemTargetTemplate && $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(): ChangeItemPagesCopyLayoutNamedPagesItemTargetTempl */ public function isDangling(): bool { - return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + return $this->value instanceof PageListSnapshotNamedPagesItemTargetDangling && $this->kind === 'dangling'; } /** - * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + * @return PageListSnapshotNamedPagesItemTargetDangling */ - public function asDangling(): ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + public function asDangling(): PageListSnapshotNamedPagesItemTargetDangling { - if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + if (!($this->value instanceof PageListSnapshotNamedPagesItemTargetDangling && $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'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + $args['value'] = PageListSnapshotNamedPagesItemTargetPage::jsonDeserialize($data); break; case 'template': - $args['value'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + $args['value'] = PageListSnapshotNamedPagesItemTargetTemplate::jsonDeserialize($data); break; case 'dangling': - $args['value'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + $args['value'] = PageListSnapshotNamedPagesItemTargetDangling::jsonDeserialize($data); break; case '_unknown': default: diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php b/src/Types/PageListSnapshotNamedPagesItemTargetDangling.php similarity index 80% rename from src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php rename to src/Types/PageListSnapshotNamedPagesItemTargetDangling.php index 71814f2f..b241f3f1 100644 --- a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php +++ b/src/Types/PageListSnapshotNamedPagesItemTargetDangling.php @@ -4,7 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; -class ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling extends JsonSerializableType +class PageListSnapshotNamedPagesItemTargetDangling extends JsonSerializableType { /** * @param array{ diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php b/src/Types/PageListSnapshotNamedPagesItemTargetPage.php similarity index 86% rename from src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php rename to src/Types/PageListSnapshotNamedPagesItemTargetPage.php index 732b9281..17a08ef6 100644 --- a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php +++ b/src/Types/PageListSnapshotNamedPagesItemTargetPage.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutNamedPagesItemTargetPage extends JsonSerializableType +class PageListSnapshotNamedPagesItemTargetPage extends JsonSerializableType { /** * @var PageRef $page diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php b/src/Types/PageListSnapshotNamedPagesItemTargetTemplate.php similarity index 86% rename from src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php rename to src/Types/PageListSnapshotNamedPagesItemTargetTemplate.php index 0539be67..3c5a1828 100644 --- a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php +++ b/src/Types/PageListSnapshotNamedPagesItemTargetTemplate.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate extends JsonSerializableType +class PageListSnapshotNamedPagesItemTargetTemplate extends JsonSerializableType { /** * @var int $objectNumber diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItem.php b/src/Types/PageListSnapshotPagesItem.php similarity index 64% rename from src/Types/ChangeItemPagesInsertLayoutPagesItem.php rename to src/Types/PageListSnapshotPagesItem.php index 4067e56c..3e14f323 100644 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItem.php +++ b/src/Types/PageListSnapshotPagesItem.php @@ -4,8 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; -class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType +class PageListSnapshotPagesItem extends JsonSerializableType { /** * @var int $index @@ -26,10 +27,10 @@ class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType public ?string $label; /** - * @var ChangeItemPagesInsertLayoutPagesItemSize $size + * @var PageListSnapshotPagesItemSize $size */ #[JsonProperty('size')] - public ChangeItemPagesInsertLayoutPagesItemSize $size; + public PageListSnapshotPagesItemSize $size; /** * @var int $rotation @@ -44,22 +45,22 @@ class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType public float $userUnit; /** - * @var ?value-of $tabOrder + * @var ?value-of $tabOrder */ #[JsonProperty('tabOrder')] public ?string $tabOrder; /** - * @var ChangeItemPagesInsertLayoutPagesItemBoxes $boxes + * @var PageListSnapshotPagesItemBoxes $boxes */ #[JsonProperty('boxes')] - public ChangeItemPagesInsertLayoutPagesItemBoxes $boxes; + public PageListSnapshotPagesItemBoxes $boxes; /** - * @var ChangeItemPagesInsertLayoutPagesItemPdfCropBox $pdfCropBox + * @var PageListSnapshotPagesItemPdfCropBox $pdfCropBox */ #[JsonProperty('pdfCropBox')] - public ChangeItemPagesInsertLayoutPagesItemPdfCropBox $pdfCropBox; + public PageListSnapshotPagesItemPdfCropBox $pdfCropBox; /** * @var ?PdfPageActions $actions @@ -67,18 +68,25 @@ class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType #[JsonProperty('actions')] public ?PdfPageActions $actions; + /** + * @var ?array $viewports + */ + #[JsonProperty('viewports'), ArrayType([PageMeasurementViewport::class])] + public ?array $viewports; + /** * @param array{ * index: int, * ref: PageRef, - * size: ChangeItemPagesInsertLayoutPagesItemSize, + * size: PageListSnapshotPagesItemSize, * rotation: int, * userUnit: float, - * boxes: ChangeItemPagesInsertLayoutPagesItemBoxes, - * pdfCropBox: ChangeItemPagesInsertLayoutPagesItemPdfCropBox, + * boxes: PageListSnapshotPagesItemBoxes, + * pdfCropBox: PageListSnapshotPagesItemPdfCropBox, * label?: ?string, - * tabOrder?: ?value-of, + * tabOrder?: ?value-of, * actions?: ?PdfPageActions, + * viewports?: ?array, * } $values */ public function __construct( @@ -94,6 +102,7 @@ public function __construct( $this->boxes = $values['boxes']; $this->pdfCropBox = $values['pdfCropBox']; $this->actions = $values['actions'] ?? null; + $this->viewports = $values['viewports'] ?? null; } /** diff --git a/src/Types/PageListSnapshotPagesItemBoxes.php b/src/Types/PageListSnapshotPagesItemBoxes.php new file mode 100644 index 00000000..fa93bd16 --- /dev/null +++ b/src/Types/PageListSnapshotPagesItemBoxes.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/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php b/src/Types/PageListSnapshotPagesItemBoxesArt.php similarity index 92% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php rename to src/Types/PageListSnapshotPagesItemBoxesArt.php index 59093f8d..822479b5 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php +++ b/src/Types/PageListSnapshotPagesItemBoxesArt.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutPagesItemBoxesArt extends JsonSerializableType +class PageListSnapshotPagesItemBoxesArt extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/DocPagesViewportsResponseViewportsItemBbox.php b/src/Types/PageListSnapshotPagesItemBoxesBleed.php similarity index 92% rename from src/Types/DocPagesViewportsResponseViewportsItemBbox.php rename to src/Types/PageListSnapshotPagesItemBoxesBleed.php index 1b051533..f8788b4f 100644 --- a/src/Types/DocPagesViewportsResponseViewportsItemBbox.php +++ b/src/Types/PageListSnapshotPagesItemBoxesBleed.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesViewportsResponseViewportsItemBbox extends JsonSerializableType +class PageListSnapshotPagesItemBoxesBleed extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php b/src/Types/PageListSnapshotPagesItemBoxesCrop.php similarity index 92% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php rename to src/Types/PageListSnapshotPagesItemBoxesCrop.php index ab7537e6..378559d3 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php +++ b/src/Types/PageListSnapshotPagesItemBoxesCrop.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutPagesItemBoxesTrim extends JsonSerializableType +class PageListSnapshotPagesItemBoxesCrop extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php b/src/Types/PageListSnapshotPagesItemBoxesMedia.php similarity index 92% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php rename to src/Types/PageListSnapshotPagesItemBoxesMedia.php index 9d3465d7..7292773f 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php +++ b/src/Types/PageListSnapshotPagesItemBoxesMedia.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutPagesItemBoxesCrop extends JsonSerializableType +class PageListSnapshotPagesItemBoxesMedia extends JsonSerializableType { /** * @var float $x diff --git a/src/Types/PageListSnapshotPagesItemBoxesTrim.php b/src/Types/PageListSnapshotPagesItemBoxesTrim.php new file mode 100644 index 00000000..0b84f5ff --- /dev/null +++ b/src/Types/PageListSnapshotPagesItemBoxesTrim.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/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.php b/src/Types/PageListSnapshotPagesItemPdfCropBox.php similarity index 92% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.php rename to src/Types/PageListSnapshotPagesItemPdfCropBox.php index f81bb4c8..a04af6d0 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.php +++ b/src/Types/PageListSnapshotPagesItemPdfCropBox.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutPagesItemPdfCropBox extends JsonSerializableType +class PageListSnapshotPagesItemPdfCropBox extends JsonSerializableType { /** * @var float $left diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemSize.php b/src/Types/PageListSnapshotPagesItemSize.php similarity index 90% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemSize.php rename to src/Types/PageListSnapshotPagesItemSize.php index 092acb20..ec539ce4 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemSize.php +++ b/src/Types/PageListSnapshotPagesItemSize.php @@ -5,7 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class ChangeItemPagesCopyLayoutPagesItemSize extends JsonSerializableType +class PageListSnapshotPagesItemSize extends JsonSerializableType { /** * @var float $width diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php b/src/Types/PageListSnapshotPagesItemTabOrder.php similarity index 77% rename from src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php rename to src/Types/PageListSnapshotPagesItemTabOrder.php index 39f60344..ec5a095d 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php +++ b/src/Types/PageListSnapshotPagesItemTabOrder.php @@ -2,7 +2,7 @@ namespace CloudPDF\Types; -enum ChangeItemPagesCopyLayoutPagesItemTabOrder: string +enum PageListSnapshotPagesItemTabOrder: string { case Rows = "rows"; case Columns = "columns"; diff --git a/src/Types/DocPagesViewportsResponseViewportsItem.php b/src/Types/PageMeasurementViewport.php similarity index 81% rename from src/Types/DocPagesViewportsResponseViewportsItem.php rename to src/Types/PageMeasurementViewport.php index a9dffbc9..1bfaf074 100644 --- a/src/Types/DocPagesViewportsResponseViewportsItem.php +++ b/src/Types/PageMeasurementViewport.php @@ -5,13 +5,13 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; -class DocPagesViewportsResponseViewportsItem extends JsonSerializableType +class PageMeasurementViewport extends JsonSerializableType { /** - * @var DocPagesViewportsResponseViewportsItemBbox $bbox + * @var PageMeasurementViewportBbox $bbox */ #[JsonProperty('bbox')] - public DocPagesViewportsResponseViewportsItemBbox $bbox; + public PageMeasurementViewportBbox $bbox; /** * @var ?string $name @@ -33,7 +33,7 @@ class DocPagesViewportsResponseViewportsItem extends JsonSerializableType /** * @param array{ - * bbox: DocPagesViewportsResponseViewportsItemBbox, + * bbox: PageMeasurementViewportBbox, * owned: bool, * name?: ?string, * measure?: ?PdfMeasurement, diff --git a/src/Types/PageMeasurementViewportBbox.php b/src/Types/PageMeasurementViewportBbox.php new file mode 100644 index 00000000..befb2e1d --- /dev/null +++ b/src/Types/PageMeasurementViewportBbox.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(); + } +}