From 00eb24b38f0fea07ee7978a1e74bbda8fbad9106 Mon Sep 17 00:00:00 2001 From: cloudpdf-sdk-bot Date: Tue, 1 Dec 2026 13:55:59 +0000 Subject: [PATCH] chore: generate CloudPDF PHP SDK 3.5.0 --- .fern/metadata.json | 6 +- README.md | 2 +- cloudpdf-generation.json | 8 +- src/CloudPDFClient.php | 6 +- src/Types/AnnotationDraftWidget.php | 8 + src/Types/AnnotationDraftWidgetLayout.php | 14 + src/Types/ChangeItem.php | 90 +++++++ src/Types/ChangeItemFormsRepeat.php | 83 ++++++ src/Types/ChangeItemFormsRepeatAs.php | 9 + .../ChangeItemFormsRepeatDroppedItem.php | 58 +++++ ...ChangeItemFormsRepeatDroppedItemReason.php | 12 + src/Types/ChangeItemFormsSetButtonImage.php | 59 +++++ src/Types/ChangeItemSkippedOp.php | 2 + src/Types/ChangeOp.php | 90 +++++++ src/Types/ChangeOpFormsRepeat.php | 66 +++++ src/Types/ChangeOpFormsRepeatAs.php | 9 + src/Types/ChangeOpFormsRepeatPagesZero.php | 8 + src/Types/ChangeOpFormsSetButtonImage.php | 42 +++ .../ChangeOpFormsSetButtonImageResources.php | 34 +++ src/Types/FieldAssignment.php | 241 ++++++++++++++++++ src/Types/FieldAssignmentAnyone.php | 26 ++ src/Types/FieldAssignmentGroup.php | 34 +++ src/Types/FieldAssignmentUnassigned.php | 26 ++ src/Types/FieldSignatureLock.php | 42 +++ src/Types/FieldSignatureLockSource.php | 9 + src/Types/FormFieldCheckbox.php | 32 +++ src/Types/FormFieldCombobox.php | 24 ++ src/Types/FormFieldDraftCheckbox.php | 16 ++ src/Types/FormFieldDraftCombobox.php | 16 ++ src/Types/FormFieldDraftListbox.php | 16 ++ src/Types/FormFieldDraftPushbutton.php | 24 ++ src/Types/FormFieldDraftRadio.php | 16 ++ src/Types/FormFieldDraftSignature.php | 16 ++ src/Types/FormFieldDraftText.php | 16 ++ src/Types/FormFieldListbox.php | 24 ++ src/Types/FormFieldPatch.php | 24 ++ src/Types/FormFieldPushbutton.php | 40 +++ src/Types/FormFieldRadio.php | 32 +++ src/Types/FormFieldSignature.php | 24 ++ src/Types/FormFieldText.php | 24 ++ src/Types/FormFieldUnknown.php | 24 ++ src/Types/WidgetAnnotation.php | 8 + src/Types/WidgetAnnotationLayout.php | 14 + src/Types/WidgetPatch.php | 8 + src/Types/WidgetPatchLayout.php | 14 + src/Types/WidgetPlacement.php | 8 + src/Types/WidgetPlacementLayout.php | 14 + 47 files changed, 1407 insertions(+), 11 deletions(-) create mode 100644 src/Types/AnnotationDraftWidgetLayout.php create mode 100644 src/Types/ChangeItemFormsRepeat.php create mode 100644 src/Types/ChangeItemFormsRepeatAs.php create mode 100644 src/Types/ChangeItemFormsRepeatDroppedItem.php create mode 100644 src/Types/ChangeItemFormsRepeatDroppedItemReason.php create mode 100644 src/Types/ChangeItemFormsSetButtonImage.php create mode 100644 src/Types/ChangeOpFormsRepeat.php create mode 100644 src/Types/ChangeOpFormsRepeatAs.php create mode 100644 src/Types/ChangeOpFormsRepeatPagesZero.php create mode 100644 src/Types/ChangeOpFormsSetButtonImage.php create mode 100644 src/Types/ChangeOpFormsSetButtonImageResources.php create mode 100644 src/Types/FieldAssignment.php create mode 100644 src/Types/FieldAssignmentAnyone.php create mode 100644 src/Types/FieldAssignmentGroup.php create mode 100644 src/Types/FieldAssignmentUnassigned.php create mode 100644 src/Types/FieldSignatureLock.php create mode 100644 src/Types/FieldSignatureLockSource.php create mode 100644 src/Types/WidgetAnnotationLayout.php create mode 100644 src/Types/WidgetPatchLayout.php create mode 100644 src/Types/WidgetPlacementLayout.php diff --git a/.fern/metadata.json b/.fern/metadata.json index cd7931b..82e9d26 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "9af4d9ee755d6e5c20a8055654e895a81b95fb83", + "originGitCommit": "7b7201308398662b3f0b9fdb47aca99f653b01b5", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.4.0", + "requestedVersion": "3.5.0", "ciProvider": "github", - "sdkVersion": "3.4.0" + "sdkVersion": "3.5.0" } \ No newline at end of file diff --git a/README.md b/README.md index d440d4e..61e4e4f 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.4', + embedPdfVersion: '3.5', token: '', ); $client->doc->changes( diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 047f2b1..0999a5c 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.4.0", - "sdkVersion": "3.4.0", + "canonicalVersion": "3.5.0", + "sdkVersion": "3.5.0", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "1416853fd5400e76cd33ffd218e90673faf6c8c8c50f86af1937ba6576efb27d", - "gitCommit": "9af4d9ee755d6e5c20a8055654e895a81b95fb83", + "openapiSha256": "6d3ad28f2a9e47e0e98945a6f8111bbc271a12e95ce8ac5f5eadbda260ad0d0e", + "gitCommit": "7b7201308398662b3f0b9fdb47aca99f653b01b5", "gitCommitIsDirty": false }, "fern": { diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index a6d6a79..ffc3aa0 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -82,11 +82,11 @@ public function __construct( ?array $options = null, ) { $defaultHeaders = [ - 'EmbedPDF-Version' => '3.4', + 'EmbedPDF-Version' => '3.5', 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.4.0', - 'User-Agent' => 'cloudpdf/sdk/3.4.0', + 'X-Fern-SDK-Version' => '3.5.0', + 'User-Agent' => 'cloudpdf/sdk/3.5.0', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Types/AnnotationDraftWidget.php b/src/Types/AnnotationDraftWidget.php index b02deec..8dff45c 100644 --- a/src/Types/AnnotationDraftWidget.php +++ b/src/Types/AnnotationDraftWidget.php @@ -272,6 +272,12 @@ class AnnotationDraftWidget extends JsonSerializableType #[JsonProperty('checkStyle')] public ?string $checkStyle; + /** + * @var ?value-of $layout + */ + #[JsonProperty('layout')] + public ?string $layout; + /** * @var mixed $field */ @@ -336,6 +342,7 @@ class AnnotationDraftWidget extends JsonSerializableType * textAlign?: ?value-of, * caption?: ?string, * checkStyle?: ?value-of, + * layout?: ?value-of, * field?: mixed, * fieldKind?: mixed, * hasMark?: mixed, @@ -388,6 +395,7 @@ public function __construct( $this->textAlign = $values['textAlign'] ?? null; $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; + $this->layout = $values['layout'] ?? null; $this->field = $values['field'] ?? null; $this->fieldKind = $values['fieldKind'] ?? null; $this->hasMark = $values['hasMark'] ?? null; diff --git a/src/Types/AnnotationDraftWidgetLayout.php b/src/Types/AnnotationDraftWidgetLayout.php new file mode 100644 index 0000000..b8f8a84 --- /dev/null +++ b/src/Types/AnnotationDraftWidgetLayout.php @@ -0,0 +1,14 @@ + 'forms.repeat', + 'value' => $formsRepeat, + ]); + } + /** * @param ChangeItemFormsUpdate $formsUpdate * @return ChangeItem @@ -410,6 +430,18 @@ public static function formsSetSignatureAppearance(ChangeItemFormsSetSignatureAp ]); } + /** + * @param ChangeItemFormsSetButtonImage $formsSetButtonImage + * @return ChangeItem + */ + public static function formsSetButtonImage(ChangeItemFormsSetButtonImage $formsSetButtonImage): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.setButtonImage', + 'value' => $formsSetButtonImage, + ]); + } + /** * @param ChangeItemFormsAddWidget $formsAddWidget * @return ChangeItem @@ -996,6 +1028,28 @@ public function asFormsCopy(): ChangeItemFormsCopy return $this->value; } + /** + * @return bool + */ + public function isFormsRepeat(): bool + { + return $this->value instanceof ChangeItemFormsRepeat && $this->type === 'forms.repeat'; + } + + /** + * @return ChangeItemFormsRepeat + */ + public function asFormsRepeat(): ChangeItemFormsRepeat + { + if (!($this->value instanceof ChangeItemFormsRepeat && $this->type === 'forms.repeat')) { + throw new Exception( + "Expected forms.repeat; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1084,6 +1138,28 @@ public function asFormsSetSignatureAppearance(): ChangeItemFormsSetSignatureAppe return $this->value; } + /** + * @return bool + */ + public function isFormsSetButtonImage(): bool + { + return $this->value instanceof ChangeItemFormsSetButtonImage && $this->type === 'forms.setButtonImage'; + } + + /** + * @return ChangeItemFormsSetButtonImage + */ + public function asFormsSetButtonImage(): ChangeItemFormsSetButtonImage + { + if (!($this->value instanceof ChangeItemFormsSetButtonImage && $this->type === 'forms.setButtonImage')) { + throw new Exception( + "Expected forms.setButtonImage; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1706,6 +1782,10 @@ public function jsonSerialize(): array $value = $this->asFormsCopy()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'forms.repeat': + $value = $this->asFormsRepeat()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'forms.update': $value = $this->asFormsUpdate()->jsonSerialize(); $result = array_merge($value, $result); @@ -1722,6 +1802,10 @@ public function jsonSerialize(): array $value = $this->asFormsSetSignatureAppearance()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'forms.setButtonImage': + $value = $this->asFormsSetButtonImage()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'forms.addWidget': $value = $this->asFormsAddWidget()->jsonSerialize(); $result = array_merge($value, $result); @@ -1897,6 +1981,9 @@ public static function jsonDeserialize(array $data): static case 'forms.copy': $args['value'] = ChangeItemFormsCopy::jsonDeserialize($data); break; + case 'forms.repeat': + $args['value'] = ChangeItemFormsRepeat::jsonDeserialize($data); + break; case 'forms.update': $args['value'] = ChangeItemFormsUpdate::jsonDeserialize($data); break; @@ -1909,6 +1996,9 @@ public static function jsonDeserialize(array $data): static case 'forms.setSignatureAppearance': $args['value'] = ChangeItemFormsSetSignatureAppearance::jsonDeserialize($data); break; + case 'forms.setButtonImage': + $args['value'] = ChangeItemFormsSetButtonImage::jsonDeserialize($data); + break; case 'forms.addWidget': $args['value'] = ChangeItemFormsAddWidget::jsonDeserialize($data); break; diff --git a/src/Types/ChangeItemFormsRepeat.php b/src/Types/ChangeItemFormsRepeat.php new file mode 100644 index 0000000..984dbe7 --- /dev/null +++ b/src/Types/ChangeItemFormsRepeat.php @@ -0,0 +1,83 @@ + $as + */ + #[JsonProperty('as')] + public string $as; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var array $dropped + */ + #[JsonProperty('dropped'), ArrayType([ChangeItemFormsRepeatDroppedItem::class])] + public array $dropped; + + /** + * @var ?array $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public ?array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * as: value-of, + * fields: array, + * widgets: array, + * dropped: array, + * meta: FormMutationMeta, + * undone?: ?bool, + * calculationOrder?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->undone = $values['undone'] ?? null; + $this->as = $values['as']; + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; + $this->dropped = $values['dropped']; + $this->calculationOrder = $values['calculationOrder'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsRepeatAs.php b/src/Types/ChangeItemFormsRepeatAs.php new file mode 100644 index 0000000..dca55b6 --- /dev/null +++ b/src/Types/ChangeItemFormsRepeatAs.php @@ -0,0 +1,9 @@ + $reason + */ + #[JsonProperty('reason')] + public string $reason; + + /** + * @param array{ + * reason: value-of, + * ref?: ?FormFieldRef, + * widget?: ?AnnotationRef, + * field?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->widget = $values['widget'] ?? null; + $this->field = $values['field'] ?? null; + $this->reason = $values['reason']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsRepeatDroppedItemReason.php b/src/Types/ChangeItemFormsRepeatDroppedItemReason.php new file mode 100644 index 0000000..ac4e853 --- /dev/null +++ b/src/Types/ChangeItemFormsRepeatDroppedItemReason.php @@ -0,0 +1,12 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var ?array $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public ?array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * calculationOrder?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->calculationOrder = $values['calculationOrder'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemSkippedOp.php b/src/Types/ChangeItemSkippedOp.php index 4b246b4..d53670b 100644 --- a/src/Types/ChangeItemSkippedOp.php +++ b/src/Types/ChangeItemSkippedOp.php @@ -15,6 +15,7 @@ enum ChangeItemSkippedOp: string case FormsReset = "forms.reset"; case FormsCreate = "forms.create"; case FormsCopy = "forms.copy"; + case FormsRepeat = "forms.repeat"; case FormsUpdate = "forms.update"; case FormsDelete = "forms.delete"; case FormsAddWidget = "forms.addWidget"; @@ -24,6 +25,7 @@ enum ChangeItemSkippedOp: string case FormsReorderWidgets = "forms.reorderWidgets"; case FormsUpdateWidget = "forms.updateWidget"; case FormsSetSignatureAppearance = "forms.setSignatureAppearance"; + case FormsSetButtonImage = "forms.setButtonImage"; case MetadataUpdate = "metadata.update"; case MetadataUpdateCustom = "metadata.updateCustom"; case OutlineCreate = "outline.create"; diff --git a/src/Types/ChangeOp.php b/src/Types/ChangeOp.php index af46a41..9015049 100644 --- a/src/Types/ChangeOp.php +++ b/src/Types/ChangeOp.php @@ -20,6 +20,7 @@ class ChangeOp extends JsonSerializableType * |'forms.reset' * |'forms.create' * |'forms.copy' + * |'forms.repeat' * |'forms.update' * |'forms.delete' * |'forms.addWidget' @@ -29,6 +30,7 @@ class ChangeOp extends JsonSerializableType * |'forms.reorderWidgets' * |'forms.updateWidget' * |'forms.setSignatureAppearance' + * |'forms.setButtonImage' * |'metadata.update' * |'metadata.updateCustom' * |'outline.create' @@ -62,6 +64,7 @@ class ChangeOp extends JsonSerializableType * |ChangeOpFormsReset * |ChangeOpFormsCreate * |ChangeOpFormsCopy + * |ChangeOpFormsRepeat * |ChangeOpFormsUpdate * |ChangeOpFormsDelete * |ChangeOpFormsAddWidget @@ -71,6 +74,7 @@ class ChangeOp extends JsonSerializableType * |ChangeOpFormsReorderWidgets * |ChangeOpFormsUpdateWidget * |ChangeOpFormsSetSignatureAppearance + * |ChangeOpFormsSetButtonImage * |ChangeOpMetadataUpdate * |ChangeOpMetadataUpdateCustom * |ChangeOpOutlineCreate @@ -105,6 +109,7 @@ class ChangeOp extends JsonSerializableType * |'forms.reset' * |'forms.create' * |'forms.copy' + * |'forms.repeat' * |'forms.update' * |'forms.delete' * |'forms.addWidget' @@ -114,6 +119,7 @@ class ChangeOp extends JsonSerializableType * |'forms.reorderWidgets' * |'forms.updateWidget' * |'forms.setSignatureAppearance' + * |'forms.setButtonImage' * |'metadata.update' * |'metadata.updateCustom' * |'outline.create' @@ -143,6 +149,7 @@ class ChangeOp extends JsonSerializableType * |ChangeOpFormsReset * |ChangeOpFormsCreate * |ChangeOpFormsCopy + * |ChangeOpFormsRepeat * |ChangeOpFormsUpdate * |ChangeOpFormsDelete * |ChangeOpFormsAddWidget @@ -152,6 +159,7 @@ class ChangeOp extends JsonSerializableType * |ChangeOpFormsReorderWidgets * |ChangeOpFormsUpdateWidget * |ChangeOpFormsSetSignatureAppearance + * |ChangeOpFormsSetButtonImage * |ChangeOpMetadataUpdate * |ChangeOpMetadataUpdateCustom * |ChangeOpOutlineCreate @@ -310,6 +318,18 @@ public static function formsCopy(ChangeOpFormsCopy $formsCopy): ChangeOp ]); } + /** + * @param ChangeOpFormsRepeat $formsRepeat + * @return ChangeOp + */ + public static function formsRepeat(ChangeOpFormsRepeat $formsRepeat): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.repeat', + 'value' => $formsRepeat, + ]); + } + /** * @param ChangeOpFormsUpdate $formsUpdate * @return ChangeOp @@ -418,6 +438,18 @@ public static function formsSetSignatureAppearance(ChangeOpFormsSetSignatureAppe ]); } + /** + * @param ChangeOpFormsSetButtonImage $formsSetButtonImage + * @return ChangeOp + */ + public static function formsSetButtonImage(ChangeOpFormsSetButtonImage $formsSetButtonImage): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.setButtonImage', + 'value' => $formsSetButtonImage, + ]); + } + /** * @param ChangeOpMetadataUpdate $metadataUpdate * @return ChangeOp @@ -840,6 +872,28 @@ public function asFormsCopy(): ChangeOpFormsCopy return $this->value; } + /** + * @return bool + */ + public function isFormsRepeat(): bool + { + return $this->value instanceof ChangeOpFormsRepeat && $this->type === 'forms.repeat'; + } + + /** + * @return ChangeOpFormsRepeat + */ + public function asFormsRepeat(): ChangeOpFormsRepeat + { + if (!($this->value instanceof ChangeOpFormsRepeat && $this->type === 'forms.repeat')) { + throw new Exception( + "Expected forms.repeat; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1038,6 +1092,28 @@ public function asFormsSetSignatureAppearance(): ChangeOpFormsSetSignatureAppear return $this->value; } + /** + * @return bool + */ + public function isFormsSetButtonImage(): bool + { + return $this->value instanceof ChangeOpFormsSetButtonImage && $this->type === 'forms.setButtonImage'; + } + + /** + * @return ChangeOpFormsSetButtonImage + */ + public function asFormsSetButtonImage(): ChangeOpFormsSetButtonImage + { + if (!($this->value instanceof ChangeOpFormsSetButtonImage && $this->type === 'forms.setButtonImage')) { + throw new Exception( + "Expected forms.setButtonImage; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1432,6 +1508,10 @@ public function jsonSerialize(): array $value = $this->asFormsCopy()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'forms.repeat': + $value = $this->asFormsRepeat()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'forms.update': $value = $this->asFormsUpdate()->jsonSerialize(); $result = array_merge($value, $result); @@ -1468,6 +1548,10 @@ public function jsonSerialize(): array $value = $this->asFormsSetSignatureAppearance()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'forms.setButtonImage': + $value = $this->asFormsSetButtonImage()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'metadata.update': $value = $this->asMetadataUpdate()->jsonSerialize(); $result = array_merge($value, $result); @@ -1597,6 +1681,9 @@ public static function jsonDeserialize(array $data): static case 'forms.copy': $args['value'] = ChangeOpFormsCopy::jsonDeserialize($data); break; + case 'forms.repeat': + $args['value'] = ChangeOpFormsRepeat::jsonDeserialize($data); + break; case 'forms.update': $args['value'] = ChangeOpFormsUpdate::jsonDeserialize($data); break; @@ -1624,6 +1711,9 @@ public static function jsonDeserialize(array $data): static case 'forms.setSignatureAppearance': $args['value'] = ChangeOpFormsSetSignatureAppearance::jsonDeserialize($data); break; + case 'forms.setButtonImage': + $args['value'] = ChangeOpFormsSetButtonImage::jsonDeserialize($data); + break; case 'metadata.update': $args['value'] = ChangeOpMetadataUpdate::jsonDeserialize($data); break; diff --git a/src/Types/ChangeOpFormsRepeat.php b/src/Types/ChangeOpFormsRepeat.php new file mode 100644 index 0000000..3fcc2ec --- /dev/null +++ b/src/Types/ChangeOpFormsRepeat.php @@ -0,0 +1,66 @@ + + * |array + * ) $pages + */ + #[JsonProperty('pages'), Union('string', [PageRef::class])] + public string|array $pages; + + /** + * @var ?value-of $as + */ + #[JsonProperty('as')] + public ?string $as; + + /** + * @var ?array $objectNumbers + */ + #[JsonProperty('objectNumbers'), ArrayType(['integer'])] + public ?array $objectNumbers; + + /** + * @param array{ + * field: FormFieldRef, + * pages: ( + * value-of + * |array + * ), + * as?: ?value-of, + * objectNumbers?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->pages = $values['pages']; + $this->as = $values['as'] ?? null; + $this->objectNumbers = $values['objectNumbers'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsRepeatAs.php b/src/Types/ChangeOpFormsRepeatAs.php new file mode 100644 index 0000000..1089a9f --- /dev/null +++ b/src/Types/ChangeOpFormsRepeatAs.php @@ -0,0 +1,9 @@ +field = $values['field']; + $this->resources = $values['resources']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetButtonImageResources.php b/src/Types/ChangeOpFormsSetButtonImageResources.php new file mode 100644 index 0000000..303d099 --- /dev/null +++ b/src/Types/ChangeOpFormsSetButtonImageResources.php @@ -0,0 +1,34 @@ +image = $values['image'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldAssignment.php b/src/Types/FieldAssignment.php new file mode 100644 index 0000000..c078fb2 --- /dev/null +++ b/src/Types/FieldAssignment.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FieldAssignmentGroup $group + * @return FieldAssignment + */ + public static function group(FieldAssignmentGroup $group): FieldAssignment + { + return new FieldAssignment([ + 'kind' => 'group', + 'value' => $group, + ]); + } + + /** + * @param FieldAssignmentAnyone $anyone + * @return FieldAssignment + */ + public static function anyone(FieldAssignmentAnyone $anyone): FieldAssignment + { + return new FieldAssignment([ + 'kind' => 'anyone', + 'value' => $anyone, + ]); + } + + /** + * @param FieldAssignmentUnassigned $unassigned + * @return FieldAssignment + */ + public static function unassigned(FieldAssignmentUnassigned $unassigned): FieldAssignment + { + return new FieldAssignment([ + 'kind' => 'unassigned', + 'value' => $unassigned, + ]); + } + + /** + * @return bool + */ + public function isGroup(): bool + { + return $this->value instanceof FieldAssignmentGroup && $this->kind === 'group'; + } + + /** + * @return FieldAssignmentGroup + */ + public function asGroup(): FieldAssignmentGroup + { + if (!($this->value instanceof FieldAssignmentGroup && $this->kind === 'group')) { + throw new Exception( + "Expected group; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnyone(): bool + { + return $this->value instanceof FieldAssignmentAnyone && $this->kind === 'anyone'; + } + + /** + * @return FieldAssignmentAnyone + */ + public function asAnyone(): FieldAssignmentAnyone + { + if (!($this->value instanceof FieldAssignmentAnyone && $this->kind === 'anyone')) { + throw new Exception( + "Expected anyone; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnassigned(): bool + { + return $this->value instanceof FieldAssignmentUnassigned && $this->kind === 'unassigned'; + } + + /** + * @return FieldAssignmentUnassigned + */ + public function asUnassigned(): FieldAssignmentUnassigned + { + if (!($this->value instanceof FieldAssignmentUnassigned && $this->kind === 'unassigned')) { + throw new Exception( + "Expected unassigned; 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 'group': + $value = $this->asGroup()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'anyone': + $value = $this->asAnyone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unassigned': + $value = $this->asUnassigned()->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 'group': + $args['value'] = FieldAssignmentGroup::jsonDeserialize($data); + break; + case 'anyone': + $args['value'] = FieldAssignmentAnyone::jsonDeserialize($data); + break; + case 'unassigned': + $args['value'] = FieldAssignmentUnassigned::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/FieldAssignmentAnyone.php b/src/Types/FieldAssignmentAnyone.php new file mode 100644 index 0000000..4643708 --- /dev/null +++ b/src/Types/FieldAssignmentAnyone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FieldAssignmentGroup.php b/src/Types/FieldAssignmentGroup.php new file mode 100644 index 0000000..5497a68 --- /dev/null +++ b/src/Types/FieldAssignmentGroup.php @@ -0,0 +1,34 @@ +groupId = $values['groupId']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldAssignmentUnassigned.php b/src/Types/FieldAssignmentUnassigned.php new file mode 100644 index 0000000..165caf6 --- /dev/null +++ b/src/Types/FieldAssignmentUnassigned.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FieldSignatureLock.php b/src/Types/FieldSignatureLock.php new file mode 100644 index 0000000..10ceaf9 --- /dev/null +++ b/src/Types/FieldSignatureLock.php @@ -0,0 +1,42 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldSignatureLockSource.php b/src/Types/FieldSignatureLockSource.php new file mode 100644 index 0000000..2195566 --- /dev/null +++ b/src/Types/FieldSignatureLockSource.php @@ -0,0 +1,9 @@ +, * checked: bool, * exportValue: string, + * hasValuesList: bool, * alternateName?: ?string, * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -183,7 +211,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; @@ -193,6 +224,7 @@ public function __construct( $this->widgets = $values['widgets']; $this->checked = $values['checked']; $this->exportValue = $values['exportValue']; + $this->hasValuesList = $values['hasValuesList']; } /** diff --git a/src/Types/FormFieldCombobox.php b/src/Types/FormFieldCombobox.php index c9313f1..9608030 100644 --- a/src/Types/FormFieldCombobox.php +++ b/src/Types/FormFieldCombobox.php @@ -82,12 +82,30 @@ class FormFieldCombobox extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -170,6 +188,7 @@ class FormFieldCombobox extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * value: string, * defaultValue: string, @@ -179,7 +198,9 @@ class FormFieldCombobox extends JsonSerializableType * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -204,7 +225,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; diff --git a/src/Types/FormFieldDraftCheckbox.php b/src/Types/FormFieldDraftCheckbox.php index 9e22e79..65a84f4 100644 --- a/src/Types/FormFieldDraftCheckbox.php +++ b/src/Types/FormFieldDraftCheckbox.php @@ -50,12 +50,24 @@ class FormFieldDraftCheckbox extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -77,7 +89,9 @@ class FormFieldDraftCheckbox extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * } $values @@ -92,7 +106,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; } diff --git a/src/Types/FormFieldDraftCombobox.php b/src/Types/FormFieldDraftCombobox.php index b5e9da0..8103e52 100644 --- a/src/Types/FormFieldDraftCombobox.php +++ b/src/Types/FormFieldDraftCombobox.php @@ -50,12 +50,24 @@ class FormFieldDraftCombobox extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -101,7 +113,9 @@ class FormFieldDraftCombobox extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * edit?: ?bool, @@ -120,7 +134,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; $this->edit = $values['edit'] ?? null; diff --git a/src/Types/FormFieldDraftListbox.php b/src/Types/FormFieldDraftListbox.php index 0b65294..3085a15 100644 --- a/src/Types/FormFieldDraftListbox.php +++ b/src/Types/FormFieldDraftListbox.php @@ -50,12 +50,24 @@ class FormFieldDraftListbox extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -95,7 +107,9 @@ class FormFieldDraftListbox extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * multiSelect?: ?bool, @@ -113,7 +127,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; $this->multiSelect = $values['multiSelect'] ?? null; diff --git a/src/Types/FormFieldDraftPushbutton.php b/src/Types/FormFieldDraftPushbutton.php index 8fd7697..efc868f 100644 --- a/src/Types/FormFieldDraftPushbutton.php +++ b/src/Types/FormFieldDraftPushbutton.php @@ -50,12 +50,24 @@ class FormFieldDraftPushbutton extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -68,6 +80,12 @@ class FormFieldDraftPushbutton extends JsonSerializableType #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] public ?array $widgets; + /** + * @var ?bool $takesImage Make the push button an image field: the engine writes Acrobat's import-icon script as each widget's activation action. It needs a widget, and can't go beside a widget's `actions.activate` or `actions.mouseUp`. + */ + #[JsonProperty('takesImage')] + public ?bool $takesImage; + /** * @param array{ * name: string, @@ -77,9 +95,12 @@ class FormFieldDraftPushbutton extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, + * takesImage?: ?bool, * } $values */ public function __construct( @@ -92,9 +113,12 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; + $this->takesImage = $values['takesImage'] ?? null; } /** diff --git a/src/Types/FormFieldDraftRadio.php b/src/Types/FormFieldDraftRadio.php index d9f5152..c22df8b 100644 --- a/src/Types/FormFieldDraftRadio.php +++ b/src/Types/FormFieldDraftRadio.php @@ -50,12 +50,24 @@ class FormFieldDraftRadio extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -89,7 +101,9 @@ class FormFieldDraftRadio extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * radiosInUnison?: ?bool, @@ -106,7 +120,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; $this->radiosInUnison = $values['radiosInUnison'] ?? null; diff --git a/src/Types/FormFieldDraftSignature.php b/src/Types/FormFieldDraftSignature.php index 5e4e4ac..d9647e0 100644 --- a/src/Types/FormFieldDraftSignature.php +++ b/src/Types/FormFieldDraftSignature.php @@ -50,12 +50,24 @@ class FormFieldDraftSignature extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -77,7 +89,9 @@ class FormFieldDraftSignature extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * } $values @@ -92,7 +106,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; } diff --git a/src/Types/FormFieldDraftText.php b/src/Types/FormFieldDraftText.php index ebbacc9..7cbf29e 100644 --- a/src/Types/FormFieldDraftText.php +++ b/src/Types/FormFieldDraftText.php @@ -50,12 +50,24 @@ class FormFieldDraftText extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -113,7 +125,9 @@ class FormFieldDraftText extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * widgets?: ?array, * defaultValue?: ?string, @@ -134,7 +148,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->widgets = $values['widgets'] ?? null; $this->defaultValue = $values['defaultValue'] ?? null; diff --git a/src/Types/FormFieldListbox.php b/src/Types/FormFieldListbox.php index 76fb3c4..e195b9e 100644 --- a/src/Types/FormFieldListbox.php +++ b/src/Types/FormFieldListbox.php @@ -82,12 +82,30 @@ class FormFieldListbox extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -170,6 +188,7 @@ class FormFieldListbox extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * selectedValues: array, * defaultValue: array, @@ -180,7 +199,9 @@ class FormFieldListbox extends JsonSerializableType * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -204,7 +225,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; diff --git a/src/Types/FormFieldPatch.php b/src/Types/FormFieldPatch.php index 87e0215..7b1f119 100644 --- a/src/Types/FormFieldPatch.php +++ b/src/Types/FormFieldPatch.php @@ -51,12 +51,24 @@ class FormFieldPatch extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var ?FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public ?FieldAssignment $assignment; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?FieldActionsPatch $actions */ @@ -138,6 +150,12 @@ class FormFieldPatch extends JsonSerializableType #[JsonProperty('format')] public ?FormFieldFormatWritable $format; + /** + * @var ?bool $takesImage A push button's: `true` makes it an image field, writing Acrobat's import-icon script as the activation action of each widget whose press does nothing, and is refused while a widget's press runs another action. `false` takes the script off each widget whose press is exactly it. + */ + #[JsonProperty('takesImage')] + public ?bool $takesImage; + /** * @param array{ * name?: ?string, @@ -147,7 +165,9 @@ class FormFieldPatch extends JsonSerializableType * alternateName?: ?string, * mappingName?: ?string, * groupId?: ?string, + * assignment?: ?FieldAssignment, * purpose?: ?string, + * placeholder?: ?string, * actions?: ?FieldActionsPatch, * kind?: ?value-of, * defaultValue?: ( @@ -164,6 +184,7 @@ class FormFieldPatch extends JsonSerializableType * multiSelect?: ?bool, * options?: ?array, * format?: ?FormFieldFormatWritable, + * takesImage?: ?bool, * } $values */ public function __construct( @@ -176,7 +197,9 @@ public function __construct( $this->alternateName = $values['alternateName'] ?? null; $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->actions = $values['actions'] ?? null; $this->kind = $values['kind'] ?? null; $this->defaultValue = $values['defaultValue'] ?? null; @@ -190,6 +213,7 @@ public function __construct( $this->multiSelect = $values['multiSelect'] ?? null; $this->options = $values['options'] ?? null; $this->format = $values['format'] ?? null; + $this->takesImage = $values['takesImage'] ?? null; } /** diff --git a/src/Types/FormFieldPushbutton.php b/src/Types/FormFieldPushbutton.php index 83f80cc..19899a0 100644 --- a/src/Types/FormFieldPushbutton.php +++ b/src/Types/FormFieldPushbutton.php @@ -82,12 +82,30 @@ class FormFieldPushbutton extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -130,6 +148,18 @@ class FormFieldPushbutton extends JsonSerializableType #[JsonProperty('widgets'), ArrayType([FormWidget::class])] public array $widgets; + /** + * @var bool $hasImage + */ + #[JsonProperty('hasImage')] + public bool $hasImage; + + /** + * @var bool $takesImage Whether the push button is an image field, which a person fills with a picture: it has a widget, and every widget's press runs Acrobat's import-icon script (`event.target.buttonImportIcon()`) and nothing else. + */ + #[JsonProperty('takesImage')] + public bool $takesImage; + /** * @param array{ * ref: FormFieldRef, @@ -140,12 +170,17 @@ class FormFieldPushbutton extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, + * hasImage: bool, + * takesImage: bool, * alternateName?: ?string, * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -169,7 +204,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; @@ -177,6 +215,8 @@ public function __construct( $this->filledAt = $values['filledAt'] ?? null; $this->importedBy = $values['importedBy'] ?? null; $this->widgets = $values['widgets']; + $this->hasImage = $values['hasImage']; + $this->takesImage = $values['takesImage']; } /** diff --git a/src/Types/FormFieldRadio.php b/src/Types/FormFieldRadio.php index e17f246..32ebd96 100644 --- a/src/Types/FormFieldRadio.php +++ b/src/Types/FormFieldRadio.php @@ -82,12 +82,30 @@ class FormFieldRadio extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -148,6 +166,12 @@ class FormFieldRadio extends JsonSerializableType #[JsonProperty('noToggleToOff')] public bool $noToggleToOff; + /** + * @var bool $hasValuesList Whether the field names its widgets' values in a list (`/Opt`), as Acrobat does for values that repeat or aren't plain names: each widget's `exportValue` is then the list's entry at its place, and its `onState` only a key. + */ + #[JsonProperty('hasValuesList')] + public bool $hasValuesList; + /** * @param array{ * ref: FormFieldRef, @@ -158,15 +182,19 @@ class FormFieldRadio extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * value: string, * radiosInUnison: bool, * noToggleToOff: bool, + * hasValuesList: bool, * alternateName?: ?string, * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -190,7 +218,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; @@ -201,6 +232,7 @@ public function __construct( $this->value = $values['value']; $this->radiosInUnison = $values['radiosInUnison']; $this->noToggleToOff = $values['noToggleToOff']; + $this->hasValuesList = $values['hasValuesList']; } /** diff --git a/src/Types/FormFieldSignature.php b/src/Types/FormFieldSignature.php index f3d8602..5b1972e 100644 --- a/src/Types/FormFieldSignature.php +++ b/src/Types/FormFieldSignature.php @@ -82,12 +82,30 @@ class FormFieldSignature extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -140,12 +158,15 @@ class FormFieldSignature extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * alternateName?: ?string, * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -169,7 +190,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; diff --git a/src/Types/FormFieldText.php b/src/Types/FormFieldText.php index 585ac0d..5fb45ff 100644 --- a/src/Types/FormFieldText.php +++ b/src/Types/FormFieldText.php @@ -82,12 +82,30 @@ class FormFieldText extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -182,6 +200,7 @@ class FormFieldText extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * value: string, * defaultValue: string, @@ -192,7 +211,9 @@ class FormFieldText extends JsonSerializableType * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -218,7 +239,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; diff --git a/src/Types/FormFieldUnknown.php b/src/Types/FormFieldUnknown.php index bd4279c..b3392f6 100644 --- a/src/Types/FormFieldUnknown.php +++ b/src/Types/FormFieldUnknown.php @@ -82,12 +82,30 @@ class FormFieldUnknown extends JsonSerializableType #[JsonProperty('groupId')] public ?string $groupId; + /** + * @var FieldAssignment $assignment + */ + #[JsonProperty('assignment')] + public FieldAssignment $assignment; + + /** + * @var ?FieldSignatureLock $lockedBy + */ + #[JsonProperty('lockedBy')] + public ?FieldSignatureLock $lockedBy; + /** * @var ?string $purpose */ #[JsonProperty('purpose')] public ?string $purpose; + /** + * @var ?string $placeholder + */ + #[JsonProperty('placeholder')] + public ?string $placeholder; + /** * @var ?string $createdBy */ @@ -146,13 +164,16 @@ class FormFieldUnknown extends JsonSerializableType * noExport: bool, * valueEntry: FormValueEntry, * defaultValueEntry: FormValueEntry, + * assignment: FieldAssignment, * widgets: array, * rawValue: string, * alternateName?: ?string, * mappingName?: ?string, * actions?: ?PdfFieldActions, * groupId?: ?string, + * lockedBy?: ?FieldSignatureLock, * purpose?: ?string, + * placeholder?: ?string, * createdBy?: ?string, * createdAt?: ?DateTime, * filledBy?: ?string, @@ -176,7 +197,10 @@ public function __construct( $this->defaultValueEntry = $values['defaultValueEntry']; $this->actions = $values['actions'] ?? null; $this->groupId = $values['groupId'] ?? null; + $this->assignment = $values['assignment']; + $this->lockedBy = $values['lockedBy'] ?? null; $this->purpose = $values['purpose'] ?? null; + $this->placeholder = $values['placeholder'] ?? null; $this->createdBy = $values['createdBy'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->filledBy = $values['filledBy'] ?? null; diff --git a/src/Types/WidgetAnnotation.php b/src/Types/WidgetAnnotation.php index e5941e2..c310dbb 100644 --- a/src/Types/WidgetAnnotation.php +++ b/src/Types/WidgetAnnotation.php @@ -280,6 +280,12 @@ class WidgetAnnotation extends JsonSerializableType #[JsonProperty('checkStyle')] public ?string $checkStyle; + /** + * @var ?value-of $layout + */ + #[JsonProperty('layout')] + public ?string $layout; + /** * @var ?FormFieldRef $field */ @@ -347,6 +353,7 @@ class WidgetAnnotation extends JsonSerializableType * fontColor?: ?string, * caption?: ?string, * checkStyle?: ?value-of, + * layout?: ?value-of, * field?: ?FormFieldRef, * } $values */ @@ -398,6 +405,7 @@ public function __construct( $this->textAlign = $values['textAlign']; $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; + $this->layout = $values['layout'] ?? null; $this->field = $values['field'] ?? null; $this->fieldKind = $values['fieldKind']; $this->hasMark = $values['hasMark']; diff --git a/src/Types/WidgetAnnotationLayout.php b/src/Types/WidgetAnnotationLayout.php new file mode 100644 index 0000000..dd4f24d --- /dev/null +++ b/src/Types/WidgetAnnotationLayout.php @@ -0,0 +1,14 @@ + $layout + */ + #[JsonProperty('layout')] + public ?string $layout; + /** * @var mixed $field */ @@ -352,6 +358,7 @@ class WidgetPatch extends JsonSerializableType * textAlign?: ?value-of, * caption?: ?string, * checkStyle?: ?value-of, + * layout?: ?value-of, * field?: mixed, * fieldKind?: mixed, * hasMark?: mixed, @@ -405,6 +412,7 @@ public function __construct( $this->textAlign = $values['textAlign'] ?? null; $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; + $this->layout = $values['layout'] ?? null; $this->field = $values['field'] ?? null; $this->fieldKind = $values['fieldKind'] ?? null; $this->hasMark = $values['hasMark'] ?? null; diff --git a/src/Types/WidgetPatchLayout.php b/src/Types/WidgetPatchLayout.php new file mode 100644 index 0000000..d583e13 --- /dev/null +++ b/src/Types/WidgetPatchLayout.php @@ -0,0 +1,14 @@ + $layout + */ + #[JsonProperty('layout')] + public ?string $layout; + /** * @param array{ * page: PageRef, @@ -129,6 +135,7 @@ class WidgetPlacement extends JsonSerializableType * textAlign?: ?value-of, * caption?: ?string, * checkStyle?: ?value-of, + * layout?: ?value-of, * } $values */ public function __construct( @@ -151,6 +158,7 @@ public function __construct( $this->textAlign = $values['textAlign'] ?? null; $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; + $this->layout = $values['layout'] ?? null; } /** diff --git a/src/Types/WidgetPlacementLayout.php b/src/Types/WidgetPlacementLayout.php new file mode 100644 index 0000000..2a3ade7 --- /dev/null +++ b/src/Types/WidgetPlacementLayout.php @@ -0,0 +1,14 @@ +