diff --git a/.fern/metadata.json b/.fern/metadata.json index d54cb86..151657f 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "b7dddfba5011349a40db7878b5cbc8685b2d42cf", + "originGitCommit": "c6f87eecf9636e7ef367946a7fd7f3729401ce90", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.14", + "requestedVersion": "3.0.0-alpha.15", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.14" + "sdkVersion": "3.0.0-alpha.15" } \ No newline at end of file diff --git a/README.md b/README.md index 44b352b..576d200 100644 --- a/README.md +++ b/README.md @@ -37,14 +37,21 @@ Instantiate and use the client with the following: namespace Example; use CloudPDF\CloudPDFClient; -use CloudPDF\Shares\Requests\SharesExchangeRequest; +use CloudPDF\Doc\Requests\DocChangesRequest; +use CloudPDF\Doc\Types\DocChangesRequestChangesItem; $client = new CloudPDFClient( token: '', ); -$client->shares->exchange( - new SharesExchangeRequest([ - 'shareToken' => 'shareToken', +$client->doc->changes( + 'docId', + 'layerName', + new DocChangesRequest([ + 'changes' => [ + new DocChangesRequestChangesItem([ + 'opId' => 'opId', + ]), + ], ]), ); @@ -59,7 +66,7 @@ use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Exceptions\CloudPDFException; try { - $response = $client->shares->exchange(...); + $response = $client->doc->changes(...); } catch (CloudPDFApiException $e) { echo 'API Exception occurred: ' . $e->getMessage() . "\n"; echo 'Status Code: ' . $e->getCode() . "\n"; @@ -118,7 +125,7 @@ The `retryStatusCodes` configuration controls which [5XX](https://developer.mozi Use the `maxRetries` request option to configure this behavior. ```php -$response = $client->shares->exchange( +$response = $client->doc->changes( ..., options: [ 'maxRetries' => 0 // Override maxRetries at the request level @@ -131,7 +138,7 @@ $response = $client->shares->exchange( The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior. ```php -$response = $client->shares->exchange( +$response = $client->doc->changes( ..., options: [ 'timeout' => 3.0 // Override timeout at the request level diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 1f6e41b..6c84da2 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.14", - "sdkVersion": "3.0.0-alpha.14", + "canonicalVersion": "3.0.0-next.15", + "sdkVersion": "3.0.0-alpha.15", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "188ea071e3534971638ee3d1fb1f19c77f36e04b2a783f5eefdbe67326527ea6", - "gitCommit": "b7dddfba5011349a40db7878b5cbc8685b2d42cf", + "openapiSha256": "9d70deca638cc7a80b0e670ec47fc45710d6603eb8f493d5fac95a38d7e5f8b3", + "gitCommit": "c6f87eecf9636e7ef367946a7fd7f3729401ce90", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index ec412db..bbd1338 100644 --- a/reference.md +++ b/reference.md @@ -73,6 +73,94 @@ $client->doc->head( + + + + +
$client->doc->changes($docId, $layerName, $request) -> ?DocChanges200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { : '' }`, and each file as the part `resource:`. At most 64 changes per request and 512 ops per change. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->changes( + 'docId', + 'layerName', + new DocChangesRequest([ + 'changes' => [ + new DocChangesRequestChangesItem([ + 'opId' => 'opId', + ]), + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$changes:** `array` + +
+
+
+
+ +
@@ -197,7 +285,7 @@ $client->doc->manifest( -
$client->doc->render($docId, $layerName, $pon, $request) -> string +
$client->doc->render($docId, $layerName, $pageKey, $request) -> string
@@ -227,7 +315,7 @@ Render parameters (viewport, format) pass as flat dotted query keys, e.g. `?view $client->doc->render( 'docId', 'layerName', - 1, + 'pageKey', new RenderDocRequest([]), ); ``` @@ -260,7 +348,7 @@ $client->doc->render(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -280,7 +368,7 @@ $client->doc->render(
-
$client->doc->text($docId, $layerName, $pon, $request) -> ?DocText200Response +
$client->doc->text($docId, $layerName, $pageKey, $request) -> ?DocText200Response
@@ -296,7 +384,7 @@ $client->doc->render( $client->doc->text( 'docId', 'layerName', - 1, + 'pageKey', new TextDocRequest([]), ); ``` @@ -329,7 +417,7 @@ $client->doc->text(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -495,7 +583,7 @@ $client->shares->list(
-The returned share id IS the public share token. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. +The returned share id is the public share token. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does.
@@ -1635,7 +1723,7 @@ $client->documents->importFrom(
-**$source:** `DocumentsImportFromRequestSource` — Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. +**$source:** `DocumentsImportFromRequestSource` — Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file.
@@ -1963,7 +2051,7 @@ $client->tokens->revoke(
## Doc Annotations -
$client->doc->annotations->listAll($docId, $layerName, $request) -> ?DocAnnotationsListAll200Response +
$client->doc->annotations->listAll($docId, $layerName, $request) -> ?AnnotationList
@@ -1975,7 +2063,7 @@ $client->tokens->revoke(
-Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `pageState.pageObjectNumber` when display order matters. +Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `page` (a `PageRef`) when display order matters.
@@ -2037,7 +2125,7 @@ $client->doc->annotations->listAll(
-
$client->doc->annotations->list($docId, $layerName, $pon, $request) -> ?DocAnnotationsList200Response +
$client->doc->annotations->list($docId, $layerName, $pageKey, $request) -> ?AnnotationList
@@ -2053,7 +2141,7 @@ $client->doc->annotations->listAll( $client->doc->annotations->list( 'docId', 'layerName', - 1, + 'pageKey', new ListAnnotationsRequest([]), ); ``` @@ -2086,7 +2174,7 @@ $client->doc->annotations->list(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2106,7 +2194,7 @@ $client->doc->annotations->list(
-
$client->doc->annotations->create($docId, $layerName, $pon, $request) -> ?DocAnnotationsCreate200Response +
$client->doc->annotations->create($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsCreate200Response
@@ -2136,7 +2224,7 @@ Doc JWTs may instead carry collab scopes (annotations:create:self, …) that ref $client->doc->annotations->create( 'docId', 'layerName', - 1, + 'pageKey', new CreateAnnotationsRequest([ 'body' => [ 'key' => "value", @@ -2173,7 +2261,7 @@ $client->doc->annotations->create(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2189,6 +2277,14 @@ $client->doc->annotations->create(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -2201,7 +2297,7 @@ $client->doc->annotations->create(
-
$client->doc->annotations->delete($docId, $layerName, $pon, $annotKey, $request) -> ?DocAnnotationsDelete200Response +
$client->doc->annotations->delete($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocAnnotationsDelete200Response
@@ -2217,7 +2313,7 @@ $client->doc->annotations->create( $client->doc->annotations->delete( 'docId', 'layerName', - 1, + 'pageKey', 'annotKey', new DeleteAnnotationsRequest([]), ); @@ -2251,7 +2347,7 @@ $client->doc->annotations->delete(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2259,7 +2355,7 @@ $client->doc->annotations->delete(
-**$annotKey:** `string` +**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -2269,6 +2365,14 @@ $client->doc->annotations->delete( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. +
@@ -2279,7 +2383,7 @@ $client->doc->annotations->delete(
-
$client->doc->annotations->update($docId, $layerName, $pon, $annotKey, $request) -> ?DocAnnotationsUpdate200Response +
$client->doc->annotations->update($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocAnnotationsUpdate200Response
@@ -2295,7 +2399,7 @@ $client->doc->annotations->delete( $client->doc->annotations->update( 'docId', 'layerName', - 1, + 'pageKey', 'annotKey', new UpdateAnnotationsRequest([ 'body' => [ @@ -2333,7 +2437,7 @@ $client->doc->annotations->update(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2341,7 +2445,7 @@ $client->doc->annotations->update(
-**$annotKey:** `string` +**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -2357,6 +2461,14 @@ $client->doc->annotations->update(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -2369,7 +2481,7 @@ $client->doc->annotations->update(
-
$client->doc->annotations->exportAppearance($docId, $layerName, $pon, $request) -> string +
$client->doc->annotations->readAppearance($docId, $layerName, $pageKey, $annotKey, $request) -> string
@@ -2382,17 +2494,12 @@ $client->doc->annotations->update(
```php -$client->doc->annotations->exportAppearance( +$client->doc->annotations->readAppearance( 'docId', 'layerName', - 1, - new ExportAppearanceAnnotationsRequest([ - 'body' => [ - 'string' => [ - 'key' => "value", - ], - ], - ]), + 'pageKey', + 'annotKey', + new ReadAppearanceAnnotationsRequest([]), ); ```
@@ -2424,7 +2531,7 @@ $client->doc->annotations->exportAppearance(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2432,7 +2539,7 @@ $client->doc->annotations->exportAppearance(
-**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. +**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -2440,7 +2547,7 @@ $client->doc->annotations->exportAppearance(
-**$request:** `array` +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
@@ -2452,7 +2559,7 @@ $client->doc->annotations->exportAppearance(
-
$client->doc->annotations->flatten($docId, $layerName, $pon, $request) -> ?DocAnnotationsFlatten200Response +
$client->doc->annotations->exportAppearance($docId, $layerName, $pageKey, $request) -> string
@@ -2465,13 +2572,15 @@ $client->doc->annotations->exportAppearance(
```php -$client->doc->annotations->flatten( +$client->doc->annotations->exportAppearance( 'docId', 'layerName', - 1, - new FlattenAnnotationsRequest([ + 'pageKey', + new ExportAppearanceAnnotationsRequest([ 'body' => [ - 'key' => "value", + 'string' => [ + 'key' => "value", + ], ], ]), ); @@ -2505,7 +2614,7 @@ $client->doc->annotations->flatten(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2533,8 +2642,7 @@ $client->doc->annotations->flatten(
-## Doc Forms -
$client->doc->forms->get($docId, $layerName, $request) -> ?DocFormsGet200Response +
$client->doc->annotations->flatten($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsFlatten200Response
@@ -2547,10 +2655,15 @@ $client->doc->annotations->flatten(
```php -$client->doc->forms->get( +$client->doc->annotations->flatten( 'docId', 'layerName', - new GetFormsRequest([]), + 'pageKey', + new FlattenAnnotationsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), ); ```
@@ -2582,8 +2695,32 @@ $client->doc->forms->get(
+**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$request:** `array` +
@@ -2594,7 +2731,7 @@ $client->doc->forms->get(
-
$client->doc->forms->exportData($docId, $layerName, $request) -> string +
$client->doc->annotations->reorder($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsReorder200Response
@@ -2607,10 +2744,22 @@ $client->doc->forms->get(
```php -$client->doc->forms->exportData( +$client->doc->annotations->reorder( 'docId', 'layerName', - new ExportDataFormsRequest([]), + 'pageKey', + new DocAnnotationsReorderRequest([ + 'refs' => [ + AnnotationRef::objectNumber(new AnnotationRefObjectNumber([ + 'page' => new PageRef([ + 'kind' => PageRefKind::ObjectNumber->value, + 'objectNumber' => 1, + ]), + 'objectNumber' => 1, + ])), + ], + 'position' => AnnotationPositionZero::Start->value, + ]), ); ```
@@ -2642,7 +2791,7 @@ $client->doc->forms->exportData(
-**$format:** `?string` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -2652,6 +2801,30 @@ $client->doc->forms->exportData( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$refs:** `array` + +
+
+ +
+
+ +**$position:** `string|AnnotationPositionAfter` +
@@ -2662,7 +2835,8 @@ $client->doc->forms->exportData(
-
$client->doc->forms->importData($docId, $layerName, $request) -> ?DocFormsImportData200Response +## Doc Forms +
$client->doc->forms->list($docId, $layerName, $request) -> ?DocFormsList200Response
@@ -2675,14 +2849,10 @@ $client->doc->forms->exportData(
```php -$client->doc->forms->importData( +$client->doc->forms->list( 'docId', 'layerName', - new ImportDataFormsRequest([ - 'body' => [ - 'key' => "value", - ], - ]), + new ListFormsRequest([]), ); ```
@@ -2716,14 +2886,6 @@ $client->doc->forms->importData( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. - -
- -
-
- -**$request:** `array` -
@@ -2734,7 +2896,7 @@ $client->doc->forms->importData(
-
$client->doc->forms->reset($docId, $layerName, $fieldKey, $request) -> ?DocFormsReset200Response +
$client->doc->forms->reorderCalculations($docId, $layerName, $request) -> ?DocFormsReorderCalculations200Response
@@ -2747,11 +2909,17 @@ $client->doc->forms->importData(
```php -$client->doc->forms->reset( +$client->doc->forms->reorderCalculations( 'docId', 'layerName', - 'fieldKey', - new ResetFormsRequest([]), + new DocFormsReorderCalculationsRequest([ + 'fields' => [ + FormFieldRef::objectNumber(new FormFieldRefObjectNumber([ + 'objectNumber' => 1, + ])), + ], + 'position' => FieldPositionZero::Start->value, + ]), ); ```
@@ -2783,7 +2951,7 @@ $client->doc->forms->reset(
-**$fieldKey:** `string` +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
@@ -2791,7 +2959,23 @@ $client->doc->forms->reset(
-**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$fields:** `array` + +
+
+ +
+
+ +**$position:** `string|FieldPositionAfter`
@@ -2872,6 +3056,14 @@ $client->doc->forms->setValue(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -2884,8 +3076,7 @@ $client->doc->forms->setValue(
-## Doc Metadata -
$client->doc->metadata->get($docId, $layerName, $request) -> ?DocMetadataGet200Response +
$client->doc->forms->reset($docId, $layerName, $request) -> ?DocFormsReset200Response
@@ -2898,10 +3089,10 @@ $client->doc->forms->setValue(
```php -$client->doc->metadata->get( +$client->doc->forms->reset( 'docId', 'layerName', - new GetMetadataRequest([]), + new DocFormsResetRequest([]), ); ```
@@ -2935,6 +3126,22 @@ $client->doc->metadata->get( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$refs:** `?array` +
@@ -2945,8 +3152,7 @@ $client->doc->metadata->get(
-## Doc Pages -
$client->doc->pages->setScale($docId, $layerName, $pon, $request) -> ?DocPagesSetScale200Response +
$client->doc->forms->deleteWidget($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocFormsDeleteWidget200Response
@@ -2959,11 +3165,12 @@ $client->doc->metadata->get(
```php -$client->doc->pages->setScale( +$client->doc->forms->deleteWidget( 'docId', 'layerName', - 1, - new DocPagesSetScaleRequest([]), + 'pageKey', + 'annotKey', + new DeleteWidgetFormsRequest([]), ); ```
@@ -2995,7 +3202,15 @@ $client->doc->pages->setScale(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ +**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -3011,7 +3226,7 @@ $client->doc->pages->setScale(
-**$measure:** `?DocPagesSetScaleRequestMeasure` +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing.
@@ -3023,7 +3238,7 @@ $client->doc->pages->setScale(
-
$client->doc->pages->viewports($docId, $layerName, $pon, $request) -> ?array +
$client->doc->forms->updateWidget($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocFormsUpdateWidget200Response
@@ -3036,12 +3251,15 @@ $client->doc->pages->setScale(
```php -$client->doc->pages->viewports( +$client->doc->forms->updateWidget( 'docId', 'layerName', - 1, - new ViewportsPagesRequest([]), -); + 'pageKey', + 'annotKey', + new DocFormsUpdateWidgetRequest([ + 'patch' => new WidgetPatch([]), + ]), +); ```
@@ -3072,7 +3290,351 @@ $client->doc->pages->viewports(
-**$pon:** `int` +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ +**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$patch:** `WidgetPatch` + +
+
+ + + + + + +
+ +
$client->doc->forms->reorderWidgets($docId, $layerName, $pageKey, $request) -> ?DocFormsReorderWidgets200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->reorderWidgets( + 'docId', + 'layerName', + 'pageKey', + new DocFormsReorderWidgetsRequest([ + 'widgets' => [ + AnnotationRef::objectNumber(new AnnotationRefObjectNumber([ + 'page' => new PageRef([ + 'kind' => PageRefKind::ObjectNumber->value, + 'objectNumber' => 1, + ]), + 'objectNumber' => 1, + ])), + ], + 'position' => AnnotationPositionZero::Start->value, + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$widgets:** `array` + +
+
+ +
+
+ +**$position:** `string|AnnotationPositionAfter` + +
+
+
+
+ + +
+
+
+ +## Doc Metadata +
$client->doc->metadata->get($docId, $layerName, $request) -> ?DocumentMetadata +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->metadata->get( + 'docId', + 'layerName', + new GetMetadataRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +## Doc Pages +
$client->doc->pages->setScale($docId, $layerName, $pageKey, $request) -> ?DocPagesSetScale200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->setScale( + 'docId', + 'layerName', + 'pageKey', + new DocPagesSetScaleRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$measure:** `?DocPagesSetScaleRequestMeasure` + +
+
+
+
+ + +
+
+
+ +
$client->doc->pages->viewports($docId, $layerName, $pageKey, $request) -> ?DocPagesViewports200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->viewports( + 'docId', + 'layerName', + 'pageKey', + new ViewportsPagesRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`.
@@ -3152,6 +3714,14 @@ $client->doc->pages->delete(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3176,7 +3746,7 @@ $client->doc->pages->delete(
-A read, not a mutation: the source document is untouched and no event is published. Body is `{"pageObjectNumbers": number[]}`; the response body is the new PDF. +A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[]}`; the response body is the new PDF.
@@ -3312,6 +3882,14 @@ $client->doc->pages->flatten(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3336,7 +3914,7 @@ $client->doc->pages->flatten(
-Multipart mutation envelope: a `body` field holding `{"destIndex"?: number}` (omitted → append) plus a `resource:source` file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. +Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source": ""}}` (position omitted → the end), and the standalone PDF whose pages are copied in as the part `resource:`. The inserted copies get fresh page object numbers, returned in insertion order.
@@ -3390,6 +3968,14 @@ $client->doc->pages->insert( **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. +
@@ -3412,7 +3998,7 @@ $client->doc->pages->insert(
-Body is `{"size": {"width", "height"}, "count"?, "destIndex"?}` — size in PDF points, count in [1, 100], destIndex omitted → append. +Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end).
@@ -3474,6 +4060,14 @@ $client->doc->pages->insertBlank(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3486,7 +4080,7 @@ $client->doc->pages->insertBlank(
-
$client->doc->pages->move($docId, $layerName, $request) -> ?DocPagesMove200Response +
$client->doc->pages->setName($docId, $layerName, $request) -> ?DocPagesSetName200Response
@@ -3499,10 +4093,10 @@ $client->doc->pages->insertBlank(
```php -$client->doc->pages->move( +$client->doc->pages->setName( 'docId', 'layerName', - new MovePagesRequest([ + new SetNamePagesRequest([ 'body' => [ 'key' => "value", ], @@ -3546,6 +4140,14 @@ $client->doc->pages->move(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3558,7 +4160,7 @@ $client->doc->pages->move(
-
$client->doc->pages->setName($docId, $layerName, $request) -> ?DocPagesSetName200Response +
$client->doc->pages->removeName($docId, $layerName, $request) -> ?DocPagesRemoveName200Response
@@ -3571,10 +4173,10 @@ $client->doc->pages->move(
```php -$client->doc->pages->setName( +$client->doc->pages->removeName( 'docId', 'layerName', - new SetNamePagesRequest([ + new RemoveNamePagesRequest([ 'body' => [ 'key' => "value", ], @@ -3618,6 +4220,14 @@ $client->doc->pages->setName(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3630,7 +4240,7 @@ $client->doc->pages->setName(
-
$client->doc->pages->removeName($docId, $layerName, $request) -> ?DocPagesRemoveName200Response +
$client->doc->pages->reorder($docId, $layerName, $request) -> ?DocPagesReorder200Response
@@ -3643,13 +4253,17 @@ $client->doc->pages->setName(
```php -$client->doc->pages->removeName( +$client->doc->pages->reorder( 'docId', 'layerName', - new RemoveNamePagesRequest([ - 'body' => [ - 'key' => "value", + new DocPagesReorderRequest([ + 'pages' => [ + new PageRef([ + 'kind' => PageRefKind::ObjectNumber->value, + 'objectNumber' => 1, + ]), ], + 'position' => PagePositionZero::Start->value, ]), ); ``` @@ -3690,7 +4304,23 @@ $client->doc->pages->removeName(
-**$request:** `array` +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$pages:** `array` + +
+
+ +
+
+ +**$position:** `string|PagePositionAfter`
@@ -3762,6 +4392,14 @@ $client->doc->pages->rotate(
+**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ **$request:** `array`
@@ -3791,11 +4429,7 @@ $client->doc->pages->rotate( $client->doc->redactions->apply( 'docId', 'layerName', - new ApplyRedactionsRequest([ - 'body' => [ - 'key' => "value", - ], - ]), + new DocRedactionsApplyRequest([]), ); ```
@@ -3835,7 +4469,23 @@ $client->doc->redactions->apply(
-**$request:** `array` +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$pages:** `?array` + +
+
+ +
+
+ +**$annotations:** `?array`
@@ -3922,7 +4572,7 @@ $client->doc->signatures->list(
-
$client->doc->signatures->abort($docId, $layerName, $signingId, $request) -> ?DocSignaturesAbort200Response +
$client->doc->signatures->cancel($docId, $layerName, $signingId, $request) -> ?DocSignaturesCancel200Response
@@ -3935,11 +4585,11 @@ $client->doc->signatures->list(
```php -$client->doc->signatures->abort( +$client->doc->signatures->cancel( 'docId', 'layerName', 'signingId', - new AbortSignaturesRequest([]), + new CancelSignaturesRequest([]), ); ```
@@ -4206,7 +4856,7 @@ $client->doc->signatures->analysis(
-The multipart envelope: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock, appearance) and an optional `resource:` PDF part the body's `appearance.resource` names. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is aborted, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). +Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase).
@@ -4814,3 +5464,64 @@ $client->doc->versions->signatureDigest(
+## Doc Metadata Custom +
$client->doc->metadata->custom->get($docId, $layerName, $request) -> ?array +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->metadata->custom->get( + 'docId', + 'layerName', + new GetCustomRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 787813c..ddaff4c 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -76,8 +76,8 @@ public function __construct( $defaultHeaders = [ 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0-alpha.14', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.14', + 'X-Fern-SDK-Version' => '3.0.0-alpha.15', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.15', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Doc/Annotations/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php index 171b0e9..f6f8f69 100644 --- a/src/Doc/Annotations/AnnotationsClient.php +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Annotations\Requests\ListAllAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsListAll200Response; +use CloudPDF\Types\AnnotationList; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -13,16 +13,18 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Annotations\Requests\ListAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsList200Response; use CloudPDF\Doc\Annotations\Requests\CreateAnnotationsRequest; use CloudPDF\Types\DocAnnotationsCreate200Response; use CloudPDF\Doc\Annotations\Requests\DeleteAnnotationsRequest; use CloudPDF\Types\DocAnnotationsDelete200Response; use CloudPDF\Doc\Annotations\Requests\UpdateAnnotationsRequest; use CloudPDF\Types\DocAnnotationsUpdate200Response; +use CloudPDF\Doc\Annotations\Requests\ReadAppearanceAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\ExportAppearanceAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\FlattenAnnotationsRequest; use CloudPDF\Types\DocAnnotationsFlatten200Response; +use CloudPDF\Doc\Annotations\Requests\DocAnnotationsReorderRequest; +use CloudPDF\Types\DocAnnotationsReorder200Response; class AnnotationsClient { @@ -61,7 +63,7 @@ public function __construct( } /** - * Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `pageState.pageObjectNumber` when display order matters. + * Returns one entry per page plus the audit-log cursor for reconciling subsequent document events. Page order is unspecified; join by `page` (a `PageRef`) when display order matters. * * Example: * ```php @@ -83,11 +85,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsListAll200Response + * @return ?AnnotationList * @throws CloudPDFException * @throws CloudPDFApiException */ - public function listAll(string $docId, string $layerName, ListAllAnnotationsRequest $request = new ListAllAnnotationsRequest(), ?array $options = null): ?DocAnnotationsListAll200Response + public function listAll(string $docId, string $layerName, ListAllAnnotationsRequest $request = new ListAllAnnotationsRequest(), ?array $options = null): ?AnnotationList { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -110,7 +112,7 @@ public function listAll(string $docId, string $layerName, ListAllAnnotationsRequ if (empty($json)) { return null; } - return DocAnnotationsListAll200Response::fromJson($json); + return AnnotationList::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -130,14 +132,14 @@ public function listAll(string $docId, string $layerName, ListAllAnnotationsRequ * $client->doc->annotations->list( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new ListAnnotationsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param ListAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -147,11 +149,11 @@ public function listAll(string $docId, string $layerName, ListAllAnnotationsRequ * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsList200Response + * @return ?AnnotationList * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $docId, string $layerName, int $pon, ListAnnotationsRequest $request = new ListAnnotationsRequest(), ?array $options = null): ?DocAnnotationsList200Response + public function list(string $docId, string $layerName, string $pageKey, ListAnnotationsRequest $request = new ListAnnotationsRequest(), ?array $options = null): ?AnnotationList { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -162,7 +164,7 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items", method: HttpMethod::GET, headers: $headers, ), @@ -174,7 +176,7 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations if (empty($json)) { return null; } - return DocAnnotationsList200Response::fromJson($json); + return AnnotationList::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -196,7 +198,7 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations * $client->doc->annotations->create( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new CreateAnnotationsRequest([ * 'body' => [ * 'key' => "value", @@ -207,7 +209,7 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param CreateAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -221,18 +223,21 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations * @throws CloudPDFException * @throws CloudPDFApiException */ - public function create(string $docId, string $layerName, int $pon, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreate200Response + public function create(string $docId, string $layerName, string $pageKey, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreate200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -265,7 +270,7 @@ public function create(string $docId, string $layerName, int $pon, CreateAnnotat * $client->doc->annotations->delete( * 'docId', * 'layerName', - * 1, + * 'pageKey', * 'annotKey', * new DeleteAnnotationsRequest([]), * ); @@ -273,8 +278,8 @@ public function create(string $docId, string $layerName, int $pon, CreateAnnotat * * @param string $docId * @param string $layerName - * @param int $pon - * @param string $annotKey + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param DeleteAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -288,18 +293,21 @@ public function create(string $docId, string $layerName, int $pon, CreateAnnotat * @throws CloudPDFException * @throws CloudPDFApiException */ - public function delete(string $docId, string $layerName, int $pon, string $annotKey, DeleteAnnotationsRequest $request = new DeleteAnnotationsRequest(), ?array $options = null): ?DocAnnotationsDelete200Response + public function delete(string $docId, string $layerName, string $pageKey, string $annotKey, DeleteAnnotationsRequest $request = new DeleteAnnotationsRequest(), ?array $options = null): ?DocAnnotationsDelete200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", method: HttpMethod::DELETE, headers: $headers, ), @@ -331,7 +339,7 @@ public function delete(string $docId, string $layerName, int $pon, string $annot * $client->doc->annotations->update( * 'docId', * 'layerName', - * 1, + * 'pageKey', * 'annotKey', * new UpdateAnnotationsRequest([ * 'body' => [ @@ -343,8 +351,8 @@ public function delete(string $docId, string $layerName, int $pon, string $annot * * @param string $docId * @param string $layerName - * @param int $pon - * @param string $annotKey + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param UpdateAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -358,18 +366,21 @@ public function delete(string $docId, string $layerName, int $pon, string $annot * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $docId, string $layerName, int $pon, string $annotKey, UpdateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsUpdate200Response + public function update(string $docId, string $layerName, string $pageKey, string $annotKey, UpdateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsUpdate200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", method: HttpMethod::PATCH, headers: $headers, body: $request->body, @@ -396,13 +407,73 @@ public function update(string $docId, string $layerName, int $pon, string $annot ); } + /** + * Example: + * ```php + * $client->doc->annotations->readAppearance( + * 'docId', + * 'layerName', + * 'pageKey', + * 'annotKey', + * new ReadAppearanceAnnotationsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param ReadAppearanceAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function readAppearance(string $docId, string $layerName, string $pageKey, string $annotKey, ReadAppearanceAnnotationsRequest $request = new ReadAppearanceAnnotationsRequest(), ?array $options = null): string + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/appearance", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return $response->getBody()->getContents(); + } + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Example: * ```php * $client->doc->annotations->exportAppearance( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new ExportAppearanceAnnotationsRequest([ * 'body' => [ * 'string' => [ @@ -415,7 +486,7 @@ public function update(string $docId, string $layerName, int $pon, string $annot * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param ExportAppearanceAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -429,7 +500,7 @@ public function update(string $docId, string $layerName, int $pon, string $annot * @throws CloudPDFException * @throws CloudPDFApiException */ - public function exportAppearance(string $docId, string $layerName, int $pon, ExportAppearanceAnnotationsRequest $request, ?array $options = null): string + public function exportAppearance(string $docId, string $layerName, string $pageKey, ExportAppearanceAnnotationsRequest $request, ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -440,7 +511,7 @@ public function exportAppearance(string $docId, string $layerName, int $pon, Exp $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items/appearance", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/appearance", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -467,7 +538,7 @@ public function exportAppearance(string $docId, string $layerName, int $pon, Exp * $client->doc->annotations->flatten( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new FlattenAnnotationsRequest([ * 'body' => [ * 'key' => "value", @@ -478,7 +549,7 @@ public function exportAppearance(string $docId, string $layerName, int $pon, Exp * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param FlattenAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -492,18 +563,21 @@ public function exportAppearance(string $docId, string $layerName, int $pon, Exp * @throws CloudPDFException * @throws CloudPDFApiException */ - public function flatten(string $docId, string $layerName, int $pon, FlattenAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsFlatten200Response + public function flatten(string $docId, string $layerName, string $pageKey, FlattenAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsFlatten200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pon}/items/flatten", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/flatten", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -529,4 +603,83 @@ public function flatten(string $docId, string $layerName, int $pon, FlattenAnnot body: $response->getBody()->getContents(), ); } + + /** + * Example: + * ```php + * $client->doc->annotations->reorder( + * 'docId', + * 'layerName', + * 'pageKey', + * new DocAnnotationsReorderRequest([ + * 'refs' => [ + * AnnotationRef::objectNumber(new AnnotationRefObjectNumber([ + * 'page' => new PageRef([ + * 'kind' => PageRefKind::ObjectNumber->value, + * 'objectNumber' => 1, + * ]), + * 'objectNumber' => 1, + * ])), + * ], + * 'position' => AnnotationPositionZero::Start->value, + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param DocAnnotationsReorderRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocAnnotationsReorder200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function reorder(string $docId, string $layerName, string $pageKey, DocAnnotationsReorderRequest $request, ?array $options = null): ?DocAnnotationsReorder200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/reorder", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocAnnotationsReorder200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } } diff --git a/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php b/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php index ba1a2f6..d9cca78 100644 --- a/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php +++ b/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php @@ -11,6 +11,11 @@ class CreateAnnotationsRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class CreateAnnotationsRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php b/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php index 69229ac..c256f9f 100644 --- a/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php +++ b/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php @@ -11,14 +11,21 @@ class DeleteAnnotationsRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @param array{ * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values = [], ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; } } diff --git a/src/Doc/Annotations/Requests/DocAnnotationsReorderRequest.php b/src/Doc/Annotations/Requests/DocAnnotationsReorderRequest.php new file mode 100644 index 0000000..ebfa0a7 --- /dev/null +++ b/src/Doc/Annotations/Requests/DocAnnotationsReorderRequest.php @@ -0,0 +1,59 @@ + $refs + */ + #[JsonProperty('refs'), ArrayType([AnnotationRef::class])] + public array $refs; + + /** + * @var ( + * value-of + * |AnnotationPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', AnnotationPositionAfter::class)] + public string|AnnotationPositionAfter $position; + + /** + * @param array{ + * refs: array, + * position: ( + * value-of + * |AnnotationPositionAfter + * ), + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->refs = $values['refs']; + $this->position = $values['position']; + } +} diff --git a/src/Doc/Annotations/Requests/FlattenAnnotationsRequest.php b/src/Doc/Annotations/Requests/FlattenAnnotationsRequest.php index 463a4d9..27724a6 100644 --- a/src/Doc/Annotations/Requests/FlattenAnnotationsRequest.php +++ b/src/Doc/Annotations/Requests/FlattenAnnotationsRequest.php @@ -11,6 +11,11 @@ class FlattenAnnotationsRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class FlattenAnnotationsRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Annotations/Requests/ReadAppearanceAnnotationsRequest.php b/src/Doc/Annotations/Requests/ReadAppearanceAnnotationsRequest.php new file mode 100644 index 0000000..540316d --- /dev/null +++ b/src/Doc/Annotations/Requests/ReadAppearanceAnnotationsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Annotations/Requests/UpdateAnnotationsRequest.php b/src/Doc/Annotations/Requests/UpdateAnnotationsRequest.php index f78b8e4..c863fac 100644 --- a/src/Doc/Annotations/Requests/UpdateAnnotationsRequest.php +++ b/src/Doc/Annotations/Requests/UpdateAnnotationsRequest.php @@ -11,6 +11,11 @@ class UpdateAnnotationsRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class UpdateAnnotationsRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/DocClient.php b/src/Doc/DocClient.php index 650aa09..8c17d47 100644 --- a/src/Doc/DocClient.php +++ b/src/Doc/DocClient.php @@ -19,6 +19,8 @@ use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; +use CloudPDF\Doc\Requests\DocChangesRequest; +use CloudPDF\Types\DocChanges200Response; use CloudPDF\Doc\Requests\DownloadDocRequest; use CloudPDF\Doc\Requests\ManifestDocRequest; use CloudPDF\Types\DocManifest200Response; @@ -164,6 +166,77 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest ); } + /** + * Each change stands on its own and names itself by `opId`: a refused change rolls back alone, and the answer lists every change in order, applied with its result or refused with its error. Asked again under its `opId`, a change gets the same answer, refusals included; a different change under an answered `opId` is refused (IdempotencyKeyReused). `{ opId, undoOf }` undoes an earlier change of the caller, here or in an earlier request; an undo leaves alone what was changed since, and the undo of an undo redoes. A redaction, a flatten, a form repair or a completed signature ends undo for the changes before it (UndoUnavailable). Each op is checked against its own capability: annotation ops need `doc.annotate.modify`, form values `doc.forms.fill`, form structure `doc.forms.modify`, metadata `doc.metadata.modify`. Bytes (a stamp's drawing, an attached file, a signature's artwork) travel as multipart: a JSON `body` part, each op naming its files by role as `resources: { : '' }`, and each file as the part `resource:`. At most 64 changes per request and 512 ops per change. + * + * Example: + * ```php + * $client->doc->changes( + * 'docId', + * 'layerName', + * new DocChangesRequest([ + * 'changes' => [ + * new DocChangesRequestChangesItem([ + * 'opId' => 'opId', + * ]), + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param DocChangesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocChanges200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function changes(string $docId, string $layerName, DocChangesRequest $request, ?array $options = null): ?DocChanges200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/changes", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocChanges200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Example: * ```php @@ -290,14 +363,14 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r * $client->doc->render( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new RenderDocRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param RenderDocRequest $request * @param ?array{ * baseUrl?: string, @@ -311,7 +384,7 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r * @throws CloudPDFException * @throws CloudPDFApiException */ - public function render(string $docId, string $layerName, int $pon, RenderDocRequest $request = new RenderDocRequest(), ?array $options = null): string + public function render(string $docId, string $layerName, string $pageKey, RenderDocRequest $request = new RenderDocRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -322,7 +395,7 @@ public function render(string $docId, string $layerName, int $pon, RenderDocRequ $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/render/pages/{$pon}/data", + path: "v1/docs/{$docId}/layers/{$layerName}/render/pages/{$pageKey}/data", method: HttpMethod::GET, headers: $headers, ), @@ -348,14 +421,14 @@ public function render(string $docId, string $layerName, int $pon, RenderDocRequ * $client->doc->text( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new TextDocRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param TextDocRequest $request * @param ?array{ * baseUrl?: string, @@ -369,7 +442,7 @@ public function render(string $docId, string $layerName, int $pon, RenderDocRequ * @throws CloudPDFException * @throws CloudPDFApiException */ - public function text(string $docId, string $layerName, int $pon, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocText200Response + public function text(string $docId, string $layerName, string $pageKey, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocText200Response { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -380,7 +453,7 @@ public function text(string $docId, string $layerName, int $pon, TextDocRequest $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/text/pages/{$pon}/data", + path: "v1/docs/{$docId}/layers/{$layerName}/text/pages/{$pageKey}/data", method: HttpMethod::GET, headers: $headers, ), diff --git a/src/Doc/Forms/FormsClient.php b/src/Doc/Forms/FormsClient.php index 9f21849..139edd6 100644 --- a/src/Doc/Forms/FormsClient.php +++ b/src/Doc/Forms/FormsClient.php @@ -4,21 +4,26 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; -use CloudPDF\Doc\Forms\Requests\GetFormsRequest; -use CloudPDF\Types\DocFormsGet200Response; +use CloudPDF\Doc\Forms\Requests\ListFormsRequest; +use CloudPDF\Types\DocFormsList200Response; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; -use CloudPDF\Doc\Forms\Requests\ExportDataFormsRequest; -use CloudPDF\Doc\Forms\Requests\ImportDataFormsRequest; -use CloudPDF\Types\DocFormsImportData200Response; -use CloudPDF\Doc\Forms\Requests\ResetFormsRequest; -use CloudPDF\Types\DocFormsReset200Response; +use CloudPDF\Doc\Forms\Requests\DocFormsReorderCalculationsRequest; +use CloudPDF\Types\DocFormsReorderCalculations200Response; use CloudPDF\Doc\Forms\Requests\SetValueFormsRequest; use CloudPDF\Types\DocFormsSetValue200Response; +use CloudPDF\Doc\Forms\Requests\DocFormsResetRequest; +use CloudPDF\Types\DocFormsReset200Response; +use CloudPDF\Doc\Forms\Requests\DeleteWidgetFormsRequest; +use CloudPDF\Types\DocFormsDeleteWidget200Response; +use CloudPDF\Doc\Forms\Requests\DocFormsUpdateWidgetRequest; +use CloudPDF\Types\DocFormsUpdateWidget200Response; +use CloudPDF\Doc\Forms\Requests\DocFormsReorderWidgetsRequest; +use CloudPDF\Types\DocFormsReorderWidgets200Response; class FormsClient { @@ -59,16 +64,16 @@ public function __construct( /** * Example: * ```php - * $client->doc->forms->get( + * $client->doc->forms->list( * 'docId', * 'layerName', - * new GetFormsRequest([]), + * new ListFormsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param GetFormsRequest $request + * @param ListFormsRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -77,11 +82,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsGet200Response + * @return ?DocFormsList200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $docId, string $layerName, GetFormsRequest $request = new GetFormsRequest(), ?array $options = null): ?DocFormsGet200Response + public function list(string $docId, string $layerName, ListFormsRequest $request = new ListFormsRequest(), ?array $options = null): ?DocFormsList200Response { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -104,7 +109,7 @@ public function get(string $docId, string $layerName, GetFormsRequest $request = if (empty($json)) { return null; } - return DocFormsGet200Response::fromJson($json); + return DocFormsList200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -121,16 +126,23 @@ public function get(string $docId, string $layerName, GetFormsRequest $request = /** * Example: * ```php - * $client->doc->forms->exportData( + * $client->doc->forms->reorderCalculations( * 'docId', * 'layerName', - * new ExportDataFormsRequest([]), + * new DocFormsReorderCalculationsRequest([ + * 'fields' => [ + * FormFieldRef::objectNumber(new FormFieldRefObjectNumber([ + * 'objectNumber' => 1, + * ])), + * ], + * 'position' => FieldPositionZero::Start->value, + * ]), * ); * ``` * * @param string $docId * @param string $layerName - * @param ExportDataFormsRequest $request + * @param DocFormsReorderCalculationsRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -139,36 +151,41 @@ public function get(string $docId, string $layerName, GetFormsRequest $request = * queryParameters?: array, * bodyProperties?: array, * } $options - * @return string + * @return ?DocFormsReorderCalculations200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function exportData(string $docId, string $layerName, ExportDataFormsRequest $request = new ExportDataFormsRequest(), ?array $options = null): string + public function reorderCalculations(string $docId, string $layerName, DocFormsReorderCalculationsRequest $request, ?array $options = null): ?DocFormsReorderCalculations200Response { $options = array_merge($this->options, $options ?? []); - $query = []; - if ($request->format != null) { - $query['format'] = $request->format; - } $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/form/data", - method: HttpMethod::GET, + path: "v1/docs/{$docId}/layers/{$layerName}/form/calculations/reorder", + method: HttpMethod::POST, headers: $headers, - query: $query, + body: $request, ), $options, ); $statusCode = $response->getStatusCode(); if ($statusCode >= 200 && $statusCode < 400) { - return $response->getBody()->getContents(); + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsReorderCalculations200Response::fromJson($json); } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); } catch (ClientExceptionInterface $e) { throw new CloudPDFException(message: $e->getMessage(), previous: $e); } @@ -182,10 +199,11 @@ public function exportData(string $docId, string $layerName, ExportDataFormsRequ /** * Example: * ```php - * $client->doc->forms->importData( + * $client->doc->forms->setValue( * 'docId', * 'layerName', - * new ImportDataFormsRequest([ + * 'fieldKey', + * new SetValueFormsRequest([ * 'body' => [ * 'key' => "value", * ], @@ -195,7 +213,8 @@ public function exportData(string $docId, string $layerName, ExportDataFormsRequ * * @param string $docId * @param string $layerName - * @param ImportDataFormsRequest $request + * @param string $fieldKey + * @param SetValueFormsRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -204,22 +223,25 @@ public function exportData(string $docId, string $layerName, ExportDataFormsRequ * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsImportData200Response + * @return ?DocFormsSetValue200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function importData(string $docId, string $layerName, ImportDataFormsRequest $request, ?array $options = null): ?DocFormsImportData200Response + public function setValue(string $docId, string $layerName, string $fieldKey, SetValueFormsRequest $request, ?array $options = null): ?DocFormsSetValue200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/form/data", + path: "v1/docs/{$docId}/layers/{$layerName}/form/fields/{$fieldKey}/value", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -232,7 +254,7 @@ public function importData(string $docId, string $layerName, ImportDataFormsRequ if (empty($json)) { return null; } - return DocFormsImportData200Response::fromJson($json); + return DocFormsSetValue200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -252,15 +274,13 @@ public function importData(string $docId, string $layerName, ImportDataFormsRequ * $client->doc->forms->reset( * 'docId', * 'layerName', - * 'fieldKey', - * new ResetFormsRequest([]), + * new DocFormsResetRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $fieldKey - * @param ResetFormsRequest $request + * @param DocFormsResetRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -273,20 +293,24 @@ public function importData(string $docId, string $layerName, ImportDataFormsRequ * @throws CloudPDFException * @throws CloudPDFApiException */ - public function reset(string $docId, string $layerName, string $fieldKey, ResetFormsRequest $request = new ResetFormsRequest(), ?array $options = null): ?DocFormsReset200Response + public function reset(string $docId, string $layerName, DocFormsResetRequest $request = new DocFormsResetRequest(), ?array $options = null): ?DocFormsReset200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/form/fields/{$fieldKey}/reset", + path: "v1/docs/{$docId}/layers/{$layerName}/form/reset", method: HttpMethod::POST, headers: $headers, + body: $request, ), $options, ); @@ -313,22 +337,170 @@ public function reset(string $docId, string $layerName, string $fieldKey, ResetF /** * Example: * ```php - * $client->doc->forms->setValue( + * $client->doc->forms->deleteWidget( * 'docId', * 'layerName', - * 'fieldKey', - * new SetValueFormsRequest([ - * 'body' => [ - * 'key' => "value", + * 'pageKey', + * 'annotKey', + * new DeleteWidgetFormsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param DeleteWidgetFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsDeleteWidget200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function deleteWidget(string $docId, string $layerName, string $pageKey, string $annotKey, DeleteWidgetFormsRequest $request = new DeleteWidgetFormsRequest(), ?array $options = null): ?DocFormsDeleteWidget200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", + method: HttpMethod::DELETE, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsDeleteWidget200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->forms->updateWidget( + * 'docId', + * 'layerName', + * 'pageKey', + * 'annotKey', + * new DocFormsUpdateWidgetRequest([ + * 'patch' => new WidgetPatch([]), + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param DocFormsUpdateWidgetRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsUpdateWidget200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function updateWidget(string $docId, string $layerName, string $pageKey, string $annotKey, DocFormsUpdateWidgetRequest $request, ?array $options = null): ?DocFormsUpdateWidget200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", + method: HttpMethod::PATCH, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsUpdateWidget200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->forms->reorderWidgets( + * 'docId', + * 'layerName', + * 'pageKey', + * new DocFormsReorderWidgetsRequest([ + * 'widgets' => [ + * AnnotationRef::objectNumber(new AnnotationRefObjectNumber([ + * 'page' => new PageRef([ + * 'kind' => PageRefKind::ObjectNumber->value, + * 'objectNumber' => 1, + * ]), + * 'objectNumber' => 1, + * ])), * ], + * 'position' => AnnotationPositionZero::Start->value, * ]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $fieldKey - * @param SetValueFormsRequest $request + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param DocFormsReorderWidgetsRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -337,25 +509,28 @@ public function reset(string $docId, string $layerName, string $fieldKey, ResetF * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsSetValue200Response + * @return ?DocFormsReorderWidgets200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setValue(string $docId, string $layerName, string $fieldKey, SetValueFormsRequest $request, ?array $options = null): ?DocFormsSetValue200Response + public function reorderWidgets(string $docId, string $layerName, string $pageKey, DocFormsReorderWidgetsRequest $request, ?array $options = null): ?DocFormsReorderWidgets200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/form/fields/{$fieldKey}/value", + path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/reorder", method: HttpMethod::POST, headers: $headers, - body: $request->body, + body: $request, ), $options, ); @@ -365,7 +540,7 @@ public function setValue(string $docId, string $layerName, string $fieldKey, Set if (empty($json)) { return null; } - return DocFormsSetValue200Response::fromJson($json); + return DocFormsReorderWidgets200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Forms/Requests/DeleteWidgetFormsRequest.php b/src/Doc/Forms/Requests/DeleteWidgetFormsRequest.php new file mode 100644 index 0000000..514c4db --- /dev/null +++ b/src/Doc/Forms/Requests/DeleteWidgetFormsRequest.php @@ -0,0 +1,31 @@ +documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + } +} diff --git a/src/Doc/Forms/Requests/DocFormsReorderCalculationsRequest.php b/src/Doc/Forms/Requests/DocFormsReorderCalculationsRequest.php new file mode 100644 index 0000000..4c85ce5 --- /dev/null +++ b/src/Doc/Forms/Requests/DocFormsReorderCalculationsRequest.php @@ -0,0 +1,59 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([FormFieldRef::class])] + public array $fields; + + /** + * @var ( + * value-of + * |FieldPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', FieldPositionAfter::class)] + public string|FieldPositionAfter $position; + + /** + * @param array{ + * fields: array, + * position: ( + * value-of + * |FieldPositionAfter + * ), + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->fields = $values['fields']; + $this->position = $values['position']; + } +} diff --git a/src/Doc/Forms/Requests/DocFormsReorderWidgetsRequest.php b/src/Doc/Forms/Requests/DocFormsReorderWidgetsRequest.php new file mode 100644 index 0000000..98bfd87 --- /dev/null +++ b/src/Doc/Forms/Requests/DocFormsReorderWidgetsRequest.php @@ -0,0 +1,59 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([AnnotationRef::class])] + public array $widgets; + + /** + * @var ( + * value-of + * |AnnotationPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', AnnotationPositionAfter::class)] + public string|AnnotationPositionAfter $position; + + /** + * @param array{ + * widgets: array, + * position: ( + * value-of + * |AnnotationPositionAfter + * ), + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->widgets = $values['widgets']; + $this->position = $values['position']; + } +} diff --git a/src/Doc/Forms/Requests/DocFormsResetRequest.php b/src/Doc/Forms/Requests/DocFormsResetRequest.php new file mode 100644 index 0000000..9a1cd08 --- /dev/null +++ b/src/Doc/Forms/Requests/DocFormsResetRequest.php @@ -0,0 +1,42 @@ + $refs + */ + #[JsonProperty('refs'), ArrayType([FormFieldRef::class])] + public ?array $refs; + + /** + * @param array{ + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * refs?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->refs = $values['refs'] ?? null; + } +} diff --git a/src/Doc/Forms/Requests/DocFormsUpdateWidgetRequest.php b/src/Doc/Forms/Requests/DocFormsUpdateWidgetRequest.php new file mode 100644 index 0000000..d1144a3 --- /dev/null +++ b/src/Doc/Forms/Requests/DocFormsUpdateWidgetRequest.php @@ -0,0 +1,41 @@ +documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->patch = $values['patch']; + } +} diff --git a/src/Doc/Forms/Requests/ExportDataFormsRequest.php b/src/Doc/Forms/Requests/ExportDataFormsRequest.php deleted file mode 100644 index 6acb60d..0000000 --- a/src/Doc/Forms/Requests/ExportDataFormsRequest.php +++ /dev/null @@ -1,32 +0,0 @@ - $format - */ - public ?string $format; - - /** - * @var ?string $documentPassword Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. - */ - public ?string $documentPassword; - - /** - * @param array{ - * format?: ?value-of, - * documentPassword?: ?string, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->format = $values['format'] ?? null; - $this->documentPassword = $values['documentPassword'] ?? null; - } -} diff --git a/src/Doc/Forms/Requests/GetFormsRequest.php b/src/Doc/Forms/Requests/GetFormsRequest.php deleted file mode 100644 index 4d1890a..0000000 --- a/src/Doc/Forms/Requests/GetFormsRequest.php +++ /dev/null @@ -1,24 +0,0 @@ -documentPassword = $values['documentPassword'] ?? null; - } -} diff --git a/src/Doc/Forms/Requests/ImportDataFormsRequest.php b/src/Doc/Forms/Requests/ImportDataFormsRequest.php deleted file mode 100644 index 227d16c..0000000 --- a/src/Doc/Forms/Requests/ImportDataFormsRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Doc/Forms/Requests/ListFormsRequest.php b/src/Doc/Forms/Requests/ListFormsRequest.php new file mode 100644 index 0000000..3f831fe --- /dev/null +++ b/src/Doc/Forms/Requests/ListFormsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Forms/Requests/ResetFormsRequest.php b/src/Doc/Forms/Requests/ResetFormsRequest.php deleted file mode 100644 index 1ca97ed..0000000 --- a/src/Doc/Forms/Requests/ResetFormsRequest.php +++ /dev/null @@ -1,24 +0,0 @@ -documentPassword = $values['documentPassword'] ?? null; - } -} diff --git a/src/Doc/Forms/Requests/SetValueFormsRequest.php b/src/Doc/Forms/Requests/SetValueFormsRequest.php index cccfc5e..54a8f0f 100644 --- a/src/Doc/Forms/Requests/SetValueFormsRequest.php +++ b/src/Doc/Forms/Requests/SetValueFormsRequest.php @@ -11,6 +11,11 @@ class SetValueFormsRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class SetValueFormsRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Forms/Types/ExportDataFormsRequestFormat.php b/src/Doc/Forms/Types/ExportDataFormsRequestFormat.php deleted file mode 100644 index 3922289..0000000 --- a/src/Doc/Forms/Types/ExportDataFormsRequestFormat.php +++ /dev/null @@ -1,9 +0,0 @@ -, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Example: + * ```php + * $client->doc->metadata->custom->get( + * 'docId', + * 'layerName', + * new GetCustomRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param GetCustomRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?array + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function get(string $docId, string $layerName, GetCustomRequest $request = new GetCustomRequest(), ?array $options = null): ?array + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/metadata/custom", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return JsonDecoder::decodeArray($json, ['string' => 'string']); // @phpstan-ignore-line + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Doc/Metadata/Custom/Requests/GetCustomRequest.php b/src/Doc/Metadata/Custom/Requests/GetCustomRequest.php new file mode 100644 index 0000000..3334b38 --- /dev/null +++ b/src/Doc/Metadata/Custom/Requests/GetCustomRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Metadata/MetadataClient.php b/src/Doc/Metadata/MetadataClient.php index c1952f2..e4ff001 100644 --- a/src/Doc/Metadata/MetadataClient.php +++ b/src/Doc/Metadata/MetadataClient.php @@ -2,10 +2,11 @@ namespace CloudPDF\Doc\Metadata; +use CloudPDF\Doc\Metadata\Custom\CustomClient; use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Metadata\Requests\GetMetadataRequest; -use CloudPDF\Types\DocMetadataGet200Response; +use CloudPDF\Types\DocumentMetadata; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -15,6 +16,11 @@ class MetadataClient { + /** + * @var CustomClient $custom + */ + public CustomClient $custom; + /** * @var array{ * baseUrl?: string, @@ -47,6 +53,7 @@ public function __construct( ) { $this->client = $client; $this->options = $options ?? []; + $this->custom = new CustomClient($this->client, $this->options); } /** @@ -70,11 +77,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocMetadataGet200Response + * @return ?DocumentMetadata * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $docId, string $layerName, GetMetadataRequest $request = new GetMetadataRequest(), ?array $options = null): ?DocMetadataGet200Response + public function get(string $docId, string $layerName, GetMetadataRequest $request = new GetMetadataRequest(), ?array $options = null): ?DocumentMetadata { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -97,7 +104,7 @@ public function get(string $docId, string $layerName, GetMetadataRequest $reques if (empty($json)) { return null; } - return DocMetadataGet200Response::fromJson($json); + return DocumentMetadata::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php index f4c24f9..da0a7b9 100644 --- a/src/Doc/Pages/PagesClient.php +++ b/src/Doc/Pages/PagesClient.php @@ -13,8 +13,7 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Pages\Requests\ViewportsPagesRequest; -use CloudPDF\Types\DocPagesViewports200ResponseItem; -use CloudPDF\Core\Json\JsonDecoder; +use CloudPDF\Types\DocPagesViewports200Response; use CloudPDF\Doc\Pages\Requests\DeletePagesRequest; use CloudPDF\Types\DocPagesDelete200Response; use CloudPDF\Doc\Pages\Requests\ExtractPagesRequest; @@ -26,12 +25,12 @@ use CloudPDF\Core\Multipart\MultipartApiRequest; use CloudPDF\Doc\Pages\Requests\InsertBlankPagesRequest; use CloudPDF\Types\DocPagesInsertBlank200Response; -use CloudPDF\Doc\Pages\Requests\MovePagesRequest; -use CloudPDF\Types\DocPagesMove200Response; use CloudPDF\Doc\Pages\Requests\SetNamePagesRequest; use CloudPDF\Types\DocPagesSetName200Response; use CloudPDF\Doc\Pages\Requests\RemoveNamePagesRequest; use CloudPDF\Types\DocPagesRemoveName200Response; +use CloudPDF\Doc\Pages\Requests\DocPagesReorderRequest; +use CloudPDF\Types\DocPagesReorder200Response; use CloudPDF\Doc\Pages\Requests\RotatePagesRequest; use CloudPDF\Types\DocPagesRotate200Response; @@ -77,14 +76,14 @@ public function __construct( * $client->doc->pages->setScale( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new DocPagesSetScaleRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param DocPagesSetScaleRequest $request * @param ?array{ * baseUrl?: string, @@ -98,18 +97,21 @@ public function __construct( * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setScale(string $docId, string $layerName, int $pon, DocPagesSetScaleRequest $request, ?array $options = null): ?DocPagesSetScale200Response + public function setScale(string $docId, string $layerName, string $pageKey, DocPagesSetScaleRequest $request, ?array $options = null): ?DocPagesSetScale200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pon}/scale", + path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pageKey}/scale", method: HttpMethod::PUT, headers: $headers, body: $request, @@ -142,14 +144,14 @@ public function setScale(string $docId, string $layerName, int $pon, DocPagesSet * $client->doc->pages->viewports( * 'docId', * 'layerName', - * 1, + * 'pageKey', * new ViewportsPagesRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param int $pon + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. * @param ViewportsPagesRequest $request * @param ?array{ * baseUrl?: string, @@ -159,11 +161,11 @@ public function setScale(string $docId, string $layerName, int $pon, DocPagesSet * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?array + * @return ?DocPagesViewports200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function viewports(string $docId, string $layerName, int $pon, ViewportsPagesRequest $request = new ViewportsPagesRequest(), ?array $options = null): ?array + public function viewports(string $docId, string $layerName, string $pageKey, ViewportsPagesRequest $request = new ViewportsPagesRequest(), ?array $options = null): ?DocPagesViewports200Response { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -174,7 +176,7 @@ public function viewports(string $docId, string $layerName, int $pon, ViewportsP $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pon}/viewports", + path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pageKey}/viewports", method: HttpMethod::GET, headers: $headers, ), @@ -186,7 +188,7 @@ public function viewports(string $docId, string $layerName, int $pon, ViewportsP if (empty($json)) { return null; } - return JsonDecoder::decodeArray($json, [DocPagesViewports200ResponseItem::class]); // @phpstan-ignore-line + return DocPagesViewports200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -236,6 +238,9 @@ public function delete(string $docId, string $layerName, DeletePagesRequest $req if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( @@ -268,7 +273,7 @@ public function delete(string $docId, string $layerName, DeletePagesRequest $req } /** - * A read, not a mutation: the source document is untouched and no event is published. Body is `{"pageObjectNumbers": number[]}`; the response body is the new PDF. + * A read, not a mutation: the source document is untouched and no event is published. Body is `{"pages": PageRef[]}`; the response body is the new PDF. * * Example: * ```php @@ -368,6 +373,9 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( @@ -400,7 +408,7 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r } /** - * Multipart mutation envelope: a `body` field holding `{"destIndex"?: number}` (omitted → append) plus a `resource:source` file part carrying the standalone PDF whose pages are copied in. The inserted copies get fresh page object numbers, returned in insertion order. + * Multipart: a JSON `body` part `{"position"?: PagePosition, "resources": {"source": ""}}` (position omitted → the end), and the standalone PDF whose pages are copied in as the part `resource:`. The inserted copies get fresh page object numbers, returned in insertion order. * * Example: * ```php @@ -434,6 +442,9 @@ public function insert(string $docId, string $layerName, InsertPagesRequest $req if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } $body = new MultipartFormData(); $body->addPart($request->file->toMultipartFormDataPart('file')); try { @@ -468,7 +479,7 @@ public function insert(string $docId, string $layerName, InsertPagesRequest $req } /** - * Body is `{"size": {"width", "height"}, "count"?, "destIndex"?}` — size in PDF points, count in [1, 100], destIndex omitted → append. + * Body is `{"size": {"width", "height"}, "count"?, "position"?}` — size in PDF points, count in [1, 100], `position` a `PagePosition` (omitted → the end). * * Example: * ```php @@ -505,6 +516,9 @@ public function insertBlank(string $docId, string $layerName, InsertBlankPagesRe if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( @@ -539,10 +553,10 @@ public function insertBlank(string $docId, string $layerName, InsertBlankPagesRe /** * Example: * ```php - * $client->doc->pages->move( + * $client->doc->pages->setName( * 'docId', * 'layerName', - * new MovePagesRequest([ + * new SetNamePagesRequest([ * 'body' => [ * 'key' => "value", * ], @@ -552,7 +566,7 @@ public function insertBlank(string $docId, string $layerName, InsertBlankPagesRe * * @param string $docId * @param string $layerName - * @param MovePagesRequest $request + * @param SetNamePagesRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -561,22 +575,25 @@ public function insertBlank(string $docId, string $layerName, InsertBlankPagesRe * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesMove200Response + * @return ?DocPagesSetName200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function move(string $docId, string $layerName, MovePagesRequest $request, ?array $options = null): ?DocPagesMove200Response + public function setName(string $docId, string $layerName, SetNamePagesRequest $request, ?array $options = null): ?DocPagesSetName200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/move", + path: "v1/docs/{$docId}/layers/{$layerName}/pages/names", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -589,7 +606,7 @@ public function move(string $docId, string $layerName, MovePagesRequest $request if (empty($json)) { return null; } - return DocPagesMove200Response::fromJson($json); + return DocPagesSetName200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -606,10 +623,10 @@ public function move(string $docId, string $layerName, MovePagesRequest $request /** * Example: * ```php - * $client->doc->pages->setName( + * $client->doc->pages->removeName( * 'docId', * 'layerName', - * new SetNamePagesRequest([ + * new RemoveNamePagesRequest([ * 'body' => [ * 'key' => "value", * ], @@ -619,7 +636,7 @@ public function move(string $docId, string $layerName, MovePagesRequest $request * * @param string $docId * @param string $layerName - * @param SetNamePagesRequest $request + * @param RemoveNamePagesRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -628,22 +645,25 @@ public function move(string $docId, string $layerName, MovePagesRequest $request * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesSetName200Response + * @return ?DocPagesRemoveName200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setName(string $docId, string $layerName, SetNamePagesRequest $request, ?array $options = null): ?DocPagesSetName200Response + public function removeName(string $docId, string $layerName, RemoveNamePagesRequest $request, ?array $options = null): ?DocPagesRemoveName200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/names", + path: "v1/docs/{$docId}/layers/{$layerName}/pages/names/delete", method: HttpMethod::POST, headers: $headers, body: $request->body, @@ -656,7 +676,7 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r if (empty($json)) { return null; } - return DocPagesSetName200Response::fromJson($json); + return DocPagesRemoveName200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -673,20 +693,24 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r /** * Example: * ```php - * $client->doc->pages->removeName( + * $client->doc->pages->reorder( * 'docId', * 'layerName', - * new RemoveNamePagesRequest([ - * 'body' => [ - * 'key' => "value", + * new DocPagesReorderRequest([ + * 'pages' => [ + * new PageRef([ + * 'kind' => PageRefKind::ObjectNumber->value, + * 'objectNumber' => 1, + * ]), * ], + * 'position' => PagePositionZero::Start->value, * ]), * ); * ``` * * @param string $docId * @param string $layerName - * @param RemoveNamePagesRequest $request + * @param DocPagesReorderRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -695,25 +719,28 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesRemoveName200Response + * @return ?DocPagesReorder200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function removeName(string $docId, string $layerName, RemoveNamePagesRequest $request, ?array $options = null): ?DocPagesRemoveName200Response + public function reorder(string $docId, string $layerName, DocPagesReorderRequest $request, ?array $options = null): ?DocPagesReorder200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', - path: "v1/docs/{$docId}/layers/{$layerName}/pages/names/delete", + path: "v1/docs/{$docId}/layers/{$layerName}/pages/reorder", method: HttpMethod::POST, headers: $headers, - body: $request->body, + body: $request, ), $options, ); @@ -723,7 +750,7 @@ public function removeName(string $docId, string $layerName, RemoveNamePagesRequ if (empty($json)) { return null; } - return DocPagesRemoveName200Response::fromJson($json); + return DocPagesReorder200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -773,6 +800,9 @@ public function rotate(string $docId, string $layerName, RotatePagesRequest $req if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( diff --git a/src/Doc/Pages/Requests/DeletePagesRequest.php b/src/Doc/Pages/Requests/DeletePagesRequest.php index 183c37c..243c352 100644 --- a/src/Doc/Pages/Requests/DeletePagesRequest.php +++ b/src/Doc/Pages/Requests/DeletePagesRequest.php @@ -11,6 +11,11 @@ class DeletePagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class DeletePagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Requests/DocPagesReorderRequest.php b/src/Doc/Pages/Requests/DocPagesReorderRequest.php new file mode 100644 index 0000000..ebce975 --- /dev/null +++ b/src/Doc/Pages/Requests/DocPagesReorderRequest.php @@ -0,0 +1,59 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ( + * value-of + * |PagePositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', PagePositionAfter::class)] + public string|PagePositionAfter $position; + + /** + * @param array{ + * pages: array, + * position: ( + * value-of + * |PagePositionAfter + * ), + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->pages = $values['pages']; + $this->position = $values['position']; + } +} diff --git a/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php b/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php index 6324fcd..98102f6 100644 --- a/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php +++ b/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php @@ -13,6 +13,11 @@ class DocPagesSetScaleRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var ?DocPagesSetScaleRequestMeasure $measure */ @@ -22,6 +27,7 @@ class DocPagesSetScaleRequest extends JsonSerializableType /** * @param array{ * documentPassword?: ?string, + * idempotencyKey?: ?string, * measure?: ?DocPagesSetScaleRequestMeasure, * } $values */ @@ -29,6 +35,7 @@ public function __construct( array $values = [], ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->measure = $values['measure'] ?? null; } } diff --git a/src/Doc/Pages/Requests/FlattenPagesRequest.php b/src/Doc/Pages/Requests/FlattenPagesRequest.php index ece6075..59c4123 100644 --- a/src/Doc/Pages/Requests/FlattenPagesRequest.php +++ b/src/Doc/Pages/Requests/FlattenPagesRequest.php @@ -11,6 +11,11 @@ class FlattenPagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class FlattenPagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Requests/InsertBlankPagesRequest.php b/src/Doc/Pages/Requests/InsertBlankPagesRequest.php index 1fb7c58..9a991ad 100644 --- a/src/Doc/Pages/Requests/InsertBlankPagesRequest.php +++ b/src/Doc/Pages/Requests/InsertBlankPagesRequest.php @@ -11,6 +11,11 @@ class InsertBlankPagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class InsertBlankPagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Requests/InsertPagesRequest.php b/src/Doc/Pages/Requests/InsertPagesRequest.php index 315d576..aab3842 100644 --- a/src/Doc/Pages/Requests/InsertPagesRequest.php +++ b/src/Doc/Pages/Requests/InsertPagesRequest.php @@ -12,6 +12,11 @@ class InsertPagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var File $file */ @@ -21,12 +26,14 @@ class InsertPagesRequest extends JsonSerializableType * @param array{ * file: File, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->file = $values['file']; } } diff --git a/src/Doc/Pages/Requests/MovePagesRequest.php b/src/Doc/Pages/Requests/MovePagesRequest.php deleted file mode 100644 index 25960ce..0000000 --- a/src/Doc/Pages/Requests/MovePagesRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Doc/Pages/Requests/RemoveNamePagesRequest.php b/src/Doc/Pages/Requests/RemoveNamePagesRequest.php index a7e11dd..348aa8e 100644 --- a/src/Doc/Pages/Requests/RemoveNamePagesRequest.php +++ b/src/Doc/Pages/Requests/RemoveNamePagesRequest.php @@ -11,6 +11,11 @@ class RemoveNamePagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class RemoveNamePagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Requests/RotatePagesRequest.php b/src/Doc/Pages/Requests/RotatePagesRequest.php index cabe8ae..227fca2 100644 --- a/src/Doc/Pages/Requests/RotatePagesRequest.php +++ b/src/Doc/Pages/Requests/RotatePagesRequest.php @@ -11,6 +11,11 @@ class RotatePagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class RotatePagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Requests/SetNamePagesRequest.php b/src/Doc/Pages/Requests/SetNamePagesRequest.php index 58bc596..aaad1be 100644 --- a/src/Doc/Pages/Requests/SetNamePagesRequest.php +++ b/src/Doc/Pages/Requests/SetNamePagesRequest.php @@ -11,6 +11,11 @@ class SetNamePagesRequest extends JsonSerializableType */ public ?string $documentPassword; + /** + * @var ?string $idempotencyKey Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + */ + public ?string $idempotencyKey; + /** * @var array $body */ @@ -20,12 +25,14 @@ class SetNamePagesRequest extends JsonSerializableType * @param array{ * body: array, * documentPassword?: ?string, + * idempotencyKey?: ?string, * } $values */ public function __construct( array $values, ) { $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->body = $values['body']; } } diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSubtype.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSubtype.php index 8453f0d..10de7ca 100644 --- a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSubtype.php +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSubtype.php @@ -4,5 +4,5 @@ enum DocPagesSetScaleRequestMeasureSubtype: string { - case Rl = "RL"; + case Rectilinear = "rectilinear"; } diff --git a/src/Doc/Redactions/RedactionsClient.php b/src/Doc/Redactions/RedactionsClient.php index 3162c05..c4d0be9 100644 --- a/src/Doc/Redactions/RedactionsClient.php +++ b/src/Doc/Redactions/RedactionsClient.php @@ -4,7 +4,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; -use CloudPDF\Doc\Redactions\Requests\ApplyRedactionsRequest; +use CloudPDF\Doc\Redactions\Requests\DocRedactionsApplyRequest; use CloudPDF\Types\DocRedactionsApply200Response; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; @@ -55,17 +55,13 @@ public function __construct( * $client->doc->redactions->apply( * 'docId', * 'layerName', - * new ApplyRedactionsRequest([ - * 'body' => [ - * 'key' => "value", - * ], - * ]), + * new DocRedactionsApplyRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param ApplyRedactionsRequest $request + * @param DocRedactionsApplyRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -78,13 +74,16 @@ public function __construct( * @throws CloudPDFException * @throws CloudPDFApiException */ - public function apply(string $docId, string $layerName, ApplyRedactionsRequest $request, ?array $options = null): ?DocRedactionsApply200Response + public function apply(string $docId, string $layerName, DocRedactionsApplyRequest $request = new DocRedactionsApplyRequest(), ?array $options = null): ?DocRedactionsApply200Response { $options = array_merge($this->options, $options ?? []); $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } try { $response = $this->client->sendRequest( new JsonApiRequest( @@ -92,7 +91,7 @@ public function apply(string $docId, string $layerName, ApplyRedactionsRequest $ path: "v1/docs/{$docId}/layers/{$layerName}/redactions/apply", method: HttpMethod::POST, headers: $headers, - body: $request->body, + body: $request, ), $options, ); diff --git a/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php b/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php deleted file mode 100644 index 637d1f1..0000000 --- a/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php +++ /dev/null @@ -1,31 +0,0 @@ - $body - */ - public array $body; - - /** - * @param array{ - * body: array, - * documentPassword?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documentPassword = $values['documentPassword'] ?? null; - $this->body = $values['body']; - } -} diff --git a/src/Doc/Redactions/Requests/DocRedactionsApplyRequest.php b/src/Doc/Redactions/Requests/DocRedactionsApplyRequest.php new file mode 100644 index 0000000..ae2021f --- /dev/null +++ b/src/Doc/Redactions/Requests/DocRedactionsApplyRequest.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public ?array $pages; + + /** + * @var ?array $annotations + */ + #[JsonProperty('annotations'), ArrayType([AnnotationRef::class])] + public ?array $annotations; + + /** + * @param array{ + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * pages?: ?array, + * annotations?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->pages = $values['pages'] ?? null; + $this->annotations = $values['annotations'] ?? null; + } +} diff --git a/src/Doc/Requests/DocChangesRequest.php b/src/Doc/Requests/DocChangesRequest.php new file mode 100644 index 0000000..8c6e3fe --- /dev/null +++ b/src/Doc/Requests/DocChangesRequest.php @@ -0,0 +1,35 @@ + $changes + */ + #[JsonProperty('changes'), ArrayType([DocChangesRequestChangesItem::class])] + public array $changes; + + /** + * @param array{ + * changes: array, + * documentPassword?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->changes = $values['changes']; + } +} diff --git a/src/Doc/Signatures/Requests/AbortSignaturesRequest.php b/src/Doc/Signatures/Requests/AbortSignaturesRequest.php deleted file mode 100644 index 2357253..0000000 --- a/src/Doc/Signatures/Requests/AbortSignaturesRequest.php +++ /dev/null @@ -1,24 +0,0 @@ -documentPassword = $values['documentPassword'] ?? null; - } -} diff --git a/src/Doc/Signatures/Requests/CancelSignaturesRequest.php b/src/Doc/Signatures/Requests/CancelSignaturesRequest.php new file mode 100644 index 0000000..0f9cb29 --- /dev/null +++ b/src/Doc/Signatures/Requests/CancelSignaturesRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Signatures/SignaturesClient.php b/src/Doc/Signatures/SignaturesClient.php index 9700a06..9caf5ba 100644 --- a/src/Doc/Signatures/SignaturesClient.php +++ b/src/Doc/Signatures/SignaturesClient.php @@ -12,8 +12,8 @@ use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; -use CloudPDF\Doc\Signatures\Requests\AbortSignaturesRequest; -use CloudPDF\Types\DocSignaturesAbort200Response; +use CloudPDF\Doc\Signatures\Requests\CancelSignaturesRequest; +use CloudPDF\Types\DocSignaturesCancel200Response; use CloudPDF\Doc\Signatures\Requests\DocSignaturesCompleteRequest; use CloudPDF\Types\DocSignaturesComplete200Response; use CloudPDF\Doc\Signatures\Requests\AnalysisSignaturesRequest; @@ -126,18 +126,18 @@ public function list(string $docId, string $layerName, ListSignaturesRequest $re /** * Example: * ```php - * $client->doc->signatures->abort( + * $client->doc->signatures->cancel( * 'docId', * 'layerName', * 'signingId', - * new AbortSignaturesRequest([]), + * new CancelSignaturesRequest([]), * ); * ``` * * @param string $docId * @param string $layerName * @param string $signingId - * @param AbortSignaturesRequest $request + * @param CancelSignaturesRequest $request * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -146,11 +146,11 @@ public function list(string $docId, string $layerName, ListSignaturesRequest $re * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocSignaturesAbort200Response + * @return ?DocSignaturesCancel200Response * @throws CloudPDFException * @throws CloudPDFApiException */ - public function abort(string $docId, string $layerName, string $signingId, AbortSignaturesRequest $request = new AbortSignaturesRequest(), ?array $options = null): ?DocSignaturesAbort200Response + public function cancel(string $docId, string $layerName, string $signingId, CancelSignaturesRequest $request = new CancelSignaturesRequest(), ?array $options = null): ?DocSignaturesCancel200Response { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -173,7 +173,7 @@ public function abort(string $docId, string $layerName, string $signingId, Abort if (empty($json)) { return null; } - return DocSignaturesAbort200Response::fromJson($json); + return DocSignaturesCancel200Response::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -336,7 +336,7 @@ public function analysis(string $docId, string $layerName, AnalysisSignaturesReq } /** - * The multipart envelope: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock, appearance) and an optional `resource:` PDF part the body's `appearance.resource` names. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is aborted, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). + * Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A layer behind the document head cannot sign (StaleBase). * * Example: * ```php diff --git a/src/Doc/Types/DocChangesRequestChangesItem.php b/src/Doc/Types/DocChangesRequestChangesItem.php new file mode 100644 index 0000000..bfb0a50 --- /dev/null +++ b/src/Doc/Types/DocChangesRequestChangesItem.php @@ -0,0 +1,52 @@ + $ops + */ + #[JsonProperty('ops'), ArrayType([ChangeOp::class])] + public ?array $ops; + + /** + * @var ?string $undoOf + */ + #[JsonProperty('undoOf')] + public ?string $undoOf; + + /** + * @param array{ + * opId: string, + * ops?: ?array, + * undoOf?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->opId = $values['opId']; + $this->ops = $values['ops'] ?? null; + $this->undoOf = $values['undoOf'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Documents/Requests/DocumentsImportFromRequest.php b/src/Documents/Requests/DocumentsImportFromRequest.php index 8174375..a8ceb74 100644 --- a/src/Documents/Requests/DocumentsImportFromRequest.php +++ b/src/Documents/Requests/DocumentsImportFromRequest.php @@ -13,7 +13,7 @@ class DocumentsImportFromRequest extends JsonSerializableType { /** - * @var DocumentsImportFromRequestSource $source Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. + * @var DocumentsImportFromRequestSource $source Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file. */ #[JsonProperty('source')] public DocumentsImportFromRequestSource $source; diff --git a/src/Documents/Types/DocumentsImportFromRequestSource.php b/src/Documents/Types/DocumentsImportFromRequestSource.php index 1166d2a..47c8160 100644 --- a/src/Documents/Types/DocumentsImportFromRequestSource.php +++ b/src/Documents/Types/DocumentsImportFromRequestSource.php @@ -6,7 +6,7 @@ use Exception; /** - * Where CloudPDF pulls the bytes from. The two shapes differ in WHO supplies the authority to read, not in which storage vendor holds the file. + * Where CloudPDF pulls the bytes from. The two shapes differ in who supplies the authority to read, not in which storage vendor holds the file. */ class DocumentsImportFromRequestSource extends JsonSerializableType { diff --git a/src/Shares/SharesClient.php b/src/Shares/SharesClient.php index 9516476..1eea0a6 100644 --- a/src/Shares/SharesClient.php +++ b/src/Shares/SharesClient.php @@ -181,7 +181,7 @@ public function list(string $tenantId, ListSharesRequest $request = new ListShar } /** - * The returned share id IS the public share token. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. + * The returned share id is the public share token. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. * * Example: * ```php diff --git a/src/Types/Annotation.php b/src/Types/Annotation.php new file mode 100644 index 0000000..870a154 --- /dev/null +++ b/src/Types/Annotation.php @@ -0,0 +1,1006 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationHighlight $highlight + * @return Annotation + */ + public static function highlight(AnnotationHighlight $highlight): Annotation + { + return new Annotation([ + 'subtype' => 'highlight', + 'value' => $highlight, + ]); + } + + /** + * @param AnnotationUnderline $underline + * @return Annotation + */ + public static function underline(AnnotationUnderline $underline): Annotation + { + return new Annotation([ + 'subtype' => 'underline', + 'value' => $underline, + ]); + } + + /** + * @param AnnotationSquiggly $squiggly + * @return Annotation + */ + public static function squiggly(AnnotationSquiggly $squiggly): Annotation + { + return new Annotation([ + 'subtype' => 'squiggly', + 'value' => $squiggly, + ]); + } + + /** + * @param AnnotationStrikeout $strikeout + * @return Annotation + */ + public static function strikeout(AnnotationStrikeout $strikeout): Annotation + { + return new Annotation([ + 'subtype' => 'strikeout', + 'value' => $strikeout, + ]); + } + + /** + * @param AnnotationCircle $circle + * @return Annotation + */ + public static function circle(AnnotationCircle $circle): Annotation + { + return new Annotation([ + 'subtype' => 'circle', + 'value' => $circle, + ]); + } + + /** + * @param AnnotationSquare $square + * @return Annotation + */ + public static function square(AnnotationSquare $square): Annotation + { + return new Annotation([ + 'subtype' => 'square', + 'value' => $square, + ]); + } + + /** + * @param AnnotationPolygon $polygon + * @return Annotation + */ + public static function polygon(AnnotationPolygon $polygon): Annotation + { + return new Annotation([ + 'subtype' => 'polygon', + 'value' => $polygon, + ]); + } + + /** + * @param AnnotationPolyline $polyline + * @return Annotation + */ + public static function polyline(AnnotationPolyline $polyline): Annotation + { + return new Annotation([ + 'subtype' => 'polyline', + 'value' => $polyline, + ]); + } + + /** + * @param AnnotationLine $line + * @return Annotation + */ + public static function line(AnnotationLine $line): Annotation + { + return new Annotation([ + 'subtype' => 'line', + 'value' => $line, + ]); + } + + /** + * @param AnnotationLink $link + * @return Annotation + */ + public static function link(AnnotationLink $link): Annotation + { + return new Annotation([ + 'subtype' => 'link', + 'value' => $link, + ]); + } + + /** + * @param AnnotationInk $ink + * @return Annotation + */ + public static function ink(AnnotationInk $ink): Annotation + { + return new Annotation([ + 'subtype' => 'ink', + 'value' => $ink, + ]); + } + + /** + * @param AnnotationFreeText $freeText + * @return Annotation + */ + public static function freeText(AnnotationFreeText $freeText): Annotation + { + return new Annotation([ + 'subtype' => 'free-text', + 'value' => $freeText, + ]); + } + + /** + * @param AnnotationCaret $caret + * @return Annotation + */ + public static function caret(AnnotationCaret $caret): Annotation + { + return new Annotation([ + 'subtype' => 'caret', + 'value' => $caret, + ]); + } + + /** + * @param AnnotationText $text + * @return Annotation + */ + public static function text(AnnotationText $text): Annotation + { + return new Annotation([ + 'subtype' => 'text', + 'value' => $text, + ]); + } + + /** + * @param AnnotationStamp $stamp + * @return Annotation + */ + public static function stamp(AnnotationStamp $stamp): Annotation + { + return new Annotation([ + 'subtype' => 'stamp', + 'value' => $stamp, + ]); + } + + /** + * @param AnnotationFileAttachment $fileAttachment + * @return Annotation + */ + public static function fileAttachment(AnnotationFileAttachment $fileAttachment): Annotation + { + return new Annotation([ + 'subtype' => 'file-attachment', + 'value' => $fileAttachment, + ]); + } + + /** + * @param WidgetAnnotation $widget + * @return Annotation + */ + public static function widget(WidgetAnnotation $widget): Annotation + { + return new Annotation([ + 'subtype' => 'widget', + 'value' => $widget, + ]); + } + + /** + * @param AnnotationRedact $redact + * @return Annotation + */ + public static function redact(AnnotationRedact $redact): Annotation + { + return new Annotation([ + 'subtype' => 'redact', + 'value' => $redact, + ]); + } + + /** + * @param AnnotationPopup $popup + * @return Annotation + */ + public static function popup(AnnotationPopup $popup): Annotation + { + return new Annotation([ + 'subtype' => 'popup', + 'value' => $popup, + ]); + } + + /** + * @param AnnotationUnsupported $unsupported + * @return Annotation + */ + public static function unsupported(AnnotationUnsupported $unsupported): Annotation + { + return new Annotation([ + 'subtype' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isHighlight(): bool + { + return $this->value instanceof AnnotationHighlight && $this->subtype === 'highlight'; + } + + /** + * @return AnnotationHighlight + */ + public function asHighlight(): AnnotationHighlight + { + if (!($this->value instanceof AnnotationHighlight && $this->subtype === 'highlight')) { + throw new Exception( + "Expected highlight; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnderline(): bool + { + return $this->value instanceof AnnotationUnderline && $this->subtype === 'underline'; + } + + /** + * @return AnnotationUnderline + */ + public function asUnderline(): AnnotationUnderline + { + if (!($this->value instanceof AnnotationUnderline && $this->subtype === 'underline')) { + throw new Exception( + "Expected underline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquiggly(): bool + { + return $this->value instanceof AnnotationSquiggly && $this->subtype === 'squiggly'; + } + + /** + * @return AnnotationSquiggly + */ + public function asSquiggly(): AnnotationSquiggly + { + if (!($this->value instanceof AnnotationSquiggly && $this->subtype === 'squiggly')) { + throw new Exception( + "Expected squiggly; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStrikeout(): bool + { + return $this->value instanceof AnnotationStrikeout && $this->subtype === 'strikeout'; + } + + /** + * @return AnnotationStrikeout + */ + public function asStrikeout(): AnnotationStrikeout + { + if (!($this->value instanceof AnnotationStrikeout && $this->subtype === 'strikeout')) { + throw new Exception( + "Expected strikeout; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCircle(): bool + { + return $this->value instanceof AnnotationCircle && $this->subtype === 'circle'; + } + + /** + * @return AnnotationCircle + */ + public function asCircle(): AnnotationCircle + { + if (!($this->value instanceof AnnotationCircle && $this->subtype === 'circle')) { + throw new Exception( + "Expected circle; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquare(): bool + { + return $this->value instanceof AnnotationSquare && $this->subtype === 'square'; + } + + /** + * @return AnnotationSquare + */ + public function asSquare(): AnnotationSquare + { + if (!($this->value instanceof AnnotationSquare && $this->subtype === 'square')) { + throw new Exception( + "Expected square; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolygon(): bool + { + return $this->value instanceof AnnotationPolygon && $this->subtype === 'polygon'; + } + + /** + * @return AnnotationPolygon + */ + public function asPolygon(): AnnotationPolygon + { + if (!($this->value instanceof AnnotationPolygon && $this->subtype === 'polygon')) { + throw new Exception( + "Expected polygon; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolyline(): bool + { + return $this->value instanceof AnnotationPolyline && $this->subtype === 'polyline'; + } + + /** + * @return AnnotationPolyline + */ + public function asPolyline(): AnnotationPolyline + { + if (!($this->value instanceof AnnotationPolyline && $this->subtype === 'polyline')) { + throw new Exception( + "Expected polyline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLine(): bool + { + return $this->value instanceof AnnotationLine && $this->subtype === 'line'; + } + + /** + * @return AnnotationLine + */ + public function asLine(): AnnotationLine + { + if (!($this->value instanceof AnnotationLine && $this->subtype === 'line')) { + throw new Exception( + "Expected line; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLink(): bool + { + return $this->value instanceof AnnotationLink && $this->subtype === 'link'; + } + + /** + * @return AnnotationLink + */ + public function asLink(): AnnotationLink + { + if (!($this->value instanceof AnnotationLink && $this->subtype === 'link')) { + throw new Exception( + "Expected link; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isInk(): bool + { + return $this->value instanceof AnnotationInk && $this->subtype === 'ink'; + } + + /** + * @return AnnotationInk + */ + public function asInk(): AnnotationInk + { + if (!($this->value instanceof AnnotationInk && $this->subtype === 'ink')) { + throw new Exception( + "Expected ink; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFreeText(): bool + { + return $this->value instanceof AnnotationFreeText && $this->subtype === 'free-text'; + } + + /** + * @return AnnotationFreeText + */ + public function asFreeText(): AnnotationFreeText + { + if (!($this->value instanceof AnnotationFreeText && $this->subtype === 'free-text')) { + throw new Exception( + "Expected free-text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCaret(): bool + { + return $this->value instanceof AnnotationCaret && $this->subtype === 'caret'; + } + + /** + * @return AnnotationCaret + */ + public function asCaret(): AnnotationCaret + { + if (!($this->value instanceof AnnotationCaret && $this->subtype === 'caret')) { + throw new Exception( + "Expected caret; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isText(): bool + { + return $this->value instanceof AnnotationText && $this->subtype === 'text'; + } + + /** + * @return AnnotationText + */ + public function asText(): AnnotationText + { + if (!($this->value instanceof AnnotationText && $this->subtype === 'text')) { + throw new Exception( + "Expected text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStamp(): bool + { + return $this->value instanceof AnnotationStamp && $this->subtype === 'stamp'; + } + + /** + * @return AnnotationStamp + */ + public function asStamp(): AnnotationStamp + { + if (!($this->value instanceof AnnotationStamp && $this->subtype === 'stamp')) { + throw new Exception( + "Expected stamp; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFileAttachment(): bool + { + return $this->value instanceof AnnotationFileAttachment && $this->subtype === 'file-attachment'; + } + + /** + * @return AnnotationFileAttachment + */ + public function asFileAttachment(): AnnotationFileAttachment + { + if (!($this->value instanceof AnnotationFileAttachment && $this->subtype === 'file-attachment')) { + throw new Exception( + "Expected file-attachment; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isWidget(): bool + { + return $this->value instanceof WidgetAnnotation && $this->subtype === 'widget'; + } + + /** + * @return WidgetAnnotation + */ + public function asWidget(): WidgetAnnotation + { + if (!($this->value instanceof WidgetAnnotation && $this->subtype === 'widget')) { + throw new Exception( + "Expected widget; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRedact(): bool + { + return $this->value instanceof AnnotationRedact && $this->subtype === 'redact'; + } + + /** + * @return AnnotationRedact + */ + public function asRedact(): AnnotationRedact + { + if (!($this->value instanceof AnnotationRedact && $this->subtype === 'redact')) { + throw new Exception( + "Expected redact; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPopup(): bool + { + return $this->value instanceof AnnotationPopup && $this->subtype === 'popup'; + } + + /** + * @return AnnotationPopup + */ + public function asPopup(): AnnotationPopup + { + if (!($this->value instanceof AnnotationPopup && $this->subtype === 'popup')) { + throw new Exception( + "Expected popup; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof AnnotationUnsupported && $this->subtype === 'unsupported'; + } + + /** + * @return AnnotationUnsupported + */ + public function asUnsupported(): AnnotationUnsupported + { + if (!($this->value instanceof AnnotationUnsupported && $this->subtype === 'unsupported')) { + throw new Exception( + "Expected unsupported; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'highlight': + $value = $this->asHighlight()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'underline': + $value = $this->asUnderline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'squiggly': + $value = $this->asSquiggly()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'strikeout': + $value = $this->asStrikeout()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'circle': + $value = $this->asCircle()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'square': + $value = $this->asSquare()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polygon': + $value = $this->asPolygon()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polyline': + $value = $this->asPolyline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'line': + $value = $this->asLine()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'link': + $value = $this->asLink()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ink': + $value = $this->asInk()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'free-text': + $value = $this->asFreeText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'caret': + $value = $this->asCaret()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'text': + $value = $this->asText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'stamp': + $value = $this->asStamp()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'file-attachment': + $value = $this->asFileAttachment()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'widget': + $value = $this->asWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'redact': + $value = $this->asRedact()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'popup': + $value = $this->asPopup()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'highlight': + $args['value'] = AnnotationHighlight::jsonDeserialize($data); + break; + case 'underline': + $args['value'] = AnnotationUnderline::jsonDeserialize($data); + break; + case 'squiggly': + $args['value'] = AnnotationSquiggly::jsonDeserialize($data); + break; + case 'strikeout': + $args['value'] = AnnotationStrikeout::jsonDeserialize($data); + break; + case 'circle': + $args['value'] = AnnotationCircle::jsonDeserialize($data); + break; + case 'square': + $args['value'] = AnnotationSquare::jsonDeserialize($data); + break; + case 'polygon': + $args['value'] = AnnotationPolygon::jsonDeserialize($data); + break; + case 'polyline': + $args['value'] = AnnotationPolyline::jsonDeserialize($data); + break; + case 'line': + $args['value'] = AnnotationLine::jsonDeserialize($data); + break; + case 'link': + $args['value'] = AnnotationLink::jsonDeserialize($data); + break; + case 'ink': + $args['value'] = AnnotationInk::jsonDeserialize($data); + break; + case 'free-text': + $args['value'] = AnnotationFreeText::jsonDeserialize($data); + break; + case 'caret': + $args['value'] = AnnotationCaret::jsonDeserialize($data); + break; + case 'text': + $args['value'] = AnnotationText::jsonDeserialize($data); + break; + case 'stamp': + $args['value'] = AnnotationStamp::jsonDeserialize($data); + break; + case 'file-attachment': + $args['value'] = AnnotationFileAttachment::jsonDeserialize($data); + break; + case 'widget': + $args['value'] = WidgetAnnotation::jsonDeserialize($data); + break; + case 'redact': + $args['value'] = AnnotationRedact::jsonDeserialize($data); + break; + case 'popup': + $args['value'] = AnnotationPopup::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = AnnotationUnsupported::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationCaret.php b/src/Types/AnnotationCaret.php new file mode 100644 index 0000000..fdc41ed --- /dev/null +++ b/src/Types/AnnotationCaret.php @@ -0,0 +1,308 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationCaretReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationCaretReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var AnnotationCaretBox $box + */ + #[JsonProperty('box')] + public AnnotationCaretBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationCaretRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * box: AnnotationCaretBox, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationCaretReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * rotation?: ?float, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationCaretBlendMode.php b/src/Types/AnnotationCaretBlendMode.php new file mode 100644 index 0000000..ebdac07 --- /dev/null +++ b/src/Types/AnnotationCaretBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationCaretIntent.php b/src/Types/AnnotationCaretIntent.php new file mode 100644 index 0000000..d20050a --- /dev/null +++ b/src/Types/AnnotationCaretIntent.php @@ -0,0 +1,8 @@ +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/AnnotationCaretReply.php b/src/Types/AnnotationCaretReply.php new file mode 100644 index 0000000..617d8ba --- /dev/null +++ b/src/Types/AnnotationCaretReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationCaretReplyType.php b/src/Types/AnnotationCaretReplyType.php new file mode 100644 index 0000000..c3f92b1 --- /dev/null +++ b/src/Types/AnnotationCaretReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationCircleReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationCircleReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var AnnotationCircleBox $box + */ + #[JsonProperty('box')] + public AnnotationCircleBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationCircleRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * box: AnnotationCircleBox, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationCircleReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationCircleBlendMode.php b/src/Types/AnnotationCircleBlendMode.php new file mode 100644 index 0000000..c49a2a5 --- /dev/null +++ b/src/Types/AnnotationCircleBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationCircleRect.php b/src/Types/AnnotationCircleRect.php new file mode 100644 index 0000000..6e28f1a --- /dev/null +++ b/src/Types/AnnotationCircleRect.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/AnnotationCircleReply.php b/src/Types/AnnotationCircleReply.php new file mode 100644 index 0000000..01c5c79 --- /dev/null +++ b/src/Types/AnnotationCircleReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationCircleReplyType.php b/src/Types/AnnotationCircleReplyType.php new file mode 100644 index 0000000..d03e783 --- /dev/null +++ b/src/Types/AnnotationCircleReplyType.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftHighlight $highlight + * @return AnnotationDraft + */ + public static function highlight(AnnotationDraftHighlight $highlight): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'highlight', + 'value' => $highlight, + ]); + } + + /** + * @param AnnotationDraftUnderline $underline + * @return AnnotationDraft + */ + public static function underline(AnnotationDraftUnderline $underline): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'underline', + 'value' => $underline, + ]); + } + + /** + * @param AnnotationDraftSquiggly $squiggly + * @return AnnotationDraft + */ + public static function squiggly(AnnotationDraftSquiggly $squiggly): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'squiggly', + 'value' => $squiggly, + ]); + } + + /** + * @param AnnotationDraftStrikeout $strikeout + * @return AnnotationDraft + */ + public static function strikeout(AnnotationDraftStrikeout $strikeout): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'strikeout', + 'value' => $strikeout, + ]); + } + + /** + * @param AnnotationDraftCircle $circle + * @return AnnotationDraft + */ + public static function circle(AnnotationDraftCircle $circle): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'circle', + 'value' => $circle, + ]); + } + + /** + * @param AnnotationDraftSquare $square + * @return AnnotationDraft + */ + public static function square(AnnotationDraftSquare $square): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'square', + 'value' => $square, + ]); + } + + /** + * @param AnnotationDraftPolygon $polygon + * @return AnnotationDraft + */ + public static function polygon(AnnotationDraftPolygon $polygon): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'polygon', + 'value' => $polygon, + ]); + } + + /** + * @param AnnotationDraftPolyline $polyline + * @return AnnotationDraft + */ + public static function polyline(AnnotationDraftPolyline $polyline): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'polyline', + 'value' => $polyline, + ]); + } + + /** + * @param AnnotationDraftLine $line + * @return AnnotationDraft + */ + public static function line(AnnotationDraftLine $line): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'line', + 'value' => $line, + ]); + } + + /** + * @param AnnotationDraftLink $link + * @return AnnotationDraft + */ + public static function link(AnnotationDraftLink $link): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'link', + 'value' => $link, + ]); + } + + /** + * @param AnnotationDraftInk $ink + * @return AnnotationDraft + */ + public static function ink(AnnotationDraftInk $ink): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'ink', + 'value' => $ink, + ]); + } + + /** + * @param AnnotationDraftFreeText $freeText + * @return AnnotationDraft + */ + public static function freeText(AnnotationDraftFreeText $freeText): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'free-text', + 'value' => $freeText, + ]); + } + + /** + * @param AnnotationDraftCaret $caret + * @return AnnotationDraft + */ + public static function caret(AnnotationDraftCaret $caret): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'caret', + 'value' => $caret, + ]); + } + + /** + * @param AnnotationDraftText $text + * @return AnnotationDraft + */ + public static function text(AnnotationDraftText $text): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'text', + 'value' => $text, + ]); + } + + /** + * @param AnnotationDraftStamp $stamp + * @return AnnotationDraft + */ + public static function stamp(AnnotationDraftStamp $stamp): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'stamp', + 'value' => $stamp, + ]); + } + + /** + * @param AnnotationDraftFileAttachment $fileAttachment + * @return AnnotationDraft + */ + public static function fileAttachment(AnnotationDraftFileAttachment $fileAttachment): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'file-attachment', + 'value' => $fileAttachment, + ]); + } + + /** + * @param AnnotationDraftWidget $widget + * @return AnnotationDraft + */ + public static function widget(AnnotationDraftWidget $widget): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'widget', + 'value' => $widget, + ]); + } + + /** + * @param AnnotationDraftRedact $redact + * @return AnnotationDraft + */ + public static function redact(AnnotationDraftRedact $redact): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'redact', + 'value' => $redact, + ]); + } + + /** + * @param AnnotationDraftPopup $popup + * @return AnnotationDraft + */ + public static function popup(AnnotationDraftPopup $popup): AnnotationDraft + { + return new AnnotationDraft([ + 'subtype' => 'popup', + 'value' => $popup, + ]); + } + + /** + * @return bool + */ + public function isHighlight(): bool + { + return $this->value instanceof AnnotationDraftHighlight && $this->subtype === 'highlight'; + } + + /** + * @return AnnotationDraftHighlight + */ + public function asHighlight(): AnnotationDraftHighlight + { + if (!($this->value instanceof AnnotationDraftHighlight && $this->subtype === 'highlight')) { + throw new Exception( + "Expected highlight; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnderline(): bool + { + return $this->value instanceof AnnotationDraftUnderline && $this->subtype === 'underline'; + } + + /** + * @return AnnotationDraftUnderline + */ + public function asUnderline(): AnnotationDraftUnderline + { + if (!($this->value instanceof AnnotationDraftUnderline && $this->subtype === 'underline')) { + throw new Exception( + "Expected underline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquiggly(): bool + { + return $this->value instanceof AnnotationDraftSquiggly && $this->subtype === 'squiggly'; + } + + /** + * @return AnnotationDraftSquiggly + */ + public function asSquiggly(): AnnotationDraftSquiggly + { + if (!($this->value instanceof AnnotationDraftSquiggly && $this->subtype === 'squiggly')) { + throw new Exception( + "Expected squiggly; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStrikeout(): bool + { + return $this->value instanceof AnnotationDraftStrikeout && $this->subtype === 'strikeout'; + } + + /** + * @return AnnotationDraftStrikeout + */ + public function asStrikeout(): AnnotationDraftStrikeout + { + if (!($this->value instanceof AnnotationDraftStrikeout && $this->subtype === 'strikeout')) { + throw new Exception( + "Expected strikeout; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCircle(): bool + { + return $this->value instanceof AnnotationDraftCircle && $this->subtype === 'circle'; + } + + /** + * @return AnnotationDraftCircle + */ + public function asCircle(): AnnotationDraftCircle + { + if (!($this->value instanceof AnnotationDraftCircle && $this->subtype === 'circle')) { + throw new Exception( + "Expected circle; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquare(): bool + { + return $this->value instanceof AnnotationDraftSquare && $this->subtype === 'square'; + } + + /** + * @return AnnotationDraftSquare + */ + public function asSquare(): AnnotationDraftSquare + { + if (!($this->value instanceof AnnotationDraftSquare && $this->subtype === 'square')) { + throw new Exception( + "Expected square; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolygon(): bool + { + return $this->value instanceof AnnotationDraftPolygon && $this->subtype === 'polygon'; + } + + /** + * @return AnnotationDraftPolygon + */ + public function asPolygon(): AnnotationDraftPolygon + { + if (!($this->value instanceof AnnotationDraftPolygon && $this->subtype === 'polygon')) { + throw new Exception( + "Expected polygon; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolyline(): bool + { + return $this->value instanceof AnnotationDraftPolyline && $this->subtype === 'polyline'; + } + + /** + * @return AnnotationDraftPolyline + */ + public function asPolyline(): AnnotationDraftPolyline + { + if (!($this->value instanceof AnnotationDraftPolyline && $this->subtype === 'polyline')) { + throw new Exception( + "Expected polyline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLine(): bool + { + return $this->value instanceof AnnotationDraftLine && $this->subtype === 'line'; + } + + /** + * @return AnnotationDraftLine + */ + public function asLine(): AnnotationDraftLine + { + if (!($this->value instanceof AnnotationDraftLine && $this->subtype === 'line')) { + throw new Exception( + "Expected line; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLink(): bool + { + return $this->value instanceof AnnotationDraftLink && $this->subtype === 'link'; + } + + /** + * @return AnnotationDraftLink + */ + public function asLink(): AnnotationDraftLink + { + if (!($this->value instanceof AnnotationDraftLink && $this->subtype === 'link')) { + throw new Exception( + "Expected link; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isInk(): bool + { + return $this->value instanceof AnnotationDraftInk && $this->subtype === 'ink'; + } + + /** + * @return AnnotationDraftInk + */ + public function asInk(): AnnotationDraftInk + { + if (!($this->value instanceof AnnotationDraftInk && $this->subtype === 'ink')) { + throw new Exception( + "Expected ink; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFreeText(): bool + { + return $this->value instanceof AnnotationDraftFreeText && $this->subtype === 'free-text'; + } + + /** + * @return AnnotationDraftFreeText + */ + public function asFreeText(): AnnotationDraftFreeText + { + if (!($this->value instanceof AnnotationDraftFreeText && $this->subtype === 'free-text')) { + throw new Exception( + "Expected free-text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCaret(): bool + { + return $this->value instanceof AnnotationDraftCaret && $this->subtype === 'caret'; + } + + /** + * @return AnnotationDraftCaret + */ + public function asCaret(): AnnotationDraftCaret + { + if (!($this->value instanceof AnnotationDraftCaret && $this->subtype === 'caret')) { + throw new Exception( + "Expected caret; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isText(): bool + { + return $this->value instanceof AnnotationDraftText && $this->subtype === 'text'; + } + + /** + * @return AnnotationDraftText + */ + public function asText(): AnnotationDraftText + { + if (!($this->value instanceof AnnotationDraftText && $this->subtype === 'text')) { + throw new Exception( + "Expected text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStamp(): bool + { + return $this->value instanceof AnnotationDraftStamp && $this->subtype === 'stamp'; + } + + /** + * @return AnnotationDraftStamp + */ + public function asStamp(): AnnotationDraftStamp + { + if (!($this->value instanceof AnnotationDraftStamp && $this->subtype === 'stamp')) { + throw new Exception( + "Expected stamp; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFileAttachment(): bool + { + return $this->value instanceof AnnotationDraftFileAttachment && $this->subtype === 'file-attachment'; + } + + /** + * @return AnnotationDraftFileAttachment + */ + public function asFileAttachment(): AnnotationDraftFileAttachment + { + if (!($this->value instanceof AnnotationDraftFileAttachment && $this->subtype === 'file-attachment')) { + throw new Exception( + "Expected file-attachment; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isWidget(): bool + { + return $this->value instanceof AnnotationDraftWidget && $this->subtype === 'widget'; + } + + /** + * @return AnnotationDraftWidget + */ + public function asWidget(): AnnotationDraftWidget + { + if (!($this->value instanceof AnnotationDraftWidget && $this->subtype === 'widget')) { + throw new Exception( + "Expected widget; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRedact(): bool + { + return $this->value instanceof AnnotationDraftRedact && $this->subtype === 'redact'; + } + + /** + * @return AnnotationDraftRedact + */ + public function asRedact(): AnnotationDraftRedact + { + if (!($this->value instanceof AnnotationDraftRedact && $this->subtype === 'redact')) { + throw new Exception( + "Expected redact; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPopup(): bool + { + return $this->value instanceof AnnotationDraftPopup && $this->subtype === 'popup'; + } + + /** + * @return AnnotationDraftPopup + */ + public function asPopup(): AnnotationDraftPopup + { + if (!($this->value instanceof AnnotationDraftPopup && $this->subtype === 'popup')) { + throw new Exception( + "Expected popup; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'highlight': + $value = $this->asHighlight()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'underline': + $value = $this->asUnderline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'squiggly': + $value = $this->asSquiggly()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'strikeout': + $value = $this->asStrikeout()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'circle': + $value = $this->asCircle()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'square': + $value = $this->asSquare()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polygon': + $value = $this->asPolygon()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polyline': + $value = $this->asPolyline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'line': + $value = $this->asLine()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'link': + $value = $this->asLink()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ink': + $value = $this->asInk()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'free-text': + $value = $this->asFreeText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'caret': + $value = $this->asCaret()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'text': + $value = $this->asText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'stamp': + $value = $this->asStamp()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'file-attachment': + $value = $this->asFileAttachment()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'widget': + $value = $this->asWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'redact': + $value = $this->asRedact()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'popup': + $value = $this->asPopup()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'highlight': + $args['value'] = AnnotationDraftHighlight::jsonDeserialize($data); + break; + case 'underline': + $args['value'] = AnnotationDraftUnderline::jsonDeserialize($data); + break; + case 'squiggly': + $args['value'] = AnnotationDraftSquiggly::jsonDeserialize($data); + break; + case 'strikeout': + $args['value'] = AnnotationDraftStrikeout::jsonDeserialize($data); + break; + case 'circle': + $args['value'] = AnnotationDraftCircle::jsonDeserialize($data); + break; + case 'square': + $args['value'] = AnnotationDraftSquare::jsonDeserialize($data); + break; + case 'polygon': + $args['value'] = AnnotationDraftPolygon::jsonDeserialize($data); + break; + case 'polyline': + $args['value'] = AnnotationDraftPolyline::jsonDeserialize($data); + break; + case 'line': + $args['value'] = AnnotationDraftLine::jsonDeserialize($data); + break; + case 'link': + $args['value'] = AnnotationDraftLink::jsonDeserialize($data); + break; + case 'ink': + $args['value'] = AnnotationDraftInk::jsonDeserialize($data); + break; + case 'free-text': + $args['value'] = AnnotationDraftFreeText::jsonDeserialize($data); + break; + case 'caret': + $args['value'] = AnnotationDraftCaret::jsonDeserialize($data); + break; + case 'text': + $args['value'] = AnnotationDraftText::jsonDeserialize($data); + break; + case 'stamp': + $args['value'] = AnnotationDraftStamp::jsonDeserialize($data); + break; + case 'file-attachment': + $args['value'] = AnnotationDraftFileAttachment::jsonDeserialize($data); + break; + case 'widget': + $args['value'] = AnnotationDraftWidget::jsonDeserialize($data); + break; + case 'redact': + $args['value'] = AnnotationDraftRedact::jsonDeserialize($data); + break; + case 'popup': + $args['value'] = AnnotationDraftPopup::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftCaret.php b/src/Types/AnnotationDraftCaret.php new file mode 100644 index 0000000..8da9d8c --- /dev/null +++ b/src/Types/AnnotationDraftCaret.php @@ -0,0 +1,306 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftCaretReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftCaretReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?AnnotationDraftCaretBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftCaretBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftCaretRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftCaretReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * box?: ?AnnotationDraftCaretBox, + * rotation?: ?float, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftCaretBlendMode.php b/src/Types/AnnotationDraftCaretBlendMode.php new file mode 100644 index 0000000..d546953 --- /dev/null +++ b/src/Types/AnnotationDraftCaretBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftCaretIntent.php b/src/Types/AnnotationDraftCaretIntent.php new file mode 100644 index 0000000..65e0e9d --- /dev/null +++ b/src/Types/AnnotationDraftCaretIntent.php @@ -0,0 +1,8 @@ +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/AnnotationDraftCaretReply.php b/src/Types/AnnotationDraftCaretReply.php new file mode 100644 index 0000000..2d691b0 --- /dev/null +++ b/src/Types/AnnotationDraftCaretReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftCaretReplyType.php b/src/Types/AnnotationDraftCaretReplyType.php new file mode 100644 index 0000000..10fcee6 --- /dev/null +++ b/src/Types/AnnotationDraftCaretReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftCircleReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftCircleReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?AnnotationDraftCircleBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftCircleBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftCircleRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftCircleReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * interiorColor?: ?string, + * box?: ?AnnotationDraftCircleBox, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftCircleBlendMode.php b/src/Types/AnnotationDraftCircleBlendMode.php new file mode 100644 index 0000000..4ccca8c --- /dev/null +++ b/src/Types/AnnotationDraftCircleBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftCircleRect.php b/src/Types/AnnotationDraftCircleRect.php new file mode 100644 index 0000000..822d862 --- /dev/null +++ b/src/Types/AnnotationDraftCircleRect.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/AnnotationDraftCircleReply.php b/src/Types/AnnotationDraftCircleReply.php new file mode 100644 index 0000000..d357972 --- /dev/null +++ b/src/Types/AnnotationDraftCircleReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftCircleReplyType.php b/src/Types/AnnotationDraftCircleReplyType.php new file mode 100644 index 0000000..13cfe80 --- /dev/null +++ b/src/Types/AnnotationDraftCircleReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftFileAttachmentReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftFileAttachmentReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?value-of $icon + */ + #[JsonProperty('icon')] + public ?string $icon; + + /** + * @var ?AnnotationDraftFileAttachmentFile $file + */ + #[JsonProperty('file')] + public ?AnnotationDraftFileAttachmentFile $file; + + /** + * @param array{ + * rect: AnnotationDraftFileAttachmentRect, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftFileAttachmentReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * icon?: ?value-of, + * file?: ?AnnotationDraftFileAttachmentFile, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->icon = $values['icon'] ?? null; + $this->file = $values['file'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFileAttachmentBlendMode.php b/src/Types/AnnotationDraftFileAttachmentBlendMode.php new file mode 100644 index 0000000..2f8fc25 --- /dev/null +++ b/src/Types/AnnotationDraftFileAttachmentBlendMode.php @@ -0,0 +1,23 @@ +name = $values['name']; + $this->mimeType = $values['mimeType'] ?? null; + $this->description = $values['description'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFileAttachmentIcon.php b/src/Types/AnnotationDraftFileAttachmentIcon.php new file mode 100644 index 0000000..6fa01ba --- /dev/null +++ b/src/Types/AnnotationDraftFileAttachmentIcon.php @@ -0,0 +1,11 @@ +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/AnnotationDraftFileAttachmentReply.php b/src/Types/AnnotationDraftFileAttachmentReply.php new file mode 100644 index 0000000..175e6ca --- /dev/null +++ b/src/Types/AnnotationDraftFileAttachmentReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFileAttachmentReplyType.php b/src/Types/AnnotationDraftFileAttachmentReplyType.php new file mode 100644 index 0000000..2293eae --- /dev/null +++ b/src/Types/AnnotationDraftFileAttachmentReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftFreeTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftFreeTextReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?AnnotationDraftFreeTextBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftFreeTextBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @var ?value-of $verticalAlign + */ + #[JsonProperty('verticalAlign')] + public ?string $verticalAlign; + + /** + * @var ?AnnotationDraftFreeTextRichText $richText + */ + #[JsonProperty('richText')] + public ?AnnotationDraftFreeTextRichText $richText; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @var ?array $calloutLine + */ + #[JsonProperty('calloutLine'), ArrayType(['mixed'])] + public ?array $calloutLine; + + /** + * @var ?value-of $lineEnding + */ + #[JsonProperty('lineEnding')] + public ?string $lineEnding; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftFreeTextRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftFreeTextReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * box?: ?AnnotationDraftFreeTextBox, + * rotation?: ?float, + * intent?: ?value-of, + * fontFamily?: ?string, + * fontSize?: ?float, + * textAlign?: ?value-of, + * verticalAlign?: ?value-of, + * richText?: ?AnnotationDraftFreeTextRichText, + * color?: ?string, + * fontColor?: ?string, + * interiorColor?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * cloudyIntensity?: ?float, + * calloutLine?: ?array, + * lineEnding?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + $this->verticalAlign = $values['verticalAlign'] ?? null; + $this->richText = $values['richText'] ?? null; + $this->color = $values['color'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + $this->calloutLine = $values['calloutLine'] ?? null; + $this->lineEnding = $values['lineEnding'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextBlendMode.php b/src/Types/AnnotationDraftFreeTextBlendMode.php new file mode 100644 index 0000000..1481a90 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftFreeTextIntent.php b/src/Types/AnnotationDraftFreeTextIntent.php new file mode 100644 index 0000000..4938218 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextIntent.php @@ -0,0 +1,9 @@ +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/AnnotationDraftFreeTextReply.php b/src/Types/AnnotationDraftFreeTextReply.php new file mode 100644 index 0000000..0f95aac --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextReplyType.php b/src/Types/AnnotationDraftFreeTextReplyType.php new file mode 100644 index 0000000..b5cfc2c --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextReplyType.php @@ -0,0 +1,9 @@ + $paragraphs + */ + #[JsonProperty('paragraphs'), ArrayType([AnnotationDraftFreeTextRichTextParagraphsItem::class])] + public array $paragraphs; + + /** + * @param array{ + * paragraphs: array, + * body?: ?AnnotationDraftFreeTextRichTextBody, + * } $values + */ + public function __construct( + array $values, + ) { + $this->body = $values['body'] ?? null; + $this->paragraphs = $values['paragraphs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextBody.php b/src/Types/AnnotationDraftFreeTextRichTextBody.php new file mode 100644 index 0000000..e31df87 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextBody.php @@ -0,0 +1,147 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public ?array $decoration; + + /** + * @var ?value-of $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var ?float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public ?float $letterSpacing; + + /** + * @var ?float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public ?float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var ?value-of $align + */ + #[JsonProperty('align')] + public ?string $align; + + /** + * @var ?value-of $dir + */ + #[JsonProperty('dir')] + public ?string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationDraftFreeTextRichTextBodyMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationDraftFreeTextRichTextBodyMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @param array{ + * family?: ?string, + * weight?: ?int, + * italic?: ?bool, + * size?: ?float, + * color?: ?string, + * decoration?: ?array>, + * script?: ?value-of, + * letterSpacing?: ?float, + * horizontalScale?: ?float, + * unknown?: ?string, + * align?: ?value-of, + * dir?: ?value-of, + * lineHeight?: ?float, + * margins?: ?AnnotationDraftFreeTextRichTextBodyMargins, + * textIndent?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->size = $values['size'] ?? null; + $this->color = $values['color'] ?? null; + $this->decoration = $values['decoration'] ?? null; + $this->script = $values['script'] ?? null; + $this->letterSpacing = $values['letterSpacing'] ?? null; + $this->horizontalScale = $values['horizontalScale'] ?? null; + $this->unknown = $values['unknown'] ?? null; + $this->align = $values['align'] ?? null; + $this->dir = $values['dir'] ?? null; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextBodyAlign.php b/src/Types/AnnotationDraftFreeTextRichTextBodyAlign.php new file mode 100644 index 0000000..24bc8c8 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextBodyAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextBodyScript.php b/src/Types/AnnotationDraftFreeTextRichTextBodyScript.php new file mode 100644 index 0000000..476604c --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextBodyScript.php @@ -0,0 +1,10 @@ + $align + */ + #[JsonProperty('align')] + public ?string $align; + + /** + * @var ?value-of $dir + */ + #[JsonProperty('dir')] + public ?string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationDraftFreeTextRichTextParagraphsItemMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationDraftFreeTextRichTextParagraphsItemMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var array $runs + */ + #[JsonProperty('runs'), ArrayType([AnnotationDraftFreeTextRichTextParagraphsItemRunsItem::class])] + public array $runs; + + /** + * @param array{ + * runs: array, + * align?: ?value-of, + * dir?: ?value-of, + * lineHeight?: ?float, + * margins?: ?AnnotationDraftFreeTextRichTextParagraphsItemMargins, + * textIndent?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->align = $values['align'] ?? null; + $this->dir = $values['dir'] ?? null; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + $this->unknown = $values['unknown'] ?? null; + $this->runs = $values['runs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemAlign.php b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemAlign.php new file mode 100644 index 0000000..fb9265b --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItem.php b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItem.php new file mode 100644 index 0000000..47c16d6 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItem.php @@ -0,0 +1,42 @@ +text = $values['text']; + $this->style = $values['style'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyle.php b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyle.php new file mode 100644 index 0000000..62ff1d3 --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyle.php @@ -0,0 +1,107 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public ?array $decoration; + + /** + * @var ?value-of $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var ?float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public ?float $letterSpacing; + + /** + * @var ?float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public ?float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @param array{ + * family?: ?string, + * weight?: ?int, + * italic?: ?bool, + * size?: ?float, + * color?: ?string, + * decoration?: ?array>, + * script?: ?value-of, + * letterSpacing?: ?float, + * horizontalScale?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->size = $values['size'] ?? null; + $this->color = $values['color'] ?? null; + $this->decoration = $values['decoration'] ?? null; + $this->script = $values['script'] ?? null; + $this->letterSpacing = $values['letterSpacing'] ?? null; + $this->horizontalScale = $values['horizontalScale'] ?? null; + $this->unknown = $values['unknown'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php new file mode 100644 index 0000000..354f58a --- /dev/null +++ b/src/Types/AnnotationDraftFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php @@ -0,0 +1,10 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftHighlightReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftHighlightReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationDraftHighlightQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * quadPoints: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftHighlightRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftHighlightReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightBlendMode.php b/src/Types/AnnotationDraftHighlightBlendMode.php new file mode 100644 index 0000000..773d29b --- /dev/null +++ b/src/Types/AnnotationDraftHighlightBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightQuadPointsItemLowerLeft.php b/src/Types/AnnotationDraftHighlightQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..9f4a114 --- /dev/null +++ b/src/Types/AnnotationDraftHighlightQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightQuadPointsItemLowerRight.php b/src/Types/AnnotationDraftHighlightQuadPointsItemLowerRight.php new file mode 100644 index 0000000..f7a9f4f --- /dev/null +++ b/src/Types/AnnotationDraftHighlightQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightQuadPointsItemUpperLeft.php b/src/Types/AnnotationDraftHighlightQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..20f6176 --- /dev/null +++ b/src/Types/AnnotationDraftHighlightQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightQuadPointsItemUpperRight.php b/src/Types/AnnotationDraftHighlightQuadPointsItemUpperRight.php new file mode 100644 index 0000000..9e09fda --- /dev/null +++ b/src/Types/AnnotationDraftHighlightQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightRect.php b/src/Types/AnnotationDraftHighlightRect.php new file mode 100644 index 0000000..17c2ac7 --- /dev/null +++ b/src/Types/AnnotationDraftHighlightRect.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/AnnotationDraftHighlightReply.php b/src/Types/AnnotationDraftHighlightReply.php new file mode 100644 index 0000000..bcc17a4 --- /dev/null +++ b/src/Types/AnnotationDraftHighlightReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftHighlightReplyType.php b/src/Types/AnnotationDraftHighlightReplyType.php new file mode 100644 index 0000000..c7b79da --- /dev/null +++ b/src/Types/AnnotationDraftHighlightReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftInkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftInkReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var array> $inkList + */ + #[JsonProperty('inkList'), ArrayType([[AnnotationDraftInkInkListItemItem::class]])] + public array $inkList; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @param array{ + * inkList: array>, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftInkRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftInkReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * intent?: ?value-of, + * rotation?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->inkList = $values['inkList']; + $this->intent = $values['intent'] ?? null; + $this->rotation = $values['rotation'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftInkBlendMode.php b/src/Types/AnnotationDraftInkBlendMode.php new file mode 100644 index 0000000..a5d370a --- /dev/null +++ b/src/Types/AnnotationDraftInkBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftInkIntent.php b/src/Types/AnnotationDraftInkIntent.php new file mode 100644 index 0000000..5406f80 --- /dev/null +++ b/src/Types/AnnotationDraftInkIntent.php @@ -0,0 +1,8 @@ +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/AnnotationDraftInkReply.php b/src/Types/AnnotationDraftInkReply.php new file mode 100644 index 0000000..8719c1d --- /dev/null +++ b/src/Types/AnnotationDraftInkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftInkReplyType.php b/src/Types/AnnotationDraftInkReplyType.php new file mode 100644 index 0000000..a0e5bfd --- /dev/null +++ b/src/Types/AnnotationDraftInkReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftLineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftLineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var AnnotationDraftLineLinePoints $linePoints + */ + #[JsonProperty('linePoints')] + public AnnotationDraftLineLinePoints $linePoints; + + /** + * @var ?AnnotationDraftLineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public ?AnnotationDraftLineLineEndings $lineEndings; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationDraftLineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationDraftLineMeasure $measure; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?value-of $captionPosition + */ + #[JsonProperty('captionPosition')] + public ?string $captionPosition; + + /** + * @var ?AnnotationDraftLineCaptionOffset $captionOffset + */ + #[JsonProperty('captionOffset')] + public ?AnnotationDraftLineCaptionOffset $captionOffset; + + /** + * @var ?AnnotationDraftLineLeader $leader + */ + #[JsonProperty('leader')] + public ?AnnotationDraftLineLeader $leader; + + /** + * @param array{ + * linePoints: AnnotationDraftLineLinePoints, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftLineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftLineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * interiorColor?: ?string, + * lineEndings?: ?AnnotationDraftLineLineEndings, + * rotation?: ?float, + * intent?: ?value-of, + * measure?: ?AnnotationDraftLineMeasure, + * captionEnabled?: ?bool, + * captionPosition?: ?value-of, + * captionOffset?: ?AnnotationDraftLineCaptionOffset, + * leader?: ?AnnotationDraftLineLeader, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->linePoints = $values['linePoints']; + $this->lineEndings = $values['lineEndings'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionPosition = $values['captionPosition'] ?? null; + $this->captionOffset = $values['captionOffset'] ?? null; + $this->leader = $values['leader'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineBlendMode.php b/src/Types/AnnotationDraftLineBlendMode.php new file mode 100644 index 0000000..5eb004e --- /dev/null +++ b/src/Types/AnnotationDraftLineBlendMode.php @@ -0,0 +1,23 @@ +along = $values['along']; + $this->perpendicular = $values['perpendicular']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineCaptionPosition.php b/src/Types/AnnotationDraftLineCaptionPosition.php new file mode 100644 index 0000000..8a60b77 --- /dev/null +++ b/src/Types/AnnotationDraftLineCaptionPosition.php @@ -0,0 +1,9 @@ +length = $values['length']; + $this->extension = $values['extension'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineLineEndings.php b/src/Types/AnnotationDraftLineLineEndings.php new file mode 100644 index 0000000..44de402 --- /dev/null +++ b/src/Types/AnnotationDraftLineLineEndings.php @@ -0,0 +1,42 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineLineEndingsEnd.php b/src/Types/AnnotationDraftLineLineEndingsEnd.php new file mode 100644 index 0000000..525f95b --- /dev/null +++ b/src/Types/AnnotationDraftLineLineEndingsEnd.php @@ -0,0 +1,17 @@ +start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineLinePointsEnd.php b/src/Types/AnnotationDraftLineLinePointsEnd.php new file mode 100644 index 0000000..c3cb00d --- /dev/null +++ b/src/Types/AnnotationDraftLineLinePointsEnd.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineLinePointsStart.php b/src/Types/AnnotationDraftLineLinePointsStart.php new file mode 100644 index 0000000..ece3c6e --- /dev/null +++ b/src/Types/AnnotationDraftLineLinePointsStart.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineMeasure.php b/src/Types/AnnotationDraftLineMeasure.php new file mode 100644 index 0000000..5f548a2 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasure.php @@ -0,0 +1,207 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftLineMeasureRectilinear $rectilinear + * @return AnnotationDraftLineMeasure + */ + public static function rectilinear(AnnotationDraftLineMeasureRectilinear $rectilinear): AnnotationDraftLineMeasure + { + return new AnnotationDraftLineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationDraftLineMeasureUnknown $unknown + * @return AnnotationDraftLineMeasure + */ + public static function unknown(AnnotationDraftLineMeasureUnknown $unknown): AnnotationDraftLineMeasure + { + return new AnnotationDraftLineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationDraftLineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationDraftLineMeasureRectilinear + */ + public function asRectilinear(): AnnotationDraftLineMeasureRectilinear + { + if (!($this->value instanceof AnnotationDraftLineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftLineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftLineMeasureUnknown + */ + public function asUnknown(): AnnotationDraftLineMeasureUnknown + { + if (!($this->value instanceof AnnotationDraftLineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationDraftLineMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationDraftLineMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftLineMeasureRectilinear.php b/src/Types/AnnotationDraftLineMeasureRectilinear.php new file mode 100644 index 0000000..b01733b --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationDraftLineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationDraftLineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationDraftLineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationDraftLineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationDraftLineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationDraftLineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationDraftLineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationDraftLineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationDraftLineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationDraftLineMeasureRectilinearAngleItem.php b/src/Types/AnnotationDraftLineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..ebd3cb3 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearAngleItem.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/AnnotationDraftLineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..a530385 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearAngleItemFraction.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/AnnotationDraftLineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..70ba38c --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearAreaItemFraction.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/AnnotationDraftLineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..445a079 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearDistanceItemFraction.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/AnnotationDraftLineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationDraftLineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..043374a --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearSlopeItem.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/AnnotationDraftLineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..8100fd3 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearSlopeItemFraction.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/AnnotationDraftLineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..cd1f47b --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearXItemFraction.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/AnnotationDraftLineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationDraftLineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..0982f68 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftLineMeasureUnknownGeospatial $geospatial + * @return AnnotationDraftLineMeasureUnknown + */ + public static function geospatial(AnnotationDraftLineMeasureUnknownGeospatial $geospatial): AnnotationDraftLineMeasureUnknown + { + return new AnnotationDraftLineMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationDraftLineMeasureUnknownUnknown $unknown + * @return AnnotationDraftLineMeasureUnknown + */ + public static function unknown(AnnotationDraftLineMeasureUnknownUnknown $unknown): AnnotationDraftLineMeasureUnknown + { + return new AnnotationDraftLineMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationDraftLineMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationDraftLineMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationDraftLineMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationDraftLineMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftLineMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftLineMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationDraftLineMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationDraftLineMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationDraftLineMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationDraftLineMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftLineMeasureUnknownGeospatial.php b/src/Types/AnnotationDraftLineMeasureUnknownGeospatial.php new file mode 100644 index 0000000..cc307ef --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineMeasureUnknownUnknown.php b/src/Types/AnnotationDraftLineMeasureUnknownUnknown.php new file mode 100644 index 0000000..6041803 --- /dev/null +++ b/src/Types/AnnotationDraftLineMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineRect.php b/src/Types/AnnotationDraftLineRect.php new file mode 100644 index 0000000..aaba606 --- /dev/null +++ b/src/Types/AnnotationDraftLineRect.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/AnnotationDraftLineReply.php b/src/Types/AnnotationDraftLineReply.php new file mode 100644 index 0000000..5f8c5cc --- /dev/null +++ b/src/Types/AnnotationDraftLineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLineReplyType.php b/src/Types/AnnotationDraftLineReplyType.php new file mode 100644 index 0000000..5dda4a4 --- /dev/null +++ b/src/Types/AnnotationDraftLineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftLinkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftLinkReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?PdfLinkTargetWritable $target + */ + #[JsonProperty('target')] + public ?PdfLinkTargetWritable $target; + + /** + * @param array{ + * rect: AnnotationDraftLinkRect, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftLinkReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * target?: ?PdfLinkTargetWritable, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->target = $values['target'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLinkBlendMode.php b/src/Types/AnnotationDraftLinkBlendMode.php new file mode 100644 index 0000000..1a966a8 --- /dev/null +++ b/src/Types/AnnotationDraftLinkBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftLinkReply.php b/src/Types/AnnotationDraftLinkReply.php new file mode 100644 index 0000000..7854bb9 --- /dev/null +++ b/src/Types/AnnotationDraftLinkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftLinkReplyType.php b/src/Types/AnnotationDraftLinkReplyType.php new file mode 100644 index 0000000..b5d149d --- /dev/null +++ b/src/Types/AnnotationDraftLinkReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftPolygonReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftPolygonReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var array $vertices + */ + #[JsonProperty('vertices'), ArrayType([AnnotationDraftPolygonVerticesItem::class])] + public array $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationDraftPolygonCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationDraftPolygonCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationDraftPolygonMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationDraftPolygonMeasure $measure; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * vertices: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftPolygonRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftPolygonReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationDraftPolygonCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationDraftPolygonMeasure, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices']; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolygonBlendMode.php b/src/Types/AnnotationDraftPolygonBlendMode.php new file mode 100644 index 0000000..df2482c --- /dev/null +++ b/src/Types/AnnotationDraftPolygonBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolygonIntent.php b/src/Types/AnnotationDraftPolygonIntent.php new file mode 100644 index 0000000..e99c92b --- /dev/null +++ b/src/Types/AnnotationDraftPolygonIntent.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftPolygonMeasureRectilinear $rectilinear + * @return AnnotationDraftPolygonMeasure + */ + public static function rectilinear(AnnotationDraftPolygonMeasureRectilinear $rectilinear): AnnotationDraftPolygonMeasure + { + return new AnnotationDraftPolygonMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationDraftPolygonMeasureUnknown $unknown + * @return AnnotationDraftPolygonMeasure + */ + public static function unknown(AnnotationDraftPolygonMeasureUnknown $unknown): AnnotationDraftPolygonMeasure + { + return new AnnotationDraftPolygonMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationDraftPolygonMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationDraftPolygonMeasureRectilinear + */ + public function asRectilinear(): AnnotationDraftPolygonMeasureRectilinear + { + if (!($this->value instanceof AnnotationDraftPolygonMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftPolygonMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftPolygonMeasureUnknown + */ + public function asUnknown(): AnnotationDraftPolygonMeasureUnknown + { + if (!($this->value instanceof AnnotationDraftPolygonMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationDraftPolygonMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationDraftPolygonMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftPolygonMeasureRectilinear.php b/src/Types/AnnotationDraftPolygonMeasureRectilinear.php new file mode 100644 index 0000000..b331e7f --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationDraftPolygonMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationDraftPolygonMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationDraftPolygonMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationDraftPolygonMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationDraftPolygonMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationDraftPolygonMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationDraftPolygonMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationDraftPolygonMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationDraftPolygonMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationDraftPolygonMeasureRectilinearAngleItem.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..023fd8a --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearAngleItem.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/AnnotationDraftPolygonMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..b0151fa --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearAngleItemFraction.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/AnnotationDraftPolygonMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..4b30d40 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearAreaItemFraction.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/AnnotationDraftPolygonMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..21a97b9 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearDistanceItemFraction.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/AnnotationDraftPolygonMeasureRectilinearSlopeItem.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..ca6b7f5 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearSlopeItem.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/AnnotationDraftPolygonMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..f8d920b --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearSlopeItemFraction.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/AnnotationDraftPolygonMeasureRectilinearXItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..75c12b7 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearXItemFraction.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/AnnotationDraftPolygonMeasureRectilinearYItemFraction.php b/src/Types/AnnotationDraftPolygonMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..735a5f3 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftPolygonMeasureUnknownGeospatial $geospatial + * @return AnnotationDraftPolygonMeasureUnknown + */ + public static function geospatial(AnnotationDraftPolygonMeasureUnknownGeospatial $geospatial): AnnotationDraftPolygonMeasureUnknown + { + return new AnnotationDraftPolygonMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationDraftPolygonMeasureUnknownUnknown $unknown + * @return AnnotationDraftPolygonMeasureUnknown + */ + public static function unknown(AnnotationDraftPolygonMeasureUnknownUnknown $unknown): AnnotationDraftPolygonMeasureUnknown + { + return new AnnotationDraftPolygonMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationDraftPolygonMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationDraftPolygonMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationDraftPolygonMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationDraftPolygonMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftPolygonMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftPolygonMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationDraftPolygonMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationDraftPolygonMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationDraftPolygonMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationDraftPolygonMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftPolygonMeasureUnknownGeospatial.php b/src/Types/AnnotationDraftPolygonMeasureUnknownGeospatial.php new file mode 100644 index 0000000..6a0026d --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolygonMeasureUnknownUnknown.php b/src/Types/AnnotationDraftPolygonMeasureUnknownUnknown.php new file mode 100644 index 0000000..083b705 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolygonRect.php b/src/Types/AnnotationDraftPolygonRect.php new file mode 100644 index 0000000..6b71144 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonRect.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/AnnotationDraftPolygonReply.php b/src/Types/AnnotationDraftPolygonReply.php new file mode 100644 index 0000000..8cc9143 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolygonReplyType.php b/src/Types/AnnotationDraftPolygonReplyType.php new file mode 100644 index 0000000..64b4b48 --- /dev/null +++ b/src/Types/AnnotationDraftPolygonReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolyline.php b/src/Types/AnnotationDraftPolyline.php new file mode 100644 index 0000000..8c115dc --- /dev/null +++ b/src/Types/AnnotationDraftPolyline.php @@ -0,0 +1,371 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftPolylineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftPolylineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var array $vertices + */ + #[JsonProperty('vertices'), ArrayType([AnnotationDraftPolylineVerticesItem::class])] + public array $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationDraftPolylineCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationDraftPolylineCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationDraftPolylineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationDraftPolylineMeasure $measure; + + /** + * @var ?AnnotationDraftPolylineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public ?AnnotationDraftPolylineLineEndings $lineEndings; + + /** + * @param array{ + * vertices: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftPolylineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftPolylineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationDraftPolylineCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationDraftPolylineMeasure, + * lineEndings?: ?AnnotationDraftPolylineLineEndings, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices']; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->lineEndings = $values['lineEndings'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineBlendMode.php b/src/Types/AnnotationDraftPolylineBlendMode.php new file mode 100644 index 0000000..f9fdaad --- /dev/null +++ b/src/Types/AnnotationDraftPolylineBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineIntent.php b/src/Types/AnnotationDraftPolylineIntent.php new file mode 100644 index 0000000..7fa4b47 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineIntent.php @@ -0,0 +1,8 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineLineEndingsEnd.php b/src/Types/AnnotationDraftPolylineLineEndingsEnd.php new file mode 100644 index 0000000..7a35ab5 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineLineEndingsEnd.php @@ -0,0 +1,17 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftPolylineMeasureRectilinear $rectilinear + * @return AnnotationDraftPolylineMeasure + */ + public static function rectilinear(AnnotationDraftPolylineMeasureRectilinear $rectilinear): AnnotationDraftPolylineMeasure + { + return new AnnotationDraftPolylineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationDraftPolylineMeasureUnknown $unknown + * @return AnnotationDraftPolylineMeasure + */ + public static function unknown(AnnotationDraftPolylineMeasureUnknown $unknown): AnnotationDraftPolylineMeasure + { + return new AnnotationDraftPolylineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationDraftPolylineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationDraftPolylineMeasureRectilinear + */ + public function asRectilinear(): AnnotationDraftPolylineMeasureRectilinear + { + if (!($this->value instanceof AnnotationDraftPolylineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftPolylineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftPolylineMeasureUnknown + */ + public function asUnknown(): AnnotationDraftPolylineMeasureUnknown + { + if (!($this->value instanceof AnnotationDraftPolylineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationDraftPolylineMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationDraftPolylineMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftPolylineMeasureRectilinear.php b/src/Types/AnnotationDraftPolylineMeasureRectilinear.php new file mode 100644 index 0000000..4637372 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationDraftPolylineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationDraftPolylineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationDraftPolylineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationDraftPolylineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationDraftPolylineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationDraftPolylineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationDraftPolylineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationDraftPolylineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationDraftPolylineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationDraftPolylineMeasureRectilinearAngleItem.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..669cf27 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearAngleItem.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/AnnotationDraftPolylineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..b3c524c --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearAngleItemFraction.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/AnnotationDraftPolylineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..5dbbe11 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearAreaItemFraction.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/AnnotationDraftPolylineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..7c32bf4 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearDistanceItemFraction.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/AnnotationDraftPolylineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..b02c0ac --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearSlopeItem.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/AnnotationDraftPolylineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..acb7733 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearSlopeItemFraction.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/AnnotationDraftPolylineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..1cd4461 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearXItemFraction.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/AnnotationDraftPolylineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationDraftPolylineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..73a5b34 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationDraftPolylineMeasureUnknownGeospatial $geospatial + * @return AnnotationDraftPolylineMeasureUnknown + */ + public static function geospatial(AnnotationDraftPolylineMeasureUnknownGeospatial $geospatial): AnnotationDraftPolylineMeasureUnknown + { + return new AnnotationDraftPolylineMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationDraftPolylineMeasureUnknownUnknown $unknown + * @return AnnotationDraftPolylineMeasureUnknown + */ + public static function unknown(AnnotationDraftPolylineMeasureUnknownUnknown $unknown): AnnotationDraftPolylineMeasureUnknown + { + return new AnnotationDraftPolylineMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationDraftPolylineMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationDraftPolylineMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationDraftPolylineMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationDraftPolylineMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationDraftPolylineMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationDraftPolylineMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationDraftPolylineMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationDraftPolylineMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationDraftPolylineMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationDraftPolylineMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationDraftPolylineMeasureUnknownGeospatial.php b/src/Types/AnnotationDraftPolylineMeasureUnknownGeospatial.php new file mode 100644 index 0000000..9a3c59a --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineMeasureUnknownUnknown.php b/src/Types/AnnotationDraftPolylineMeasureUnknownUnknown.php new file mode 100644 index 0000000..6f98fba --- /dev/null +++ b/src/Types/AnnotationDraftPolylineMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineRect.php b/src/Types/AnnotationDraftPolylineRect.php new file mode 100644 index 0000000..1ced055 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineRect.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/AnnotationDraftPolylineReply.php b/src/Types/AnnotationDraftPolylineReply.php new file mode 100644 index 0000000..123657f --- /dev/null +++ b/src/Types/AnnotationDraftPolylineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPolylineReplyType.php b/src/Types/AnnotationDraftPolylineReplyType.php new file mode 100644 index 0000000..73841f7 --- /dev/null +++ b/src/Types/AnnotationDraftPolylineReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPopup.php b/src/Types/AnnotationDraftPopup.php new file mode 100644 index 0000000..d84d6cf --- /dev/null +++ b/src/Types/AnnotationDraftPopup.php @@ -0,0 +1,282 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftPopupReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftPopupReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var AnnotationRef $parent + */ + #[JsonProperty('parent')] + public AnnotationRef $parent; + + /** + * @var ?bool $open + */ + #[JsonProperty('open')] + public ?bool $open; + + /** + * @param array{ + * rect: AnnotationDraftPopupRect, + * parent: AnnotationRef, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftPopupReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * open?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->parent = $values['parent']; + $this->open = $values['open'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPopupBlendMode.php b/src/Types/AnnotationDraftPopupBlendMode.php new file mode 100644 index 0000000..2effb68 --- /dev/null +++ b/src/Types/AnnotationDraftPopupBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftPopupReply.php b/src/Types/AnnotationDraftPopupReply.php new file mode 100644 index 0000000..ea53a6b --- /dev/null +++ b/src/Types/AnnotationDraftPopupReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftPopupReplyType.php b/src/Types/AnnotationDraftPopupReplyType.php new file mode 100644 index 0000000..d66d1a8 --- /dev/null +++ b/src/Types/AnnotationDraftPopupReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftRedactReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftRedactReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationDraftRedactQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?string $overlayText + */ + #[JsonProperty('overlayText')] + public ?string $overlayText; + + /** + * @var ?bool $repeat + */ + #[JsonProperty('repeat')] + public ?bool $repeat; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftRedactRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftRedactReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * interiorColor?: ?string, + * overlayText?: ?string, + * repeat?: ?bool, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * textAlign?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->overlayText = $values['overlayText'] ?? null; + $this->repeat = $values['repeat'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactBlendMode.php b/src/Types/AnnotationDraftRedactBlendMode.php new file mode 100644 index 0000000..b9d22b7 --- /dev/null +++ b/src/Types/AnnotationDraftRedactBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactQuadPointsItemLowerLeft.php b/src/Types/AnnotationDraftRedactQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..52e68d9 --- /dev/null +++ b/src/Types/AnnotationDraftRedactQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactQuadPointsItemLowerRight.php b/src/Types/AnnotationDraftRedactQuadPointsItemLowerRight.php new file mode 100644 index 0000000..181f648 --- /dev/null +++ b/src/Types/AnnotationDraftRedactQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactQuadPointsItemUpperLeft.php b/src/Types/AnnotationDraftRedactQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..95b389e --- /dev/null +++ b/src/Types/AnnotationDraftRedactQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactQuadPointsItemUpperRight.php b/src/Types/AnnotationDraftRedactQuadPointsItemUpperRight.php new file mode 100644 index 0000000..531db77 --- /dev/null +++ b/src/Types/AnnotationDraftRedactQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactRect.php b/src/Types/AnnotationDraftRedactRect.php new file mode 100644 index 0000000..c593a36 --- /dev/null +++ b/src/Types/AnnotationDraftRedactRect.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/AnnotationDraftRedactReply.php b/src/Types/AnnotationDraftRedactReply.php new file mode 100644 index 0000000..f031e1c --- /dev/null +++ b/src/Types/AnnotationDraftRedactReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftRedactReplyType.php b/src/Types/AnnotationDraftRedactReplyType.php new file mode 100644 index 0000000..4d71557 --- /dev/null +++ b/src/Types/AnnotationDraftRedactReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftSquareReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftSquareReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?AnnotationDraftSquareBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftSquareBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftSquareRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftSquareReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * interiorColor?: ?string, + * box?: ?AnnotationDraftSquareBox, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquareBlendMode.php b/src/Types/AnnotationDraftSquareBlendMode.php new file mode 100644 index 0000000..4d10739 --- /dev/null +++ b/src/Types/AnnotationDraftSquareBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftSquareRect.php b/src/Types/AnnotationDraftSquareRect.php new file mode 100644 index 0000000..91656a9 --- /dev/null +++ b/src/Types/AnnotationDraftSquareRect.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/AnnotationDraftSquareReply.php b/src/Types/AnnotationDraftSquareReply.php new file mode 100644 index 0000000..fcee616 --- /dev/null +++ b/src/Types/AnnotationDraftSquareReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquareReplyType.php b/src/Types/AnnotationDraftSquareReplyType.php new file mode 100644 index 0000000..7e2a2c9 --- /dev/null +++ b/src/Types/AnnotationDraftSquareReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftSquigglyReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftSquigglyReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationDraftSquigglyQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * quadPoints: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftSquigglyRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftSquigglyReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyBlendMode.php b/src/Types/AnnotationDraftSquigglyBlendMode.php new file mode 100644 index 0000000..889da79 --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerLeft.php b/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..017e3f0 --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerRight.php b/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerRight.php new file mode 100644 index 0000000..e06f99e --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperLeft.php b/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..98933be --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperRight.php b/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperRight.php new file mode 100644 index 0000000..346faaa --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyRect.php b/src/Types/AnnotationDraftSquigglyRect.php new file mode 100644 index 0000000..4e44120 --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyRect.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/AnnotationDraftSquigglyReply.php b/src/Types/AnnotationDraftSquigglyReply.php new file mode 100644 index 0000000..87e1e2f --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftSquigglyReplyType.php b/src/Types/AnnotationDraftSquigglyReplyType.php new file mode 100644 index 0000000..3c4ce34 --- /dev/null +++ b/src/Types/AnnotationDraftSquigglyReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftStampReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftStampReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?AnnotationDraftStampBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftStampBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $name + */ + #[JsonProperty('name')] + public ?string $name; + + /** + * @var ?value-of $fit + */ + #[JsonProperty('fit')] + public ?string $fit; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftStampRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftStampReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * box?: ?AnnotationDraftStampBox, + * rotation?: ?float, + * name?: ?string, + * fit?: ?value-of, + * opacity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->name = $values['name'] ?? null; + $this->fit = $values['fit'] ?? null; + $this->opacity = $values['opacity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStampBlendMode.php b/src/Types/AnnotationDraftStampBlendMode.php new file mode 100644 index 0000000..9c8cae6 --- /dev/null +++ b/src/Types/AnnotationDraftStampBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftStampFit.php b/src/Types/AnnotationDraftStampFit.php new file mode 100644 index 0000000..8551921 --- /dev/null +++ b/src/Types/AnnotationDraftStampFit.php @@ -0,0 +1,10 @@ +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/AnnotationDraftStampReply.php b/src/Types/AnnotationDraftStampReply.php new file mode 100644 index 0000000..823d738 --- /dev/null +++ b/src/Types/AnnotationDraftStampReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStampReplyType.php b/src/Types/AnnotationDraftStampReplyType.php new file mode 100644 index 0000000..aff1779 --- /dev/null +++ b/src/Types/AnnotationDraftStampReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftStrikeoutReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftStrikeoutReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationDraftStrikeoutQuadPointsItem::class])] + public array $quadPoints; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * quadPoints: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftStrikeoutRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftStrikeoutReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints']; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutBlendMode.php b/src/Types/AnnotationDraftStrikeoutBlendMode.php new file mode 100644 index 0000000..4658704 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerLeft.php b/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..6c7266c --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerRight.php b/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerRight.php new file mode 100644 index 0000000..12d810c --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperLeft.php b/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..aecdba5 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperRight.php b/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperRight.php new file mode 100644 index 0000000..0d8b4a1 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutRect.php b/src/Types/AnnotationDraftStrikeoutRect.php new file mode 100644 index 0000000..647bbe2 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutRect.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/AnnotationDraftStrikeoutReply.php b/src/Types/AnnotationDraftStrikeoutReply.php new file mode 100644 index 0000000..473cb29 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftStrikeoutReplyType.php b/src/Types/AnnotationDraftStrikeoutReplyType.php new file mode 100644 index 0000000..592ab03 --- /dev/null +++ b/src/Types/AnnotationDraftStrikeoutReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftTextReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?value-of $icon + */ + #[JsonProperty('icon')] + public ?string $icon; + + /** + * @var ?bool $open + */ + #[JsonProperty('open')] + public ?bool $open; + + /** + * @var ?string $state + */ + #[JsonProperty('state')] + public ?string $state; + + /** + * @var ?string $stateModel + */ + #[JsonProperty('stateModel')] + public ?string $stateModel; + + /** + * @param array{ + * rect: AnnotationDraftTextRect, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftTextReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * icon?: ?value-of, + * open?: ?bool, + * state?: ?string, + * stateModel?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->icon = $values['icon'] ?? null; + $this->open = $values['open'] ?? null; + $this->state = $values['state'] ?? null; + $this->stateModel = $values['stateModel'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftTextBlendMode.php b/src/Types/AnnotationDraftTextBlendMode.php new file mode 100644 index 0000000..3c8f1fd --- /dev/null +++ b/src/Types/AnnotationDraftTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftTextReply.php b/src/Types/AnnotationDraftTextReply.php new file mode 100644 index 0000000..e8b6888 --- /dev/null +++ b/src/Types/AnnotationDraftTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftTextReplyType.php b/src/Types/AnnotationDraftTextReplyType.php new file mode 100644 index 0000000..d941ea4 --- /dev/null +++ b/src/Types/AnnotationDraftTextReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftUnderlineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftUnderlineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationDraftUnderlineQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * quadPoints: array, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftUnderlineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftUnderlineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineBlendMode.php b/src/Types/AnnotationDraftUnderlineBlendMode.php new file mode 100644 index 0000000..7558596 --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerLeft.php b/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..ab95e3d --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerRight.php b/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerRight.php new file mode 100644 index 0000000..8c3b00b --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperLeft.php b/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..66a05e8 --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperRight.php b/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperRight.php new file mode 100644 index 0000000..5f78987 --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineRect.php b/src/Types/AnnotationDraftUnderlineRect.php new file mode 100644 index 0000000..9c2ecd2 --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineRect.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/AnnotationDraftUnderlineReply.php b/src/Types/AnnotationDraftUnderlineReply.php new file mode 100644 index 0000000..65d51cb --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftUnderlineReplyType.php b/src/Types/AnnotationDraftUnderlineReplyType.php new file mode 100644 index 0000000..15394fc --- /dev/null +++ b/src/Types/AnnotationDraftUnderlineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationDraftWidgetReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationDraftWidgetReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var ?WidgetActionsPatch $actions + */ + #[JsonProperty('actions')] + public ?WidgetActionsPatch $actions; + + /** + * @var ?AnnotationDraftWidgetBox $box + */ + #[JsonProperty('box')] + public ?AnnotationDraftWidgetBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @var ?string $caption + */ + #[JsonProperty('caption')] + public ?string $caption; + + /** + * @var ?value-of $checkStyle + */ + #[JsonProperty('checkStyle')] + public ?string $checkStyle; + + /** + * @var mixed $field + */ + #[JsonProperty('field')] + public mixed $field; + + /** + * @var mixed $fieldFamily + */ + #[JsonProperty('fieldFamily')] + public mixed $fieldFamily; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationDraftWidgetRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationDraftWidgetReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: ?WidgetActionsPatch, + * box?: ?AnnotationDraftWidgetBox, + * rotation?: ?float, + * color?: ?string, + * interiorColor?: ?string, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * textAlign?: ?value-of, + * caption?: ?string, + * checkStyle?: ?value-of, + * field?: mixed, + * fieldFamily?: mixed, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->color = $values['color'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->checkStyle = $values['checkStyle'] ?? null; + $this->field = $values['field'] ?? null; + $this->fieldFamily = $values['fieldFamily'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftWidgetBlendMode.php b/src/Types/AnnotationDraftWidgetBlendMode.php new file mode 100644 index 0000000..3495b77 --- /dev/null +++ b/src/Types/AnnotationDraftWidgetBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationDraftWidgetCheckStyle.php b/src/Types/AnnotationDraftWidgetCheckStyle.php new file mode 100644 index 0000000..0be397b --- /dev/null +++ b/src/Types/AnnotationDraftWidgetCheckStyle.php @@ -0,0 +1,13 @@ +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/AnnotationDraftWidgetReply.php b/src/Types/AnnotationDraftWidgetReply.php new file mode 100644 index 0000000..01fba34 --- /dev/null +++ b/src/Types/AnnotationDraftWidgetReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationDraftWidgetReplyType.php b/src/Types/AnnotationDraftWidgetReplyType.php new file mode 100644 index 0000000..5425939 --- /dev/null +++ b/src/Types/AnnotationDraftWidgetReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationFileAttachmentReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationFileAttachmentReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var value-of $icon + */ + #[JsonProperty('icon')] + public string $icon; + + /** + * @var ?AnnotationFileAttachmentFile $file + */ + #[JsonProperty('file')] + public ?AnnotationFileAttachmentFile $file; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationFileAttachmentRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * icon: value-of, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationFileAttachmentReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * file?: ?AnnotationFileAttachmentFile, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->icon = $values['icon']; + $this->file = $values['file'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFileAttachmentBlendMode.php b/src/Types/AnnotationFileAttachmentBlendMode.php new file mode 100644 index 0000000..fafa087 --- /dev/null +++ b/src/Types/AnnotationFileAttachmentBlendMode.php @@ -0,0 +1,23 @@ +name = $values['name']; + $this->mimeType = $values['mimeType'] ?? null; + $this->description = $values['description'] ?? null; + $this->size = $values['size'] ?? null; + $this->checksum = $values['checksum'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFileAttachmentIcon.php b/src/Types/AnnotationFileAttachmentIcon.php new file mode 100644 index 0000000..6dcfeb3 --- /dev/null +++ b/src/Types/AnnotationFileAttachmentIcon.php @@ -0,0 +1,11 @@ +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/AnnotationFileAttachmentReply.php b/src/Types/AnnotationFileAttachmentReply.php new file mode 100644 index 0000000..cad005e --- /dev/null +++ b/src/Types/AnnotationFileAttachmentReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFileAttachmentReplyType.php b/src/Types/AnnotationFileAttachmentReplyType.php new file mode 100644 index 0000000..3d8fd0e --- /dev/null +++ b/src/Types/AnnotationFileAttachmentReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationFreeTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationFreeTextReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var AnnotationFreeTextBox $box + */ + #[JsonProperty('box')] + public AnnotationFreeTextBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var value-of $intent + */ + #[JsonProperty('intent')] + public string $intent; + + /** + * @var string $fontFamily + */ + #[JsonProperty('fontFamily')] + public string $fontFamily; + + /** + * @var float $fontSize + */ + #[JsonProperty('fontSize')] + public float $fontSize; + + /** + * @var value-of $textAlign + */ + #[JsonProperty('textAlign')] + public string $textAlign; + + /** + * @var value-of $verticalAlign + */ + #[JsonProperty('verticalAlign')] + public string $verticalAlign; + + /** + * @var AnnotationFreeTextRichText $richText + */ + #[JsonProperty('richText')] + public AnnotationFreeTextRichText $richText; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var string $fontColor + */ + #[JsonProperty('fontColor')] + public string $fontColor; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @var ?array $calloutLine + */ + #[JsonProperty('calloutLine'), ArrayType(['mixed'])] + public ?array $calloutLine; + + /** + * @var ?value-of $lineEnding + */ + #[JsonProperty('lineEnding')] + public ?string $lineEnding; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationFreeTextRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * box: AnnotationFreeTextBox, + * intent: value-of, + * fontFamily: string, + * fontSize: float, + * textAlign: value-of, + * verticalAlign: value-of, + * richText: AnnotationFreeTextRichText, + * color: string, + * fontColor: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationFreeTextReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * rotation?: ?float, + * interiorColor?: ?string, + * dashArray?: ?array, + * cloudyIntensity?: ?float, + * calloutLine?: ?array, + * lineEnding?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent']; + $this->fontFamily = $values['fontFamily']; + $this->fontSize = $values['fontSize']; + $this->textAlign = $values['textAlign']; + $this->verticalAlign = $values['verticalAlign']; + $this->richText = $values['richText']; + $this->color = $values['color']; + $this->fontColor = $values['fontColor']; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + $this->calloutLine = $values['calloutLine'] ?? null; + $this->lineEnding = $values['lineEnding'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextBlendMode.php b/src/Types/AnnotationFreeTextBlendMode.php new file mode 100644 index 0000000..b68f12e --- /dev/null +++ b/src/Types/AnnotationFreeTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationFreeTextIntent.php b/src/Types/AnnotationFreeTextIntent.php new file mode 100644 index 0000000..15e8add --- /dev/null +++ b/src/Types/AnnotationFreeTextIntent.php @@ -0,0 +1,10 @@ +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/AnnotationFreeTextReply.php b/src/Types/AnnotationFreeTextReply.php new file mode 100644 index 0000000..6fb3518 --- /dev/null +++ b/src/Types/AnnotationFreeTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextReplyType.php b/src/Types/AnnotationFreeTextReplyType.php new file mode 100644 index 0000000..f99d093 --- /dev/null +++ b/src/Types/AnnotationFreeTextReplyType.php @@ -0,0 +1,9 @@ + $paragraphs + */ + #[JsonProperty('paragraphs'), ArrayType([AnnotationFreeTextRichTextParagraphsItem::class])] + public array $paragraphs; + + /** + * @param array{ + * body: AnnotationFreeTextRichTextBody, + * paragraphs: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->body = $values['body']; + $this->paragraphs = $values['paragraphs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextBody.php b/src/Types/AnnotationFreeTextRichTextBody.php new file mode 100644 index 0000000..bfcfe56 --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextBody.php @@ -0,0 +1,147 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public array $decoration; + + /** + * @var value-of $script + */ + #[JsonProperty('script')] + public string $script; + + /** + * @var float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public float $letterSpacing; + + /** + * @var float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var value-of $align + */ + #[JsonProperty('align')] + public string $align; + + /** + * @var value-of $dir + */ + #[JsonProperty('dir')] + public string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationFreeTextRichTextBodyMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationFreeTextRichTextBodyMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @param array{ + * family: string, + * weight: int, + * italic: bool, + * size: float, + * color: string, + * decoration: array>, + * script: value-of, + * letterSpacing: float, + * horizontalScale: float, + * align: value-of, + * dir: value-of, + * unknown?: ?string, + * lineHeight?: ?float, + * margins?: ?AnnotationFreeTextRichTextBodyMargins, + * textIndent?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->family = $values['family']; + $this->weight = $values['weight']; + $this->italic = $values['italic']; + $this->size = $values['size']; + $this->color = $values['color']; + $this->decoration = $values['decoration']; + $this->script = $values['script']; + $this->letterSpacing = $values['letterSpacing']; + $this->horizontalScale = $values['horizontalScale']; + $this->unknown = $values['unknown'] ?? null; + $this->align = $values['align']; + $this->dir = $values['dir']; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextBodyAlign.php b/src/Types/AnnotationFreeTextRichTextBodyAlign.php new file mode 100644 index 0000000..89a56c3 --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextBodyAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextBodyScript.php b/src/Types/AnnotationFreeTextRichTextBodyScript.php new file mode 100644 index 0000000..fac68be --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextBodyScript.php @@ -0,0 +1,10 @@ + $align + */ + #[JsonProperty('align')] + public ?string $align; + + /** + * @var ?value-of $dir + */ + #[JsonProperty('dir')] + public ?string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationFreeTextRichTextParagraphsItemMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationFreeTextRichTextParagraphsItemMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var array $runs + */ + #[JsonProperty('runs'), ArrayType([AnnotationFreeTextRichTextParagraphsItemRunsItem::class])] + public array $runs; + + /** + * @param array{ + * runs: array, + * align?: ?value-of, + * dir?: ?value-of, + * lineHeight?: ?float, + * margins?: ?AnnotationFreeTextRichTextParagraphsItemMargins, + * textIndent?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->align = $values['align'] ?? null; + $this->dir = $values['dir'] ?? null; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + $this->unknown = $values['unknown'] ?? null; + $this->runs = $values['runs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextParagraphsItemAlign.php b/src/Types/AnnotationFreeTextRichTextParagraphsItemAlign.php new file mode 100644 index 0000000..c2cd0f5 --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextParagraphsItemAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItem.php b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItem.php new file mode 100644 index 0000000..d0de50b --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItem.php @@ -0,0 +1,42 @@ +text = $values['text']; + $this->style = $values['style'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyle.php b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyle.php new file mode 100644 index 0000000..cc2f988 --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyle.php @@ -0,0 +1,107 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public ?array $decoration; + + /** + * @var ?value-of $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var ?float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public ?float $letterSpacing; + + /** + * @var ?float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public ?float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @param array{ + * family?: ?string, + * weight?: ?int, + * italic?: ?bool, + * size?: ?float, + * color?: ?string, + * decoration?: ?array>, + * script?: ?value-of, + * letterSpacing?: ?float, + * horizontalScale?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->size = $values['size'] ?? null; + $this->color = $values['color'] ?? null; + $this->decoration = $values['decoration'] ?? null; + $this->script = $values['script'] ?? null; + $this->letterSpacing = $values['letterSpacing'] ?? null; + $this->horizontalScale = $values['horizontalScale'] ?? null; + $this->unknown = $values['unknown'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php new file mode 100644 index 0000000..42abe24 --- /dev/null +++ b/src/Types/AnnotationFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php @@ -0,0 +1,10 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationHighlightReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationHighlightReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationHighlightQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationHighlightRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * quadPoints: array, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationHighlightReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightBlendMode.php b/src/Types/AnnotationHighlightBlendMode.php new file mode 100644 index 0000000..aeb50f8 --- /dev/null +++ b/src/Types/AnnotationHighlightBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightQuadPointsItemLowerLeft.php b/src/Types/AnnotationHighlightQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..335e92d --- /dev/null +++ b/src/Types/AnnotationHighlightQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightQuadPointsItemLowerRight.php b/src/Types/AnnotationHighlightQuadPointsItemLowerRight.php new file mode 100644 index 0000000..aec6423 --- /dev/null +++ b/src/Types/AnnotationHighlightQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightQuadPointsItemUpperLeft.php b/src/Types/AnnotationHighlightQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..a6ae86b --- /dev/null +++ b/src/Types/AnnotationHighlightQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightQuadPointsItemUpperRight.php b/src/Types/AnnotationHighlightQuadPointsItemUpperRight.php new file mode 100644 index 0000000..79e21c1 --- /dev/null +++ b/src/Types/AnnotationHighlightQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightRect.php b/src/Types/AnnotationHighlightRect.php new file mode 100644 index 0000000..84e43b6 --- /dev/null +++ b/src/Types/AnnotationHighlightRect.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/AnnotationHighlightReply.php b/src/Types/AnnotationHighlightReply.php new file mode 100644 index 0000000..c4e436e --- /dev/null +++ b/src/Types/AnnotationHighlightReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationHighlightReplyType.php b/src/Types/AnnotationHighlightReplyType.php new file mode 100644 index 0000000..98d2165 --- /dev/null +++ b/src/Types/AnnotationHighlightReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationInkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationInkReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var array> $inkList + */ + #[JsonProperty('inkList'), ArrayType([[AnnotationInkInkListItemItem::class]])] + public array $inkList; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationInkRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * inkList: array>, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationInkReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * intent?: ?value-of, + * rotation?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->inkList = $values['inkList']; + $this->intent = $values['intent'] ?? null; + $this->rotation = $values['rotation'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationInkBlendMode.php b/src/Types/AnnotationInkBlendMode.php new file mode 100644 index 0000000..3c742cb --- /dev/null +++ b/src/Types/AnnotationInkBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationInkIntent.php b/src/Types/AnnotationInkIntent.php new file mode 100644 index 0000000..09c5eff --- /dev/null +++ b/src/Types/AnnotationInkIntent.php @@ -0,0 +1,8 @@ +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/AnnotationInkReply.php b/src/Types/AnnotationInkReply.php new file mode 100644 index 0000000..af6e9f1 --- /dev/null +++ b/src/Types/AnnotationInkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationInkReplyType.php b/src/Types/AnnotationInkReplyType.php new file mode 100644 index 0000000..8b308ba --- /dev/null +++ b/src/Types/AnnotationInkReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationLineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationLineReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var AnnotationLineLinePoints $linePoints + */ + #[JsonProperty('linePoints')] + public AnnotationLineLinePoints $linePoints; + + /** + * @var AnnotationLineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public AnnotationLineLineEndings $lineEndings; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationLineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationLineMeasure $measure; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var value-of $captionPosition + */ + #[JsonProperty('captionPosition')] + public string $captionPosition; + + /** + * @var ?AnnotationLineCaptionOffset $captionOffset + */ + #[JsonProperty('captionOffset')] + public ?AnnotationLineCaptionOffset $captionOffset; + + /** + * @var ?AnnotationLineLeader $leader + */ + #[JsonProperty('leader')] + public ?AnnotationLineLeader $leader; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationLineRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * linePoints: AnnotationLineLinePoints, + * lineEndings: AnnotationLineLineEndings, + * captionPosition: value-of, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationLineReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * intent?: ?value-of, + * measure?: ?AnnotationLineMeasure, + * captionEnabled?: ?bool, + * captionOffset?: ?AnnotationLineCaptionOffset, + * leader?: ?AnnotationLineLeader, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->linePoints = $values['linePoints']; + $this->lineEndings = $values['lineEndings']; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionPosition = $values['captionPosition']; + $this->captionOffset = $values['captionOffset'] ?? null; + $this->leader = $values['leader'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineBlendMode.php b/src/Types/AnnotationLineBlendMode.php new file mode 100644 index 0000000..f41cebe --- /dev/null +++ b/src/Types/AnnotationLineBlendMode.php @@ -0,0 +1,23 @@ +along = $values['along']; + $this->perpendicular = $values['perpendicular']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineCaptionPosition.php b/src/Types/AnnotationLineCaptionPosition.php new file mode 100644 index 0000000..1f056a2 --- /dev/null +++ b/src/Types/AnnotationLineCaptionPosition.php @@ -0,0 +1,9 @@ +length = $values['length']; + $this->extension = $values['extension'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineLineEndings.php b/src/Types/AnnotationLineLineEndings.php new file mode 100644 index 0000000..13d8cf1 --- /dev/null +++ b/src/Types/AnnotationLineLineEndings.php @@ -0,0 +1,42 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineLineEndingsEnd.php b/src/Types/AnnotationLineLineEndingsEnd.php new file mode 100644 index 0000000..b54d004 --- /dev/null +++ b/src/Types/AnnotationLineLineEndingsEnd.php @@ -0,0 +1,17 @@ +start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineLinePointsEnd.php b/src/Types/AnnotationLineLinePointsEnd.php new file mode 100644 index 0000000..ad5aa59 --- /dev/null +++ b/src/Types/AnnotationLineLinePointsEnd.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineLinePointsStart.php b/src/Types/AnnotationLineLinePointsStart.php new file mode 100644 index 0000000..9959466 --- /dev/null +++ b/src/Types/AnnotationLineLinePointsStart.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineMeasure.php b/src/Types/AnnotationLineMeasure.php new file mode 100644 index 0000000..68d99ff --- /dev/null +++ b/src/Types/AnnotationLineMeasure.php @@ -0,0 +1,241 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationLineMeasureRectilinear $rectilinear + * @return AnnotationLineMeasure + */ + public static function rectilinear(AnnotationLineMeasureRectilinear $rectilinear): AnnotationLineMeasure + { + return new AnnotationLineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationLineMeasureGeospatial $geospatial + * @return AnnotationLineMeasure + */ + public static function geospatial(AnnotationLineMeasureGeospatial $geospatial): AnnotationLineMeasure + { + return new AnnotationLineMeasure([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationLineMeasureUnknown $unknown + * @return AnnotationLineMeasure + */ + public static function unknown(AnnotationLineMeasureUnknown $unknown): AnnotationLineMeasure + { + return new AnnotationLineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationLineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationLineMeasureRectilinear + */ + public function asRectilinear(): AnnotationLineMeasureRectilinear + { + if (!($this->value instanceof AnnotationLineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationLineMeasureGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationLineMeasureGeospatial + */ + public function asGeospatial(): AnnotationLineMeasureGeospatial + { + if (!($this->value instanceof AnnotationLineMeasureGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationLineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationLineMeasureUnknown + */ + public function asUnknown(): AnnotationLineMeasureUnknown + { + if (!($this->value instanceof AnnotationLineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationLineMeasureRectilinear::jsonDeserialize($data); + break; + case 'geospatial': + $args['value'] = AnnotationLineMeasureGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationLineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationLineMeasureGeospatial.php b/src/Types/AnnotationLineMeasureGeospatial.php new file mode 100644 index 0000000..0ab85ed --- /dev/null +++ b/src/Types/AnnotationLineMeasureGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationLineMeasureRectilinear.php b/src/Types/AnnotationLineMeasureRectilinear.php new file mode 100644 index 0000000..99d0ca4 --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationLineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationLineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationLineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationLineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationLineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationLineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationLineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationLineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationLineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationLineMeasureRectilinearAngleItem.php b/src/Types/AnnotationLineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..699075f --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearAngleItem.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/AnnotationLineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..44be064 --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearAngleItemFraction.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/AnnotationLineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..7aecd67 --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearAreaItemFraction.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/AnnotationLineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..ee39b3f --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearDistanceItemFraction.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/AnnotationLineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationLineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..32bdb9c --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearSlopeItem.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/AnnotationLineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..b6acd1e --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearSlopeItemFraction.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/AnnotationLineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..6067be2 --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearXItemFraction.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/AnnotationLineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..a93ebb0 --- /dev/null +++ b/src/Types/AnnotationLineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationLineRect.php b/src/Types/AnnotationLineRect.php new file mode 100644 index 0000000..87f61ad --- /dev/null +++ b/src/Types/AnnotationLineRect.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/AnnotationLineReply.php b/src/Types/AnnotationLineReply.php new file mode 100644 index 0000000..2974f72 --- /dev/null +++ b/src/Types/AnnotationLineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLineReplyType.php b/src/Types/AnnotationLineReplyType.php new file mode 100644 index 0000000..6a9242b --- /dev/null +++ b/src/Types/AnnotationLineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationLinkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationLinkReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var ?PdfLinkTarget $target + */ + #[JsonProperty('target')] + public ?PdfLinkTarget $target; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationLinkRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationLinkReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * target?: ?PdfLinkTarget, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->target = $values['target'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLinkBlendMode.php b/src/Types/AnnotationLinkBlendMode.php new file mode 100644 index 0000000..739e9cb --- /dev/null +++ b/src/Types/AnnotationLinkBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationLinkReply.php b/src/Types/AnnotationLinkReply.php new file mode 100644 index 0000000..067cc92 --- /dev/null +++ b/src/Types/AnnotationLinkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationLinkReplyType.php b/src/Types/AnnotationLinkReplyType.php new file mode 100644 index 0000000..ccf84f7 --- /dev/null +++ b/src/Types/AnnotationLinkReplyType.php @@ -0,0 +1,9 @@ + $annotations + */ + #[JsonProperty('annotations'), ArrayType([Annotation::class])] + public array $annotations; + + /** + * @var array $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ?int $auditHead + */ + #[JsonProperty('auditHead')] + public ?int $auditHead; + + /** + * @param array{ + * annotations: array, + * pages: array, + * auditHead?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->annotations = $values['annotations']; + $this->pages = $values['pages']; + $this->auditHead = $values['auditHead'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationMutationMeta.php b/src/Types/AnnotationMutationMeta.php new file mode 100644 index 0000000..a3dd6fb --- /dev/null +++ b/src/Types/AnnotationMutationMeta.php @@ -0,0 +1,67 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([PageRef::class])] + public array $affectedPages; + + /** + * @var ?CacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?CacheDelta $cacheDelta; + + /** + * @var string $opId + */ + #[JsonProperty('opId')] + public string $opId; + + /** + * @var bool $undoable + */ + #[JsonProperty('undoable')] + public bool $undoable; + + /** + * @var array $changed + */ + #[JsonProperty('changed'), ArrayType([AnnotationRef::class])] + public array $changed; + + /** + * @param array{ + * affectedPages: array, + * opId: string, + * undoable: bool, + * changed: array, + * cacheDelta?: ?CacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + $this->opId = $values['opId']; + $this->undoable = $values['undoable']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatch.php b/src/Types/AnnotationPatch.php new file mode 100644 index 0000000..d877457 --- /dev/null +++ b/src/Types/AnnotationPatch.php @@ -0,0 +1,961 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchHighlight $highlight + * @return AnnotationPatch + */ + public static function highlight(AnnotationPatchHighlight $highlight): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'highlight', + 'value' => $highlight, + ]); + } + + /** + * @param AnnotationPatchUnderline $underline + * @return AnnotationPatch + */ + public static function underline(AnnotationPatchUnderline $underline): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'underline', + 'value' => $underline, + ]); + } + + /** + * @param AnnotationPatchSquiggly $squiggly + * @return AnnotationPatch + */ + public static function squiggly(AnnotationPatchSquiggly $squiggly): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'squiggly', + 'value' => $squiggly, + ]); + } + + /** + * @param AnnotationPatchStrikeout $strikeout + * @return AnnotationPatch + */ + public static function strikeout(AnnotationPatchStrikeout $strikeout): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'strikeout', + 'value' => $strikeout, + ]); + } + + /** + * @param AnnotationPatchCircle $circle + * @return AnnotationPatch + */ + public static function circle(AnnotationPatchCircle $circle): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'circle', + 'value' => $circle, + ]); + } + + /** + * @param AnnotationPatchSquare $square + * @return AnnotationPatch + */ + public static function square(AnnotationPatchSquare $square): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'square', + 'value' => $square, + ]); + } + + /** + * @param AnnotationPatchPolygon $polygon + * @return AnnotationPatch + */ + public static function polygon(AnnotationPatchPolygon $polygon): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'polygon', + 'value' => $polygon, + ]); + } + + /** + * @param AnnotationPatchPolyline $polyline + * @return AnnotationPatch + */ + public static function polyline(AnnotationPatchPolyline $polyline): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'polyline', + 'value' => $polyline, + ]); + } + + /** + * @param AnnotationPatchLine $line + * @return AnnotationPatch + */ + public static function line(AnnotationPatchLine $line): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'line', + 'value' => $line, + ]); + } + + /** + * @param AnnotationPatchLink $link + * @return AnnotationPatch + */ + public static function link(AnnotationPatchLink $link): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'link', + 'value' => $link, + ]); + } + + /** + * @param AnnotationPatchInk $ink + * @return AnnotationPatch + */ + public static function ink(AnnotationPatchInk $ink): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'ink', + 'value' => $ink, + ]); + } + + /** + * @param AnnotationPatchFreeText $freeText + * @return AnnotationPatch + */ + public static function freeText(AnnotationPatchFreeText $freeText): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'free-text', + 'value' => $freeText, + ]); + } + + /** + * @param AnnotationPatchCaret $caret + * @return AnnotationPatch + */ + public static function caret(AnnotationPatchCaret $caret): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'caret', + 'value' => $caret, + ]); + } + + /** + * @param AnnotationPatchText $text + * @return AnnotationPatch + */ + public static function text(AnnotationPatchText $text): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'text', + 'value' => $text, + ]); + } + + /** + * @param AnnotationPatchStamp $stamp + * @return AnnotationPatch + */ + public static function stamp(AnnotationPatchStamp $stamp): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'stamp', + 'value' => $stamp, + ]); + } + + /** + * @param AnnotationPatchFileAttachment $fileAttachment + * @return AnnotationPatch + */ + public static function fileAttachment(AnnotationPatchFileAttachment $fileAttachment): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'file-attachment', + 'value' => $fileAttachment, + ]); + } + + /** + * @param WidgetPatch $widget + * @return AnnotationPatch + */ + public static function widget(WidgetPatch $widget): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'widget', + 'value' => $widget, + ]); + } + + /** + * @param AnnotationPatchRedact $redact + * @return AnnotationPatch + */ + public static function redact(AnnotationPatchRedact $redact): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'redact', + 'value' => $redact, + ]); + } + + /** + * @param AnnotationPatchPopup $popup + * @return AnnotationPatch + */ + public static function popup(AnnotationPatchPopup $popup): AnnotationPatch + { + return new AnnotationPatch([ + 'subtype' => 'popup', + 'value' => $popup, + ]); + } + + /** + * @return bool + */ + public function isHighlight(): bool + { + return $this->value instanceof AnnotationPatchHighlight && $this->subtype === 'highlight'; + } + + /** + * @return AnnotationPatchHighlight + */ + public function asHighlight(): AnnotationPatchHighlight + { + if (!($this->value instanceof AnnotationPatchHighlight && $this->subtype === 'highlight')) { + throw new Exception( + "Expected highlight; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnderline(): bool + { + return $this->value instanceof AnnotationPatchUnderline && $this->subtype === 'underline'; + } + + /** + * @return AnnotationPatchUnderline + */ + public function asUnderline(): AnnotationPatchUnderline + { + if (!($this->value instanceof AnnotationPatchUnderline && $this->subtype === 'underline')) { + throw new Exception( + "Expected underline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquiggly(): bool + { + return $this->value instanceof AnnotationPatchSquiggly && $this->subtype === 'squiggly'; + } + + /** + * @return AnnotationPatchSquiggly + */ + public function asSquiggly(): AnnotationPatchSquiggly + { + if (!($this->value instanceof AnnotationPatchSquiggly && $this->subtype === 'squiggly')) { + throw new Exception( + "Expected squiggly; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStrikeout(): bool + { + return $this->value instanceof AnnotationPatchStrikeout && $this->subtype === 'strikeout'; + } + + /** + * @return AnnotationPatchStrikeout + */ + public function asStrikeout(): AnnotationPatchStrikeout + { + if (!($this->value instanceof AnnotationPatchStrikeout && $this->subtype === 'strikeout')) { + throw new Exception( + "Expected strikeout; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCircle(): bool + { + return $this->value instanceof AnnotationPatchCircle && $this->subtype === 'circle'; + } + + /** + * @return AnnotationPatchCircle + */ + public function asCircle(): AnnotationPatchCircle + { + if (!($this->value instanceof AnnotationPatchCircle && $this->subtype === 'circle')) { + throw new Exception( + "Expected circle; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSquare(): bool + { + return $this->value instanceof AnnotationPatchSquare && $this->subtype === 'square'; + } + + /** + * @return AnnotationPatchSquare + */ + public function asSquare(): AnnotationPatchSquare + { + if (!($this->value instanceof AnnotationPatchSquare && $this->subtype === 'square')) { + throw new Exception( + "Expected square; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolygon(): bool + { + return $this->value instanceof AnnotationPatchPolygon && $this->subtype === 'polygon'; + } + + /** + * @return AnnotationPatchPolygon + */ + public function asPolygon(): AnnotationPatchPolygon + { + if (!($this->value instanceof AnnotationPatchPolygon && $this->subtype === 'polygon')) { + throw new Exception( + "Expected polygon; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPolyline(): bool + { + return $this->value instanceof AnnotationPatchPolyline && $this->subtype === 'polyline'; + } + + /** + * @return AnnotationPatchPolyline + */ + public function asPolyline(): AnnotationPatchPolyline + { + if (!($this->value instanceof AnnotationPatchPolyline && $this->subtype === 'polyline')) { + throw new Exception( + "Expected polyline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLine(): bool + { + return $this->value instanceof AnnotationPatchLine && $this->subtype === 'line'; + } + + /** + * @return AnnotationPatchLine + */ + public function asLine(): AnnotationPatchLine + { + if (!($this->value instanceof AnnotationPatchLine && $this->subtype === 'line')) { + throw new Exception( + "Expected line; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLink(): bool + { + return $this->value instanceof AnnotationPatchLink && $this->subtype === 'link'; + } + + /** + * @return AnnotationPatchLink + */ + public function asLink(): AnnotationPatchLink + { + if (!($this->value instanceof AnnotationPatchLink && $this->subtype === 'link')) { + throw new Exception( + "Expected link; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isInk(): bool + { + return $this->value instanceof AnnotationPatchInk && $this->subtype === 'ink'; + } + + /** + * @return AnnotationPatchInk + */ + public function asInk(): AnnotationPatchInk + { + if (!($this->value instanceof AnnotationPatchInk && $this->subtype === 'ink')) { + throw new Exception( + "Expected ink; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFreeText(): bool + { + return $this->value instanceof AnnotationPatchFreeText && $this->subtype === 'free-text'; + } + + /** + * @return AnnotationPatchFreeText + */ + public function asFreeText(): AnnotationPatchFreeText + { + if (!($this->value instanceof AnnotationPatchFreeText && $this->subtype === 'free-text')) { + throw new Exception( + "Expected free-text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCaret(): bool + { + return $this->value instanceof AnnotationPatchCaret && $this->subtype === 'caret'; + } + + /** + * @return AnnotationPatchCaret + */ + public function asCaret(): AnnotationPatchCaret + { + if (!($this->value instanceof AnnotationPatchCaret && $this->subtype === 'caret')) { + throw new Exception( + "Expected caret; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isText(): bool + { + return $this->value instanceof AnnotationPatchText && $this->subtype === 'text'; + } + + /** + * @return AnnotationPatchText + */ + public function asText(): AnnotationPatchText + { + if (!($this->value instanceof AnnotationPatchText && $this->subtype === 'text')) { + throw new Exception( + "Expected text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isStamp(): bool + { + return $this->value instanceof AnnotationPatchStamp && $this->subtype === 'stamp'; + } + + /** + * @return AnnotationPatchStamp + */ + public function asStamp(): AnnotationPatchStamp + { + if (!($this->value instanceof AnnotationPatchStamp && $this->subtype === 'stamp')) { + throw new Exception( + "Expected stamp; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFileAttachment(): bool + { + return $this->value instanceof AnnotationPatchFileAttachment && $this->subtype === 'file-attachment'; + } + + /** + * @return AnnotationPatchFileAttachment + */ + public function asFileAttachment(): AnnotationPatchFileAttachment + { + if (!($this->value instanceof AnnotationPatchFileAttachment && $this->subtype === 'file-attachment')) { + throw new Exception( + "Expected file-attachment; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isWidget(): bool + { + return $this->value instanceof WidgetPatch && $this->subtype === 'widget'; + } + + /** + * @return WidgetPatch + */ + public function asWidget(): WidgetPatch + { + if (!($this->value instanceof WidgetPatch && $this->subtype === 'widget')) { + throw new Exception( + "Expected widget; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRedact(): bool + { + return $this->value instanceof AnnotationPatchRedact && $this->subtype === 'redact'; + } + + /** + * @return AnnotationPatchRedact + */ + public function asRedact(): AnnotationPatchRedact + { + if (!($this->value instanceof AnnotationPatchRedact && $this->subtype === 'redact')) { + throw new Exception( + "Expected redact; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPopup(): bool + { + return $this->value instanceof AnnotationPatchPopup && $this->subtype === 'popup'; + } + + /** + * @return AnnotationPatchPopup + */ + public function asPopup(): AnnotationPatchPopup + { + if (!($this->value instanceof AnnotationPatchPopup && $this->subtype === 'popup')) { + throw new Exception( + "Expected popup; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'highlight': + $value = $this->asHighlight()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'underline': + $value = $this->asUnderline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'squiggly': + $value = $this->asSquiggly()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'strikeout': + $value = $this->asStrikeout()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'circle': + $value = $this->asCircle()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'square': + $value = $this->asSquare()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polygon': + $value = $this->asPolygon()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'polyline': + $value = $this->asPolyline()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'line': + $value = $this->asLine()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'link': + $value = $this->asLink()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'ink': + $value = $this->asInk()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'free-text': + $value = $this->asFreeText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'caret': + $value = $this->asCaret()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'text': + $value = $this->asText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'stamp': + $value = $this->asStamp()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'file-attachment': + $value = $this->asFileAttachment()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'widget': + $value = $this->asWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'redact': + $value = $this->asRedact()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'popup': + $value = $this->asPopup()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'highlight': + $args['value'] = AnnotationPatchHighlight::jsonDeserialize($data); + break; + case 'underline': + $args['value'] = AnnotationPatchUnderline::jsonDeserialize($data); + break; + case 'squiggly': + $args['value'] = AnnotationPatchSquiggly::jsonDeserialize($data); + break; + case 'strikeout': + $args['value'] = AnnotationPatchStrikeout::jsonDeserialize($data); + break; + case 'circle': + $args['value'] = AnnotationPatchCircle::jsonDeserialize($data); + break; + case 'square': + $args['value'] = AnnotationPatchSquare::jsonDeserialize($data); + break; + case 'polygon': + $args['value'] = AnnotationPatchPolygon::jsonDeserialize($data); + break; + case 'polyline': + $args['value'] = AnnotationPatchPolyline::jsonDeserialize($data); + break; + case 'line': + $args['value'] = AnnotationPatchLine::jsonDeserialize($data); + break; + case 'link': + $args['value'] = AnnotationPatchLink::jsonDeserialize($data); + break; + case 'ink': + $args['value'] = AnnotationPatchInk::jsonDeserialize($data); + break; + case 'free-text': + $args['value'] = AnnotationPatchFreeText::jsonDeserialize($data); + break; + case 'caret': + $args['value'] = AnnotationPatchCaret::jsonDeserialize($data); + break; + case 'text': + $args['value'] = AnnotationPatchText::jsonDeserialize($data); + break; + case 'stamp': + $args['value'] = AnnotationPatchStamp::jsonDeserialize($data); + break; + case 'file-attachment': + $args['value'] = AnnotationPatchFileAttachment::jsonDeserialize($data); + break; + case 'widget': + $args['value'] = WidgetPatch::jsonDeserialize($data); + break; + case 'redact': + $args['value'] = AnnotationPatchRedact::jsonDeserialize($data); + break; + case 'popup': + $args['value'] = AnnotationPatchPopup::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchCaret.php b/src/Types/AnnotationPatchCaret.php new file mode 100644 index 0000000..5705e94 --- /dev/null +++ b/src/Types/AnnotationPatchCaret.php @@ -0,0 +1,306 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchCaretReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchCaretReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?AnnotationPatchCaretBox $box + */ + #[JsonProperty('box')] + public ?AnnotationPatchCaretBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchCaretRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchCaretReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * box?: ?AnnotationPatchCaretBox, + * rotation?: ?float, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchCaretBlendMode.php b/src/Types/AnnotationPatchCaretBlendMode.php new file mode 100644 index 0000000..ed1690c --- /dev/null +++ b/src/Types/AnnotationPatchCaretBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchCaretIntent.php b/src/Types/AnnotationPatchCaretIntent.php new file mode 100644 index 0000000..4f08b0e --- /dev/null +++ b/src/Types/AnnotationPatchCaretIntent.php @@ -0,0 +1,8 @@ +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/AnnotationPatchCaretReply.php b/src/Types/AnnotationPatchCaretReply.php new file mode 100644 index 0000000..450e934 --- /dev/null +++ b/src/Types/AnnotationPatchCaretReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchCaretReplyType.php b/src/Types/AnnotationPatchCaretReplyType.php new file mode 100644 index 0000000..45b2c2a --- /dev/null +++ b/src/Types/AnnotationPatchCaretReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchCircleReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchCircleReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?AnnotationPatchCircleBox $box + */ + #[JsonProperty('box')] + public ?AnnotationPatchCircleBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchCircleRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchCircleReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * interiorColor?: ?string, + * box?: ?AnnotationPatchCircleBox, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchCircleBlendMode.php b/src/Types/AnnotationPatchCircleBlendMode.php new file mode 100644 index 0000000..de04a1e --- /dev/null +++ b/src/Types/AnnotationPatchCircleBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchCircleRect.php b/src/Types/AnnotationPatchCircleRect.php new file mode 100644 index 0000000..a93692b --- /dev/null +++ b/src/Types/AnnotationPatchCircleRect.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/AnnotationPatchCircleReply.php b/src/Types/AnnotationPatchCircleReply.php new file mode 100644 index 0000000..fd4f724 --- /dev/null +++ b/src/Types/AnnotationPatchCircleReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchCircleReplyType.php b/src/Types/AnnotationPatchCircleReplyType.php new file mode 100644 index 0000000..4c7015a --- /dev/null +++ b/src/Types/AnnotationPatchCircleReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchFileAttachmentReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchFileAttachmentReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?value-of $icon + */ + #[JsonProperty('icon')] + public ?string $icon; + + /** + * @var ?AnnotationPatchFileAttachmentFile $file + */ + #[JsonProperty('file')] + public ?AnnotationPatchFileAttachmentFile $file; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchFileAttachmentRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchFileAttachmentReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * icon?: ?value-of, + * file?: ?AnnotationPatchFileAttachmentFile, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->icon = $values['icon'] ?? null; + $this->file = $values['file'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFileAttachmentBlendMode.php b/src/Types/AnnotationPatchFileAttachmentBlendMode.php new file mode 100644 index 0000000..aa6d50a --- /dev/null +++ b/src/Types/AnnotationPatchFileAttachmentBlendMode.php @@ -0,0 +1,23 @@ +name = $values['name']; + $this->mimeType = $values['mimeType'] ?? null; + $this->description = $values['description'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFileAttachmentIcon.php b/src/Types/AnnotationPatchFileAttachmentIcon.php new file mode 100644 index 0000000..a3467c7 --- /dev/null +++ b/src/Types/AnnotationPatchFileAttachmentIcon.php @@ -0,0 +1,11 @@ +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/AnnotationPatchFileAttachmentReply.php b/src/Types/AnnotationPatchFileAttachmentReply.php new file mode 100644 index 0000000..7d3c14d --- /dev/null +++ b/src/Types/AnnotationPatchFileAttachmentReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFileAttachmentReplyType.php b/src/Types/AnnotationPatchFileAttachmentReplyType.php new file mode 100644 index 0000000..30fcbf9 --- /dev/null +++ b/src/Types/AnnotationPatchFileAttachmentReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchFreeTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchFreeTextReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?AnnotationPatchFreeTextBox $box + */ + #[JsonProperty('box')] + public ?AnnotationPatchFreeTextBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ( + * value-of + * |value-of + * )|null $intent + */ + #[JsonProperty('intent'), Union('string', 'null')] + public string|null $intent; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @var ?value-of $verticalAlign + */ + #[JsonProperty('verticalAlign')] + public ?string $verticalAlign; + + /** + * @var ?AnnotationPatchFreeTextRichText $richText + */ + #[JsonProperty('richText')] + public ?AnnotationPatchFreeTextRichText $richText; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @var ?array $calloutLine + */ + #[JsonProperty('calloutLine'), ArrayType(['mixed'])] + public ?array $calloutLine; + + /** + * @var ?value-of $lineEnding + */ + #[JsonProperty('lineEnding')] + public ?string $lineEnding; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchFreeTextRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchFreeTextReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * box?: ?AnnotationPatchFreeTextBox, + * rotation?: ?float, + * intent?: ( + * value-of + * |value-of + * )|null, + * fontFamily?: ?string, + * fontSize?: ?float, + * textAlign?: ?value-of, + * verticalAlign?: ?value-of, + * richText?: ?AnnotationPatchFreeTextRichText, + * color?: ?string, + * fontColor?: ?string, + * interiorColor?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * cloudyIntensity?: ?float, + * calloutLine?: ?array, + * lineEnding?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + $this->verticalAlign = $values['verticalAlign'] ?? null; + $this->richText = $values['richText'] ?? null; + $this->color = $values['color'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + $this->calloutLine = $values['calloutLine'] ?? null; + $this->lineEnding = $values['lineEnding'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextBlendMode.php b/src/Types/AnnotationPatchFreeTextBlendMode.php new file mode 100644 index 0000000..b4c9a0e --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchFreeTextIntentOne.php b/src/Types/AnnotationPatchFreeTextIntentOne.php new file mode 100644 index 0000000..0b7cf71 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextIntentOne.php @@ -0,0 +1,10 @@ +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/AnnotationPatchFreeTextReply.php b/src/Types/AnnotationPatchFreeTextReply.php new file mode 100644 index 0000000..fa1e8b1 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextReplyType.php b/src/Types/AnnotationPatchFreeTextReplyType.php new file mode 100644 index 0000000..b9f6156 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextReplyType.php @@ -0,0 +1,9 @@ + $paragraphs + */ + #[JsonProperty('paragraphs'), ArrayType([AnnotationPatchFreeTextRichTextParagraphsItem::class])] + public array $paragraphs; + + /** + * @param array{ + * paragraphs: array, + * body?: ?AnnotationPatchFreeTextRichTextBody, + * } $values + */ + public function __construct( + array $values, + ) { + $this->body = $values['body'] ?? null; + $this->paragraphs = $values['paragraphs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextBody.php b/src/Types/AnnotationPatchFreeTextRichTextBody.php new file mode 100644 index 0000000..e194782 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextBody.php @@ -0,0 +1,147 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public ?array $decoration; + + /** + * @var ?value-of $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var ?float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public ?float $letterSpacing; + + /** + * @var ?float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public ?float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var ?value-of $align + */ + #[JsonProperty('align')] + public ?string $align; + + /** + * @var ?value-of $dir + */ + #[JsonProperty('dir')] + public ?string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationPatchFreeTextRichTextBodyMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationPatchFreeTextRichTextBodyMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @param array{ + * family?: ?string, + * weight?: ?int, + * italic?: ?bool, + * size?: ?float, + * color?: ?string, + * decoration?: ?array>, + * script?: ?value-of, + * letterSpacing?: ?float, + * horizontalScale?: ?float, + * unknown?: ?string, + * align?: ?value-of, + * dir?: ?value-of, + * lineHeight?: ?float, + * margins?: ?AnnotationPatchFreeTextRichTextBodyMargins, + * textIndent?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->size = $values['size'] ?? null; + $this->color = $values['color'] ?? null; + $this->decoration = $values['decoration'] ?? null; + $this->script = $values['script'] ?? null; + $this->letterSpacing = $values['letterSpacing'] ?? null; + $this->horizontalScale = $values['horizontalScale'] ?? null; + $this->unknown = $values['unknown'] ?? null; + $this->align = $values['align'] ?? null; + $this->dir = $values['dir'] ?? null; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextBodyAlign.php b/src/Types/AnnotationPatchFreeTextRichTextBodyAlign.php new file mode 100644 index 0000000..3b991dd --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextBodyAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextBodyScript.php b/src/Types/AnnotationPatchFreeTextRichTextBodyScript.php new file mode 100644 index 0000000..49a5ac1 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextBodyScript.php @@ -0,0 +1,10 @@ + $align + */ + #[JsonProperty('align')] + public ?string $align; + + /** + * @var ?value-of $dir + */ + #[JsonProperty('dir')] + public ?string $dir; + + /** + * @var ?float $lineHeight + */ + #[JsonProperty('lineHeight')] + public ?float $lineHeight; + + /** + * @var ?AnnotationPatchFreeTextRichTextParagraphsItemMargins $margins + */ + #[JsonProperty('margins')] + public ?AnnotationPatchFreeTextRichTextParagraphsItemMargins $margins; + + /** + * @var ?float $textIndent + */ + #[JsonProperty('textIndent')] + public ?float $textIndent; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @var array $runs + */ + #[JsonProperty('runs'), ArrayType([AnnotationPatchFreeTextRichTextParagraphsItemRunsItem::class])] + public array $runs; + + /** + * @param array{ + * runs: array, + * align?: ?value-of, + * dir?: ?value-of, + * lineHeight?: ?float, + * margins?: ?AnnotationPatchFreeTextRichTextParagraphsItemMargins, + * textIndent?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->align = $values['align'] ?? null; + $this->dir = $values['dir'] ?? null; + $this->lineHeight = $values['lineHeight'] ?? null; + $this->margins = $values['margins'] ?? null; + $this->textIndent = $values['textIndent'] ?? null; + $this->unknown = $values['unknown'] ?? null; + $this->runs = $values['runs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemAlign.php b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemAlign.php new file mode 100644 index 0000000..d3d82a1 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemAlign.php @@ -0,0 +1,11 @@ +top = $values['top']; + $this->bottom = $values['bottom']; + $this->left = $values['left']; + $this->right = $values['right']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItem.php b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItem.php new file mode 100644 index 0000000..346d9c0 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItem.php @@ -0,0 +1,42 @@ +text = $values['text']; + $this->style = $values['style'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyle.php b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyle.php new file mode 100644 index 0000000..f0594e3 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyle.php @@ -0,0 +1,107 @@ +> $decoration + */ + #[JsonProperty('decoration'), ArrayType(['string'])] + public ?array $decoration; + + /** + * @var ?value-of $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var ?float $letterSpacing + */ + #[JsonProperty('letterSpacing')] + public ?float $letterSpacing; + + /** + * @var ?float $horizontalScale + */ + #[JsonProperty('horizontalScale')] + public ?float $horizontalScale; + + /** + * @var ?string $unknown + */ + #[JsonProperty('unknown')] + public ?string $unknown; + + /** + * @param array{ + * family?: ?string, + * weight?: ?int, + * italic?: ?bool, + * size?: ?float, + * color?: ?string, + * decoration?: ?array>, + * script?: ?value-of, + * letterSpacing?: ?float, + * horizontalScale?: ?float, + * unknown?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + $this->size = $values['size'] ?? null; + $this->color = $values['color'] ?? null; + $this->decoration = $values['decoration'] ?? null; + $this->script = $values['script'] ?? null; + $this->letterSpacing = $values['letterSpacing'] ?? null; + $this->horizontalScale = $values['horizontalScale'] ?? null; + $this->unknown = $values['unknown'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php new file mode 100644 index 0000000..e6d9e51 --- /dev/null +++ b/src/Types/AnnotationPatchFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php @@ -0,0 +1,10 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchHighlightReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchHighlightReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationPatchHighlightQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchHighlightRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchHighlightReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightBlendMode.php b/src/Types/AnnotationPatchHighlightBlendMode.php new file mode 100644 index 0000000..248cb89 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightQuadPointsItemLowerLeft.php b/src/Types/AnnotationPatchHighlightQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..7a8a238 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightQuadPointsItemLowerRight.php b/src/Types/AnnotationPatchHighlightQuadPointsItemLowerRight.php new file mode 100644 index 0000000..9266122 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightQuadPointsItemUpperLeft.php b/src/Types/AnnotationPatchHighlightQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..0811210 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightQuadPointsItemUpperRight.php b/src/Types/AnnotationPatchHighlightQuadPointsItemUpperRight.php new file mode 100644 index 0000000..a342ab9 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightRect.php b/src/Types/AnnotationPatchHighlightRect.php new file mode 100644 index 0000000..ee34825 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightRect.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/AnnotationPatchHighlightReply.php b/src/Types/AnnotationPatchHighlightReply.php new file mode 100644 index 0000000..6409875 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchHighlightReplyType.php b/src/Types/AnnotationPatchHighlightReplyType.php new file mode 100644 index 0000000..80c4db5 --- /dev/null +++ b/src/Types/AnnotationPatchHighlightReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchInkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchInkReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ( + * array> + * |array> + * )|null $inkList + */ + #[JsonProperty('inkList'), Union([[AnnotationPatchInkInkListZeroItemItem::class]], [[AnnotationPatchInkInkListOneItemItem::class]], 'null')] + public array|null $inkList; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchInkRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchInkReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * inkList?: ( + * array> + * |array> + * )|null, + * intent?: ?value-of, + * rotation?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->inkList = $values['inkList'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->rotation = $values['rotation'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchInkBlendMode.php b/src/Types/AnnotationPatchInkBlendMode.php new file mode 100644 index 0000000..125a54e --- /dev/null +++ b/src/Types/AnnotationPatchInkBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchInkInkListZeroItemItem.php b/src/Types/AnnotationPatchInkInkListZeroItemItem.php new file mode 100644 index 0000000..f46f363 --- /dev/null +++ b/src/Types/AnnotationPatchInkInkListZeroItemItem.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchInkIntent.php b/src/Types/AnnotationPatchInkIntent.php new file mode 100644 index 0000000..9e05235 --- /dev/null +++ b/src/Types/AnnotationPatchInkIntent.php @@ -0,0 +1,8 @@ +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/AnnotationPatchInkReply.php b/src/Types/AnnotationPatchInkReply.php new file mode 100644 index 0000000..d917807 --- /dev/null +++ b/src/Types/AnnotationPatchInkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchInkReplyType.php b/src/Types/AnnotationPatchInkReplyType.php new file mode 100644 index 0000000..c6f65b1 --- /dev/null +++ b/src/Types/AnnotationPatchInkReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchLineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchLineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?AnnotationPatchLineLinePoints $linePoints + */ + #[JsonProperty('linePoints')] + public ?AnnotationPatchLineLinePoints $linePoints; + + /** + * @var ?AnnotationPatchLineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public ?AnnotationPatchLineLineEndings $lineEndings; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationPatchLineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationPatchLineMeasure $measure; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?value-of $captionPosition + */ + #[JsonProperty('captionPosition')] + public ?string $captionPosition; + + /** + * @var ?AnnotationPatchLineCaptionOffset $captionOffset + */ + #[JsonProperty('captionOffset')] + public ?AnnotationPatchLineCaptionOffset $captionOffset; + + /** + * @var ?AnnotationPatchLineLeader $leader + */ + #[JsonProperty('leader')] + public ?AnnotationPatchLineLeader $leader; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchLineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchLineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * interiorColor?: ?string, + * linePoints?: ?AnnotationPatchLineLinePoints, + * lineEndings?: ?AnnotationPatchLineLineEndings, + * rotation?: ?float, + * intent?: ?value-of, + * measure?: ?AnnotationPatchLineMeasure, + * captionEnabled?: ?bool, + * captionPosition?: ?value-of, + * captionOffset?: ?AnnotationPatchLineCaptionOffset, + * leader?: ?AnnotationPatchLineLeader, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->linePoints = $values['linePoints'] ?? null; + $this->lineEndings = $values['lineEndings'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionPosition = $values['captionPosition'] ?? null; + $this->captionOffset = $values['captionOffset'] ?? null; + $this->leader = $values['leader'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineBlendMode.php b/src/Types/AnnotationPatchLineBlendMode.php new file mode 100644 index 0000000..3d1268d --- /dev/null +++ b/src/Types/AnnotationPatchLineBlendMode.php @@ -0,0 +1,23 @@ +along = $values['along']; + $this->perpendicular = $values['perpendicular']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineCaptionPosition.php b/src/Types/AnnotationPatchLineCaptionPosition.php new file mode 100644 index 0000000..2450990 --- /dev/null +++ b/src/Types/AnnotationPatchLineCaptionPosition.php @@ -0,0 +1,9 @@ +length = $values['length']; + $this->extension = $values['extension'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineLineEndings.php b/src/Types/AnnotationPatchLineLineEndings.php new file mode 100644 index 0000000..a99f7a1 --- /dev/null +++ b/src/Types/AnnotationPatchLineLineEndings.php @@ -0,0 +1,42 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineLineEndingsEnd.php b/src/Types/AnnotationPatchLineLineEndingsEnd.php new file mode 100644 index 0000000..d2c86c0 --- /dev/null +++ b/src/Types/AnnotationPatchLineLineEndingsEnd.php @@ -0,0 +1,17 @@ +start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineLinePointsEnd.php b/src/Types/AnnotationPatchLineLinePointsEnd.php new file mode 100644 index 0000000..3fad97f --- /dev/null +++ b/src/Types/AnnotationPatchLineLinePointsEnd.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineLinePointsStart.php b/src/Types/AnnotationPatchLineLinePointsStart.php new file mode 100644 index 0000000..a7cd15b --- /dev/null +++ b/src/Types/AnnotationPatchLineLinePointsStart.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineMeasure.php b/src/Types/AnnotationPatchLineMeasure.php new file mode 100644 index 0000000..1fe757a --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasure.php @@ -0,0 +1,207 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchLineMeasureRectilinear $rectilinear + * @return AnnotationPatchLineMeasure + */ + public static function rectilinear(AnnotationPatchLineMeasureRectilinear $rectilinear): AnnotationPatchLineMeasure + { + return new AnnotationPatchLineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationPatchLineMeasureUnknown $unknown + * @return AnnotationPatchLineMeasure + */ + public static function unknown(AnnotationPatchLineMeasureUnknown $unknown): AnnotationPatchLineMeasure + { + return new AnnotationPatchLineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationPatchLineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationPatchLineMeasureRectilinear + */ + public function asRectilinear(): AnnotationPatchLineMeasureRectilinear + { + if (!($this->value instanceof AnnotationPatchLineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchLineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchLineMeasureUnknown + */ + public function asUnknown(): AnnotationPatchLineMeasureUnknown + { + if (!($this->value instanceof AnnotationPatchLineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationPatchLineMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationPatchLineMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchLineMeasureRectilinear.php b/src/Types/AnnotationPatchLineMeasureRectilinear.php new file mode 100644 index 0000000..a7635c2 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationPatchLineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationPatchLineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationPatchLineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationPatchLineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationPatchLineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationPatchLineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationPatchLineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationPatchLineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationPatchLineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationPatchLineMeasureRectilinearAngleItem.php b/src/Types/AnnotationPatchLineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..b0a8ce2 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearAngleItem.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/AnnotationPatchLineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..543b25d --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearAngleItemFraction.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/AnnotationPatchLineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..22be68b --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearAreaItemFraction.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/AnnotationPatchLineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..26686d4 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearDistanceItemFraction.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/AnnotationPatchLineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPatchLineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..def5262 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearSlopeItem.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/AnnotationPatchLineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..ab4c9f7 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearSlopeItemFraction.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/AnnotationPatchLineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..e0f6278 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearXItemFraction.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/AnnotationPatchLineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPatchLineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..f5ceaf6 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchLineMeasureUnknownGeospatial $geospatial + * @return AnnotationPatchLineMeasureUnknown + */ + public static function geospatial(AnnotationPatchLineMeasureUnknownGeospatial $geospatial): AnnotationPatchLineMeasureUnknown + { + return new AnnotationPatchLineMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationPatchLineMeasureUnknownUnknown $unknown + * @return AnnotationPatchLineMeasureUnknown + */ + public static function unknown(AnnotationPatchLineMeasureUnknownUnknown $unknown): AnnotationPatchLineMeasureUnknown + { + return new AnnotationPatchLineMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationPatchLineMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationPatchLineMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationPatchLineMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationPatchLineMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchLineMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchLineMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationPatchLineMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationPatchLineMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationPatchLineMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationPatchLineMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchLineMeasureUnknownGeospatial.php b/src/Types/AnnotationPatchLineMeasureUnknownGeospatial.php new file mode 100644 index 0000000..9237927 --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineMeasureUnknownUnknown.php b/src/Types/AnnotationPatchLineMeasureUnknownUnknown.php new file mode 100644 index 0000000..dbe447c --- /dev/null +++ b/src/Types/AnnotationPatchLineMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineRect.php b/src/Types/AnnotationPatchLineRect.php new file mode 100644 index 0000000..b2da5c9 --- /dev/null +++ b/src/Types/AnnotationPatchLineRect.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/AnnotationPatchLineReply.php b/src/Types/AnnotationPatchLineReply.php new file mode 100644 index 0000000..d719d0b --- /dev/null +++ b/src/Types/AnnotationPatchLineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLineReplyType.php b/src/Types/AnnotationPatchLineReplyType.php new file mode 100644 index 0000000..6a5184e --- /dev/null +++ b/src/Types/AnnotationPatchLineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchLinkReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchLinkReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ( + * PdfLinkTargetWritable + * |PdfLinkTarget + * |null + * ) $target + */ + #[JsonProperty('target'), Union(new Union(PdfLinkTargetWritable::class, 'null'), new Union(PdfLinkTarget::class, 'null'), 'null')] + public PdfLinkTargetWritable|PdfLinkTarget|null $target; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchLinkRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchLinkReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * target?: ( + * PdfLinkTargetWritable + * |PdfLinkTarget + * |null + * ), + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->target = $values['target'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLinkBlendMode.php b/src/Types/AnnotationPatchLinkBlendMode.php new file mode 100644 index 0000000..5e062f3 --- /dev/null +++ b/src/Types/AnnotationPatchLinkBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchLinkReply.php b/src/Types/AnnotationPatchLinkReply.php new file mode 100644 index 0000000..6816eb9 --- /dev/null +++ b/src/Types/AnnotationPatchLinkReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchLinkReplyType.php b/src/Types/AnnotationPatchLinkReplyType.php new file mode 100644 index 0000000..c82629a --- /dev/null +++ b/src/Types/AnnotationPatchLinkReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchPolygonReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchPolygonReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ( + * array + * |array + * )|null $vertices + */ + #[JsonProperty('vertices'), Union([AnnotationPatchPolygonVerticesZeroItem::class], [AnnotationPatchPolygonVerticesOneItem::class], 'null')] + public array|null $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationPatchPolygonCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationPatchPolygonCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationPatchPolygonMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationPatchPolygonMeasure $measure; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchPolygonRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchPolygonReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * interiorColor?: ?string, + * vertices?: ( + * array + * |array + * )|null, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationPatchPolygonCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationPatchPolygonMeasure, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonBlendMode.php b/src/Types/AnnotationPatchPolygonBlendMode.php new file mode 100644 index 0000000..2299bd9 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonIntent.php b/src/Types/AnnotationPatchPolygonIntent.php new file mode 100644 index 0000000..0434ff8 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonIntent.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchPolygonMeasureRectilinear $rectilinear + * @return AnnotationPatchPolygonMeasure + */ + public static function rectilinear(AnnotationPatchPolygonMeasureRectilinear $rectilinear): AnnotationPatchPolygonMeasure + { + return new AnnotationPatchPolygonMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationPatchPolygonMeasureUnknown $unknown + * @return AnnotationPatchPolygonMeasure + */ + public static function unknown(AnnotationPatchPolygonMeasureUnknown $unknown): AnnotationPatchPolygonMeasure + { + return new AnnotationPatchPolygonMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationPatchPolygonMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationPatchPolygonMeasureRectilinear + */ + public function asRectilinear(): AnnotationPatchPolygonMeasureRectilinear + { + if (!($this->value instanceof AnnotationPatchPolygonMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchPolygonMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchPolygonMeasureUnknown + */ + public function asUnknown(): AnnotationPatchPolygonMeasureUnknown + { + if (!($this->value instanceof AnnotationPatchPolygonMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationPatchPolygonMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationPatchPolygonMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchPolygonMeasureRectilinear.php b/src/Types/AnnotationPatchPolygonMeasureRectilinear.php new file mode 100644 index 0000000..ab8c091 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationPatchPolygonMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationPatchPolygonMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationPatchPolygonMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationPatchPolygonMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationPatchPolygonMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationPatchPolygonMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationPatchPolygonMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationPatchPolygonMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationPatchPolygonMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationPatchPolygonMeasureRectilinearAngleItem.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..1a88185 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearAngleItem.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/AnnotationPatchPolygonMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..d3a875e --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearAngleItemFraction.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/AnnotationPatchPolygonMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..d28c669 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearAreaItemFraction.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/AnnotationPatchPolygonMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..bcbf83d --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearDistanceItemFraction.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/AnnotationPatchPolygonMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..2ec063d --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearSlopeItem.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/AnnotationPatchPolygonMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..960a682 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearSlopeItemFraction.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/AnnotationPatchPolygonMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..a059c9a --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearXItemFraction.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/AnnotationPatchPolygonMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPatchPolygonMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..a1b2c71 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchPolygonMeasureUnknownGeospatial $geospatial + * @return AnnotationPatchPolygonMeasureUnknown + */ + public static function geospatial(AnnotationPatchPolygonMeasureUnknownGeospatial $geospatial): AnnotationPatchPolygonMeasureUnknown + { + return new AnnotationPatchPolygonMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationPatchPolygonMeasureUnknownUnknown $unknown + * @return AnnotationPatchPolygonMeasureUnknown + */ + public static function unknown(AnnotationPatchPolygonMeasureUnknownUnknown $unknown): AnnotationPatchPolygonMeasureUnknown + { + return new AnnotationPatchPolygonMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationPatchPolygonMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationPatchPolygonMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationPatchPolygonMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationPatchPolygonMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchPolygonMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchPolygonMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationPatchPolygonMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationPatchPolygonMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationPatchPolygonMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationPatchPolygonMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchPolygonMeasureUnknownGeospatial.php b/src/Types/AnnotationPatchPolygonMeasureUnknownGeospatial.php new file mode 100644 index 0000000..09cc0bc --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonMeasureUnknownUnknown.php b/src/Types/AnnotationPatchPolygonMeasureUnknownUnknown.php new file mode 100644 index 0000000..c5aa069 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonRect.php b/src/Types/AnnotationPatchPolygonRect.php new file mode 100644 index 0000000..6585866 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonRect.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/AnnotationPatchPolygonReply.php b/src/Types/AnnotationPatchPolygonReply.php new file mode 100644 index 0000000..a07862e --- /dev/null +++ b/src/Types/AnnotationPatchPolygonReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonReplyType.php b/src/Types/AnnotationPatchPolygonReplyType.php new file mode 100644 index 0000000..f1db5d5 --- /dev/null +++ b/src/Types/AnnotationPatchPolygonReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolygonVerticesZeroItem.php b/src/Types/AnnotationPatchPolygonVerticesZeroItem.php new file mode 100644 index 0000000..4e7f5fe --- /dev/null +++ b/src/Types/AnnotationPatchPolygonVerticesZeroItem.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolyline.php b/src/Types/AnnotationPatchPolyline.php new file mode 100644 index 0000000..62fa2fd --- /dev/null +++ b/src/Types/AnnotationPatchPolyline.php @@ -0,0 +1,384 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchPolylineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchPolylineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ( + * array + * |array + * )|null $vertices + */ + #[JsonProperty('vertices'), Union([AnnotationPatchPolylineVerticesZeroItem::class], [AnnotationPatchPolylineVerticesOneItem::class], 'null')] + public array|null $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationPatchPolylineCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationPatchPolylineCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationPatchPolylineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationPatchPolylineMeasure $measure; + + /** + * @var ?AnnotationPatchPolylineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public ?AnnotationPatchPolylineLineEndings $lineEndings; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchPolylineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchPolylineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * interiorColor?: ?string, + * vertices?: ( + * array + * |array + * )|null, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationPatchPolylineCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationPatchPolylineMeasure, + * lineEndings?: ?AnnotationPatchPolylineLineEndings, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->lineEndings = $values['lineEndings'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineBlendMode.php b/src/Types/AnnotationPatchPolylineBlendMode.php new file mode 100644 index 0000000..f909fb8 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineIntent.php b/src/Types/AnnotationPatchPolylineIntent.php new file mode 100644 index 0000000..61ebfa1 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineIntent.php @@ -0,0 +1,8 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineLineEndingsEnd.php b/src/Types/AnnotationPatchPolylineLineEndingsEnd.php new file mode 100644 index 0000000..8448847 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineLineEndingsEnd.php @@ -0,0 +1,17 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchPolylineMeasureRectilinear $rectilinear + * @return AnnotationPatchPolylineMeasure + */ + public static function rectilinear(AnnotationPatchPolylineMeasureRectilinear $rectilinear): AnnotationPatchPolylineMeasure + { + return new AnnotationPatchPolylineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationPatchPolylineMeasureUnknown $unknown + * @return AnnotationPatchPolylineMeasure + */ + public static function unknown(AnnotationPatchPolylineMeasureUnknown $unknown): AnnotationPatchPolylineMeasure + { + return new AnnotationPatchPolylineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationPatchPolylineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationPatchPolylineMeasureRectilinear + */ + public function asRectilinear(): AnnotationPatchPolylineMeasureRectilinear + { + if (!($this->value instanceof AnnotationPatchPolylineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchPolylineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchPolylineMeasureUnknown + */ + public function asUnknown(): AnnotationPatchPolylineMeasureUnknown + { + if (!($this->value instanceof AnnotationPatchPolylineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result['unknown'] = $value; + 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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationPatchPolylineMeasureRectilinear::jsonDeserialize($data); + break; + case 'unknown': + if (!array_key_exists('unknown', $data)) { + throw new Exception( + "JSON data is missing property 'unknown'", + ); + } + + if (!(is_array($data['unknown']))) { + throw new Exception( + "Expected property 'unknown' in JSON data to be array, instead received " . get_debug_type($data['unknown']), + ); + } + $args['value'] = AnnotationPatchPolylineMeasureUnknown::jsonDeserialize($data['unknown']); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchPolylineMeasureRectilinear.php b/src/Types/AnnotationPatchPolylineMeasureRectilinear.php new file mode 100644 index 0000000..3ffe162 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationPatchPolylineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationPatchPolylineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationPatchPolylineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationPatchPolylineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationPatchPolylineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationPatchPolylineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationPatchPolylineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationPatchPolylineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationPatchPolylineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationPatchPolylineMeasureRectilinearAngleItem.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..85cffaf --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearAngleItem.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/AnnotationPatchPolylineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..117ea3a --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearAngleItemFraction.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/AnnotationPatchPolylineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..5702185 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearAreaItemFraction.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/AnnotationPatchPolylineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..e5d55f6 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearDistanceItemFraction.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/AnnotationPatchPolylineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..6f6389a --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearSlopeItem.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/AnnotationPatchPolylineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..15e014c --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearSlopeItemFraction.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/AnnotationPatchPolylineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..a948e43 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearXItemFraction.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/AnnotationPatchPolylineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPatchPolylineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..a327052 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPatchPolylineMeasureUnknownGeospatial $geospatial + * @return AnnotationPatchPolylineMeasureUnknown + */ + public static function geospatial(AnnotationPatchPolylineMeasureUnknownGeospatial $geospatial): AnnotationPatchPolylineMeasureUnknown + { + return new AnnotationPatchPolylineMeasureUnknown([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationPatchPolylineMeasureUnknownUnknown $unknown + * @return AnnotationPatchPolylineMeasureUnknown + */ + public static function unknown(AnnotationPatchPolylineMeasureUnknownUnknown $unknown): AnnotationPatchPolylineMeasureUnknown + { + return new AnnotationPatchPolylineMeasureUnknown([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationPatchPolylineMeasureUnknownGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationPatchPolylineMeasureUnknownGeospatial + */ + public function asGeospatial(): AnnotationPatchPolylineMeasureUnknownGeospatial + { + if (!($this->value instanceof AnnotationPatchPolylineMeasureUnknownGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPatchPolylineMeasureUnknownUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPatchPolylineMeasureUnknownUnknown + */ + public function asUnknown(): AnnotationPatchPolylineMeasureUnknownUnknown + { + if (!($this->value instanceof AnnotationPatchPolylineMeasureUnknownUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'geospatial': + $args['value'] = AnnotationPatchPolylineMeasureUnknownGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationPatchPolylineMeasureUnknownUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPatchPolylineMeasureUnknownGeospatial.php b/src/Types/AnnotationPatchPolylineMeasureUnknownGeospatial.php new file mode 100644 index 0000000..cef4541 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureUnknownGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineMeasureUnknownUnknown.php b/src/Types/AnnotationPatchPolylineMeasureUnknownUnknown.php new file mode 100644 index 0000000..b2528b3 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineMeasureUnknownUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineRect.php b/src/Types/AnnotationPatchPolylineRect.php new file mode 100644 index 0000000..38de6cc --- /dev/null +++ b/src/Types/AnnotationPatchPolylineRect.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/AnnotationPatchPolylineReply.php b/src/Types/AnnotationPatchPolylineReply.php new file mode 100644 index 0000000..7ce1c3f --- /dev/null +++ b/src/Types/AnnotationPatchPolylineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineReplyType.php b/src/Types/AnnotationPatchPolylineReplyType.php new file mode 100644 index 0000000..d642b30 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPolylineVerticesZeroItem.php b/src/Types/AnnotationPatchPolylineVerticesZeroItem.php new file mode 100644 index 0000000..939ec65 --- /dev/null +++ b/src/Types/AnnotationPatchPolylineVerticesZeroItem.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPopup.php b/src/Types/AnnotationPatchPopup.php new file mode 100644 index 0000000..4ebfe0d --- /dev/null +++ b/src/Types/AnnotationPatchPopup.php @@ -0,0 +1,282 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchPopupReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchPopupReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?AnnotationRef $parent + */ + #[JsonProperty('parent')] + public ?AnnotationRef $parent; + + /** + * @var ?bool $open + */ + #[JsonProperty('open')] + public ?bool $open; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchPopupRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchPopupReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * parent?: ?AnnotationRef, + * open?: ?bool, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->parent = $values['parent'] ?? null; + $this->open = $values['open'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPopupBlendMode.php b/src/Types/AnnotationPatchPopupBlendMode.php new file mode 100644 index 0000000..53df2f2 --- /dev/null +++ b/src/Types/AnnotationPatchPopupBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchPopupReply.php b/src/Types/AnnotationPatchPopupReply.php new file mode 100644 index 0000000..c2ce614 --- /dev/null +++ b/src/Types/AnnotationPatchPopupReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchPopupReplyType.php b/src/Types/AnnotationPatchPopupReplyType.php new file mode 100644 index 0000000..2393574 --- /dev/null +++ b/src/Types/AnnotationPatchPopupReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchRedactReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchRedactReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationPatchRedactQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?string $overlayText + */ + #[JsonProperty('overlayText')] + public ?string $overlayText; + + /** + * @var ?bool $repeat + */ + #[JsonProperty('repeat')] + public ?bool $repeat; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchRedactRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchRedactReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * interiorColor?: ?string, + * overlayText?: ?string, + * repeat?: ?bool, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * textAlign?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->overlayText = $values['overlayText'] ?? null; + $this->repeat = $values['repeat'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactBlendMode.php b/src/Types/AnnotationPatchRedactBlendMode.php new file mode 100644 index 0000000..6b129d0 --- /dev/null +++ b/src/Types/AnnotationPatchRedactBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactQuadPointsItemLowerLeft.php b/src/Types/AnnotationPatchRedactQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..aa61865 --- /dev/null +++ b/src/Types/AnnotationPatchRedactQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactQuadPointsItemLowerRight.php b/src/Types/AnnotationPatchRedactQuadPointsItemLowerRight.php new file mode 100644 index 0000000..03a7652 --- /dev/null +++ b/src/Types/AnnotationPatchRedactQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactQuadPointsItemUpperLeft.php b/src/Types/AnnotationPatchRedactQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..6aba701 --- /dev/null +++ b/src/Types/AnnotationPatchRedactQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactQuadPointsItemUpperRight.php b/src/Types/AnnotationPatchRedactQuadPointsItemUpperRight.php new file mode 100644 index 0000000..eb4e5e3 --- /dev/null +++ b/src/Types/AnnotationPatchRedactQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactRect.php b/src/Types/AnnotationPatchRedactRect.php new file mode 100644 index 0000000..d4f8858 --- /dev/null +++ b/src/Types/AnnotationPatchRedactRect.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/AnnotationPatchRedactReply.php b/src/Types/AnnotationPatchRedactReply.php new file mode 100644 index 0000000..da6473b --- /dev/null +++ b/src/Types/AnnotationPatchRedactReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchRedactReplyType.php b/src/Types/AnnotationPatchRedactReplyType.php new file mode 100644 index 0000000..ec431ff --- /dev/null +++ b/src/Types/AnnotationPatchRedactReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchSquareReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchSquareReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ( + * value-of + * |value-of + * )|null $borderStyle + */ + #[JsonProperty('borderStyle'), Union('string', 'null')] + public string|null $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?AnnotationPatchSquareBox $box + */ + #[JsonProperty('box')] + public ?AnnotationPatchSquareBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchSquareRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchSquareReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * strokeWidth?: ?float, + * borderStyle?: ( + * value-of + * |value-of + * )|null, + * dashArray?: ?array, + * interiorColor?: ?string, + * box?: ?AnnotationPatchSquareBox, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquareBlendMode.php b/src/Types/AnnotationPatchSquareBlendMode.php new file mode 100644 index 0000000..535e7b5 --- /dev/null +++ b/src/Types/AnnotationPatchSquareBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchSquareRect.php b/src/Types/AnnotationPatchSquareRect.php new file mode 100644 index 0000000..700ced6 --- /dev/null +++ b/src/Types/AnnotationPatchSquareRect.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/AnnotationPatchSquareReply.php b/src/Types/AnnotationPatchSquareReply.php new file mode 100644 index 0000000..48c3e15 --- /dev/null +++ b/src/Types/AnnotationPatchSquareReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquareReplyType.php b/src/Types/AnnotationPatchSquareReplyType.php new file mode 100644 index 0000000..f55a9ce --- /dev/null +++ b/src/Types/AnnotationPatchSquareReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchSquigglyReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchSquigglyReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationPatchSquigglyQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchSquigglyRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchSquigglyReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyBlendMode.php b/src/Types/AnnotationPatchSquigglyBlendMode.php new file mode 100644 index 0000000..6d6de28 --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerLeft.php b/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..b27a8db --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerRight.php b/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerRight.php new file mode 100644 index 0000000..837acd3 --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperLeft.php b/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..6da057e --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperRight.php b/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperRight.php new file mode 100644 index 0000000..8337a4e --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyRect.php b/src/Types/AnnotationPatchSquigglyRect.php new file mode 100644 index 0000000..90a8697 --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyRect.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/AnnotationPatchSquigglyReply.php b/src/Types/AnnotationPatchSquigglyReply.php new file mode 100644 index 0000000..47e6423 --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchSquigglyReplyType.php b/src/Types/AnnotationPatchSquigglyReplyType.php new file mode 100644 index 0000000..6254990 --- /dev/null +++ b/src/Types/AnnotationPatchSquigglyReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchStampReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchStampReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?AnnotationPatchStampBox $box + */ + #[JsonProperty('box')] + public ?AnnotationPatchStampBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $name + */ + #[JsonProperty('name')] + public ?string $name; + + /** + * @var ?value-of $fit + */ + #[JsonProperty('fit')] + public ?string $fit; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchStampRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchStampReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * box?: ?AnnotationPatchStampBox, + * rotation?: ?float, + * name?: ?string, + * fit?: ?value-of, + * opacity?: ?float, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->name = $values['name'] ?? null; + $this->fit = $values['fit'] ?? null; + $this->opacity = $values['opacity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStampBlendMode.php b/src/Types/AnnotationPatchStampBlendMode.php new file mode 100644 index 0000000..fbffd08 --- /dev/null +++ b/src/Types/AnnotationPatchStampBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchStampFit.php b/src/Types/AnnotationPatchStampFit.php new file mode 100644 index 0000000..af8bf5b --- /dev/null +++ b/src/Types/AnnotationPatchStampFit.php @@ -0,0 +1,10 @@ +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/AnnotationPatchStampReply.php b/src/Types/AnnotationPatchStampReply.php new file mode 100644 index 0000000..3bd4957 --- /dev/null +++ b/src/Types/AnnotationPatchStampReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStampReplyType.php b/src/Types/AnnotationPatchStampReplyType.php new file mode 100644 index 0000000..6941417 --- /dev/null +++ b/src/Types/AnnotationPatchStampReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchStrikeoutReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchStrikeoutReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationPatchStrikeoutQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchStrikeoutRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchStrikeoutReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutBlendMode.php b/src/Types/AnnotationPatchStrikeoutBlendMode.php new file mode 100644 index 0000000..f1af583 --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerLeft.php b/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..448489f --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerRight.php b/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerRight.php new file mode 100644 index 0000000..21b0e2e --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperLeft.php b/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..a961290 --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperRight.php b/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperRight.php new file mode 100644 index 0000000..3959efa --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutRect.php b/src/Types/AnnotationPatchStrikeoutRect.php new file mode 100644 index 0000000..016b8a0 --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutRect.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/AnnotationPatchStrikeoutReply.php b/src/Types/AnnotationPatchStrikeoutReply.php new file mode 100644 index 0000000..30a09dd --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchStrikeoutReplyType.php b/src/Types/AnnotationPatchStrikeoutReplyType.php new file mode 100644 index 0000000..d102005 --- /dev/null +++ b/src/Types/AnnotationPatchStrikeoutReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchTextReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?value-of $icon + */ + #[JsonProperty('icon')] + public ?string $icon; + + /** + * @var ?bool $open + */ + #[JsonProperty('open')] + public ?bool $open; + + /** + * @var ?string $state + */ + #[JsonProperty('state')] + public ?string $state; + + /** + * @var ?string $stateModel + */ + #[JsonProperty('stateModel')] + public ?string $stateModel; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchTextRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchTextReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * icon?: ?value-of, + * open?: ?bool, + * state?: ?string, + * stateModel?: ?string, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->icon = $values['icon'] ?? null; + $this->open = $values['open'] ?? null; + $this->state = $values['state'] ?? null; + $this->stateModel = $values['stateModel'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchTextBlendMode.php b/src/Types/AnnotationPatchTextBlendMode.php new file mode 100644 index 0000000..867d80e --- /dev/null +++ b/src/Types/AnnotationPatchTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPatchTextReply.php b/src/Types/AnnotationPatchTextReply.php new file mode 100644 index 0000000..7d8e113 --- /dev/null +++ b/src/Types/AnnotationPatchTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchTextReplyType.php b/src/Types/AnnotationPatchTextReplyType.php new file mode 100644 index 0000000..2c33120 --- /dev/null +++ b/src/Types/AnnotationPatchTextReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?AnnotationPatchUnderlineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPatchUnderlineReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var mixed $actions + */ + #[JsonProperty('actions')] + public mixed $actions; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?float $opacity + */ + #[JsonProperty('opacity')] + public ?float $opacity; + + /** + * @var ?array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationPatchUnderlineQuadPointsItem::class])] + public ?array $quadPoints; + + /** + * @param array{ + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?AnnotationPatchUnderlineRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?AnnotationPatchUnderlineReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: mixed, + * color?: ?string, + * opacity?: ?float, + * quadPoints?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->opacity = $values['opacity'] ?? null; + $this->quadPoints = $values['quadPoints'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineBlendMode.php b/src/Types/AnnotationPatchUnderlineBlendMode.php new file mode 100644 index 0000000..af2ec84 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerLeft.php b/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..317ef04 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerRight.php b/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerRight.php new file mode 100644 index 0000000..7a7aefb --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperLeft.php b/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..b8a805b --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperRight.php b/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperRight.php new file mode 100644 index 0000000..8a5fce4 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineRect.php b/src/Types/AnnotationPatchUnderlineRect.php new file mode 100644 index 0000000..a3e1ea4 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineRect.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/AnnotationPatchUnderlineReply.php b/src/Types/AnnotationPatchUnderlineReply.php new file mode 100644 index 0000000..cd4f9b0 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPatchUnderlineReplyType.php b/src/Types/AnnotationPatchUnderlineReplyType.php new file mode 100644 index 0000000..a7f3737 --- /dev/null +++ b/src/Types/AnnotationPatchUnderlineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationPolygonReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPolygonReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var array $vertices + */ + #[JsonProperty('vertices'), ArrayType([AnnotationPolygonVerticesItem::class])] + public array $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationPolygonCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationPolygonCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationPolygonMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationPolygonMeasure $measure; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationPolygonRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * vertices: array, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationPolygonReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationPolygonCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationPolygonMeasure, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices']; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolygonBlendMode.php b/src/Types/AnnotationPolygonBlendMode.php new file mode 100644 index 0000000..604c490 --- /dev/null +++ b/src/Types/AnnotationPolygonBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolygonIntent.php b/src/Types/AnnotationPolygonIntent.php new file mode 100644 index 0000000..fcb74eb --- /dev/null +++ b/src/Types/AnnotationPolygonIntent.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPolygonMeasureRectilinear $rectilinear + * @return AnnotationPolygonMeasure + */ + public static function rectilinear(AnnotationPolygonMeasureRectilinear $rectilinear): AnnotationPolygonMeasure + { + return new AnnotationPolygonMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationPolygonMeasureGeospatial $geospatial + * @return AnnotationPolygonMeasure + */ + public static function geospatial(AnnotationPolygonMeasureGeospatial $geospatial): AnnotationPolygonMeasure + { + return new AnnotationPolygonMeasure([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationPolygonMeasureUnknown $unknown + * @return AnnotationPolygonMeasure + */ + public static function unknown(AnnotationPolygonMeasureUnknown $unknown): AnnotationPolygonMeasure + { + return new AnnotationPolygonMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationPolygonMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationPolygonMeasureRectilinear + */ + public function asRectilinear(): AnnotationPolygonMeasureRectilinear + { + if (!($this->value instanceof AnnotationPolygonMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationPolygonMeasureGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationPolygonMeasureGeospatial + */ + public function asGeospatial(): AnnotationPolygonMeasureGeospatial + { + if (!($this->value instanceof AnnotationPolygonMeasureGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPolygonMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPolygonMeasureUnknown + */ + public function asUnknown(): AnnotationPolygonMeasureUnknown + { + if (!($this->value instanceof AnnotationPolygonMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationPolygonMeasureRectilinear::jsonDeserialize($data); + break; + case 'geospatial': + $args['value'] = AnnotationPolygonMeasureGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationPolygonMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPolygonMeasureGeospatial.php b/src/Types/AnnotationPolygonMeasureGeospatial.php new file mode 100644 index 0000000..cd0baf9 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPolygonMeasureRectilinear.php b/src/Types/AnnotationPolygonMeasureRectilinear.php new file mode 100644 index 0000000..f810454 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationPolygonMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationPolygonMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationPolygonMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationPolygonMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationPolygonMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationPolygonMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationPolygonMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationPolygonMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationPolygonMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationPolygonMeasureRectilinearAngleItem.php b/src/Types/AnnotationPolygonMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..1cfe5b4 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearAngleItem.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/AnnotationPolygonMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..aa3a1a8 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearAngleItemFraction.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/AnnotationPolygonMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..2252e09 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearAreaItemFraction.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/AnnotationPolygonMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..9ffc86a --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearDistanceItemFraction.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/AnnotationPolygonMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..769e4e0 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItem.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/AnnotationPolygonMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..e3b4697 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItemFraction.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/AnnotationPolygonMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..9d2f280 --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearXItemFraction.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/AnnotationPolygonMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..1f7741f --- /dev/null +++ b/src/Types/AnnotationPolygonMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPolygonRect.php b/src/Types/AnnotationPolygonRect.php new file mode 100644 index 0000000..11d890f --- /dev/null +++ b/src/Types/AnnotationPolygonRect.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/AnnotationPolygonReply.php b/src/Types/AnnotationPolygonReply.php new file mode 100644 index 0000000..4aa038a --- /dev/null +++ b/src/Types/AnnotationPolygonReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolygonReplyType.php b/src/Types/AnnotationPolygonReplyType.php new file mode 100644 index 0000000..e56d66e --- /dev/null +++ b/src/Types/AnnotationPolygonReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolyline.php b/src/Types/AnnotationPolyline.php new file mode 100644 index 0000000..3360692 --- /dev/null +++ b/src/Types/AnnotationPolyline.php @@ -0,0 +1,373 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationPolylineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPolylineReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var array $vertices + */ + #[JsonProperty('vertices'), ArrayType([AnnotationPolylineVerticesItem::class])] + public array $vertices; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?bool $captionEnabled + */ + #[JsonProperty('captionEnabled')] + public ?bool $captionEnabled; + + /** + * @var ?AnnotationPolylineCaptionCenter $captionCenter + */ + #[JsonProperty('captionCenter')] + public ?AnnotationPolylineCaptionCenter $captionCenter; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?AnnotationPolylineMeasure $measure + */ + #[JsonProperty('measure')] + public ?AnnotationPolylineMeasure $measure; + + /** + * @var AnnotationPolylineLineEndings $lineEndings + */ + #[JsonProperty('lineEndings')] + public AnnotationPolylineLineEndings $lineEndings; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationPolylineRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * vertices: array, + * lineEndings: AnnotationPolylineLineEndings, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationPolylineReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * captionEnabled?: ?bool, + * captionCenter?: ?AnnotationPolylineCaptionCenter, + * intent?: ?value-of, + * measure?: ?AnnotationPolylineMeasure, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->vertices = $values['vertices']; + $this->rotation = $values['rotation'] ?? null; + $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionCenter = $values['captionCenter'] ?? null; + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->lineEndings = $values['lineEndings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolylineBlendMode.php b/src/Types/AnnotationPolylineBlendMode.php new file mode 100644 index 0000000..cdef71d --- /dev/null +++ b/src/Types/AnnotationPolylineBlendMode.php @@ -0,0 +1,23 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolylineIntent.php b/src/Types/AnnotationPolylineIntent.php new file mode 100644 index 0000000..35a75a3 --- /dev/null +++ b/src/Types/AnnotationPolylineIntent.php @@ -0,0 +1,8 @@ + $start + */ + #[JsonProperty('start')] + public string $start; + + /** + * @var value-of $end + */ + #[JsonProperty('end')] + public string $end; + + /** + * @param array{ + * start: value-of, + * end: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->start = $values['start']; + $this->end = $values['end']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolylineLineEndingsEnd.php b/src/Types/AnnotationPolylineLineEndingsEnd.php new file mode 100644 index 0000000..ea15373 --- /dev/null +++ b/src/Types/AnnotationPolylineLineEndingsEnd.php @@ -0,0 +1,17 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param AnnotationPolylineMeasureRectilinear $rectilinear + * @return AnnotationPolylineMeasure + */ + public static function rectilinear(AnnotationPolylineMeasureRectilinear $rectilinear): AnnotationPolylineMeasure + { + return new AnnotationPolylineMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param AnnotationPolylineMeasureGeospatial $geospatial + * @return AnnotationPolylineMeasure + */ + public static function geospatial(AnnotationPolylineMeasureGeospatial $geospatial): AnnotationPolylineMeasure + { + return new AnnotationPolylineMeasure([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param AnnotationPolylineMeasureUnknown $unknown + * @return AnnotationPolylineMeasure + */ + public static function unknown(AnnotationPolylineMeasureUnknown $unknown): AnnotationPolylineMeasure + { + return new AnnotationPolylineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof AnnotationPolylineMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return AnnotationPolylineMeasureRectilinear + */ + public function asRectilinear(): AnnotationPolylineMeasureRectilinear + { + if (!($this->value instanceof AnnotationPolylineMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof AnnotationPolylineMeasureGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return AnnotationPolylineMeasureGeospatial + */ + public function asGeospatial(): AnnotationPolylineMeasureGeospatial + { + if (!($this->value instanceof AnnotationPolylineMeasureGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof AnnotationPolylineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return AnnotationPolylineMeasureUnknown + */ + public function asUnknown(): AnnotationPolylineMeasureUnknown + { + if (!($this->value instanceof AnnotationPolylineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = AnnotationPolylineMeasureRectilinear::jsonDeserialize($data); + break; + case 'geospatial': + $args['value'] = AnnotationPolylineMeasureGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = AnnotationPolylineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/AnnotationPolylineMeasureGeospatial.php b/src/Types/AnnotationPolylineMeasureGeospatial.php new file mode 100644 index 0000000..709d8ee --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPolylineMeasureRectilinear.php b/src/Types/AnnotationPolylineMeasureRectilinear.php new file mode 100644 index 0000000..e071b91 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([AnnotationPolylineMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([AnnotationPolylineMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([AnnotationPolylineMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([AnnotationPolylineMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([AnnotationPolylineMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([AnnotationPolylineMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?AnnotationPolylineMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?AnnotationPolylineMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?AnnotationPolylineMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/AnnotationPolylineMeasureRectilinearAngleItem.php b/src/Types/AnnotationPolylineMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..3cce4d3 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearAngleItem.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/AnnotationPolylineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..6a96edc --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearAngleItemFraction.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/AnnotationPolylineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..cb57b8d --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearAreaItemFraction.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/AnnotationPolylineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..5205e8a --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearDistanceItemFraction.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/AnnotationPolylineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..0070a51 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItem.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/AnnotationPolylineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..c598e09 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItemFraction.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/AnnotationPolylineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..650c5a5 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearXItemFraction.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/AnnotationPolylineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..0e25c35 --- /dev/null +++ b/src/Types/AnnotationPolylineMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/AnnotationPolylineRect.php b/src/Types/AnnotationPolylineRect.php new file mode 100644 index 0000000..07b6e7f --- /dev/null +++ b/src/Types/AnnotationPolylineRect.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/AnnotationPolylineReply.php b/src/Types/AnnotationPolylineReply.php new file mode 100644 index 0000000..fbc4788 --- /dev/null +++ b/src/Types/AnnotationPolylineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPolylineReplyType.php b/src/Types/AnnotationPolylineReplyType.php new file mode 100644 index 0000000..55c4a7f --- /dev/null +++ b/src/Types/AnnotationPolylineReplyType.php @@ -0,0 +1,9 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPopup.php b/src/Types/AnnotationPopup.php new file mode 100644 index 0000000..18823ce --- /dev/null +++ b/src/Types/AnnotationPopup.php @@ -0,0 +1,284 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationPopupReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationPopupReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var ?AnnotationRef $parent + */ + #[JsonProperty('parent')] + public ?AnnotationRef $parent; + + /** + * @var bool $open + */ + #[JsonProperty('open')] + public bool $open; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationPopupRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * open: bool, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationPopupReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * parent?: ?AnnotationRef, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->parent = $values['parent'] ?? null; + $this->open = $values['open']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPopupBlendMode.php b/src/Types/AnnotationPopupBlendMode.php new file mode 100644 index 0000000..b828597 --- /dev/null +++ b/src/Types/AnnotationPopupBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationPopupReply.php b/src/Types/AnnotationPopupReply.php new file mode 100644 index 0000000..a0ce392 --- /dev/null +++ b/src/Types/AnnotationPopupReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPopupReplyType.php b/src/Types/AnnotationPopupReplyType.php new file mode 100644 index 0000000..a4d14b0 --- /dev/null +++ b/src/Types/AnnotationPopupReplyType.php @@ -0,0 +1,9 @@ +before = $values['before'] ?? null; + $this->after = $values['after'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationPositionZero.php b/src/Types/AnnotationPositionZero.php new file mode 100644 index 0000000..556d221 --- /dev/null +++ b/src/Types/AnnotationPositionZero.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationRedactReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationRedactReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationRedactQuadPointsItem::class])] + public array $quadPoints; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?string $overlayText + */ + #[JsonProperty('overlayText')] + public ?string $overlayText; + + /** + * @var bool $repeat + */ + #[JsonProperty('repeat')] + public bool $repeat; + + /** + * @var string $fontFamily + */ + #[JsonProperty('fontFamily')] + public string $fontFamily; + + /** + * @var float $fontSize + */ + #[JsonProperty('fontSize')] + public float $fontSize; + + /** + * @var string $fontColor + */ + #[JsonProperty('fontColor')] + public string $fontColor; + + /** + * @var value-of $textAlign + */ + #[JsonProperty('textAlign')] + public string $textAlign; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationRedactRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * quadPoints: array, + * repeat: bool, + * fontFamily: string, + * fontSize: float, + * fontColor: string, + * textAlign: value-of, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationRedactReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * interiorColor?: ?string, + * overlayText?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->quadPoints = $values['quadPoints']; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->overlayText = $values['overlayText'] ?? null; + $this->repeat = $values['repeat']; + $this->fontFamily = $values['fontFamily']; + $this->fontSize = $values['fontSize']; + $this->fontColor = $values['fontColor']; + $this->textAlign = $values['textAlign']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactBlendMode.php b/src/Types/AnnotationRedactBlendMode.php new file mode 100644 index 0000000..5828e5b --- /dev/null +++ b/src/Types/AnnotationRedactBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactQuadPointsItemLowerLeft.php b/src/Types/AnnotationRedactQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..2e877ad --- /dev/null +++ b/src/Types/AnnotationRedactQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactQuadPointsItemLowerRight.php b/src/Types/AnnotationRedactQuadPointsItemLowerRight.php new file mode 100644 index 0000000..57ff5b1 --- /dev/null +++ b/src/Types/AnnotationRedactQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactQuadPointsItemUpperLeft.php b/src/Types/AnnotationRedactQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..c1457ee --- /dev/null +++ b/src/Types/AnnotationRedactQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactQuadPointsItemUpperRight.php b/src/Types/AnnotationRedactQuadPointsItemUpperRight.php new file mode 100644 index 0000000..63eaeb3 --- /dev/null +++ b/src/Types/AnnotationRedactQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactRect.php b/src/Types/AnnotationRedactRect.php new file mode 100644 index 0000000..3edcdba --- /dev/null +++ b/src/Types/AnnotationRedactRect.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/AnnotationRedactReply.php b/src/Types/AnnotationRedactReply.php new file mode 100644 index 0000000..98ae8e7 --- /dev/null +++ b/src/Types/AnnotationRedactReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRedactReplyType.php b/src/Types/AnnotationRedactReplyType.php new file mode 100644 index 0000000..e1b6f57 --- /dev/null +++ b/src/Types/AnnotationRedactReplyType.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param AnnotationRefObjectNumber $objectNumber + * @return AnnotationRef + */ + public static function objectNumber(AnnotationRefObjectNumber $objectNumber): AnnotationRef + { + return new AnnotationRef([ + 'kind' => 'objectNumber', + 'value' => $objectNumber, + ]); + } + + /** + * @param AnnotationRefBaseIndex $baseIndex + * @return AnnotationRef + */ + public static function baseIndex(AnnotationRefBaseIndex $baseIndex): AnnotationRef + { + return new AnnotationRef([ + 'kind' => 'baseIndex', + 'value' => $baseIndex, + ]); + } + + /** + * @return bool + */ + public function isObjectNumber(): bool + { + return $this->value instanceof AnnotationRefObjectNumber && $this->kind === 'objectNumber'; + } + + /** + * @return AnnotationRefObjectNumber + */ + public function asObjectNumber(): AnnotationRefObjectNumber + { + if (!($this->value instanceof AnnotationRefObjectNumber && $this->kind === 'objectNumber')) { + throw new Exception( + "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isBaseIndex(): bool + { + return $this->value instanceof AnnotationRefBaseIndex && $this->kind === 'baseIndex'; + } + + /** + * @return AnnotationRefBaseIndex + */ + public function asBaseIndex(): AnnotationRefBaseIndex + { + if (!($this->value instanceof AnnotationRefBaseIndex && $this->kind === 'baseIndex')) { + throw new Exception( + "Expected baseIndex; 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 'objectNumber': + $value = $this->asObjectNumber()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'baseIndex': + $value = $this->asBaseIndex()->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 'objectNumber': + $args['value'] = AnnotationRefObjectNumber::jsonDeserialize($data); + break; + case 'baseIndex': + $args['value'] = AnnotationRefBaseIndex::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/AnnotationRefBaseIndex.php b/src/Types/AnnotationRefBaseIndex.php new file mode 100644 index 0000000..42bf9f7 --- /dev/null +++ b/src/Types/AnnotationRefBaseIndex.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->baseIndex = $values['baseIndex']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationRefObjectNumber.php b/src/Types/AnnotationRefObjectNumber.php new file mode 100644 index 0000000..c27cfd6 --- /dev/null +++ b/src/Types/AnnotationRefObjectNumber.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquare.php b/src/Types/AnnotationSquare.php new file mode 100644 index 0000000..ae8258f --- /dev/null +++ b/src/Types/AnnotationSquare.php @@ -0,0 +1,341 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationSquareReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationSquareReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var AnnotationSquareBox $box + */ + #[JsonProperty('box')] + public AnnotationSquareBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?float $cloudyIntensity + */ + #[JsonProperty('cloudyIntensity')] + public ?float $cloudyIntensity; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationSquareRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * box: AnnotationSquareBox, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationSquareReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * dashArray?: ?array, + * interiorColor?: ?string, + * rotation?: ?float, + * cloudyIntensity?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquareBlendMode.php b/src/Types/AnnotationSquareBlendMode.php new file mode 100644 index 0000000..f947274 --- /dev/null +++ b/src/Types/AnnotationSquareBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationSquareRect.php b/src/Types/AnnotationSquareRect.php new file mode 100644 index 0000000..a555f93 --- /dev/null +++ b/src/Types/AnnotationSquareRect.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/AnnotationSquareReply.php b/src/Types/AnnotationSquareReply.php new file mode 100644 index 0000000..1d07702 --- /dev/null +++ b/src/Types/AnnotationSquareReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquareReplyType.php b/src/Types/AnnotationSquareReplyType.php new file mode 100644 index 0000000..36fac70 --- /dev/null +++ b/src/Types/AnnotationSquareReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationSquigglyReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationSquigglyReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationSquigglyQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationSquigglyRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * quadPoints: array, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationSquigglyReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyBlendMode.php b/src/Types/AnnotationSquigglyBlendMode.php new file mode 100644 index 0000000..6c53fd1 --- /dev/null +++ b/src/Types/AnnotationSquigglyBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyQuadPointsItemLowerLeft.php b/src/Types/AnnotationSquigglyQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..cf24b67 --- /dev/null +++ b/src/Types/AnnotationSquigglyQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyQuadPointsItemLowerRight.php b/src/Types/AnnotationSquigglyQuadPointsItemLowerRight.php new file mode 100644 index 0000000..10d1e68 --- /dev/null +++ b/src/Types/AnnotationSquigglyQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyQuadPointsItemUpperLeft.php b/src/Types/AnnotationSquigglyQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..a097309 --- /dev/null +++ b/src/Types/AnnotationSquigglyQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyQuadPointsItemUpperRight.php b/src/Types/AnnotationSquigglyQuadPointsItemUpperRight.php new file mode 100644 index 0000000..917c57e --- /dev/null +++ b/src/Types/AnnotationSquigglyQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyRect.php b/src/Types/AnnotationSquigglyRect.php new file mode 100644 index 0000000..60d1454 --- /dev/null +++ b/src/Types/AnnotationSquigglyRect.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/AnnotationSquigglyReply.php b/src/Types/AnnotationSquigglyReply.php new file mode 100644 index 0000000..85710d9 --- /dev/null +++ b/src/Types/AnnotationSquigglyReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationSquigglyReplyType.php b/src/Types/AnnotationSquigglyReplyType.php new file mode 100644 index 0000000..d2c3387 --- /dev/null +++ b/src/Types/AnnotationSquigglyReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationStampReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationStampReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var AnnotationStampBox $box + */ + #[JsonProperty('box')] + public AnnotationStampBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $name + */ + #[JsonProperty('name')] + public ?string $name; + + /** + * @var ?value-of $fit + */ + #[JsonProperty('fit')] + public ?string $fit; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationStampRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * box: AnnotationStampBox, + * opacity: float, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationStampReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * rotation?: ?float, + * name?: ?string, + * fit?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->name = $values['name'] ?? null; + $this->fit = $values['fit'] ?? null; + $this->opacity = $values['opacity']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStampBlendMode.php b/src/Types/AnnotationStampBlendMode.php new file mode 100644 index 0000000..0d7f7dc --- /dev/null +++ b/src/Types/AnnotationStampBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationStampFit.php b/src/Types/AnnotationStampFit.php new file mode 100644 index 0000000..ab37327 --- /dev/null +++ b/src/Types/AnnotationStampFit.php @@ -0,0 +1,10 @@ +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/AnnotationStampReply.php b/src/Types/AnnotationStampReply.php new file mode 100644 index 0000000..258d7fc --- /dev/null +++ b/src/Types/AnnotationStampReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStampReplyType.php b/src/Types/AnnotationStampReplyType.php new file mode 100644 index 0000000..31cee22 --- /dev/null +++ b/src/Types/AnnotationStampReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationStrikeoutReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationStrikeoutReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationStrikeoutQuadPointsItem::class])] + public array $quadPoints; + + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationStrikeoutRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * quadPoints: array, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationStrikeoutReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * intent?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->quadPoints = $values['quadPoints']; + $this->intent = $values['intent'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutBlendMode.php b/src/Types/AnnotationStrikeoutBlendMode.php new file mode 100644 index 0000000..2d9eec1 --- /dev/null +++ b/src/Types/AnnotationStrikeoutBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutQuadPointsItemLowerLeft.php b/src/Types/AnnotationStrikeoutQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..0b09cfc --- /dev/null +++ b/src/Types/AnnotationStrikeoutQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutQuadPointsItemLowerRight.php b/src/Types/AnnotationStrikeoutQuadPointsItemLowerRight.php new file mode 100644 index 0000000..f96e8cd --- /dev/null +++ b/src/Types/AnnotationStrikeoutQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutQuadPointsItemUpperLeft.php b/src/Types/AnnotationStrikeoutQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..96e9c1e --- /dev/null +++ b/src/Types/AnnotationStrikeoutQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutQuadPointsItemUpperRight.php b/src/Types/AnnotationStrikeoutQuadPointsItemUpperRight.php new file mode 100644 index 0000000..8ba471e --- /dev/null +++ b/src/Types/AnnotationStrikeoutQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutRect.php b/src/Types/AnnotationStrikeoutRect.php new file mode 100644 index 0000000..e8a5d4e --- /dev/null +++ b/src/Types/AnnotationStrikeoutRect.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/AnnotationStrikeoutReply.php b/src/Types/AnnotationStrikeoutReply.php new file mode 100644 index 0000000..68b4c39 --- /dev/null +++ b/src/Types/AnnotationStrikeoutReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationStrikeoutReplyType.php b/src/Types/AnnotationStrikeoutReplyType.php new file mode 100644 index 0000000..ad66830 --- /dev/null +++ b/src/Types/AnnotationStrikeoutReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationTextReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationTextReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var value-of $icon + */ + #[JsonProperty('icon')] + public string $icon; + + /** + * @var bool $open + */ + #[JsonProperty('open')] + public bool $open; + + /** + * @var ?string $state + */ + #[JsonProperty('state')] + public ?string $state; + + /** + * @var ?string $stateModel + */ + #[JsonProperty('stateModel')] + public ?string $stateModel; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationTextRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * icon: value-of, + * open: bool, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationTextReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * state?: ?string, + * stateModel?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->icon = $values['icon']; + $this->open = $values['open']; + $this->state = $values['state'] ?? null; + $this->stateModel = $values['stateModel'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationTextBlendMode.php b/src/Types/AnnotationTextBlendMode.php new file mode 100644 index 0000000..56a55ee --- /dev/null +++ b/src/Types/AnnotationTextBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationTextReply.php b/src/Types/AnnotationTextReply.php new file mode 100644 index 0000000..cac8871 --- /dev/null +++ b/src/Types/AnnotationTextReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationTextReplyType.php b/src/Types/AnnotationTextReplyType.php new file mode 100644 index 0000000..c0b8e3a --- /dev/null +++ b/src/Types/AnnotationTextReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationUnderlineReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationUnderlineReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var string $color + */ + #[JsonProperty('color')] + public string $color; + + /** + * @var float $opacity + */ + #[JsonProperty('opacity')] + public float $opacity; + + /** + * @var array $quadPoints + */ + #[JsonProperty('quadPoints'), ArrayType([AnnotationUnderlineQuadPointsItem::class])] + public array $quadPoints; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationUnderlineRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * color: string, + * opacity: float, + * quadPoints: array, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationUnderlineReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color']; + $this->opacity = $values['opacity']; + $this->quadPoints = $values['quadPoints']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineBlendMode.php b/src/Types/AnnotationUnderlineBlendMode.php new file mode 100644 index 0000000..53bdbfb --- /dev/null +++ b/src/Types/AnnotationUnderlineBlendMode.php @@ -0,0 +1,23 @@ +upperLeft = $values['upperLeft']; + $this->upperRight = $values['upperRight']; + $this->lowerLeft = $values['lowerLeft']; + $this->lowerRight = $values['lowerRight']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineQuadPointsItemLowerLeft.php b/src/Types/AnnotationUnderlineQuadPointsItemLowerLeft.php new file mode 100644 index 0000000..2affa5c --- /dev/null +++ b/src/Types/AnnotationUnderlineQuadPointsItemLowerLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineQuadPointsItemLowerRight.php b/src/Types/AnnotationUnderlineQuadPointsItemLowerRight.php new file mode 100644 index 0000000..359eab4 --- /dev/null +++ b/src/Types/AnnotationUnderlineQuadPointsItemLowerRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineQuadPointsItemUpperLeft.php b/src/Types/AnnotationUnderlineQuadPointsItemUpperLeft.php new file mode 100644 index 0000000..b5e164a --- /dev/null +++ b/src/Types/AnnotationUnderlineQuadPointsItemUpperLeft.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineQuadPointsItemUpperRight.php b/src/Types/AnnotationUnderlineQuadPointsItemUpperRight.php new file mode 100644 index 0000000..4948b04 --- /dev/null +++ b/src/Types/AnnotationUnderlineQuadPointsItemUpperRight.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineRect.php b/src/Types/AnnotationUnderlineRect.php new file mode 100644 index 0000000..6883a76 --- /dev/null +++ b/src/Types/AnnotationUnderlineRect.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/AnnotationUnderlineReply.php b/src/Types/AnnotationUnderlineReply.php new file mode 100644 index 0000000..ca3746d --- /dev/null +++ b/src/Types/AnnotationUnderlineReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnderlineReplyType.php b/src/Types/AnnotationUnderlineReplyType.php new file mode 100644 index 0000000..4174ea7 --- /dev/null +++ b/src/Types/AnnotationUnderlineReplyType.php @@ -0,0 +1,9 @@ + $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?AnnotationUnsupportedReply $reply + */ + #[JsonProperty('reply')] + public ?AnnotationUnsupportedReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var int $rawSubtypeCode + */ + #[JsonProperty('rawSubtypeCode')] + public int $rawSubtypeCode; + + /** + * @var ?string $rawSubtypeName + */ + #[JsonProperty('rawSubtypeName')] + public ?string $rawSubtypeName; + + /** + * @param array{ + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: AnnotationUnsupportedRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * rawSubtypeCode: int, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?AnnotationUnsupportedReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * rawSubtypeName?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->rawSubtypeCode = $values['rawSubtypeCode']; + $this->rawSubtypeName = $values['rawSubtypeName'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnsupportedBlendMode.php b/src/Types/AnnotationUnsupportedBlendMode.php new file mode 100644 index 0000000..b566a0d --- /dev/null +++ b/src/Types/AnnotationUnsupportedBlendMode.php @@ -0,0 +1,23 @@ +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/AnnotationUnsupportedReply.php b/src/Types/AnnotationUnsupportedReply.php new file mode 100644 index 0000000..7df9ecb --- /dev/null +++ b/src/Types/AnnotationUnsupportedReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AnnotationUnsupportedReplyType.php b/src/Types/AnnotationUnsupportedReplyType.php new file mode 100644 index 0000000..6fe2fe3 --- /dev/null +++ b/src/Types/AnnotationUnsupportedReplyType.php @@ -0,0 +1,9 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([CacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * annotationsVersion?: ?int, + * formsVersion?: ?int, + * layoutVersion?: ?int, + * metadataVersion?: ?int, + * attachmentsVersion?: ?int, + * layerVersion?: ?int, + * working?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $this->annotationsVersion = $values['annotationsVersion'] ?? null; + $this->formsVersion = $values['formsVersion'] ?? null; + $this->layoutVersion = $values['layoutVersion'] ?? null; + $this->metadataVersion = $values['metadataVersion'] ?? null; + $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; + $this->layerVersion = $values['layerVersion'] ?? null; + $this->working = $values['working'] ?? null; + $this->pages = $values['pages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CacheDeltaPagesItem.php b/src/Types/CacheDeltaPagesItem.php new file mode 100644 index 0000000..6fc9348 --- /dev/null +++ b/src/Types/CacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->cache = $values['cache']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/CacheDeltaPagesItemCache.php b/src/Types/CacheDeltaPagesItemCache.php new file mode 100644 index 0000000..1150f08 --- /dev/null +++ b/src/Types/CacheDeltaPagesItemCache.php @@ -0,0 +1,50 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + $this->widgetVersion = $values['widgetVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItem.php b/src/Types/ChangeItem.php new file mode 100644 index 0000000..ad9f8d5 --- /dev/null +++ b/src/Types/ChangeItem.php @@ -0,0 +1,1186 @@ +type = $values['type']; + $this->value = $values['value']; + } + + /** + * @param ChangeItemSkipped $skipped + * @return ChangeItem + */ + public static function skipped(ChangeItemSkipped $skipped): ChangeItem + { + return new ChangeItem([ + 'type' => 'skipped', + 'value' => $skipped, + ]); + } + + /** + * @param ChangeItemAnnotationsCreate $annotationsCreate + * @return ChangeItem + */ + public static function annotationsCreate(ChangeItemAnnotationsCreate $annotationsCreate): ChangeItem + { + return new ChangeItem([ + 'type' => 'annotations.create', + 'value' => $annotationsCreate, + ]); + } + + /** + * @param ChangeItemAnnotationsUpdate $annotationsUpdate + * @return ChangeItem + */ + public static function annotationsUpdate(ChangeItemAnnotationsUpdate $annotationsUpdate): ChangeItem + { + return new ChangeItem([ + 'type' => 'annotations.update', + 'value' => $annotationsUpdate, + ]); + } + + /** + * @param ChangeItemAnnotationsDelete $annotationsDelete + * @return ChangeItem + */ + public static function annotationsDelete(ChangeItemAnnotationsDelete $annotationsDelete): ChangeItem + { + return new ChangeItem([ + 'type' => 'annotations.delete', + 'value' => $annotationsDelete, + ]); + } + + /** + * @param ChangeItemAnnotationsReorder $annotationsReorder + * @return ChangeItem + */ + public static function annotationsReorder(ChangeItemAnnotationsReorder $annotationsReorder): ChangeItem + { + return new ChangeItem([ + 'type' => 'annotations.reorder', + 'value' => $annotationsReorder, + ]); + } + + /** + * @param ChangeItemAnnotationsRestore $annotationsRestore + * @return ChangeItem + */ + public static function annotationsRestore(ChangeItemAnnotationsRestore $annotationsRestore): ChangeItem + { + return new ChangeItem([ + 'type' => 'annotations.restore', + 'value' => $annotationsRestore, + ]); + } + + /** + * @param ChangeItemFormsSetValue $formsSetValue + * @return ChangeItem + */ + public static function formsSetValue(ChangeItemFormsSetValue $formsSetValue): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.setValue', + 'value' => $formsSetValue, + ]); + } + + /** + * @param ChangeItemFormsSetDisplay $formsSetDisplay + * @return ChangeItem + */ + public static function formsSetDisplay(ChangeItemFormsSetDisplay $formsSetDisplay): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.setDisplay', + 'value' => $formsSetDisplay, + ]); + } + + /** + * @param ChangeItemFormsSetAppearanceText $formsSetAppearanceText + * @return ChangeItem + */ + public static function formsSetAppearanceText(ChangeItemFormsSetAppearanceText $formsSetAppearanceText): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.setAppearanceText', + 'value' => $formsSetAppearanceText, + ]); + } + + /** + * @param ChangeItemFormsReset $formsReset + * @return ChangeItem + */ + public static function formsReset(ChangeItemFormsReset $formsReset): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.reset', + 'value' => $formsReset, + ]); + } + + /** + * @param ChangeItemFormsCreate $formsCreate + * @return ChangeItem + */ + public static function formsCreate(ChangeItemFormsCreate $formsCreate): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.create', + 'value' => $formsCreate, + ]); + } + + /** + * @param ChangeItemFormsUpdate $formsUpdate + * @return ChangeItem + */ + public static function formsUpdate(ChangeItemFormsUpdate $formsUpdate): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.update', + 'value' => $formsUpdate, + ]); + } + + /** + * @param ChangeItemFormsDelete $formsDelete + * @return ChangeItem + */ + public static function formsDelete(ChangeItemFormsDelete $formsDelete): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.delete', + 'value' => $formsDelete, + ]); + } + + /** + * @param ChangeItemFormsRestore $formsRestore + * @return ChangeItem + */ + public static function formsRestore(ChangeItemFormsRestore $formsRestore): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.restore', + 'value' => $formsRestore, + ]); + } + + /** + * @param ChangeItemFormsSetSignatureAppearance $formsSetSignatureAppearance + * @return ChangeItem + */ + public static function formsSetSignatureAppearance(ChangeItemFormsSetSignatureAppearance $formsSetSignatureAppearance): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.setSignatureAppearance', + 'value' => $formsSetSignatureAppearance, + ]); + } + + /** + * @param ChangeItemFormsAddWidget $formsAddWidget + * @return ChangeItem + */ + public static function formsAddWidget(ChangeItemFormsAddWidget $formsAddWidget): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.addWidget', + 'value' => $formsAddWidget, + ]); + } + + /** + * @param ChangeItemFormsRemoveWidget $formsRemoveWidget + * @return ChangeItem + */ + public static function formsRemoveWidget(ChangeItemFormsRemoveWidget $formsRemoveWidget): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.removeWidget', + 'value' => $formsRemoveWidget, + ]); + } + + /** + * @param ChangeItemFormsDeleteWidget $formsDeleteWidget + * @return ChangeItem + */ + public static function formsDeleteWidget(ChangeItemFormsDeleteWidget $formsDeleteWidget): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.deleteWidget', + 'value' => $formsDeleteWidget, + ]); + } + + /** + * @param ChangeItemFormsRestoreWidget $formsRestoreWidget + * @return ChangeItem + */ + public static function formsRestoreWidget(ChangeItemFormsRestoreWidget $formsRestoreWidget): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.restoreWidget', + 'value' => $formsRestoreWidget, + ]); + } + + /** + * @param ChangeItemFormsReorderWidgets $formsReorderWidgets + * @return ChangeItem + */ + public static function formsReorderWidgets(ChangeItemFormsReorderWidgets $formsReorderWidgets): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.reorderWidgets', + 'value' => $formsReorderWidgets, + ]); + } + + /** + * @param ChangeItemFormsReorderCalculations $formsReorderCalculations + * @return ChangeItem + */ + public static function formsReorderCalculations(ChangeItemFormsReorderCalculations $formsReorderCalculations): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.reorderCalculations', + 'value' => $formsReorderCalculations, + ]); + } + + /** + * @param ChangeItemFormsUpdateWidget $formsUpdateWidget + * @return ChangeItem + */ + public static function formsUpdateWidget(ChangeItemFormsUpdateWidget $formsUpdateWidget): ChangeItem + { + return new ChangeItem([ + 'type' => 'forms.updateWidget', + 'value' => $formsUpdateWidget, + ]); + } + + /** + * @param ChangeItemMetadataUpdate $metadataUpdate + * @return ChangeItem + */ + public static function metadataUpdate(ChangeItemMetadataUpdate $metadataUpdate): ChangeItem + { + return new ChangeItem([ + 'type' => 'metadata.update', + 'value' => $metadataUpdate, + ]); + } + + /** + * @param ChangeItemMetadataUpdateCustom $metadataUpdateCustom + * @return ChangeItem + */ + public static function metadataUpdateCustom(ChangeItemMetadataUpdateCustom $metadataUpdateCustom): ChangeItem + { + return new ChangeItem([ + 'type' => 'metadata.updateCustom', + 'value' => $metadataUpdateCustom, + ]); + } + + /** + * @return bool + */ + public function isSkipped(): bool + { + return $this->value instanceof ChangeItemSkipped && $this->type === 'skipped'; + } + + /** + * @return ChangeItemSkipped + */ + public function asSkipped(): ChangeItemSkipped + { + if (!($this->value instanceof ChangeItemSkipped && $this->type === 'skipped')) { + throw new Exception( + "Expected skipped; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsCreate(): bool + { + return $this->value instanceof ChangeItemAnnotationsCreate && $this->type === 'annotations.create'; + } + + /** + * @return ChangeItemAnnotationsCreate + */ + public function asAnnotationsCreate(): ChangeItemAnnotationsCreate + { + if (!($this->value instanceof ChangeItemAnnotationsCreate && $this->type === 'annotations.create')) { + throw new Exception( + "Expected annotations.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsUpdate(): bool + { + return $this->value instanceof ChangeItemAnnotationsUpdate && $this->type === 'annotations.update'; + } + + /** + * @return ChangeItemAnnotationsUpdate + */ + public function asAnnotationsUpdate(): ChangeItemAnnotationsUpdate + { + if (!($this->value instanceof ChangeItemAnnotationsUpdate && $this->type === 'annotations.update')) { + throw new Exception( + "Expected annotations.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsDelete(): bool + { + return $this->value instanceof ChangeItemAnnotationsDelete && $this->type === 'annotations.delete'; + } + + /** + * @return ChangeItemAnnotationsDelete + */ + public function asAnnotationsDelete(): ChangeItemAnnotationsDelete + { + if (!($this->value instanceof ChangeItemAnnotationsDelete && $this->type === 'annotations.delete')) { + throw new Exception( + "Expected annotations.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsReorder(): bool + { + return $this->value instanceof ChangeItemAnnotationsReorder && $this->type === 'annotations.reorder'; + } + + /** + * @return ChangeItemAnnotationsReorder + */ + public function asAnnotationsReorder(): ChangeItemAnnotationsReorder + { + if (!($this->value instanceof ChangeItemAnnotationsReorder && $this->type === 'annotations.reorder')) { + throw new Exception( + "Expected annotations.reorder; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsRestore(): bool + { + return $this->value instanceof ChangeItemAnnotationsRestore && $this->type === 'annotations.restore'; + } + + /** + * @return ChangeItemAnnotationsRestore + */ + public function asAnnotationsRestore(): ChangeItemAnnotationsRestore + { + if (!($this->value instanceof ChangeItemAnnotationsRestore && $this->type === 'annotations.restore')) { + throw new Exception( + "Expected annotations.restore; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetValue(): bool + { + return $this->value instanceof ChangeItemFormsSetValue && $this->type === 'forms.setValue'; + } + + /** + * @return ChangeItemFormsSetValue + */ + public function asFormsSetValue(): ChangeItemFormsSetValue + { + if (!($this->value instanceof ChangeItemFormsSetValue && $this->type === 'forms.setValue')) { + throw new Exception( + "Expected forms.setValue; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetDisplay(): bool + { + return $this->value instanceof ChangeItemFormsSetDisplay && $this->type === 'forms.setDisplay'; + } + + /** + * @return ChangeItemFormsSetDisplay + */ + public function asFormsSetDisplay(): ChangeItemFormsSetDisplay + { + if (!($this->value instanceof ChangeItemFormsSetDisplay && $this->type === 'forms.setDisplay')) { + throw new Exception( + "Expected forms.setDisplay; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetAppearanceText(): bool + { + return $this->value instanceof ChangeItemFormsSetAppearanceText && $this->type === 'forms.setAppearanceText'; + } + + /** + * @return ChangeItemFormsSetAppearanceText + */ + public function asFormsSetAppearanceText(): ChangeItemFormsSetAppearanceText + { + if (!($this->value instanceof ChangeItemFormsSetAppearanceText && $this->type === 'forms.setAppearanceText')) { + throw new Exception( + "Expected forms.setAppearanceText; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReset(): bool + { + return $this->value instanceof ChangeItemFormsReset && $this->type === 'forms.reset'; + } + + /** + * @return ChangeItemFormsReset + */ + public function asFormsReset(): ChangeItemFormsReset + { + if (!($this->value instanceof ChangeItemFormsReset && $this->type === 'forms.reset')) { + throw new Exception( + "Expected forms.reset; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsCreate(): bool + { + return $this->value instanceof ChangeItemFormsCreate && $this->type === 'forms.create'; + } + + /** + * @return ChangeItemFormsCreate + */ + public function asFormsCreate(): ChangeItemFormsCreate + { + if (!($this->value instanceof ChangeItemFormsCreate && $this->type === 'forms.create')) { + throw new Exception( + "Expected forms.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsUpdate(): bool + { + return $this->value instanceof ChangeItemFormsUpdate && $this->type === 'forms.update'; + } + + /** + * @return ChangeItemFormsUpdate + */ + public function asFormsUpdate(): ChangeItemFormsUpdate + { + if (!($this->value instanceof ChangeItemFormsUpdate && $this->type === 'forms.update')) { + throw new Exception( + "Expected forms.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsDelete(): bool + { + return $this->value instanceof ChangeItemFormsDelete && $this->type === 'forms.delete'; + } + + /** + * @return ChangeItemFormsDelete + */ + public function asFormsDelete(): ChangeItemFormsDelete + { + if (!($this->value instanceof ChangeItemFormsDelete && $this->type === 'forms.delete')) { + throw new Exception( + "Expected forms.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsRestore(): bool + { + return $this->value instanceof ChangeItemFormsRestore && $this->type === 'forms.restore'; + } + + /** + * @return ChangeItemFormsRestore + */ + public function asFormsRestore(): ChangeItemFormsRestore + { + if (!($this->value instanceof ChangeItemFormsRestore && $this->type === 'forms.restore')) { + throw new Exception( + "Expected forms.restore; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetSignatureAppearance(): bool + { + return $this->value instanceof ChangeItemFormsSetSignatureAppearance && $this->type === 'forms.setSignatureAppearance'; + } + + /** + * @return ChangeItemFormsSetSignatureAppearance + */ + public function asFormsSetSignatureAppearance(): ChangeItemFormsSetSignatureAppearance + { + if (!($this->value instanceof ChangeItemFormsSetSignatureAppearance && $this->type === 'forms.setSignatureAppearance')) { + throw new Exception( + "Expected forms.setSignatureAppearance; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsAddWidget(): bool + { + return $this->value instanceof ChangeItemFormsAddWidget && $this->type === 'forms.addWidget'; + } + + /** + * @return ChangeItemFormsAddWidget + */ + public function asFormsAddWidget(): ChangeItemFormsAddWidget + { + if (!($this->value instanceof ChangeItemFormsAddWidget && $this->type === 'forms.addWidget')) { + throw new Exception( + "Expected forms.addWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsRemoveWidget(): bool + { + return $this->value instanceof ChangeItemFormsRemoveWidget && $this->type === 'forms.removeWidget'; + } + + /** + * @return ChangeItemFormsRemoveWidget + */ + public function asFormsRemoveWidget(): ChangeItemFormsRemoveWidget + { + if (!($this->value instanceof ChangeItemFormsRemoveWidget && $this->type === 'forms.removeWidget')) { + throw new Exception( + "Expected forms.removeWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsDeleteWidget(): bool + { + return $this->value instanceof ChangeItemFormsDeleteWidget && $this->type === 'forms.deleteWidget'; + } + + /** + * @return ChangeItemFormsDeleteWidget + */ + public function asFormsDeleteWidget(): ChangeItemFormsDeleteWidget + { + if (!($this->value instanceof ChangeItemFormsDeleteWidget && $this->type === 'forms.deleteWidget')) { + throw new Exception( + "Expected forms.deleteWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsRestoreWidget(): bool + { + return $this->value instanceof ChangeItemFormsRestoreWidget && $this->type === 'forms.restoreWidget'; + } + + /** + * @return ChangeItemFormsRestoreWidget + */ + public function asFormsRestoreWidget(): ChangeItemFormsRestoreWidget + { + if (!($this->value instanceof ChangeItemFormsRestoreWidget && $this->type === 'forms.restoreWidget')) { + throw new Exception( + "Expected forms.restoreWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReorderWidgets(): bool + { + return $this->value instanceof ChangeItemFormsReorderWidgets && $this->type === 'forms.reorderWidgets'; + } + + /** + * @return ChangeItemFormsReorderWidgets + */ + public function asFormsReorderWidgets(): ChangeItemFormsReorderWidgets + { + if (!($this->value instanceof ChangeItemFormsReorderWidgets && $this->type === 'forms.reorderWidgets')) { + throw new Exception( + "Expected forms.reorderWidgets; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReorderCalculations(): bool + { + return $this->value instanceof ChangeItemFormsReorderCalculations && $this->type === 'forms.reorderCalculations'; + } + + /** + * @return ChangeItemFormsReorderCalculations + */ + public function asFormsReorderCalculations(): ChangeItemFormsReorderCalculations + { + if (!($this->value instanceof ChangeItemFormsReorderCalculations && $this->type === 'forms.reorderCalculations')) { + throw new Exception( + "Expected forms.reorderCalculations; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsUpdateWidget(): bool + { + return $this->value instanceof ChangeItemFormsUpdateWidget && $this->type === 'forms.updateWidget'; + } + + /** + * @return ChangeItemFormsUpdateWidget + */ + public function asFormsUpdateWidget(): ChangeItemFormsUpdateWidget + { + if (!($this->value instanceof ChangeItemFormsUpdateWidget && $this->type === 'forms.updateWidget')) { + throw new Exception( + "Expected forms.updateWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMetadataUpdate(): bool + { + return $this->value instanceof ChangeItemMetadataUpdate && $this->type === 'metadata.update'; + } + + /** + * @return ChangeItemMetadataUpdate + */ + public function asMetadataUpdate(): ChangeItemMetadataUpdate + { + if (!($this->value instanceof ChangeItemMetadataUpdate && $this->type === 'metadata.update')) { + throw new Exception( + "Expected metadata.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMetadataUpdateCustom(): bool + { + return $this->value instanceof ChangeItemMetadataUpdateCustom && $this->type === 'metadata.updateCustom'; + } + + /** + * @return ChangeItemMetadataUpdateCustom + */ + public function asMetadataUpdateCustom(): ChangeItemMetadataUpdateCustom + { + if (!($this->value instanceof ChangeItemMetadataUpdateCustom && $this->type === 'metadata.updateCustom')) { + throw new Exception( + "Expected metadata.updateCustom; got " . $this->type . " 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['type'] = $this->type; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->type) { + case 'skipped': + $value = $this->asSkipped()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.create': + $value = $this->asAnnotationsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.update': + $value = $this->asAnnotationsUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.delete': + $value = $this->asAnnotationsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.reorder': + $value = $this->asAnnotationsReorder()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.restore': + $value = $this->asAnnotationsRestore()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setValue': + $value = $this->asFormsSetValue()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setDisplay': + $value = $this->asFormsSetDisplay()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setAppearanceText': + $value = $this->asFormsSetAppearanceText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reset': + $value = $this->asFormsReset()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.create': + $value = $this->asFormsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.update': + $value = $this->asFormsUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.delete': + $value = $this->asFormsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.restore': + $value = $this->asFormsRestore()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setSignatureAppearance': + $value = $this->asFormsSetSignatureAppearance()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.addWidget': + $value = $this->asFormsAddWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.removeWidget': + $value = $this->asFormsRemoveWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.deleteWidget': + $value = $this->asFormsDeleteWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.restoreWidget': + $value = $this->asFormsRestoreWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reorderWidgets': + $value = $this->asFormsReorderWidgets()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reorderCalculations': + $value = $this->asFormsReorderCalculations()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.updateWidget': + $value = $this->asFormsUpdateWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'metadata.update': + $value = $this->asMetadataUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'metadata.updateCustom': + $value = $this->asMetadataUpdateCustom()->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('type', $data)) { + throw new Exception( + "JSON data is missing property 'type'", + ); + } + $type = $data['type']; + if (!(is_string($type))) { + throw new Exception( + "Expected property 'type' in JSON data to be string, instead received " . get_debug_type($data['type']), + ); + } + + $args['type'] = $type; + switch ($type) { + case 'skipped': + $args['value'] = ChangeItemSkipped::jsonDeserialize($data); + break; + case 'annotations.create': + $args['value'] = ChangeItemAnnotationsCreate::jsonDeserialize($data); + break; + case 'annotations.update': + $args['value'] = ChangeItemAnnotationsUpdate::jsonDeserialize($data); + break; + case 'annotations.delete': + $args['value'] = ChangeItemAnnotationsDelete::jsonDeserialize($data); + break; + case 'annotations.reorder': + $args['value'] = ChangeItemAnnotationsReorder::jsonDeserialize($data); + break; + case 'annotations.restore': + $args['value'] = ChangeItemAnnotationsRestore::jsonDeserialize($data); + break; + case 'forms.setValue': + $args['value'] = ChangeItemFormsSetValue::jsonDeserialize($data); + break; + case 'forms.setDisplay': + $args['value'] = ChangeItemFormsSetDisplay::jsonDeserialize($data); + break; + case 'forms.setAppearanceText': + $args['value'] = ChangeItemFormsSetAppearanceText::jsonDeserialize($data); + break; + case 'forms.reset': + $args['value'] = ChangeItemFormsReset::jsonDeserialize($data); + break; + case 'forms.create': + $args['value'] = ChangeItemFormsCreate::jsonDeserialize($data); + break; + case 'forms.update': + $args['value'] = ChangeItemFormsUpdate::jsonDeserialize($data); + break; + case 'forms.delete': + $args['value'] = ChangeItemFormsDelete::jsonDeserialize($data); + break; + case 'forms.restore': + $args['value'] = ChangeItemFormsRestore::jsonDeserialize($data); + break; + case 'forms.setSignatureAppearance': + $args['value'] = ChangeItemFormsSetSignatureAppearance::jsonDeserialize($data); + break; + case 'forms.addWidget': + $args['value'] = ChangeItemFormsAddWidget::jsonDeserialize($data); + break; + case 'forms.removeWidget': + $args['value'] = ChangeItemFormsRemoveWidget::jsonDeserialize($data); + break; + case 'forms.deleteWidget': + $args['value'] = ChangeItemFormsDeleteWidget::jsonDeserialize($data); + break; + case 'forms.restoreWidget': + $args['value'] = ChangeItemFormsRestoreWidget::jsonDeserialize($data); + break; + case 'forms.reorderWidgets': + $args['value'] = ChangeItemFormsReorderWidgets::jsonDeserialize($data); + break; + case 'forms.reorderCalculations': + $args['value'] = ChangeItemFormsReorderCalculations::jsonDeserialize($data); + break; + case 'forms.updateWidget': + $args['value'] = ChangeItemFormsUpdateWidget::jsonDeserialize($data); + break; + case 'metadata.update': + $args['value'] = ChangeItemMetadataUpdate::jsonDeserialize($data); + break; + case 'metadata.updateCustom': + $args['value'] = ChangeItemMetadataUpdateCustom::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['type'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/ChangeItemAnnotationsCreate.php b/src/Types/ChangeItemAnnotationsCreate.php new file mode 100644 index 0000000..2984cb5 --- /dev/null +++ b/src/Types/ChangeItemAnnotationsCreate.php @@ -0,0 +1,50 @@ +page = $values['page']; + $this->annotation = $values['annotation']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsDelete.php b/src/Types/ChangeItemAnnotationsDelete.php new file mode 100644 index 0000000..42cad2e --- /dev/null +++ b/src/Types/ChangeItemAnnotationsDelete.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsReorder.php b/src/Types/ChangeItemAnnotationsReorder.php new file mode 100644 index 0000000..8c2d08b --- /dev/null +++ b/src/Types/ChangeItemAnnotationsReorder.php @@ -0,0 +1,51 @@ + $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var AnnotationMutationMeta $meta + */ + #[JsonProperty('meta')] + public AnnotationMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * order: array, + * meta: AnnotationMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsRestore.php b/src/Types/ChangeItemAnnotationsRestore.php new file mode 100644 index 0000000..8521599 --- /dev/null +++ b/src/Types/ChangeItemAnnotationsRestore.php @@ -0,0 +1,51 @@ + $annotations + */ + #[JsonProperty('annotations'), ArrayType([Annotation::class])] + public array $annotations; + + /** + * @var AnnotationMutationMeta $meta + */ + #[JsonProperty('meta')] + public AnnotationMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * annotations: array, + * meta: AnnotationMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->annotations = $values['annotations']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsUpdate.php b/src/Types/ChangeItemAnnotationsUpdate.php new file mode 100644 index 0000000..10ec75f --- /dev/null +++ b/src/Types/ChangeItemAnnotationsUpdate.php @@ -0,0 +1,67 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var Annotation $annotation + */ + #[JsonProperty('annotation')] + public Annotation $annotation; + + /** + * @var ChangeItemAnnotationsUpdateAppearance $appearance + */ + #[JsonProperty('appearance')] + public ChangeItemAnnotationsUpdateAppearance $appearance; + + /** + * @var AnnotationMutationMeta $meta + */ + #[JsonProperty('meta')] + public AnnotationMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * annotation: Annotation, + * appearance: ChangeItemAnnotationsUpdateAppearance, + * meta: AnnotationMutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->skipped = $values['skipped'] ?? null; + $this->annotation = $values['annotation']; + $this->appearance = $values['appearance']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsUpdateAppearance.php b/src/Types/ChangeItemAnnotationsUpdateAppearance.php new file mode 100644 index 0000000..aeb63a7 --- /dev/null +++ b/src/Types/ChangeItemAnnotationsUpdateAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemAnnotationsUpdateAppearanceAction.php b/src/Types/ChangeItemAnnotationsUpdateAppearanceAction.php new file mode 100644 index 0000000..1996e07 --- /dev/null +++ b/src/Types/ChangeItemAnnotationsUpdateAppearanceAction.php @@ -0,0 +1,11 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsCreate.php b/src/Types/ChangeItemFormsCreate.php new file mode 100644 index 0000000..61f68e2 --- /dev/null +++ b/src/Types/ChangeItemFormsCreate.php @@ -0,0 +1,59 @@ + $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/ChangeItemFormsDelete.php b/src/Types/ChangeItemFormsDelete.php new file mode 100644 index 0000000..7fef9ba --- /dev/null +++ b/src/Types/ChangeItemFormsDelete.php @@ -0,0 +1,43 @@ + $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public ?array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * meta: FormMutationMeta, + * calculationOrder?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->calculationOrder = $values['calculationOrder'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsDeleteWidget.php b/src/Types/ChangeItemFormsDeleteWidget.php new file mode 100644 index 0000000..d9c22cc --- /dev/null +++ b/src/Types/ChangeItemFormsDeleteWidget.php @@ -0,0 +1,58 @@ +widget = $values['widget']; + $this->page = $values['page']; + $this->field = $values['field'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsRemoveWidget.php b/src/Types/ChangeItemFormsRemoveWidget.php new file mode 100644 index 0000000..54d8adf --- /dev/null +++ b/src/Types/ChangeItemFormsRemoveWidget.php @@ -0,0 +1,51 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsReorderCalculations.php b/src/Types/ChangeItemFormsReorderCalculations.php new file mode 100644 index 0000000..888ca54 --- /dev/null +++ b/src/Types/ChangeItemFormsReorderCalculations.php @@ -0,0 +1,43 @@ + $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * calculationOrder: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->calculationOrder = $values['calculationOrder']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsReorderWidgets.php b/src/Types/ChangeItemFormsReorderWidgets.php new file mode 100644 index 0000000..8ef7015 --- /dev/null +++ b/src/Types/ChangeItemFormsReorderWidgets.php @@ -0,0 +1,51 @@ + $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * order: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsReset.php b/src/Types/ChangeItemFormsReset.php new file mode 100644 index 0000000..d8e598a --- /dev/null +++ b/src/Types/ChangeItemFormsReset.php @@ -0,0 +1,59 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * fields: array, + * widgets: array, + * meta: FormMutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsRestore.php b/src/Types/ChangeItemFormsRestore.php new file mode 100644 index 0000000..bbee10a --- /dev/null +++ b/src/Types/ChangeItemFormsRestore.php @@ -0,0 +1,51 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsRestoreWidget.php b/src/Types/ChangeItemFormsRestoreWidget.php new file mode 100644 index 0000000..1bd0433 --- /dev/null +++ b/src/Types/ChangeItemFormsRestoreWidget.php @@ -0,0 +1,51 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * widgets: array, + * meta: FormMutationMeta, + * field?: ?FormField, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field'] ?? null; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsSetAppearanceText.php b/src/Types/ChangeItemFormsSetAppearanceText.php new file mode 100644 index 0000000..8e12c8b --- /dev/null +++ b/src/Types/ChangeItemFormsSetAppearanceText.php @@ -0,0 +1,59 @@ + $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/ChangeItemFormsSetDisplay.php b/src/Types/ChangeItemFormsSetDisplay.php new file mode 100644 index 0000000..627a566 --- /dev/null +++ b/src/Types/ChangeItemFormsSetDisplay.php @@ -0,0 +1,59 @@ + $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/ChangeItemFormsSetSignatureAppearance.php b/src/Types/ChangeItemFormsSetSignatureAppearance.php new file mode 100644 index 0000000..9ee9413 --- /dev/null +++ b/src/Types/ChangeItemFormsSetSignatureAppearance.php @@ -0,0 +1,59 @@ + $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/ChangeItemFormsSetValue.php b/src/Types/ChangeItemFormsSetValue.php new file mode 100644 index 0000000..2bada9a --- /dev/null +++ b/src/Types/ChangeItemFormsSetValue.php @@ -0,0 +1,51 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsUpdate.php b/src/Types/ChangeItemFormsUpdate.php new file mode 100644 index 0000000..a819f5f --- /dev/null +++ b/src/Types/ChangeItemFormsUpdate.php @@ -0,0 +1,67 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var FormField $field + */ + #[JsonProperty('field')] + public FormField $field; + + /** + * @var array $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, + * skipped?: ?array, + * calculationOrder?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $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/ChangeItemFormsUpdateWidget.php b/src/Types/ChangeItemFormsUpdateWidget.php new file mode 100644 index 0000000..abeb6f4 --- /dev/null +++ b/src/Types/ChangeItemFormsUpdateWidget.php @@ -0,0 +1,59 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var WidgetAnnotation $widget + */ + #[JsonProperty('widget')] + public WidgetAnnotation $widget; + + /** + * @var ChangeItemFormsUpdateWidgetAppearance $appearance + */ + #[JsonProperty('appearance')] + public ChangeItemFormsUpdateWidgetAppearance $appearance; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * widget: WidgetAnnotation, + * appearance: ChangeItemFormsUpdateWidgetAppearance, + * meta: FormMutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $this->widget = $values['widget']; + $this->appearance = $values['appearance']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsUpdateWidgetAppearance.php b/src/Types/ChangeItemFormsUpdateWidgetAppearance.php new file mode 100644 index 0000000..65e4fee --- /dev/null +++ b/src/Types/ChangeItemFormsUpdateWidgetAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemFormsUpdateWidgetAppearanceAction.php b/src/Types/ChangeItemFormsUpdateWidgetAppearanceAction.php new file mode 100644 index 0000000..bf14f78 --- /dev/null +++ b/src/Types/ChangeItemFormsUpdateWidgetAppearanceAction.php @@ -0,0 +1,11 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var DocumentMetadata $metadata + */ + #[JsonProperty('metadata')] + public DocumentMetadata $metadata; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * metadata: DocumentMetadata, + * meta: MutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $this->metadata = $values['metadata']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemMetadataUpdateCustom.php b/src/Types/ChangeItemMetadataUpdateCustom.php new file mode 100644 index 0000000..8d290d7 --- /dev/null +++ b/src/Types/ChangeItemMetadataUpdateCustom.php @@ -0,0 +1,51 @@ + $skipped + */ + #[JsonProperty('skipped'), ArrayType(['string'])] + public ?array $skipped; + + /** + * @var array $custom + */ + #[JsonProperty('custom'), ArrayType(['string' => 'string'])] + public array $custom; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * custom: array, + * meta: MutationMeta, + * skipped?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->skipped = $values['skipped'] ?? null; + $this->custom = $values['custom']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemSkipped.php b/src/Types/ChangeItemSkipped.php new file mode 100644 index 0000000..175cea5 --- /dev/null +++ b/src/Types/ChangeItemSkipped.php @@ -0,0 +1,42 @@ + $op + */ + #[JsonProperty('op')] + public string $op; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * op: value-of, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->op = $values['op']; + $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 new file mode 100644 index 0000000..3dbd686 --- /dev/null +++ b/src/Types/ChangeItemSkippedOp.php @@ -0,0 +1,29 @@ +type = $values['type']; + $this->value = $values['value']; + } + + /** + * @param ChangeOpAnnotationsCreate $annotationsCreate + * @return ChangeOp + */ + public static function annotationsCreate(ChangeOpAnnotationsCreate $annotationsCreate): ChangeOp + { + return new ChangeOp([ + 'type' => 'annotations.create', + 'value' => $annotationsCreate, + ]); + } + + /** + * @param ChangeOpAnnotationsUpdate $annotationsUpdate + * @return ChangeOp + */ + public static function annotationsUpdate(ChangeOpAnnotationsUpdate $annotationsUpdate): ChangeOp + { + return new ChangeOp([ + 'type' => 'annotations.update', + 'value' => $annotationsUpdate, + ]); + } + + /** + * @param ChangeOpAnnotationsDelete $annotationsDelete + * @return ChangeOp + */ + public static function annotationsDelete(ChangeOpAnnotationsDelete $annotationsDelete): ChangeOp + { + return new ChangeOp([ + 'type' => 'annotations.delete', + 'value' => $annotationsDelete, + ]); + } + + /** + * @param ChangeOpAnnotationsReorder $annotationsReorder + * @return ChangeOp + */ + public static function annotationsReorder(ChangeOpAnnotationsReorder $annotationsReorder): ChangeOp + { + return new ChangeOp([ + 'type' => 'annotations.reorder', + 'value' => $annotationsReorder, + ]); + } + + /** + * @param ChangeOpFormsSetValue $formsSetValue + * @return ChangeOp + */ + public static function formsSetValue(ChangeOpFormsSetValue $formsSetValue): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.setValue', + 'value' => $formsSetValue, + ]); + } + + /** + * @param ChangeOpFormsSetDisplay $formsSetDisplay + * @return ChangeOp + */ + public static function formsSetDisplay(ChangeOpFormsSetDisplay $formsSetDisplay): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.setDisplay', + 'value' => $formsSetDisplay, + ]); + } + + /** + * @param ChangeOpFormsSetAppearanceText $formsSetAppearanceText + * @return ChangeOp + */ + public static function formsSetAppearanceText(ChangeOpFormsSetAppearanceText $formsSetAppearanceText): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.setAppearanceText', + 'value' => $formsSetAppearanceText, + ]); + } + + /** + * @param ChangeOpFormsReset $formsReset + * @return ChangeOp + */ + public static function formsReset(ChangeOpFormsReset $formsReset): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.reset', + 'value' => $formsReset, + ]); + } + + /** + * @param ChangeOpFormsCreate $formsCreate + * @return ChangeOp + */ + public static function formsCreate(ChangeOpFormsCreate $formsCreate): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.create', + 'value' => $formsCreate, + ]); + } + + /** + * @param ChangeOpFormsUpdate $formsUpdate + * @return ChangeOp + */ + public static function formsUpdate(ChangeOpFormsUpdate $formsUpdate): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.update', + 'value' => $formsUpdate, + ]); + } + + /** + * @param ChangeOpFormsDelete $formsDelete + * @return ChangeOp + */ + public static function formsDelete(ChangeOpFormsDelete $formsDelete): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.delete', + 'value' => $formsDelete, + ]); + } + + /** + * @param ChangeOpFormsAddWidget $formsAddWidget + * @return ChangeOp + */ + public static function formsAddWidget(ChangeOpFormsAddWidget $formsAddWidget): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.addWidget', + 'value' => $formsAddWidget, + ]); + } + + /** + * @param ChangeOpFormsRemoveWidget $formsRemoveWidget + * @return ChangeOp + */ + public static function formsRemoveWidget(ChangeOpFormsRemoveWidget $formsRemoveWidget): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.removeWidget', + 'value' => $formsRemoveWidget, + ]); + } + + /** + * @param ChangeOpFormsDeleteWidget $formsDeleteWidget + * @return ChangeOp + */ + public static function formsDeleteWidget(ChangeOpFormsDeleteWidget $formsDeleteWidget): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.deleteWidget', + 'value' => $formsDeleteWidget, + ]); + } + + /** + * @param ChangeOpFormsReorderCalculations $formsReorderCalculations + * @return ChangeOp + */ + public static function formsReorderCalculations(ChangeOpFormsReorderCalculations $formsReorderCalculations): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.reorderCalculations', + 'value' => $formsReorderCalculations, + ]); + } + + /** + * @param ChangeOpFormsReorderWidgets $formsReorderWidgets + * @return ChangeOp + */ + public static function formsReorderWidgets(ChangeOpFormsReorderWidgets $formsReorderWidgets): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.reorderWidgets', + 'value' => $formsReorderWidgets, + ]); + } + + /** + * @param ChangeOpFormsUpdateWidget $formsUpdateWidget + * @return ChangeOp + */ + public static function formsUpdateWidget(ChangeOpFormsUpdateWidget $formsUpdateWidget): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.updateWidget', + 'value' => $formsUpdateWidget, + ]); + } + + /** + * @param ChangeOpFormsSetSignatureAppearance $formsSetSignatureAppearance + * @return ChangeOp + */ + public static function formsSetSignatureAppearance(ChangeOpFormsSetSignatureAppearance $formsSetSignatureAppearance): ChangeOp + { + return new ChangeOp([ + 'type' => 'forms.setSignatureAppearance', + 'value' => $formsSetSignatureAppearance, + ]); + } + + /** + * @param ChangeOpMetadataUpdate $metadataUpdate + * @return ChangeOp + */ + public static function metadataUpdate(ChangeOpMetadataUpdate $metadataUpdate): ChangeOp + { + return new ChangeOp([ + 'type' => 'metadata.update', + 'value' => $metadataUpdate, + ]); + } + + /** + * @param ChangeOpMetadataUpdateCustom $metadataUpdateCustom + * @return ChangeOp + */ + public static function metadataUpdateCustom(ChangeOpMetadataUpdateCustom $metadataUpdateCustom): ChangeOp + { + return new ChangeOp([ + 'type' => 'metadata.updateCustom', + 'value' => $metadataUpdateCustom, + ]); + } + + /** + * @return bool + */ + public function isAnnotationsCreate(): bool + { + return $this->value instanceof ChangeOpAnnotationsCreate && $this->type === 'annotations.create'; + } + + /** + * @return ChangeOpAnnotationsCreate + */ + public function asAnnotationsCreate(): ChangeOpAnnotationsCreate + { + if (!($this->value instanceof ChangeOpAnnotationsCreate && $this->type === 'annotations.create')) { + throw new Exception( + "Expected annotations.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsUpdate(): bool + { + return $this->value instanceof ChangeOpAnnotationsUpdate && $this->type === 'annotations.update'; + } + + /** + * @return ChangeOpAnnotationsUpdate + */ + public function asAnnotationsUpdate(): ChangeOpAnnotationsUpdate + { + if (!($this->value instanceof ChangeOpAnnotationsUpdate && $this->type === 'annotations.update')) { + throw new Exception( + "Expected annotations.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsDelete(): bool + { + return $this->value instanceof ChangeOpAnnotationsDelete && $this->type === 'annotations.delete'; + } + + /** + * @return ChangeOpAnnotationsDelete + */ + public function asAnnotationsDelete(): ChangeOpAnnotationsDelete + { + if (!($this->value instanceof ChangeOpAnnotationsDelete && $this->type === 'annotations.delete')) { + throw new Exception( + "Expected annotations.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isAnnotationsReorder(): bool + { + return $this->value instanceof ChangeOpAnnotationsReorder && $this->type === 'annotations.reorder'; + } + + /** + * @return ChangeOpAnnotationsReorder + */ + public function asAnnotationsReorder(): ChangeOpAnnotationsReorder + { + if (!($this->value instanceof ChangeOpAnnotationsReorder && $this->type === 'annotations.reorder')) { + throw new Exception( + "Expected annotations.reorder; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetValue(): bool + { + return $this->value instanceof ChangeOpFormsSetValue && $this->type === 'forms.setValue'; + } + + /** + * @return ChangeOpFormsSetValue + */ + public function asFormsSetValue(): ChangeOpFormsSetValue + { + if (!($this->value instanceof ChangeOpFormsSetValue && $this->type === 'forms.setValue')) { + throw new Exception( + "Expected forms.setValue; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetDisplay(): bool + { + return $this->value instanceof ChangeOpFormsSetDisplay && $this->type === 'forms.setDisplay'; + } + + /** + * @return ChangeOpFormsSetDisplay + */ + public function asFormsSetDisplay(): ChangeOpFormsSetDisplay + { + if (!($this->value instanceof ChangeOpFormsSetDisplay && $this->type === 'forms.setDisplay')) { + throw new Exception( + "Expected forms.setDisplay; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetAppearanceText(): bool + { + return $this->value instanceof ChangeOpFormsSetAppearanceText && $this->type === 'forms.setAppearanceText'; + } + + /** + * @return ChangeOpFormsSetAppearanceText + */ + public function asFormsSetAppearanceText(): ChangeOpFormsSetAppearanceText + { + if (!($this->value instanceof ChangeOpFormsSetAppearanceText && $this->type === 'forms.setAppearanceText')) { + throw new Exception( + "Expected forms.setAppearanceText; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReset(): bool + { + return $this->value instanceof ChangeOpFormsReset && $this->type === 'forms.reset'; + } + + /** + * @return ChangeOpFormsReset + */ + public function asFormsReset(): ChangeOpFormsReset + { + if (!($this->value instanceof ChangeOpFormsReset && $this->type === 'forms.reset')) { + throw new Exception( + "Expected forms.reset; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsCreate(): bool + { + return $this->value instanceof ChangeOpFormsCreate && $this->type === 'forms.create'; + } + + /** + * @return ChangeOpFormsCreate + */ + public function asFormsCreate(): ChangeOpFormsCreate + { + if (!($this->value instanceof ChangeOpFormsCreate && $this->type === 'forms.create')) { + throw new Exception( + "Expected forms.create; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsUpdate(): bool + { + return $this->value instanceof ChangeOpFormsUpdate && $this->type === 'forms.update'; + } + + /** + * @return ChangeOpFormsUpdate + */ + public function asFormsUpdate(): ChangeOpFormsUpdate + { + if (!($this->value instanceof ChangeOpFormsUpdate && $this->type === 'forms.update')) { + throw new Exception( + "Expected forms.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsDelete(): bool + { + return $this->value instanceof ChangeOpFormsDelete && $this->type === 'forms.delete'; + } + + /** + * @return ChangeOpFormsDelete + */ + public function asFormsDelete(): ChangeOpFormsDelete + { + if (!($this->value instanceof ChangeOpFormsDelete && $this->type === 'forms.delete')) { + throw new Exception( + "Expected forms.delete; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsAddWidget(): bool + { + return $this->value instanceof ChangeOpFormsAddWidget && $this->type === 'forms.addWidget'; + } + + /** + * @return ChangeOpFormsAddWidget + */ + public function asFormsAddWidget(): ChangeOpFormsAddWidget + { + if (!($this->value instanceof ChangeOpFormsAddWidget && $this->type === 'forms.addWidget')) { + throw new Exception( + "Expected forms.addWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsRemoveWidget(): bool + { + return $this->value instanceof ChangeOpFormsRemoveWidget && $this->type === 'forms.removeWidget'; + } + + /** + * @return ChangeOpFormsRemoveWidget + */ + public function asFormsRemoveWidget(): ChangeOpFormsRemoveWidget + { + if (!($this->value instanceof ChangeOpFormsRemoveWidget && $this->type === 'forms.removeWidget')) { + throw new Exception( + "Expected forms.removeWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsDeleteWidget(): bool + { + return $this->value instanceof ChangeOpFormsDeleteWidget && $this->type === 'forms.deleteWidget'; + } + + /** + * @return ChangeOpFormsDeleteWidget + */ + public function asFormsDeleteWidget(): ChangeOpFormsDeleteWidget + { + if (!($this->value instanceof ChangeOpFormsDeleteWidget && $this->type === 'forms.deleteWidget')) { + throw new Exception( + "Expected forms.deleteWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReorderCalculations(): bool + { + return $this->value instanceof ChangeOpFormsReorderCalculations && $this->type === 'forms.reorderCalculations'; + } + + /** + * @return ChangeOpFormsReorderCalculations + */ + public function asFormsReorderCalculations(): ChangeOpFormsReorderCalculations + { + if (!($this->value instanceof ChangeOpFormsReorderCalculations && $this->type === 'forms.reorderCalculations')) { + throw new Exception( + "Expected forms.reorderCalculations; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsReorderWidgets(): bool + { + return $this->value instanceof ChangeOpFormsReorderWidgets && $this->type === 'forms.reorderWidgets'; + } + + /** + * @return ChangeOpFormsReorderWidgets + */ + public function asFormsReorderWidgets(): ChangeOpFormsReorderWidgets + { + if (!($this->value instanceof ChangeOpFormsReorderWidgets && $this->type === 'forms.reorderWidgets')) { + throw new Exception( + "Expected forms.reorderWidgets; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsUpdateWidget(): bool + { + return $this->value instanceof ChangeOpFormsUpdateWidget && $this->type === 'forms.updateWidget'; + } + + /** + * @return ChangeOpFormsUpdateWidget + */ + public function asFormsUpdateWidget(): ChangeOpFormsUpdateWidget + { + if (!($this->value instanceof ChangeOpFormsUpdateWidget && $this->type === 'forms.updateWidget')) { + throw new Exception( + "Expected forms.updateWidget; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFormsSetSignatureAppearance(): bool + { + return $this->value instanceof ChangeOpFormsSetSignatureAppearance && $this->type === 'forms.setSignatureAppearance'; + } + + /** + * @return ChangeOpFormsSetSignatureAppearance + */ + public function asFormsSetSignatureAppearance(): ChangeOpFormsSetSignatureAppearance + { + if (!($this->value instanceof ChangeOpFormsSetSignatureAppearance && $this->type === 'forms.setSignatureAppearance')) { + throw new Exception( + "Expected forms.setSignatureAppearance; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMetadataUpdate(): bool + { + return $this->value instanceof ChangeOpMetadataUpdate && $this->type === 'metadata.update'; + } + + /** + * @return ChangeOpMetadataUpdate + */ + public function asMetadataUpdate(): ChangeOpMetadataUpdate + { + if (!($this->value instanceof ChangeOpMetadataUpdate && $this->type === 'metadata.update')) { + throw new Exception( + "Expected metadata.update; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isMetadataUpdateCustom(): bool + { + return $this->value instanceof ChangeOpMetadataUpdateCustom && $this->type === 'metadata.updateCustom'; + } + + /** + * @return ChangeOpMetadataUpdateCustom + */ + public function asMetadataUpdateCustom(): ChangeOpMetadataUpdateCustom + { + if (!($this->value instanceof ChangeOpMetadataUpdateCustom && $this->type === 'metadata.updateCustom')) { + throw new Exception( + "Expected metadata.updateCustom; got " . $this->type . " 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['type'] = $this->type; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->type) { + case 'annotations.create': + $value = $this->asAnnotationsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.update': + $value = $this->asAnnotationsUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.delete': + $value = $this->asAnnotationsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'annotations.reorder': + $value = $this->asAnnotationsReorder()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setValue': + $value = $this->asFormsSetValue()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setDisplay': + $value = $this->asFormsSetDisplay()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setAppearanceText': + $value = $this->asFormsSetAppearanceText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reset': + $value = $this->asFormsReset()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.create': + $value = $this->asFormsCreate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.update': + $value = $this->asFormsUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.delete': + $value = $this->asFormsDelete()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.addWidget': + $value = $this->asFormsAddWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.removeWidget': + $value = $this->asFormsRemoveWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.deleteWidget': + $value = $this->asFormsDeleteWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reorderCalculations': + $value = $this->asFormsReorderCalculations()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.reorderWidgets': + $value = $this->asFormsReorderWidgets()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.updateWidget': + $value = $this->asFormsUpdateWidget()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'forms.setSignatureAppearance': + $value = $this->asFormsSetSignatureAppearance()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'metadata.update': + $value = $this->asMetadataUpdate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'metadata.updateCustom': + $value = $this->asMetadataUpdateCustom()->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('type', $data)) { + throw new Exception( + "JSON data is missing property 'type'", + ); + } + $type = $data['type']; + if (!(is_string($type))) { + throw new Exception( + "Expected property 'type' in JSON data to be string, instead received " . get_debug_type($data['type']), + ); + } + + $args['type'] = $type; + switch ($type) { + case 'annotations.create': + $args['value'] = ChangeOpAnnotationsCreate::jsonDeserialize($data); + break; + case 'annotations.update': + $args['value'] = ChangeOpAnnotationsUpdate::jsonDeserialize($data); + break; + case 'annotations.delete': + $args['value'] = ChangeOpAnnotationsDelete::jsonDeserialize($data); + break; + case 'annotations.reorder': + $args['value'] = ChangeOpAnnotationsReorder::jsonDeserialize($data); + break; + case 'forms.setValue': + $args['value'] = ChangeOpFormsSetValue::jsonDeserialize($data); + break; + case 'forms.setDisplay': + $args['value'] = ChangeOpFormsSetDisplay::jsonDeserialize($data); + break; + case 'forms.setAppearanceText': + $args['value'] = ChangeOpFormsSetAppearanceText::jsonDeserialize($data); + break; + case 'forms.reset': + $args['value'] = ChangeOpFormsReset::jsonDeserialize($data); + break; + case 'forms.create': + $args['value'] = ChangeOpFormsCreate::jsonDeserialize($data); + break; + case 'forms.update': + $args['value'] = ChangeOpFormsUpdate::jsonDeserialize($data); + break; + case 'forms.delete': + $args['value'] = ChangeOpFormsDelete::jsonDeserialize($data); + break; + case 'forms.addWidget': + $args['value'] = ChangeOpFormsAddWidget::jsonDeserialize($data); + break; + case 'forms.removeWidget': + $args['value'] = ChangeOpFormsRemoveWidget::jsonDeserialize($data); + break; + case 'forms.deleteWidget': + $args['value'] = ChangeOpFormsDeleteWidget::jsonDeserialize($data); + break; + case 'forms.reorderCalculations': + $args['value'] = ChangeOpFormsReorderCalculations::jsonDeserialize($data); + break; + case 'forms.reorderWidgets': + $args['value'] = ChangeOpFormsReorderWidgets::jsonDeserialize($data); + break; + case 'forms.updateWidget': + $args['value'] = ChangeOpFormsUpdateWidget::jsonDeserialize($data); + break; + case 'forms.setSignatureAppearance': + $args['value'] = ChangeOpFormsSetSignatureAppearance::jsonDeserialize($data); + break; + case 'metadata.update': + $args['value'] = ChangeOpMetadataUpdate::jsonDeserialize($data); + break; + case 'metadata.updateCustom': + $args['value'] = ChangeOpMetadataUpdateCustom::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['type'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/ChangeOpAnnotationsCreate.php b/src/Types/ChangeOpAnnotationsCreate.php new file mode 100644 index 0000000..7798b7b --- /dev/null +++ b/src/Types/ChangeOpAnnotationsCreate.php @@ -0,0 +1,58 @@ +page = $values['page']; + $this->data = $values['data']; + $this->objectNumber = $values['objectNumber'] ?? null; + $this->resources = $values['resources'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAnnotationsCreateResources.php b/src/Types/ChangeOpAnnotationsCreateResources.php new file mode 100644 index 0000000..803532f --- /dev/null +++ b/src/Types/ChangeOpAnnotationsCreateResources.php @@ -0,0 +1,42 @@ +appearance = $values['appearance'] ?? null; + $this->file = $values['file'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAnnotationsDelete.php b/src/Types/ChangeOpAnnotationsDelete.php new file mode 100644 index 0000000..b59520d --- /dev/null +++ b/src/Types/ChangeOpAnnotationsDelete.php @@ -0,0 +1,42 @@ +ref = $values['ref']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAnnotationsReorder.php b/src/Types/ChangeOpAnnotationsReorder.php new file mode 100644 index 0000000..13a1fe3 --- /dev/null +++ b/src/Types/ChangeOpAnnotationsReorder.php @@ -0,0 +1,58 @@ + $refs + */ + #[JsonProperty('refs'), ArrayType([AnnotationRef::class])] + public array $refs; + + /** + * @var ( + * value-of + * |AnnotationPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', AnnotationPositionAfter::class)] + public string|AnnotationPositionAfter $position; + + /** + * @param array{ + * page: PageRef, + * refs: array, + * position: ( + * value-of + * |AnnotationPositionAfter + * ), + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->refs = $values['refs']; + $this->position = $values['position']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAnnotationsUpdate.php b/src/Types/ChangeOpAnnotationsUpdate.php new file mode 100644 index 0000000..1bb8d06 --- /dev/null +++ b/src/Types/ChangeOpAnnotationsUpdate.php @@ -0,0 +1,58 @@ +ref = $values['ref']; + $this->patch = $values['patch']; + $this->resources = $values['resources'] ?? null; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpAnnotationsUpdateResources.php b/src/Types/ChangeOpAnnotationsUpdateResources.php new file mode 100644 index 0000000..90b8bc2 --- /dev/null +++ b/src/Types/ChangeOpAnnotationsUpdateResources.php @@ -0,0 +1,42 @@ +appearance = $values['appearance'] ?? null; + $this->file = $values['file'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsAddWidget.php b/src/Types/ChangeOpFormsAddWidget.php new file mode 100644 index 0000000..6932cb9 --- /dev/null +++ b/src/Types/ChangeOpFormsAddWidget.php @@ -0,0 +1,58 @@ +field = $values['field']; + $this->placement = $values['placement']; + $this->objectNumber = $values['objectNumber'] ?? null; + $this->splitObjectNumber = $values['splitObjectNumber'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsCreate.php b/src/Types/ChangeOpFormsCreate.php new file mode 100644 index 0000000..cd2f898 --- /dev/null +++ b/src/Types/ChangeOpFormsCreate.php @@ -0,0 +1,51 @@ + $widgetObjectNumbers + */ + #[JsonProperty('widgetObjectNumbers'), ArrayType(['integer'])] + public ?array $widgetObjectNumbers; + + /** + * @param array{ + * draft: FormFieldDraft, + * objectNumber?: ?int, + * widgetObjectNumbers?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->draft = $values['draft']; + $this->objectNumber = $values['objectNumber'] ?? null; + $this->widgetObjectNumbers = $values['widgetObjectNumbers'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsDelete.php b/src/Types/ChangeOpFormsDelete.php new file mode 100644 index 0000000..c2bf305 --- /dev/null +++ b/src/Types/ChangeOpFormsDelete.php @@ -0,0 +1,42 @@ +field = $values['field']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsDeleteWidget.php b/src/Types/ChangeOpFormsDeleteWidget.php new file mode 100644 index 0000000..e7ea48c --- /dev/null +++ b/src/Types/ChangeOpFormsDeleteWidget.php @@ -0,0 +1,42 @@ +widget = $values['widget']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsRemoveWidget.php b/src/Types/ChangeOpFormsRemoveWidget.php new file mode 100644 index 0000000..0e70d3d --- /dev/null +++ b/src/Types/ChangeOpFormsRemoveWidget.php @@ -0,0 +1,42 @@ +field = $values['field']; + $this->widget = $values['widget']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsReorderCalculations.php b/src/Types/ChangeOpFormsReorderCalculations.php new file mode 100644 index 0000000..c0aaa57 --- /dev/null +++ b/src/Types/ChangeOpFormsReorderCalculations.php @@ -0,0 +1,50 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([FormFieldRef::class])] + public array $fields; + + /** + * @var ( + * value-of + * |FieldPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', FieldPositionAfter::class)] + public string|FieldPositionAfter $position; + + /** + * @param array{ + * fields: array, + * position: ( + * value-of + * |FieldPositionAfter + * ), + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->position = $values['position']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsReorderWidgets.php b/src/Types/ChangeOpFormsReorderWidgets.php new file mode 100644 index 0000000..6814d78 --- /dev/null +++ b/src/Types/ChangeOpFormsReorderWidgets.php @@ -0,0 +1,58 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([AnnotationRef::class])] + public array $widgets; + + /** + * @var ( + * value-of + * |AnnotationPositionAfter + * ) $position + */ + #[JsonProperty('position'), Union('string', AnnotationPositionAfter::class)] + public string|AnnotationPositionAfter $position; + + /** + * @param array{ + * page: PageRef, + * widgets: array, + * position: ( + * value-of + * |AnnotationPositionAfter + * ), + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->widgets = $values['widgets']; + $this->position = $values['position']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsReset.php b/src/Types/ChangeOpFormsReset.php new file mode 100644 index 0000000..499e543 --- /dev/null +++ b/src/Types/ChangeOpFormsReset.php @@ -0,0 +1,35 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([FormFieldRef::class])] + public ?array $fields; + + /** + * @param array{ + * fields?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->fields = $values['fields'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetAppearanceText.php b/src/Types/ChangeOpFormsSetAppearanceText.php new file mode 100644 index 0000000..0d72890 --- /dev/null +++ b/src/Types/ChangeOpFormsSetAppearanceText.php @@ -0,0 +1,42 @@ +field = $values['field']; + $this->text = $values['text']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetDisplay.php b/src/Types/ChangeOpFormsSetDisplay.php new file mode 100644 index 0000000..f09bc16 --- /dev/null +++ b/src/Types/ChangeOpFormsSetDisplay.php @@ -0,0 +1,42 @@ + $display + */ + #[JsonProperty('display')] + public string $display; + + /** + * @param array{ + * field: FormFieldRef, + * display: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->display = $values['display']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetDisplayDisplay.php b/src/Types/ChangeOpFormsSetDisplayDisplay.php new file mode 100644 index 0000000..e12d3a0 --- /dev/null +++ b/src/Types/ChangeOpFormsSetDisplayDisplay.php @@ -0,0 +1,11 @@ +field = $values['field']; + $this->resources = $values['resources']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetSignatureAppearanceResources.php b/src/Types/ChangeOpFormsSetSignatureAppearanceResources.php new file mode 100644 index 0000000..0dedf75 --- /dev/null +++ b/src/Types/ChangeOpFormsSetSignatureAppearanceResources.php @@ -0,0 +1,34 @@ +appearance = $values['appearance']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsSetValue.php b/src/Types/ChangeOpFormsSetValue.php new file mode 100644 index 0000000..e62453e --- /dev/null +++ b/src/Types/ChangeOpFormsSetValue.php @@ -0,0 +1,50 @@ +field = $values['field']; + $this->value = $values['value']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsUpdate.php b/src/Types/ChangeOpFormsUpdate.php new file mode 100644 index 0000000..625d1d6 --- /dev/null +++ b/src/Types/ChangeOpFormsUpdate.php @@ -0,0 +1,50 @@ +field = $values['field']; + $this->patch = $values['patch']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpFormsUpdateWidget.php b/src/Types/ChangeOpFormsUpdateWidget.php new file mode 100644 index 0000000..dae6519 --- /dev/null +++ b/src/Types/ChangeOpFormsUpdateWidget.php @@ -0,0 +1,50 @@ +widget = $values['widget']; + $this->patch = $values['patch']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpMetadataUpdate.php b/src/Types/ChangeOpMetadataUpdate.php new file mode 100644 index 0000000..1aa0129 --- /dev/null +++ b/src/Types/ChangeOpMetadataUpdate.php @@ -0,0 +1,42 @@ +patch = $values['patch']; + $this->expect = $values['expect'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpMetadataUpdateCustom.php b/src/Types/ChangeOpMetadataUpdateCustom.php new file mode 100644 index 0000000..594035f --- /dev/null +++ b/src/Types/ChangeOpMetadataUpdateCustom.php @@ -0,0 +1,36 @@ + $patch + */ + #[JsonProperty('patch'), ArrayType(['string' => new Union('string', 'null')])] + public array $patch; + + /** + * @param array{ + * patch: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->patch = $values['patch']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeResult.php b/src/Types/ChangeResult.php new file mode 100644 index 0000000..c9be511 --- /dev/null +++ b/src/Types/ChangeResult.php @@ -0,0 +1,43 @@ + $items + */ + #[JsonProperty('items'), ArrayType([ChangeItem::class])] + public array $items; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * items: array, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->items = $values['items']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsCreate200Response.php b/src/Types/DocAnnotationsCreate200Response.php index e86555c..e3df4b6 100644 --- a/src/Types/DocAnnotationsCreate200Response.php +++ b/src/Types/DocAnnotationsCreate200Response.php @@ -8,19 +8,27 @@ class DocAnnotationsCreate200Response extends JsonSerializableType { /** - * @var DocAnnotationsCreate200ResponseMeta $meta + * @var Annotation $annotation + */ + #[JsonProperty('annotation')] + public Annotation $annotation; + + /** + * @var AnnotationMutationMeta $meta */ #[JsonProperty('meta')] - public DocAnnotationsCreate200ResponseMeta $meta; + public AnnotationMutationMeta $meta; /** * @param array{ - * meta: DocAnnotationsCreate200ResponseMeta, + * annotation: Annotation, + * meta: AnnotationMutationMeta, * } $values */ public function __construct( array $values, ) { + $this->annotation = $values['annotation']; $this->meta = $values['meta']; } diff --git a/src/Types/DocAnnotationsCreate200ResponseMeta.php b/src/Types/DocAnnotationsCreate200ResponseMeta.php deleted file mode 100644 index d6deaad..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocAnnotationsCreate200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocAnnotationsCreate200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocAnnotationsCreate200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocAnnotationsCreate200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItem.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index bdd0659..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index f0d9e5d..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 3431352..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 3b6666d..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 2cefa61..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php deleted file mode 100644 index a892012..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 2767ce1..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 1fd6fbe..0000000 --- a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate400Response.php b/src/Types/DocAnnotationsCreate400Response.php deleted file mode 100644 index 7bc663e..0000000 --- a/src/Types/DocAnnotationsCreate400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate400ResponseCode.php b/src/Types/DocAnnotationsCreate400ResponseCode.php deleted file mode 100644 index 69bcfee..0000000 --- a/src/Types/DocAnnotationsCreate400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreate404ResponseCode.php b/src/Types/DocAnnotationsCreate404ResponseCode.php deleted file mode 100644 index 17c06c5..0000000 --- a/src/Types/DocAnnotationsCreate404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocAnnotationsDelete200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocAnnotationsDelete200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocAnnotationsDelete200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocAnnotationsDelete200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItem.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 16ec236..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index c0b4b64..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 5ecaeb5..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 640ab7a..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index a9d8ea1..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php deleted file mode 100644 index 5094b35..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 03c0394..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 7711657..0000000 --- a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete404Response.php b/src/Types/DocAnnotationsDelete404Response.php deleted file mode 100644 index 58abf5a..0000000 --- a/src/Types/DocAnnotationsDelete404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDelete404ResponseCode.php b/src/Types/DocAnnotationsDelete404ResponseCode.php deleted file mode 100644 index 5e9c989..0000000 --- a/src/Types/DocAnnotationsDelete404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsExportAppearance400ResponseCode.php b/src/Types/DocAnnotationsExportAppearance400ResponseCode.php deleted file mode 100644 index 66b819b..0000000 --- a/src/Types/DocAnnotationsExportAppearance400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsExportAppearance404ResponseCode.php b/src/Types/DocAnnotationsExportAppearance404ResponseCode.php deleted file mode 100644 index 4b9af57..0000000 --- a/src/Types/DocAnnotationsExportAppearance404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $usage + */ + #[JsonProperty('usage')] + public string $usage; + + /** + * @var array $results + */ + #[JsonProperty('results'), ArrayType([DocAnnotationsFlatten200ResponseResultsItem::class])] + public array $results; + + /** + * @var MutationMeta $meta */ #[JsonProperty('meta')] - public DocAnnotationsFlatten200ResponseMeta $meta; + public MutationMeta $meta; /** * @param array{ - * meta: DocAnnotationsFlatten200ResponseMeta, + * page: PageRef, + * usage: value-of, + * results: array, + * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->page = $values['page']; + $this->usage = $values['usage']; + $this->results = $values['results']; $this->meta = $values['meta']; } diff --git a/src/Types/DocAnnotationsFlatten200ResponseMeta.php b/src/Types/DocAnnotationsFlatten200ResponseMeta.php deleted file mode 100644 index dc13f50..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocAnnotationsFlatten200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocAnnotationsFlatten200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocAnnotationsFlatten200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocAnnotationsFlatten200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItem.php b/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 73e01bd..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index f87c2e9..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index a94feb2..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index af6ef8d..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 4caa93c..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.php deleted file mode 100644 index 001769c..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index e238ebb..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index f67f17c..0000000 --- a/src/Types/DocAnnotationsFlatten200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php b/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php new file mode 100644 index 0000000..0e30b7d --- /dev/null +++ b/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php @@ -0,0 +1,42 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * ref: AnnotationRef, + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php b/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php new file mode 100644 index 0000000..0a320ef --- /dev/null +++ b/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php @@ -0,0 +1,9 @@ + $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten400ResponseCode.php b/src/Types/DocAnnotationsFlatten400ResponseCode.php deleted file mode 100644 index 0a6f81c..0000000 --- a/src/Types/DocAnnotationsFlatten400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten404ResponseCode.php b/src/Types/DocAnnotationsFlatten404ResponseCode.php deleted file mode 100644 index 6f175ce..0000000 --- a/src/Types/DocAnnotationsFlatten404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $annotations - */ - #[JsonProperty('annotations'), ArrayType([DocAnnotationsList200ResponseAnnotationsItem::class])] - public array $annotations; - - /** - * @param array{ - * pageState: DocAnnotationsList200ResponsePageState, - * annotations: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageState = $values['pageState']; - $this->annotations = $values['annotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItem.php deleted file mode 100644 index 5b0ee1e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItem.php +++ /dev/null @@ -1,961 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlight $highlight - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function highlight(DocAnnotationsList200ResponseAnnotationsItemHighlight $highlight): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'highlight', - 'value' => $highlight, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderline $underline - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function underline(DocAnnotationsList200ResponseAnnotationsItemUnderline $underline): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'underline', - 'value' => $underline, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquiggly $squiggly - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function squiggly(DocAnnotationsList200ResponseAnnotationsItemSquiggly $squiggly): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'squiggly', - 'value' => $squiggly, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeout $strikeout - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function strikeout(DocAnnotationsList200ResponseAnnotationsItemStrikeout $strikeout): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'strikeout', - 'value' => $strikeout, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircle $circle - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function circle(DocAnnotationsList200ResponseAnnotationsItemCircle $circle): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'circle', - 'value' => $circle, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquare $square - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function square(DocAnnotationsList200ResponseAnnotationsItemSquare $square): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'square', - 'value' => $square, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygon $polygon - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function polygon(DocAnnotationsList200ResponseAnnotationsItemPolygon $polygon): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'polygon', - 'value' => $polygon, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolyline $polyline - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function polyline(DocAnnotationsList200ResponseAnnotationsItemPolyline $polyline): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'polyline', - 'value' => $polyline, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLine $line - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function line(DocAnnotationsList200ResponseAnnotationsItemLine $line): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'line', - 'value' => $line, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLink $link - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function link(DocAnnotationsList200ResponseAnnotationsItemLink $link): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'link', - 'value' => $link, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInk $ink - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function ink(DocAnnotationsList200ResponseAnnotationsItemInk $ink): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'ink', - 'value' => $ink, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeText $freeText - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function freeText(DocAnnotationsList200ResponseAnnotationsItemFreeText $freeText): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'free-text', - 'value' => $freeText, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaret $caret - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function caret(DocAnnotationsList200ResponseAnnotationsItemCaret $caret): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'caret', - 'value' => $caret, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemText $text - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function text(DocAnnotationsList200ResponseAnnotationsItemText $text): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'text', - 'value' => $text, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStamp $stamp - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function stamp(DocAnnotationsList200ResponseAnnotationsItemStamp $stamp): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'stamp', - 'value' => $stamp, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachment $fileAttachment - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function fileAttachment(DocAnnotationsList200ResponseAnnotationsItemFileAttachment $fileAttachment): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'file-attachment', - 'value' => $fileAttachment, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidget $widget - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function widget(DocAnnotationsList200ResponseAnnotationsItemWidget $widget): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'widget', - 'value' => $widget, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedact $redact - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function redact(DocAnnotationsList200ResponseAnnotationsItemRedact $redact): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'redact', - 'value' => $redact, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupported $unsupported - * @return DocAnnotationsList200ResponseAnnotationsItem - */ - public static function unsupported(DocAnnotationsList200ResponseAnnotationsItemUnsupported $unsupported): DocAnnotationsList200ResponseAnnotationsItem - { - return new DocAnnotationsList200ResponseAnnotationsItem([ - 'subtype' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isHighlight(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlight && $this->subtype === 'highlight'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlight - */ - public function asHighlight(): DocAnnotationsList200ResponseAnnotationsItemHighlight - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlight && $this->subtype === 'highlight')) { - throw new Exception( - "Expected highlight; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnderline(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderline && $this->subtype === 'underline'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderline - */ - public function asUnderline(): DocAnnotationsList200ResponseAnnotationsItemUnderline - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderline && $this->subtype === 'underline')) { - throw new Exception( - "Expected underline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isSquiggly(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquiggly && $this->subtype === 'squiggly'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquiggly - */ - public function asSquiggly(): DocAnnotationsList200ResponseAnnotationsItemSquiggly - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquiggly && $this->subtype === 'squiggly')) { - throw new Exception( - "Expected squiggly; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isStrikeout(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeout && $this->subtype === 'strikeout'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeout - */ - public function asStrikeout(): DocAnnotationsList200ResponseAnnotationsItemStrikeout - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeout && $this->subtype === 'strikeout')) { - throw new Exception( - "Expected strikeout; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCircle(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircle && $this->subtype === 'circle'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircle - */ - public function asCircle(): DocAnnotationsList200ResponseAnnotationsItemCircle - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircle && $this->subtype === 'circle')) { - throw new Exception( - "Expected circle; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isSquare(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquare && $this->subtype === 'square'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquare - */ - public function asSquare(): DocAnnotationsList200ResponseAnnotationsItemSquare - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquare && $this->subtype === 'square')) { - throw new Exception( - "Expected square; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPolygon(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygon && $this->subtype === 'polygon'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygon - */ - public function asPolygon(): DocAnnotationsList200ResponseAnnotationsItemPolygon - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygon && $this->subtype === 'polygon')) { - throw new Exception( - "Expected polygon; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPolyline(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolyline && $this->subtype === 'polyline'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolyline - */ - public function asPolyline(): DocAnnotationsList200ResponseAnnotationsItemPolyline - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolyline && $this->subtype === 'polyline')) { - throw new Exception( - "Expected polyline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLine(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLine && $this->subtype === 'line'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLine - */ - public function asLine(): DocAnnotationsList200ResponseAnnotationsItemLine - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLine && $this->subtype === 'line')) { - throw new Exception( - "Expected line; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLink(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLink && $this->subtype === 'link'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLink - */ - public function asLink(): DocAnnotationsList200ResponseAnnotationsItemLink - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLink && $this->subtype === 'link')) { - throw new Exception( - "Expected link; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isInk(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInk && $this->subtype === 'ink'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInk - */ - public function asInk(): DocAnnotationsList200ResponseAnnotationsItemInk - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInk && $this->subtype === 'ink')) { - throw new Exception( - "Expected ink; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFreeText(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeText && $this->subtype === 'free-text'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeText - */ - public function asFreeText(): DocAnnotationsList200ResponseAnnotationsItemFreeText - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeText && $this->subtype === 'free-text')) { - throw new Exception( - "Expected free-text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCaret(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaret && $this->subtype === 'caret'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaret - */ - public function asCaret(): DocAnnotationsList200ResponseAnnotationsItemCaret - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaret && $this->subtype === 'caret')) { - throw new Exception( - "Expected caret; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isText(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemText && $this->subtype === 'text'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemText - */ - public function asText(): DocAnnotationsList200ResponseAnnotationsItemText - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemText && $this->subtype === 'text')) { - throw new Exception( - "Expected text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isStamp(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStamp && $this->subtype === 'stamp'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStamp - */ - public function asStamp(): DocAnnotationsList200ResponseAnnotationsItemStamp - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStamp && $this->subtype === 'stamp')) { - throw new Exception( - "Expected stamp; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFileAttachment(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachment && $this->subtype === 'file-attachment'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachment - */ - public function asFileAttachment(): DocAnnotationsList200ResponseAnnotationsItemFileAttachment - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachment && $this->subtype === 'file-attachment')) { - throw new Exception( - "Expected file-attachment; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isWidget(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidget && $this->subtype === 'widget'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidget - */ - public function asWidget(): DocAnnotationsList200ResponseAnnotationsItemWidget - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidget && $this->subtype === 'widget')) { - throw new Exception( - "Expected widget; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isRedact(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedact && $this->subtype === 'redact'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedact - */ - public function asRedact(): DocAnnotationsList200ResponseAnnotationsItemRedact - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedact && $this->subtype === 'redact')) { - throw new Exception( - "Expected redact; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupported && $this->subtype === 'unsupported'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupported - */ - public function asUnsupported(): DocAnnotationsList200ResponseAnnotationsItemUnsupported - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupported && $this->subtype === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'highlight': - $value = $this->asHighlight()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'underline': - $value = $this->asUnderline()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'squiggly': - $value = $this->asSquiggly()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'strikeout': - $value = $this->asStrikeout()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'circle': - $value = $this->asCircle()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'square': - $value = $this->asSquare()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'polygon': - $value = $this->asPolygon()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'polyline': - $value = $this->asPolyline()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'line': - $value = $this->asLine()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'link': - $value = $this->asLink()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'ink': - $value = $this->asInk()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'free-text': - $value = $this->asFreeText()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'caret': - $value = $this->asCaret()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'text': - $value = $this->asText()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'stamp': - $value = $this->asStamp()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'file-attachment': - $value = $this->asFileAttachment()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'widget': - $value = $this->asWidget()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'redact': - $value = $this->asRedact()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'highlight': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlight::jsonDeserialize($data); - break; - case 'underline': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderline::jsonDeserialize($data); - break; - case 'squiggly': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquiggly::jsonDeserialize($data); - break; - case 'strikeout': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeout::jsonDeserialize($data); - break; - case 'circle': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircle::jsonDeserialize($data); - break; - case 'square': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquare::jsonDeserialize($data); - break; - case 'polygon': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygon::jsonDeserialize($data); - break; - case 'polyline': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolyline::jsonDeserialize($data); - break; - case 'line': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLine::jsonDeserialize($data); - break; - case 'link': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLink::jsonDeserialize($data); - break; - case 'ink': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInk::jsonDeserialize($data); - break; - case 'free-text': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeText::jsonDeserialize($data); - break; - case 'caret': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaret::jsonDeserialize($data); - break; - case 'text': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemText::jsonDeserialize($data); - break; - case 'stamp': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStamp::jsonDeserialize($data); - break; - case 'file-attachment': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachment::jsonDeserialize($data); - break; - case 'widget': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidget::jsonDeserialize($data); - break; - case 'redact': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedact::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaret.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaret.php deleted file mode 100644 index 7c042b0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaret.php +++ /dev/null @@ -1,236 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCaretFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemCaretFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCaretRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemCaretRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCaretColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemCaretColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCaretUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsList200ResponseAnnotationsItemCaretUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemCaretRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemCaretFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemCaretRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemCaretColor, - * opacity: float, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * intent?: ?value-of, - * rectDifferences?: ?DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsList200ResponseAnnotationsItemCaretUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->intent = $values['intent'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretBlendMode.php deleted file mode 100644 index d651a29..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretFlags.php deleted file mode 100644 index f0c5c6c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIdentityQuality.php deleted file mode 100644 index f2ab7d2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex.php deleted file mode 100644 index a3f1a52..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndexRevision.php deleted file mode 100644 index e3bbcc2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm.php deleted file mode 100644 index 3b21f4c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber.php deleted file mode 100644 index 0ea0514..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIntent.php deleted file mode 100644 index 8511c73..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIntent.php +++ /dev/null @@ -1,8 +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/DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences.php deleted file mode 100644 index 7e17af8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRef.php deleted file mode 100644 index 043aa3c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemCaretRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemCaretRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemCaretRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemCaretRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCaretRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemCaretRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex.php deleted file mode 100644 index 9201aa0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndexRevision.php deleted file mode 100644 index da3a95e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefNm.php deleted file mode 100644 index db630d5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber.php deleted file mode 100644 index 44dd3f5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretReplyType.php deleted file mode 100644 index 15fa976..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsList200ResponseAnnotationsItemCircle.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircle.php deleted file mode 100644 index 5549b89..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircle.php +++ /dev/null @@ -1,269 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCircleFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemCircleFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCircleRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemCircleRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemCircleColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemCircleColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor $interiorColor; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemCircleUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsList200ResponseAnnotationsItemCircleUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemCircleRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemCircleFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemCircleRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemCircleColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor, - * cloudyIntensity?: ?float, - * rectDifferences?: ?DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsList200ResponseAnnotationsItemCircleUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleBlendMode.php deleted file mode 100644 index e56d022..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleFlags.php deleted file mode 100644 index 9e77170..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleIdentityQuality.php deleted file mode 100644 index 054da36..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex.php deleted file mode 100644 index a144da3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndexRevision.php deleted file mode 100644 index 3462955..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm.php deleted file mode 100644 index e027a55..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber.php deleted file mode 100644 index 5db14f0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor.php deleted file mode 100644 index dc04c90..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRect.php deleted file mode 100644 index 437baa4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRect.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/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php deleted file mode 100644 index 11599df..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRef.php deleted file mode 100644 index a37ff81..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemCircleRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemCircleRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemCircleRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemCircleRef - { - return new DocAnnotationsList200ResponseAnnotationsItemCircleRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemCircleRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex.php deleted file mode 100644 index 23ae397..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndexRevision.php deleted file mode 100644 index 525ee21..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefNm.php deleted file mode 100644 index 4450b9a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber.php deleted file mode 100644 index 4e5f0e6..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleReplyType.php deleted file mode 100644 index 4ce74b0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsList200ResponseAnnotationsItemFileAttachment.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachment.php deleted file mode 100644 index 0dda0f9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachment.php +++ /dev/null @@ -1,220 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFileAttachmentColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemFileAttachmentColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var value-of $icon - */ - #[JsonProperty('icon')] - public string $icon; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile $file - */ - #[JsonProperty('file')] - public DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile $file; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemFileAttachmentColor, - * opacity: float, - * icon: value-of, - * file: DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->icon = $values['icon']; - $this->file = $values['file']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentBlendMode.php deleted file mode 100644 index e3e86de..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile.php deleted file mode 100644 index 8661d6c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile.php +++ /dev/null @@ -1,74 +0,0 @@ -name = $values['name']; - $this->mimeType = $values['mimeType'] ?? null; - $this->description = $values['description'] ?? null; - $this->size = $values['size'] ?? null; - $this->checksum = $values['checksum'] ?? null; - $this->creationDate = $values['creationDate'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags.php deleted file mode 100644 index 9b1e779..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentIcon.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentIcon.php deleted file mode 100644 index 261c38f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentIcon.php +++ /dev/null @@ -1,11 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex.php deleted file mode 100644 index cee3d83..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndexRevision.php deleted file mode 100644 index 8359f36..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm.php deleted file mode 100644 index 81a4d34..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber.php deleted file mode 100644 index dbb2242..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect.php deleted file mode 100644 index ebbb3f0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect.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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php deleted file mode 100644 index b6ed7bb..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex.php deleted file mode 100644 index 9d46f76..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndexRevision.php deleted file mode 100644 index c59de80..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm.php deleted file mode 100644 index 31063d0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber.php deleted file mode 100644 index a01e64a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentReplyType.php deleted file mode 100644 index 706c90b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFreeTextRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemFreeTextRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var value-of $intent - */ - #[JsonProperty('intent')] - public string $intent; - - /** - * @var string $fontFamily - */ - #[JsonProperty('fontFamily')] - public string $fontFamily; - - /** - * @var float $fontSize - */ - #[JsonProperty('fontSize')] - public float $fontSize; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText $richText - */ - #[JsonProperty('richText')] - public DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText $richText; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemFreeTextColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemFreeTextColor $color; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor $fontColor; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInteriorColor $interiorColor; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences $rectDifferences; - - /** - * @var ?array $calloutLine - */ - #[JsonProperty('calloutLine'), ArrayType(['mixed'])] - public ?array $calloutLine; - - /** - * @var ?value-of $lineEnding - */ - #[JsonProperty('lineEnding')] - public ?string $lineEnding; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemFreeTextRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemFreeTextRect, - * blendMode: value-of, - * intent: value-of, - * fontFamily: string, - * fontSize: float, - * textAlign: value-of, - * richText: DocAnnotationsList200ResponseAnnotationsItemFreeTextRichText, - * color: DocAnnotationsList200ResponseAnnotationsItemFreeTextColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * fontColor?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInteriorColor, - * dashArray?: ?array, - * rectDifferences?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences, - * calloutLine?: ?array, - * lineEnding?: ?value-of, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->intent = $values['intent']; - $this->fontFamily = $values['fontFamily']; - $this->fontSize = $values['fontSize']; - $this->textAlign = $values['textAlign']; - $this->richText = $values['richText']; - $this->color = $values['color']; - $this->fontColor = $values['fontColor'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->calloutLine = $values['calloutLine'] ?? null; - $this->lineEnding = $values['lineEnding'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextBlendMode.php deleted file mode 100644 index a717f96..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags.php deleted file mode 100644 index b724c5c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor.php deleted file mode 100644 index 71377b4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIdentityQuality.php deleted file mode 100644 index 3dd70c0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex.php deleted file mode 100644 index a9eb7fc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndexRevision.php deleted file mode 100644 index a1241a0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm.php deleted file mode 100644 index a128a8d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber.php deleted file mode 100644 index ad92d12..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIntent.php deleted file mode 100644 index 1b5d990..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextLineEnding.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextLineEnding.php deleted file mode 100644 index 0669717..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextLineEnding.php +++ /dev/null @@ -1,17 +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/DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences.php deleted file mode 100644 index a0d632d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRef.php deleted file mode 100644 index 1b316b9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemFreeTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemFreeTextRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex.php deleted file mode 100644 index dafd0ee..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndexRevision.php deleted file mode 100644 index 9fa6a84..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm.php deleted file mode 100644 index 712b0ff..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber.php deleted file mode 100644 index 24ce734..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextReplyType.php deleted file mode 100644 index abd8755..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $paragraphs - */ - #[JsonProperty('paragraphs'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItem::class])] - public array $paragraphs; - - /** - * @param array{ - * body: DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody, - * paragraphs: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->body = $values['body']; - $this->paragraphs = $values['paragraphs']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.php deleted file mode 100644 index 4bf021e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBody.php +++ /dev/null @@ -1,147 +0,0 @@ -> $decoration - */ - #[JsonProperty('decoration'), ArrayType(['string'])] - public array $decoration; - - /** - * @var value-of $script - */ - #[JsonProperty('script')] - public string $script; - - /** - * @var float $letterSpacing - */ - #[JsonProperty('letterSpacing')] - public float $letterSpacing; - - /** - * @var float $horizontalScale - */ - #[JsonProperty('horizontalScale')] - public float $horizontalScale; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @var value-of $align - */ - #[JsonProperty('align')] - public string $align; - - /** - * @var value-of $dir - */ - #[JsonProperty('dir')] - public string $dir; - - /** - * @var ?float $lineHeight - */ - #[JsonProperty('lineHeight')] - public ?float $lineHeight; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins $margins - */ - #[JsonProperty('margins')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins $margins; - - /** - * @var ?float $textIndent - */ - #[JsonProperty('textIndent')] - public ?float $textIndent; - - /** - * @param array{ - * family: string, - * weight: int, - * italic: bool, - * size: float, - * color: string, - * decoration: array>, - * script: value-of, - * letterSpacing: float, - * horizontalScale: float, - * align: value-of, - * dir: value-of, - * unknown?: ?string, - * lineHeight?: ?float, - * margins?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyMargins, - * textIndent?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->family = $values['family']; - $this->weight = $values['weight']; - $this->italic = $values['italic']; - $this->size = $values['size']; - $this->color = $values['color']; - $this->decoration = $values['decoration']; - $this->script = $values['script']; - $this->letterSpacing = $values['letterSpacing']; - $this->horizontalScale = $values['horizontalScale']; - $this->unknown = $values['unknown'] ?? null; - $this->align = $values['align']; - $this->dir = $values['dir']; - $this->lineHeight = $values['lineHeight'] ?? null; - $this->margins = $values['margins'] ?? null; - $this->textIndent = $values['textIndent'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.php deleted file mode 100644 index bd62726..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyAlign.php +++ /dev/null @@ -1,11 +0,0 @@ -top = $values['top']; - $this->bottom = $values['bottom']; - $this->left = $values['left']; - $this->right = $values['right']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.php deleted file mode 100644 index 76e15f7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextBodyScript.php +++ /dev/null @@ -1,10 +0,0 @@ - $align - */ - #[JsonProperty('align')] - public ?string $align; - - /** - * @var ?value-of $dir - */ - #[JsonProperty('dir')] - public ?string $dir; - - /** - * @var ?float $lineHeight - */ - #[JsonProperty('lineHeight')] - public ?float $lineHeight; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins $margins - */ - #[JsonProperty('margins')] - public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins $margins; - - /** - * @var ?float $textIndent - */ - #[JsonProperty('textIndent')] - public ?float $textIndent; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @var array $runs - */ - #[JsonProperty('runs'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem::class])] - public array $runs; - - /** - * @param array{ - * runs: array, - * align?: ?value-of, - * dir?: ?value-of, - * lineHeight?: ?float, - * margins?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemMargins, - * textIndent?: ?float, - * unknown?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->align = $values['align'] ?? null; - $this->dir = $values['dir'] ?? null; - $this->lineHeight = $values['lineHeight'] ?? null; - $this->margins = $values['margins'] ?? null; - $this->textIndent = $values['textIndent'] ?? null; - $this->unknown = $values['unknown'] ?? null; - $this->runs = $values['runs']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.php deleted file mode 100644 index e3612df..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemAlign.php +++ /dev/null @@ -1,11 +0,0 @@ -top = $values['top']; - $this->bottom = $values['bottom']; - $this->left = $values['left']; - $this->right = $values['right']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php deleted file mode 100644 index be6828e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -text = $values['text']; - $this->style = $values['style'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php deleted file mode 100644 index 4e226c2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php +++ /dev/null @@ -1,107 +0,0 @@ -> $decoration - */ - #[JsonProperty('decoration'), ArrayType(['string'])] - public ?array $decoration; - - /** - * @var ?value-of $script - */ - #[JsonProperty('script')] - public ?string $script; - - /** - * @var ?float $letterSpacing - */ - #[JsonProperty('letterSpacing')] - public ?float $letterSpacing; - - /** - * @var ?float $horizontalScale - */ - #[JsonProperty('horizontalScale')] - public ?float $horizontalScale; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @param array{ - * family?: ?string, - * weight?: ?int, - * italic?: ?bool, - * size?: ?float, - * color?: ?string, - * decoration?: ?array>, - * script?: ?value-of, - * letterSpacing?: ?float, - * horizontalScale?: ?float, - * unknown?: ?string, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->family = $values['family'] ?? null; - $this->weight = $values['weight'] ?? null; - $this->italic = $values['italic'] ?? null; - $this->size = $values['size'] ?? null; - $this->color = $values['color'] ?? null; - $this->decoration = $values['decoration'] ?? null; - $this->script = $values['script'] ?? null; - $this->letterSpacing = $values['letterSpacing'] ?? null; - $this->horizontalScale = $values['horizontalScale'] ?? null; - $this->unknown = $values['unknown'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php deleted file mode 100644 index 17cfb24..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php +++ /dev/null @@ -1,10 +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/DocAnnotationsList200ResponseAnnotationsItemHighlight.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlight.php deleted file mode 100644 index 31f9561..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlight.php +++ /dev/null @@ -1,213 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemHighlightFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemHighlightFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemHighlightRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemHighlightRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemHighlightColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemHighlightColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemHighlightRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemHighlightFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemHighlightRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemHighlightColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightBlendMode.php deleted file mode 100644 index b7d8a91..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightFlags.php deleted file mode 100644 index b8f87e8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightIdentityQuality.php deleted file mode 100644 index ae63296..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex.php deleted file mode 100644 index 6657215..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndexRevision.php deleted file mode 100644 index d88aa6c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm.php deleted file mode 100644 index 3722c8d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber.php deleted file mode 100644 index 4679878..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItem.php deleted file mode 100644 index 6d044cf..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP1.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP1.php deleted file mode 100644 index d3b5268..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.php deleted file mode 100644 index 09d4886..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.php deleted file mode 100644 index 1c64129..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.php deleted file mode 100644 index bbc9077..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.php deleted file mode 100644 index da50978..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.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/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php deleted file mode 100644 index 07d6c04..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemHighlightRef - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemHighlightRef - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemHighlightRef - { - return new DocAnnotationsList200ResponseAnnotationsItemHighlightRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex.php deleted file mode 100644 index d837b43..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndexRevision.php deleted file mode 100644 index 7bb9c3e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm.php deleted file mode 100644 index a7e5dac..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber.php deleted file mode 100644 index c044bd7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightReplyType.php deleted file mode 100644 index 0e7781e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemInkFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemInkFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemInkRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemInkRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemInkColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemInkColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var array> $inkList - */ - #[JsonProperty('inkList'), ArrayType([[DocAnnotationsList200ResponseAnnotationsItemInkInkListItemItem::class]])] - public array $inkList; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemInkRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemInkFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemInkRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemInkColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * inkList: array>, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * intent?: ?value-of, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->intent = $values['intent'] ?? null; - $this->inkList = $values['inkList']; - $this->rotation = $values['rotation'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkBlendMode.php deleted file mode 100644 index 34ce1c0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkFlags.php deleted file mode 100644 index 7f7f998..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIdentityQuality.php deleted file mode 100644 index 19d873a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex.php deleted file mode 100644 index aaac20f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndexRevision.php deleted file mode 100644 index 6d1d29c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm.php deleted file mode 100644 index e6a446c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber.php deleted file mode 100644 index 818e8fc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInkListItemItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInkListItemItem.php deleted file mode 100644 index 1399ddd..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInkListItemItem.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php deleted file mode 100644 index 23cf502..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php +++ /dev/null @@ -1,8 +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/DocAnnotationsList200ResponseAnnotationsItemInkRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRef.php deleted file mode 100644 index 859918b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemInkRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemInkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemInkRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemInkRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemInkRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemInkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemInkRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemInkRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemInkRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemInkRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemInkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemInkRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemInkRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemInkRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemInkRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemInkRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemInkRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemInkRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndex.php deleted file mode 100644 index 2df9836..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndexRevision.php deleted file mode 100644 index 025ad46..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefNm.php deleted file mode 100644 index 8eca6f9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber.php deleted file mode 100644 index 920fe2e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkReplyType.php deleted file mode 100644 index 6615c0e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure $measure; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineCaption $caption; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineLeader $leader - */ - #[JsonProperty('leader')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineLeader $leader; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsList200ResponseAnnotationsItemLineRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemLineFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemLineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemLineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor $interiorColor; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineLinePoints $linePoints - */ - #[JsonProperty('linePoints')] - public DocAnnotationsList200ResponseAnnotationsItemLineLinePoints $linePoints; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLineLineEndings $lineEndings - */ - #[JsonProperty('lineEndings')] - public DocAnnotationsList200ResponseAnnotationsItemLineLineEndings $lineEndings; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemLineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemLineFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemLineRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemLineColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * linePoints: DocAnnotationsList200ResponseAnnotationsItemLineLinePoints, - * lineEndings: DocAnnotationsList200ResponseAnnotationsItemLineLineEndings, - * intent?: ?value-of, - * measure?: ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure, - * caption?: ?DocAnnotationsList200ResponseAnnotationsItemLineCaption, - * leader?: ?DocAnnotationsList200ResponseAnnotationsItemLineLeader, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->leader = $values['leader'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->linePoints = $values['linePoints']; - $this->lineEndings = $values['lineEndings']; - $this->rotation = $values['rotation'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineBlendMode.php deleted file mode 100644 index 97fb6eb..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ - $position - */ - #[JsonProperty('position')] - public ?string $position; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset $offset - */ - #[JsonProperty('offset')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset $offset; - - /** - * @param array{ - * enabled: bool, - * position?: ?value-of, - * offset?: ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enabled = $values['enabled']; - $this->position = $values['position'] ?? null; - $this->offset = $values['offset'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php deleted file mode 100644 index 4216bf1..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php +++ /dev/null @@ -1,42 +0,0 @@ -along = $values['along']; - $this->perpendicular = $values['perpendicular']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php deleted file mode 100644 index 2d2ec26..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineFlags.php deleted file mode 100644 index 75d3289..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIdentityQuality.php deleted file mode 100644 index be7a0c0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex.php deleted file mode 100644 index e12f7dd..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndexRevision.php deleted file mode 100644 index d936e03..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm.php deleted file mode 100644 index 837d03d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber.php deleted file mode 100644 index b8e42ff..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIntent.php deleted file mode 100644 index e736f7e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLeader.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLeader.php deleted file mode 100644 index b6e6296..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLeader.php +++ /dev/null @@ -1,50 +0,0 @@ -length = $values['length']; - $this->extension = $values['extension'] ?? null; - $this->offset = $values['offset'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.php deleted file mode 100644 index 97c5482..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.php +++ /dev/null @@ -1,42 +0,0 @@ - $start - */ - #[JsonProperty('start')] - public string $start; - - /** - * @var value-of $end - */ - #[JsonProperty('end')] - public string $end; - - /** - * @param array{ - * start: value-of, - * end: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.php deleted file mode 100644 index e79ca6f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.php +++ /dev/null @@ -1,17 +0,0 @@ -start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.php deleted file mode 100644 index 2dad8c4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.php deleted file mode 100644 index a31679c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php deleted file mode 100644 index 0fd35a3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl $rl - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure - */ - public static function rl(DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemLineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo $geo - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure - */ - public static function geo(DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemLineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown $unknown - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure - */ - public static function unknown(DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemLineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl - */ - public function asRl(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo - */ - public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown - */ - public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php deleted file mode 100644 index 932ef14..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php deleted file mode 100644 index f965447..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php deleted file mode 100644 index 8deefe8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php deleted file mode 100644 index fd1629b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php deleted file mode 100644 index 8ba8fa6..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php deleted file mode 100644 index bdc78c7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php deleted file mode 100644 index d7e51b2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php deleted file mode 100644 index a1cec06..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php deleted file mode 100644 index 9edbad0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php deleted file mode 100644 index 806c9a4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRect.php deleted file mode 100644 index 828c28d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRect.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/DocAnnotationsList200ResponseAnnotationsItemLineRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRef.php deleted file mode 100644 index b2ca16d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemLineRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemLineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemLineRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemLineRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemLineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLineRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemLineRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemLineRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemLineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemLineRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLineRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemLineRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemLineRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndex.php deleted file mode 100644 index 69f4613..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndexRevision.php deleted file mode 100644 index 8eb0381..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefNm.php deleted file mode 100644 index fa39caa..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber.php deleted file mode 100644 index 2c210f3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineReplyType.php deleted file mode 100644 index 2b4d80d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLinkFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemLinkFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemLinkRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemLinkRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemLinkTarget $target - */ - #[JsonProperty('target')] - public ?DocAnnotationsList200ResponseAnnotationsItemLinkTarget $target; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemLinkRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemLinkFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemLinkRect, - * blendMode: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * target?: ?DocAnnotationsList200ResponseAnnotationsItemLinkTarget, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->target = $values['target'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkBlendMode.php deleted file mode 100644 index cd8178c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkIdentityQuality.php deleted file mode 100644 index 89b7b43..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex.php deleted file mode 100644 index bad560c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndexRevision.php deleted file mode 100644 index f9fa459..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm.php deleted file mode 100644 index 9587a4d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber.php deleted file mode 100644 index ceb1ad0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRect.php deleted file mode 100644 index f8c4af6..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRect.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/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php deleted file mode 100644 index 768362e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemLinkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemLinkRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemLinkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemLinkRef - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemLinkRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex.php deleted file mode 100644 index 8d01c90..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndexRevision.php deleted file mode 100644 index fb5b232..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefNm.php deleted file mode 100644 index cade0f0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber.php deleted file mode 100644 index 0b241c5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkReplyType.php deleted file mode 100644 index fcab743..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto $goto - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function goto(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto $goto): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'goto', - 'value' => $goto, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri $uri - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function uri(DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri $uri): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'uri', - 'value' => $uri, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote $gotoRemote - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function gotoRemote(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote $gotoRemote): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'goto-remote', - 'value' => $gotoRemote, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch $launch - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function launch(DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch $launch): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'launch', - 'value' => $launch, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript $javascript - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function javascript(DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript $javascript): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'javascript', - 'value' => $javascript, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed $named - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function named(DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed $named): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'named', - 'value' => $named, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported $unsupported - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTarget - */ - public static function unsupported(DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported $unsupported): DocAnnotationsList200ResponseAnnotationsItemLinkTarget - { - return new DocAnnotationsList200ResponseAnnotationsItemLinkTarget([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isGoto_(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto && $this->kind === 'goto'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto - */ - public function asGoto_(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto && $this->kind === 'goto')) { - throw new Exception( - "Expected goto; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUri(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri && $this->kind === 'uri'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri - */ - public function asUri(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri && $this->kind === 'uri')) { - throw new Exception( - "Expected uri; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGotoRemote(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote && $this->kind === 'goto-remote'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote - */ - public function asGotoRemote(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote && $this->kind === 'goto-remote')) { - throw new Exception( - "Expected goto-remote; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLaunch(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch && $this->kind === 'launch'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch - */ - public function asLaunch(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch && $this->kind === 'launch')) { - throw new Exception( - "Expected launch; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isJavascript(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript && $this->kind === 'javascript'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript - */ - public function asJavascript(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript && $this->kind === 'javascript')) { - throw new Exception( - "Expected javascript; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNamed(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed && $this->kind === 'named'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed - */ - public function asNamed(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed && $this->kind === 'named')) { - throw new Exception( - "Expected named; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported - */ - public function asUnsupported(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'goto': - $value = $this->asGoto_()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'uri': - $value = $this->asUri()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'goto-remote': - $value = $this->asGotoRemote()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'launch': - $value = $this->asLaunch()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'javascript': - $value = $this->asJavascript()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'named': - $value = $this->asNamed()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'goto': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto::jsonDeserialize($data); - break; - case 'uri': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri::jsonDeserialize($data); - break; - case 'goto-remote': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote::jsonDeserialize($data); - break; - case 'launch': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch::jsonDeserialize($data); - break; - case 'javascript': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript::jsonDeserialize($data); - break; - case 'named': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported::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/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto.php deleted file mode 100644 index c02b340..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto.php +++ /dev/null @@ -1,34 +0,0 @@ -destination = $values['destination']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php deleted file mode 100644 index 3bddb20..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php +++ /dev/null @@ -1,34 +0,0 @@ -file = $values['file']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php deleted file mode 100644 index f347c5a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php deleted file mode 100644 index b20d7a4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php +++ /dev/null @@ -1,34 +0,0 @@ -path = $values['path']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php deleted file mode 100644 index c08f8b9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php deleted file mode 100644 index fee4531..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php deleted file mode 100644 index d8f5792..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php +++ /dev/null @@ -1,34 +0,0 @@ -uri = $values['uri']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php deleted file mode 100644 index 04b8b58..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php +++ /dev/null @@ -1,285 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure $measure; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption $caption; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolygonRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsList200ResponseAnnotationsItemPolygonRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolygonFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemPolygonFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolygonRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemPolygonRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolygonColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemPolygonColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor $interiorColor; - - /** - * @var array $vertices - */ - #[JsonProperty('vertices'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonVerticesItem::class])] - public array $vertices; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemPolygonRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemPolygonFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemPolygonRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemPolygonColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * vertices: array, - * intent?: ?value-of, - * measure?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure, - * caption?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor, - * rotation?: ?float, - * cloudyIntensity?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->vertices = $values['vertices']; - $this->rotation = $values['rotation'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonBlendMode.php deleted file mode 100644 index 75b97d9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -enabled = $values['enabled']; - $this->center = $values['center'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php deleted file mode 100644 index 7e8dfa8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonColor.php deleted file mode 100644 index 6b7807c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonFlags.php deleted file mode 100644 index 1a20615..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIdentityQuality.php deleted file mode 100644 index 194c8a4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex.php deleted file mode 100644 index 127adde..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndexRevision.php deleted file mode 100644 index 8d6be29..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm.php deleted file mode 100644 index db09520..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber.php deleted file mode 100644 index da94b47..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php deleted file mode 100644 index 2255da8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure.php deleted file mode 100644 index 8981a65..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl $rl - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - */ - public static function rl(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo $geo - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - */ - public static function geo(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown $unknown - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - */ - public static function unknown(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl - */ - public function asRl(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo - */ - public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown - */ - public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php deleted file mode 100644 index 96ccfb3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php deleted file mode 100644 index 4444537..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php deleted file mode 100644 index d2de2de..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php deleted file mode 100644 index 8821925..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php deleted file mode 100644 index 97fe83b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php deleted file mode 100644 index 9fe4c81..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php deleted file mode 100644 index 30ba57a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php deleted file mode 100644 index 78d16fe..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php deleted file mode 100644 index 7c80862..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php deleted file mode 100644 index eae52e9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.php deleted file mode 100644 index f914960..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.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/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php deleted file mode 100644 index c2c1860..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemPolygonRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemPolygonRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemPolygonRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolygonRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex.php deleted file mode 100644 index 0a23302..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndexRevision.php deleted file mode 100644 index d9c0b71..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm.php deleted file mode 100644 index 2c33bbc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber.php deleted file mode 100644 index d0c8e3d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonReplyType.php deleted file mode 100644 index bd49ee4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php deleted file mode 100644 index 4505a75..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php +++ /dev/null @@ -1,285 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure $measure; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption $caption; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolylineRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsList200ResponseAnnotationsItemPolylineRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolylineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemPolylineFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolylineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemPolylineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolylineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemPolylineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor $interiorColor; - - /** - * @var array $vertices - */ - #[JsonProperty('vertices'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineVerticesItem::class])] - public array $vertices; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings $lineEndings - */ - #[JsonProperty('lineEndings')] - public DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings $lineEndings; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemPolylineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemPolylineFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemPolylineRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemPolylineColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * vertices: array, - * lineEndings: DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings, - * intent?: ?value-of, - * measure?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure, - * caption?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->vertices = $values['vertices']; - $this->rotation = $values['rotation'] ?? null; - $this->lineEndings = $values['lineEndings']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineBlendMode.php deleted file mode 100644 index 60e6b61..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -enabled = $values['enabled']; - $this->center = $values['center'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php deleted file mode 100644 index 86adeaa..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineColor.php deleted file mode 100644 index f70f534..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineFlags.php deleted file mode 100644 index 2829fbc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIdentityQuality.php deleted file mode 100644 index 0363e84..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex.php deleted file mode 100644 index e51b480..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndexRevision.php deleted file mode 100644 index 94381ca..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm.php deleted file mode 100644 index cffee9a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber.php deleted file mode 100644 index 707aeb8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php deleted file mode 100644 index c38a84a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php +++ /dev/null @@ -1,8 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings.php deleted file mode 100644 index 6e9430e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings.php +++ /dev/null @@ -1,42 +0,0 @@ - $start - */ - #[JsonProperty('start')] - public string $start; - - /** - * @var value-of $end - */ - #[JsonProperty('end')] - public string $end; - - /** - * @param array{ - * start: value-of, - * end: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php deleted file mode 100644 index 8f2cd2c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php +++ /dev/null @@ -1,17 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl $rl - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - */ - public static function rl(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo $geo - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - */ - public static function geo(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown $unknown - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - */ - public static function unknown(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl - */ - public function asRl(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo - */ - public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown - */ - public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php deleted file mode 100644 index ce1ed7e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php deleted file mode 100644 index c08a425..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php deleted file mode 100644 index b18c8fa..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php deleted file mode 100644 index 785aa9d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php deleted file mode 100644 index 29efc87..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php deleted file mode 100644 index a092fa7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php deleted file mode 100644 index a4b8dc2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php deleted file mode 100644 index 5ae69aa..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php deleted file mode 100644 index b8a82e5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php deleted file mode 100644 index d6e5db3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRect.php deleted file mode 100644 index 0309c74..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRect.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/DocAnnotationsList200ResponseAnnotationsItemPolylineRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRef.php deleted file mode 100644 index 0ad5bcc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemPolylineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemPolylineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemPolylineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemPolylineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex.php deleted file mode 100644 index 57e60ca..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndexRevision.php deleted file mode 100644 index af759ee..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm.php deleted file mode 100644 index 70fc7dc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber.php deleted file mode 100644 index 9d7c60e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineReplyType.php deleted file mode 100644 index 055100f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedact.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedact.php deleted file mode 100644 index bd8a2b0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedact.php +++ /dev/null @@ -1,269 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemRedactFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemRedactFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemRedactRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemRedactRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItem::class])] - public array $quadPoints; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemRedactColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemRedactColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor $interiorColor; - - /** - * @var ?string $overlayText - */ - #[JsonProperty('overlayText')] - public ?string $overlayText; - - /** - * @var bool $repeat - */ - #[JsonProperty('repeat')] - public bool $repeat; - - /** - * @var value-of $fontFamily - */ - #[JsonProperty('fontFamily')] - public string $fontFamily; - - /** - * @var float $fontSize - */ - #[JsonProperty('fontSize')] - public float $fontSize; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemRedactFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public DocAnnotationsList200ResponseAnnotationsItemRedactFontColor $fontColor; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemRedactRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemRedactFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemRedactRect, - * blendMode: value-of, - * quadPoints: array, - * color: DocAnnotationsList200ResponseAnnotationsItemRedactColor, - * opacity: float, - * repeat: bool, - * fontFamily: value-of, - * fontSize: float, - * fontColor: DocAnnotationsList200ResponseAnnotationsItemRedactFontColor, - * textAlign: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor, - * overlayText?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->quadPoints = $values['quadPoints']; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->overlayText = $values['overlayText'] ?? null; - $this->repeat = $values['repeat']; - $this->fontFamily = $values['fontFamily']; - $this->fontSize = $values['fontSize']; - $this->fontColor = $values['fontColor']; - $this->textAlign = $values['textAlign']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactBlendMode.php deleted file mode 100644 index f13970c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFlags.php deleted file mode 100644 index 0d7f2da..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontColor.php deleted file mode 100644 index 2cb2acd..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontFamily.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontFamily.php deleted file mode 100644 index 9095314..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontFamily.php +++ /dev/null @@ -1,21 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex.php deleted file mode 100644 index 936124d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndexRevision.php deleted file mode 100644 index 24cef36..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm.php deleted file mode 100644 index e002aae..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber.php deleted file mode 100644 index 794c3a0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor.php deleted file mode 100644 index e3092e5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItem.php deleted file mode 100644 index 04f8b07..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP1.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP1.php deleted file mode 100644 index 9b38db2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.php deleted file mode 100644 index a09140c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.php deleted file mode 100644 index 3ba2932..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.php deleted file mode 100644 index ff6e72c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRect.php deleted file mode 100644 index 7f64234..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRect.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/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php deleted file mode 100644 index 6392b7f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemRedactRef - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemRedactRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemRedactRef - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemRedactRef - { - return new DocAnnotationsList200ResponseAnnotationsItemRedactRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemRedactRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex.php deleted file mode 100644 index 5c2805d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndexRevision.php deleted file mode 100644 index 83b9971..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefNm.php deleted file mode 100644 index 5d43903..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber.php deleted file mode 100644 index 2876e6b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactReplyType.php deleted file mode 100644 index 9780636..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquareFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemSquareFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquareRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemSquareRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquareColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemSquareColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor $interiorColor; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemSquareUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsList200ResponseAnnotationsItemSquareUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemSquareRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemSquareFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemSquareRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemSquareColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor, - * cloudyIntensity?: ?float, - * rectDifferences?: ?DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsList200ResponseAnnotationsItemSquareUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareBlendMode.php deleted file mode 100644 index fc4002c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareFlags.php deleted file mode 100644 index 239b603..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareIdentityQuality.php deleted file mode 100644 index 2c1cfb8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex.php deleted file mode 100644 index d3cbdcc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndexRevision.php deleted file mode 100644 index 4e31d56..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm.php deleted file mode 100644 index aa48e52..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber.php deleted file mode 100644 index a8911f2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor.php deleted file mode 100644 index f440c49..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRect.php deleted file mode 100644 index 4539737..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRect.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/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php deleted file mode 100644 index d9c5251..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRef.php deleted file mode 100644 index 92bdaf0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemSquareRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemSquareRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemSquareRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemSquareRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquareRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemSquareRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex.php deleted file mode 100644 index 586d23c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndexRevision.php deleted file mode 100644 index bb805fa..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefNm.php deleted file mode 100644 index 6866aba..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber.php deleted file mode 100644 index a64e686..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareReplyType.php deleted file mode 100644 index 46ebad9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsList200ResponseAnnotationsItemSquiggly.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquiggly.php deleted file mode 100644 index 70dfe13..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquiggly.php +++ /dev/null @@ -1,213 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquigglyRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemSquigglyRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemSquigglyColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemSquigglyColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemSquigglyRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemSquigglyRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemSquigglyColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyBlendMode.php deleted file mode 100644 index 03fc26b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags.php deleted file mode 100644 index 15d6453..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyIdentityQuality.php deleted file mode 100644 index b08d9db..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex.php deleted file mode 100644 index 1e0d117..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndexRevision.php deleted file mode 100644 index 15dc164..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm.php deleted file mode 100644 index ce7773e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber.php deleted file mode 100644 index eec09dd..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItem.php deleted file mode 100644 index 4a8f889..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP1.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP1.php deleted file mode 100644 index 4a025b8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.php deleted file mode 100644 index e5e293f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.php deleted file mode 100644 index e0b80ae..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.php deleted file mode 100644 index 8c81119..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.php deleted file mode 100644 index 5d4f353..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php deleted file mode 100644 index eff7a51..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemSquigglyRef - { - return new DocAnnotationsList200ResponseAnnotationsItemSquigglyRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex.php deleted file mode 100644 index 16a7103..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndexRevision.php deleted file mode 100644 index c6693da..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm.php deleted file mode 100644 index 942d6e7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber.php deleted file mode 100644 index 44c4796..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyReplyType.php deleted file mode 100644 index 35f96c6..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemStampFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemStampFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemStampRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemStampRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?string $name - */ - #[JsonProperty('name')] - public ?string $name; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemStampUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsList200ResponseAnnotationsItemStampUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemStampRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemStampFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemStampRect, - * blendMode: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * name?: ?string, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsList200ResponseAnnotationsItemStampUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->name = $values['name'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampBlendMode.php deleted file mode 100644 index d5b74f3..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampIdentityQuality.php deleted file mode 100644 index 149cb72..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex.php deleted file mode 100644 index 2d05206..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndexRevision.php deleted file mode 100644 index 87635d5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm.php deleted file mode 100644 index 5ef3d44..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber.php deleted file mode 100644 index cc28a24..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRect.php deleted file mode 100644 index b47b2cc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRect.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/DocAnnotationsList200ResponseAnnotationsItemStampRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRef.php deleted file mode 100644 index d3bcde5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemStampRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemStampRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStampRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemStampRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemStampRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemStampRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStampRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStampRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemStampRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemStampRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemStampRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStampRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemStampRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStampRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemStampRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStampRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStampRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemStampRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndex.php deleted file mode 100644 index 8db6326..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndexRevision.php deleted file mode 100644 index 8fa5554..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefNm.php deleted file mode 100644 index 4788a46..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber.php deleted file mode 100644 index c63546e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampReplyType.php deleted file mode 100644 index 65993fc..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsList200ResponseAnnotationsItemStrikeout.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeout.php deleted file mode 100644 index 174c88c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeout.php +++ /dev/null @@ -1,221 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemStrikeoutColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemStrikeoutColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItem::class])] - public array $quadPoints; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemStrikeoutColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * intent?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - $this->intent = $values['intent'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutBlendMode.php deleted file mode 100644 index 0443674..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags.php deleted file mode 100644 index 916e61e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIdentityQuality.php deleted file mode 100644 index b88a08b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex.php deleted file mode 100644 index 21400b4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndexRevision.php deleted file mode 100644 index 9855290..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm.php deleted file mode 100644 index cfcbc25..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber.php deleted file mode 100644 index 3597dea..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIntent.php deleted file mode 100644 index 61b2584..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIntent.php +++ /dev/null @@ -1,8 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP1.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP1.php deleted file mode 100644 index d35259a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.php deleted file mode 100644 index 46391ff..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.php deleted file mode 100644 index be79270..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.php deleted file mode 100644 index 92a9356..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.php deleted file mode 100644 index 76d14b7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php deleted file mode 100644 index 3c71419..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef - { - return new DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex.php deleted file mode 100644 index aa738b9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndexRevision.php deleted file mode 100644 index 7f170ac..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm.php deleted file mode 100644 index d87460a..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber.php deleted file mode 100644 index efbb53d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutReplyType.php deleted file mode 100644 index 614fd6f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemTextFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemTextFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemTextRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemTextRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemTextColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemTextColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var value-of $icon - */ - #[JsonProperty('icon')] - public string $icon; - - /** - * @var ?string $state - */ - #[JsonProperty('state')] - public ?string $state; - - /** - * @var ?string $stateModel - */ - #[JsonProperty('stateModel')] - public ?string $stateModel; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemTextRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemTextFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemTextRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemTextColor, - * opacity: float, - * icon: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * state?: ?string, - * stateModel?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->icon = $values['icon']; - $this->state = $values['state'] ?? null; - $this->stateModel = $values['stateModel'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextBlendMode.php deleted file mode 100644 index 88e9b87..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextFlags.php deleted file mode 100644 index 0b554b5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextIcon.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextIcon.php deleted file mode 100644 index 52025d4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextIcon.php +++ /dev/null @@ -1,14 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex.php deleted file mode 100644 index 54461e7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndexRevision.php deleted file mode 100644 index 3ec77ca..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm.php deleted file mode 100644 index 182f943..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber.php deleted file mode 100644 index 6b8bf8e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRect.php deleted file mode 100644 index 556cb7e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRect.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/DocAnnotationsList200ResponseAnnotationsItemTextRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRef.php deleted file mode 100644 index a716b70..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemTextRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemTextRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemTextRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemTextRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemTextRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemTextRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemTextRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemTextRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemTextRef - { - return new DocAnnotationsList200ResponseAnnotationsItemTextRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemTextRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemTextRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemTextRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemTextRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemTextRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemTextRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndex.php deleted file mode 100644 index 4f4885f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndexRevision.php deleted file mode 100644 index 3453258..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefNm.php deleted file mode 100644 index 6ab175c..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber.php deleted file mode 100644 index 3269e47..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextReplyType.php deleted file mode 100644 index 408d966..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemUnderlineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemUnderlineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemUnderlineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsList200ResponseAnnotationsItemUnderlineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemUnderlineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemUnderlineRect, - * blendMode: value-of, - * color: DocAnnotationsList200ResponseAnnotationsItemUnderlineColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineBlendMode.php deleted file mode 100644 index 728f4c8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags.php deleted file mode 100644 index dd87893..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineIdentityQuality.php deleted file mode 100644 index 32de8f8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex.php deleted file mode 100644 index 20a08b5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndexRevision.php deleted file mode 100644 index 92e7dec..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm.php deleted file mode 100644 index 5280af4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber.php deleted file mode 100644 index edbd7a2..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItem.php deleted file mode 100644 index 232b26f..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP1.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP1.php deleted file mode 100644 index 20ed6e4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.php deleted file mode 100644 index b24264d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.php deleted file mode 100644 index 52da5e0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.php deleted file mode 100644 index 61a1d2e..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.php deleted file mode 100644 index 54edaf5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php deleted file mode 100644 index 7d3e4c8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemUnderlineRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnderlineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex.php deleted file mode 100644 index 11cec95..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndexRevision.php deleted file mode 100644 index f2d3794..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm.php deleted file mode 100644 index 472e2d0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber.php deleted file mode 100644 index d7eab59..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineReplyType.php deleted file mode 100644 index 9419b89..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemUnsupportedFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemUnsupportedFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var int $rawSubtypeCode - */ - #[JsonProperty('rawSubtypeCode')] - public int $rawSubtypeCode; - - /** - * @var ?string $rawSubtypeName - */ - #[JsonProperty('rawSubtypeName')] - public ?string $rawSubtypeName; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemUnsupportedFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect, - * blendMode: value-of, - * rawSubtypeCode: int, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * rawSubtypeName?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->rawSubtypeCode = $values['rawSubtypeCode']; - $this->rawSubtypeName = $values['rawSubtypeName'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedBlendMode.php deleted file mode 100644 index 639461d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedIdentityQuality.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedIdentityQuality.php deleted file mode 100644 index 1f13cef..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex.php deleted file mode 100644 index 2b05529..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndexRevision.php deleted file mode 100644 index b1cb138..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm.php deleted file mode 100644 index a535515..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber.php deleted file mode 100644 index c196c5b..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect.php deleted file mode 100644 index 83a05f8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect.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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php deleted file mode 100644 index be34637..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef - { - return new DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex.php deleted file mode 100644 index f95a198..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndexRevision.php deleted file mode 100644 index 6a34d00..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm.php deleted file mode 100644 index 31fa450..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber.php deleted file mode 100644 index 4f47476..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedReplyType.php deleted file mode 100644 index 5d16822..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemWidgetFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsList200ResponseAnnotationsItemWidgetFlags $flags; - - /** - * @var DocAnnotationsList200ResponseAnnotationsItemWidgetRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsList200ResponseAnnotationsItemWidgetRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemWidgetColor $color - */ - #[JsonProperty('color')] - public ?DocAnnotationsList200ResponseAnnotationsItemWidgetColor $color; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor $interiorColor; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?value-of $fontFamily - */ - #[JsonProperty('fontFamily')] - public ?string $fontFamily; - - /** - * @var ?float $fontSize - */ - #[JsonProperty('fontSize')] - public ?float $fontSize; - - /** - * @var ?DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public ?DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor $fontColor; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @var int $fieldObjectNumber - */ - #[JsonProperty('fieldObjectNumber')] - public int $fieldObjectNumber; - - /** - * @var value-of $fieldFamily - */ - #[JsonProperty('fieldFamily')] - public string $fieldFamily; - - /** - * @param array{ - * ref: DocAnnotationsList200ResponseAnnotationsItemWidgetRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsList200ResponseAnnotationsItemWidgetFlags, - * rect: DocAnnotationsList200ResponseAnnotationsItemWidgetRect, - * blendMode: value-of, - * strokeWidth: float, - * borderStyle: value-of, - * textAlign: value-of, - * fieldObjectNumber: int, - * fieldFamily: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * color?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetColor, - * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor, - * fontFamily?: ?value-of, - * fontSize?: ?float, - * fontColor?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->fontFamily = $values['fontFamily'] ?? null; - $this->fontSize = $values['fontSize'] ?? null; - $this->fontColor = $values['fontColor'] ?? null; - $this->textAlign = $values['textAlign']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->fieldFamily = $values['fieldFamily']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetBlendMode.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetBlendMode.php deleted file mode 100644 index be88fc8..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFieldFamily.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFieldFamily.php deleted file mode 100644 index 1b11e01..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFieldFamily.php +++ /dev/null @@ -1,15 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor.php deleted file mode 100644 index 854e3a1..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontFamily.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontFamily.php deleted file mode 100644 index bf486df..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontFamily.php +++ /dev/null @@ -1,21 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm $nm): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex $index): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex::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/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex.php deleted file mode 100644 index 33b7961..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndexRevision.php deleted file mode 100644 index 8e6e082..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm.php deleted file mode 100644 index 5ae9655..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber.php deleted file mode 100644 index a052d43..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor.php deleted file mode 100644 index 841896d..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRect.php deleted file mode 100644 index 34d57d0..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRect.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/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php deleted file mode 100644 index 61267c4..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber $objectNumber - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRef - */ - public static function objectNumber(DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber $objectNumber): DocAnnotationsList200ResponseAnnotationsItemWidgetRef - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm $nm - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRef - */ - public static function nm(DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm $nm): DocAnnotationsList200ResponseAnnotationsItemWidgetRef - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex $index - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRef - */ - public static function index(DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex $index): DocAnnotationsList200ResponseAnnotationsItemWidgetRef - { - return new DocAnnotationsList200ResponseAnnotationsItemWidgetRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm - */ - public function asNm(): DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex - */ - public function asIndex(): DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex - { - if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex::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/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex.php deleted file mode 100644 index a472285..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndexRevision.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndexRevision.php deleted file mode 100644 index 47e59e7..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm.php deleted file mode 100644 index 7754d30..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber.php deleted file mode 100644 index 53a59f9..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetReplyType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetReplyType.php deleted file mode 100644 index a5f2dc5..0000000 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponsePageStateRevision.php b/src/Types/DocAnnotationsList200ResponsePageStateRevision.php deleted file mode 100644 index 10b7dc5..0000000 --- a/src/Types/DocAnnotationsList200ResponsePageStateRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationState.php b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationState.php deleted file mode 100644 index 11b3d84..0000000 --- a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsList200ResponsePageStateWeakAnnotationState - */ - public static function unknown(DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown $unknown): DocAnnotationsList200ResponsePageStateWeakAnnotationState - { - return new DocAnnotationsList200ResponsePageStateWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown $known - * @return DocAnnotationsList200ResponsePageStateWeakAnnotationState - */ - public static function known(DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown $known): DocAnnotationsList200ResponsePageStateWeakAnnotationState - { - return new DocAnnotationsList200ResponsePageStateWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown::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/DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown.php deleted file mode 100644 index 640344a..0000000 --- a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php deleted file mode 100644 index afc2c2d..0000000 --- a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsList404Response.php b/src/Types/DocAnnotationsList404Response.php deleted file mode 100644 index c02e9eb..0000000 --- a/src/Types/DocAnnotationsList404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsList404ResponseCode.php b/src/Types/DocAnnotationsList404ResponseCode.php deleted file mode 100644 index 8b63910..0000000 --- a/src/Types/DocAnnotationsList404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocAnnotationsListAll200ResponsePagesItem::class])] - public array $pages; - - /** - * @var ?int $auditHead - */ - #[JsonProperty('auditHead')] - public ?int $auditHead; - - /** - * @param array{ - * pages: array, - * auditHead?: ?int, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pages = $values['pages']; - $this->auditHead = $values['auditHead'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItem.php deleted file mode 100644 index cccec39..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItem.php +++ /dev/null @@ -1,43 +0,0 @@ - $annotations - */ - #[JsonProperty('annotations'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItem::class])] - public array $annotations; - - /** - * @param array{ - * pageState: DocAnnotationsListAll200ResponsePagesItemPageState, - * annotations: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pageState = $values['pageState']; - $this->annotations = $values['annotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItem.php deleted file mode 100644 index c894878..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItem.php +++ /dev/null @@ -1,961 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight $highlight - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function highlight(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight $highlight): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'highlight', - 'value' => $highlight, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline $underline - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function underline(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline $underline): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'underline', - 'value' => $underline, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly $squiggly - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function squiggly(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly $squiggly): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'squiggly', - 'value' => $squiggly, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout $strikeout - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function strikeout(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout $strikeout): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'strikeout', - 'value' => $strikeout, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle $circle - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function circle(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle $circle): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'circle', - 'value' => $circle, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare $square - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function square(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare $square): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'square', - 'value' => $square, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon $polygon - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function polygon(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon $polygon): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'polygon', - 'value' => $polygon, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline $polyline - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function polyline(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline $polyline): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'polyline', - 'value' => $polyline, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine $line - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function line(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine $line): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'line', - 'value' => $line, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink $link - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function link(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink $link): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'link', - 'value' => $link, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk $ink - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function ink(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk $ink): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'ink', - 'value' => $ink, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText $freeText - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function freeText(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText $freeText): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'free-text', - 'value' => $freeText, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret $caret - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function caret(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret $caret): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'caret', - 'value' => $caret, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText $text - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function text(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText $text): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'text', - 'value' => $text, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp $stamp - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function stamp(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp $stamp): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'stamp', - 'value' => $stamp, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment $fileAttachment - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function fileAttachment(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment $fileAttachment): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'file-attachment', - 'value' => $fileAttachment, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget $widget - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function widget(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget $widget): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'widget', - 'value' => $widget, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact $redact - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function redact(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact $redact): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'redact', - 'value' => $redact, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported $unsupported - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - */ - public static function unsupported(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported $unsupported): DocAnnotationsListAll200ResponsePagesItemAnnotationsItem - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItem([ - 'subtype' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isHighlight(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight && $this->subtype === 'highlight'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight - */ - public function asHighlight(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight && $this->subtype === 'highlight')) { - throw new Exception( - "Expected highlight; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnderline(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline && $this->subtype === 'underline'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline - */ - public function asUnderline(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline && $this->subtype === 'underline')) { - throw new Exception( - "Expected underline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isSquiggly(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly && $this->subtype === 'squiggly'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly - */ - public function asSquiggly(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly && $this->subtype === 'squiggly')) { - throw new Exception( - "Expected squiggly; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isStrikeout(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout && $this->subtype === 'strikeout'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout - */ - public function asStrikeout(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout && $this->subtype === 'strikeout')) { - throw new Exception( - "Expected strikeout; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCircle(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle && $this->subtype === 'circle'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle - */ - public function asCircle(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle && $this->subtype === 'circle')) { - throw new Exception( - "Expected circle; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isSquare(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare && $this->subtype === 'square'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare - */ - public function asSquare(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare && $this->subtype === 'square')) { - throw new Exception( - "Expected square; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPolygon(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon && $this->subtype === 'polygon'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon - */ - public function asPolygon(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon && $this->subtype === 'polygon')) { - throw new Exception( - "Expected polygon; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPolyline(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline && $this->subtype === 'polyline'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline - */ - public function asPolyline(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline && $this->subtype === 'polyline')) { - throw new Exception( - "Expected polyline; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLine(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine && $this->subtype === 'line'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine - */ - public function asLine(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine && $this->subtype === 'line')) { - throw new Exception( - "Expected line; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLink(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink && $this->subtype === 'link'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink - */ - public function asLink(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink && $this->subtype === 'link')) { - throw new Exception( - "Expected link; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isInk(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk && $this->subtype === 'ink'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk - */ - public function asInk(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk && $this->subtype === 'ink')) { - throw new Exception( - "Expected ink; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFreeText(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText && $this->subtype === 'free-text'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText - */ - public function asFreeText(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText && $this->subtype === 'free-text')) { - throw new Exception( - "Expected free-text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCaret(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret && $this->subtype === 'caret'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret - */ - public function asCaret(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret && $this->subtype === 'caret')) { - throw new Exception( - "Expected caret; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isText(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText && $this->subtype === 'text'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText - */ - public function asText(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText && $this->subtype === 'text')) { - throw new Exception( - "Expected text; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isStamp(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp && $this->subtype === 'stamp'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp - */ - public function asStamp(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp && $this->subtype === 'stamp')) { - throw new Exception( - "Expected stamp; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFileAttachment(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment && $this->subtype === 'file-attachment'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment - */ - public function asFileAttachment(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment && $this->subtype === 'file-attachment')) { - throw new Exception( - "Expected file-attachment; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isWidget(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget && $this->subtype === 'widget'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget - */ - public function asWidget(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget && $this->subtype === 'widget')) { - throw new Exception( - "Expected widget; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isRedact(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact && $this->subtype === 'redact'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact - */ - public function asRedact(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact && $this->subtype === 'redact')) { - throw new Exception( - "Expected redact; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported && $this->subtype === 'unsupported'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported - */ - public function asUnsupported(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported && $this->subtype === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'highlight': - $value = $this->asHighlight()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'underline': - $value = $this->asUnderline()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'squiggly': - $value = $this->asSquiggly()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'strikeout': - $value = $this->asStrikeout()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'circle': - $value = $this->asCircle()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'square': - $value = $this->asSquare()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'polygon': - $value = $this->asPolygon()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'polyline': - $value = $this->asPolyline()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'line': - $value = $this->asLine()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'link': - $value = $this->asLink()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'ink': - $value = $this->asInk()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'free-text': - $value = $this->asFreeText()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'caret': - $value = $this->asCaret()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'text': - $value = $this->asText()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'stamp': - $value = $this->asStamp()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'file-attachment': - $value = $this->asFileAttachment()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'widget': - $value = $this->asWidget()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'redact': - $value = $this->asRedact()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'highlight': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight::jsonDeserialize($data); - break; - case 'underline': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderline::jsonDeserialize($data); - break; - case 'squiggly': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly::jsonDeserialize($data); - break; - case 'strikeout': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout::jsonDeserialize($data); - break; - case 'circle': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle::jsonDeserialize($data); - break; - case 'square': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquare::jsonDeserialize($data); - break; - case 'polygon': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon::jsonDeserialize($data); - break; - case 'polyline': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline::jsonDeserialize($data); - break; - case 'line': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine::jsonDeserialize($data); - break; - case 'link': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLink::jsonDeserialize($data); - break; - case 'ink': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInk::jsonDeserialize($data); - break; - case 'free-text': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeText::jsonDeserialize($data); - break; - case 'caret': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret::jsonDeserialize($data); - break; - case 'text': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemText::jsonDeserialize($data); - break; - case 'stamp': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStamp::jsonDeserialize($data); - break; - case 'file-attachment': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment::jsonDeserialize($data); - break; - case 'widget': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidget::jsonDeserialize($data); - break; - case 'redact': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret.php deleted file mode 100644 index 8a1f511..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaret.php +++ /dev/null @@ -1,236 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretColor, - * opacity: float, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * intent?: ?value-of, - * rectDifferences?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->intent = $values['intent'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretBlendMode.php deleted file mode 100644 index ab72484..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags.php deleted file mode 100644 index ab16bcb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIdentityQuality.php deleted file mode 100644 index 60e1764..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex.php deleted file mode 100644 index ef299cd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndexRevision.php deleted file mode 100644 index a70b471..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm.php deleted file mode 100644 index 5703a7b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber.php deleted file mode 100644 index 1d7075b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIntent.php deleted file mode 100644 index d7c89d4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretIntent.php +++ /dev/null @@ -1,8 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences.php deleted file mode 100644 index d9f3419..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef.php deleted file mode 100644 index 9b1e1a7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex.php deleted file mode 100644 index cc24dba..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndexRevision.php deleted file mode 100644 index 1d37a1a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm.php deleted file mode 100644 index b233d89..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber.php deleted file mode 100644 index df838c7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretReplyType.php deleted file mode 100644 index b1424f7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCaretReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle.php deleted file mode 100644 index 0a9180d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircle.php +++ /dev/null @@ -1,269 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor $interiorColor; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor, - * cloudyIntensity?: ?float, - * rectDifferences?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleBlendMode.php deleted file mode 100644 index c5ea9f3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags.php deleted file mode 100644 index 61fe921..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleIdentityQuality.php deleted file mode 100644 index 216fc7a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex.php deleted file mode 100644 index e1f1be8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndexRevision.php deleted file mode 100644 index 8f811a3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm.php deleted file mode 100644 index 3c2dcdf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber.php deleted file mode 100644 index 4187e03..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor.php deleted file mode 100644 index f6f2585..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect.php deleted file mode 100644 index 648b67e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences.php deleted file mode 100644 index 81263be..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef.php deleted file mode 100644 index c4ea106..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex.php deleted file mode 100644 index 9a0e592..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndexRevision.php deleted file mode 100644 index 7d62c02..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm.php deleted file mode 100644 index 0a9541e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber.php deleted file mode 100644 index 48eabd5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleReplyType.php deleted file mode 100644 index afd6b9f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemCircleReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment.php deleted file mode 100644 index 25ac9af..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachment.php +++ /dev/null @@ -1,220 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var value-of $icon - */ - #[JsonProperty('icon')] - public string $icon; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile $file - */ - #[JsonProperty('file')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile $file; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentColor, - * opacity: float, - * icon: value-of, - * file: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->icon = $values['icon']; - $this->file = $values['file']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentBlendMode.php deleted file mode 100644 index ec2a2fc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile.php deleted file mode 100644 index 16b1016..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFile.php +++ /dev/null @@ -1,74 +0,0 @@ -name = $values['name']; - $this->mimeType = $values['mimeType'] ?? null; - $this->description = $values['description'] ?? null; - $this->size = $values['size'] ?? null; - $this->checksum = $values['checksum'] ?? null; - $this->creationDate = $values['creationDate'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags.php deleted file mode 100644 index 49d90c7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentIcon.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentIcon.php deleted file mode 100644 index 0f2b9e5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentIcon.php +++ /dev/null @@ -1,11 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex.php deleted file mode 100644 index 99353d5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndexRevision.php deleted file mode 100644 index 288dadf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm.php deleted file mode 100644 index 4db8689..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber.php deleted file mode 100644 index 8f2cc01..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect.php deleted file mode 100644 index 0f4b661..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef.php deleted file mode 100644 index 2f6f572..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex.php deleted file mode 100644 index 378b12f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndexRevision.php deleted file mode 100644 index 7b5c844..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm.php deleted file mode 100644 index 5d7104c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber.php deleted file mode 100644 index 9a942f1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentReplyType.php deleted file mode 100644 index cdb62a1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFileAttachmentReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var value-of $intent - */ - #[JsonProperty('intent')] - public string $intent; - - /** - * @var string $fontFamily - */ - #[JsonProperty('fontFamily')] - public string $fontFamily; - - /** - * @var float $fontSize - */ - #[JsonProperty('fontSize')] - public float $fontSize; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText $richText - */ - #[JsonProperty('richText')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText $richText; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextColor $color; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor $fontColor; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInteriorColor $interiorColor; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences $rectDifferences; - - /** - * @var ?array $calloutLine - */ - #[JsonProperty('calloutLine'), ArrayType(['mixed'])] - public ?array $calloutLine; - - /** - * @var ?value-of $lineEnding - */ - #[JsonProperty('lineEnding')] - public ?string $lineEnding; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRect, - * blendMode: value-of, - * intent: value-of, - * fontFamily: string, - * fontSize: float, - * textAlign: value-of, - * richText: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichText, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * fontColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInteriorColor, - * dashArray?: ?array, - * rectDifferences?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences, - * calloutLine?: ?array, - * lineEnding?: ?value-of, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->intent = $values['intent']; - $this->fontFamily = $values['fontFamily']; - $this->fontSize = $values['fontSize']; - $this->textAlign = $values['textAlign']; - $this->richText = $values['richText']; - $this->color = $values['color']; - $this->fontColor = $values['fontColor'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->calloutLine = $values['calloutLine'] ?? null; - $this->lineEnding = $values['lineEnding'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextBlendMode.php deleted file mode 100644 index 8e6e0c8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags.php deleted file mode 100644 index 16c2ee5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor.php deleted file mode 100644 index b4a9d00..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIdentityQuality.php deleted file mode 100644 index 9d03d07..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex.php deleted file mode 100644 index c49d7cf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndexRevision.php deleted file mode 100644 index 1fe43ff..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm.php deleted file mode 100644 index b84fc67..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber.php deleted file mode 100644 index 7aba365..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIntent.php deleted file mode 100644 index 52a704a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextLineEnding.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextLineEnding.php deleted file mode 100644 index 1addf9b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextLineEnding.php +++ /dev/null @@ -1,17 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences.php deleted file mode 100644 index d333f29..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef.php deleted file mode 100644 index e5eabb0..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex.php deleted file mode 100644 index 9c88f2f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndexRevision.php deleted file mode 100644 index ef8f49b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm.php deleted file mode 100644 index afbf76e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber.php deleted file mode 100644 index 69f3cd8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextReplyType.php deleted file mode 100644 index 485025b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $paragraphs - */ - #[JsonProperty('paragraphs'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItem::class])] - public array $paragraphs; - - /** - * @param array{ - * body: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody, - * paragraphs: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->body = $values['body']; - $this->paragraphs = $values['paragraphs']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.php deleted file mode 100644 index dc3c2ac..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBody.php +++ /dev/null @@ -1,147 +0,0 @@ -> $decoration - */ - #[JsonProperty('decoration'), ArrayType(['string'])] - public array $decoration; - - /** - * @var value-of $script - */ - #[JsonProperty('script')] - public string $script; - - /** - * @var float $letterSpacing - */ - #[JsonProperty('letterSpacing')] - public float $letterSpacing; - - /** - * @var float $horizontalScale - */ - #[JsonProperty('horizontalScale')] - public float $horizontalScale; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @var value-of $align - */ - #[JsonProperty('align')] - public string $align; - - /** - * @var value-of $dir - */ - #[JsonProperty('dir')] - public string $dir; - - /** - * @var ?float $lineHeight - */ - #[JsonProperty('lineHeight')] - public ?float $lineHeight; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins $margins - */ - #[JsonProperty('margins')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins $margins; - - /** - * @var ?float $textIndent - */ - #[JsonProperty('textIndent')] - public ?float $textIndent; - - /** - * @param array{ - * family: string, - * weight: int, - * italic: bool, - * size: float, - * color: string, - * decoration: array>, - * script: value-of, - * letterSpacing: float, - * horizontalScale: float, - * align: value-of, - * dir: value-of, - * unknown?: ?string, - * lineHeight?: ?float, - * margins?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyMargins, - * textIndent?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->family = $values['family']; - $this->weight = $values['weight']; - $this->italic = $values['italic']; - $this->size = $values['size']; - $this->color = $values['color']; - $this->decoration = $values['decoration']; - $this->script = $values['script']; - $this->letterSpacing = $values['letterSpacing']; - $this->horizontalScale = $values['horizontalScale']; - $this->unknown = $values['unknown'] ?? null; - $this->align = $values['align']; - $this->dir = $values['dir']; - $this->lineHeight = $values['lineHeight'] ?? null; - $this->margins = $values['margins'] ?? null; - $this->textIndent = $values['textIndent'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.php deleted file mode 100644 index e67105f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyAlign.php +++ /dev/null @@ -1,11 +0,0 @@ -top = $values['top']; - $this->bottom = $values['bottom']; - $this->left = $values['left']; - $this->right = $values['right']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.php deleted file mode 100644 index 2162fff..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextBodyScript.php +++ /dev/null @@ -1,10 +0,0 @@ - $align - */ - #[JsonProperty('align')] - public ?string $align; - - /** - * @var ?value-of $dir - */ - #[JsonProperty('dir')] - public ?string $dir; - - /** - * @var ?float $lineHeight - */ - #[JsonProperty('lineHeight')] - public ?float $lineHeight; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins $margins - */ - #[JsonProperty('margins')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins $margins; - - /** - * @var ?float $textIndent - */ - #[JsonProperty('textIndent')] - public ?float $textIndent; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @var array $runs - */ - #[JsonProperty('runs'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem::class])] - public array $runs; - - /** - * @param array{ - * runs: array, - * align?: ?value-of, - * dir?: ?value-of, - * lineHeight?: ?float, - * margins?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemMargins, - * textIndent?: ?float, - * unknown?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->align = $values['align'] ?? null; - $this->dir = $values['dir'] ?? null; - $this->lineHeight = $values['lineHeight'] ?? null; - $this->margins = $values['margins'] ?? null; - $this->textIndent = $values['textIndent'] ?? null; - $this->unknown = $values['unknown'] ?? null; - $this->runs = $values['runs']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.php deleted file mode 100644 index 247a779..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemAlign.php +++ /dev/null @@ -1,11 +0,0 @@ -top = $values['top']; - $this->bottom = $values['bottom']; - $this->left = $values['left']; - $this->right = $values['right']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php deleted file mode 100644 index c5c2d30..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -text = $values['text']; - $this->style = $values['style'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php deleted file mode 100644 index 8cbee56..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyle.php +++ /dev/null @@ -1,107 +0,0 @@ -> $decoration - */ - #[JsonProperty('decoration'), ArrayType(['string'])] - public ?array $decoration; - - /** - * @var ?value-of $script - */ - #[JsonProperty('script')] - public ?string $script; - - /** - * @var ?float $letterSpacing - */ - #[JsonProperty('letterSpacing')] - public ?float $letterSpacing; - - /** - * @var ?float $horizontalScale - */ - #[JsonProperty('horizontalScale')] - public ?float $horizontalScale; - - /** - * @var ?string $unknown - */ - #[JsonProperty('unknown')] - public ?string $unknown; - - /** - * @param array{ - * family?: ?string, - * weight?: ?int, - * italic?: ?bool, - * size?: ?float, - * color?: ?string, - * decoration?: ?array>, - * script?: ?value-of, - * letterSpacing?: ?float, - * horizontalScale?: ?float, - * unknown?: ?string, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->family = $values['family'] ?? null; - $this->weight = $values['weight'] ?? null; - $this->italic = $values['italic'] ?? null; - $this->size = $values['size'] ?? null; - $this->color = $values['color'] ?? null; - $this->decoration = $values['decoration'] ?? null; - $this->script = $values['script'] ?? null; - $this->letterSpacing = $values['letterSpacing'] ?? null; - $this->horizontalScale = $values['horizontalScale'] ?? null; - $this->unknown = $values['unknown'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php deleted file mode 100644 index fc98efb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemFreeTextRichTextParagraphsItemRunsItemStyleDecorationItem.php +++ /dev/null @@ -1,10 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight.php deleted file mode 100644 index f2b6028..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlight.php +++ /dev/null @@ -1,213 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightBlendMode.php deleted file mode 100644 index f9a2558..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags.php deleted file mode 100644 index 17c07f9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightIdentityQuality.php deleted file mode 100644 index 59f2dd3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex.php deleted file mode 100644 index 103d4e8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndexRevision.php deleted file mode 100644 index e180d79..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm.php deleted file mode 100644 index 3f6a726..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber.php deleted file mode 100644 index 68e21b1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItem.php deleted file mode 100644 index c9ad2cf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP1.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP1.php deleted file mode 100644 index 32149b4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP2.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP2.php deleted file mode 100644 index d2a5689..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP3.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP3.php deleted file mode 100644 index bbf3c16..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP4.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP4.php deleted file mode 100644 index 38188fb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect.php deleted file mode 100644 index 4e641ad..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef.php deleted file mode 100644 index 0351eee..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex.php deleted file mode 100644 index 5b536e0..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndexRevision.php deleted file mode 100644 index 48466fb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm.php deleted file mode 100644 index e9255ea..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber.php deleted file mode 100644 index 48f10cd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightReplyType.php deleted file mode 100644 index 9e010b4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemHighlightReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var array> $inkList - */ - #[JsonProperty('inkList'), ArrayType([[DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInkListItemItem::class]])] - public array $inkList; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * inkList: array>, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * intent?: ?value-of, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->intent = $values['intent'] ?? null; - $this->inkList = $values['inkList']; - $this->rotation = $values['rotation'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkBlendMode.php deleted file mode 100644 index f41a2a8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags.php deleted file mode 100644 index 6a4c8c7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIdentityQuality.php deleted file mode 100644 index 0c4d21b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex.php deleted file mode 100644 index db5421c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndexRevision.php deleted file mode 100644 index 1e4c4ae..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm.php deleted file mode 100644 index db0a4de..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber.php deleted file mode 100644 index b6be18d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInkListItemItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInkListItemItem.php deleted file mode 100644 index 52f7934..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkInkListItemItem.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIntent.php deleted file mode 100644 index 2f8e1b8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkIntent.php +++ /dev/null @@ -1,8 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef.php deleted file mode 100644 index 96fd526..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex.php deleted file mode 100644 index 76511da..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndexRevision.php deleted file mode 100644 index 8ea84fd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm.php deleted file mode 100644 index 43d797e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber.php deleted file mode 100644 index 5b9960d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkReplyType.php deleted file mode 100644 index 7450c2d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemInkReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure $measure; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption $caption; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader $leader - */ - #[JsonProperty('leader')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader $leader; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInteriorColor $interiorColor; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePoints $linePoints - */ - #[JsonProperty('linePoints')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePoints $linePoints; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings $lineEndings - */ - #[JsonProperty('lineEndings')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings $lineEndings; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * linePoints: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePoints, - * lineEndings: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings, - * intent?: ?value-of, - * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure, - * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption, - * leader?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInteriorColor, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->leader = $values['leader'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->linePoints = $values['linePoints']; - $this->lineEndings = $values['lineEndings']; - $this->rotation = $values['rotation'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineBlendMode.php deleted file mode 100644 index 4076684..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ - $position - */ - #[JsonProperty('position')] - public ?string $position; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset $offset - */ - #[JsonProperty('offset')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset $offset; - - /** - * @param array{ - * enabled: bool, - * position?: ?value-of, - * offset?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enabled = $values['enabled']; - $this->position = $values['position'] ?? null; - $this->offset = $values['offset'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php deleted file mode 100644 index 5c23530..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php +++ /dev/null @@ -1,42 +0,0 @@ -along = $values['along']; - $this->perpendicular = $values['perpendicular']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php deleted file mode 100644 index f650368..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags.php deleted file mode 100644 index 96a3e2a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIdentityQuality.php deleted file mode 100644 index d71af9f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex.php deleted file mode 100644 index e569b81..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndexRevision.php deleted file mode 100644 index 4eba165..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm.php deleted file mode 100644 index 2722a2c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber.php deleted file mode 100644 index dc365dc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIntent.php deleted file mode 100644 index 5a31324..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader.php deleted file mode 100644 index f0223de..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader.php +++ /dev/null @@ -1,50 +0,0 @@ -length = $values['length']; - $this->extension = $values['extension'] ?? null; - $this->offset = $values['offset'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings.php deleted file mode 100644 index 956ef6d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings.php +++ /dev/null @@ -1,42 +0,0 @@ - $start - */ - #[JsonProperty('start')] - public string $start; - - /** - * @var value-of $end - */ - #[JsonProperty('end')] - public string $end; - - /** - * @param array{ - * start: value-of, - * end: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndingsEnd.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndingsEnd.php deleted file mode 100644 index b71c141..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndingsEnd.php +++ /dev/null @@ -1,17 +0,0 @@ -start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsEnd.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsEnd.php deleted file mode 100644 index 8a9bc14..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsEnd.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsStart.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsStart.php deleted file mode 100644 index 461fff9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePointsStart.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php deleted file mode 100644 index 0ba7320..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl $rl - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - */ - public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo $geo - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - */ - public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown $unknown - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - */ - public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl - */ - public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo - */ - public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown - */ - public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php deleted file mode 100644 index 1044d97..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php deleted file mode 100644 index a18d31f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php deleted file mode 100644 index 6919c41..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php deleted file mode 100644 index df72cbf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php deleted file mode 100644 index 4737ef3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php deleted file mode 100644 index de965a3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php deleted file mode 100644 index 775955b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php deleted file mode 100644 index 98e13f1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php deleted file mode 100644 index 3ef837a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php deleted file mode 100644 index 43893de..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect.php deleted file mode 100644 index 52a466b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef.php deleted file mode 100644 index 9cb849a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex.php deleted file mode 100644 index 55eb118..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndexRevision.php deleted file mode 100644 index 7b80956..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm.php deleted file mode 100644 index 9e23081..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber.php deleted file mode 100644 index 82527d6..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineReplyType.php deleted file mode 100644 index 357579f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget $target - */ - #[JsonProperty('target')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget $target; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect, - * blendMode: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * target?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->target = $values['target'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkBlendMode.php deleted file mode 100644 index e1f3025..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkIdentityQuality.php deleted file mode 100644 index 143a8fd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex.php deleted file mode 100644 index c58bf47..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndexRevision.php deleted file mode 100644 index f9701e3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm.php deleted file mode 100644 index b52f8bd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber.php deleted file mode 100644 index 3f5a849..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect.php deleted file mode 100644 index c9c5f42..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef.php deleted file mode 100644 index 5e0d9e7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex.php deleted file mode 100644 index b430440..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndexRevision.php deleted file mode 100644 index eb888af..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm.php deleted file mode 100644 index 37ddf26..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber.php deleted file mode 100644 index b926e2c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkReplyType.php deleted file mode 100644 index 0fa7a42..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto $goto - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function goto(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto $goto): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'goto', - 'value' => $goto, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri $uri - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function uri(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri $uri): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'uri', - 'value' => $uri, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote $gotoRemote - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function gotoRemote(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote $gotoRemote): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'goto-remote', - 'value' => $gotoRemote, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch $launch - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function launch(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch $launch): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'launch', - 'value' => $launch, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript $javascript - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function javascript(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript $javascript): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'javascript', - 'value' => $javascript, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed $named - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function named(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed $named): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'named', - 'value' => $named, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported $unsupported - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - */ - public static function unsupported(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported $unsupported): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTarget([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isGoto_(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto && $this->kind === 'goto'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto - */ - public function asGoto_(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto && $this->kind === 'goto')) { - throw new Exception( - "Expected goto; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUri(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri && $this->kind === 'uri'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri - */ - public function asUri(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri && $this->kind === 'uri')) { - throw new Exception( - "Expected uri; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGotoRemote(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote && $this->kind === 'goto-remote'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote - */ - public function asGotoRemote(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote && $this->kind === 'goto-remote')) { - throw new Exception( - "Expected goto-remote; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isLaunch(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch && $this->kind === 'launch'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch - */ - public function asLaunch(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch && $this->kind === 'launch')) { - throw new Exception( - "Expected launch; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isJavascript(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript && $this->kind === 'javascript'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript - */ - public function asJavascript(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript && $this->kind === 'javascript')) { - throw new Exception( - "Expected javascript; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNamed(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed && $this->kind === 'named'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed - */ - public function asNamed(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed && $this->kind === 'named')) { - throw new Exception( - "Expected named; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported - */ - public function asUnsupported(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'goto': - $value = $this->asGoto_()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'uri': - $value = $this->asUri()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'goto-remote': - $value = $this->asGotoRemote()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'launch': - $value = $this->asLaunch()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'javascript': - $value = $this->asJavascript()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'named': - $value = $this->asNamed()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'goto': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto::jsonDeserialize($data); - break; - case 'uri': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri::jsonDeserialize($data); - break; - case 'goto-remote': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote::jsonDeserialize($data); - break; - case 'launch': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch::jsonDeserialize($data); - break; - case 'javascript': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript::jsonDeserialize($data); - break; - case 'named': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto.php deleted file mode 100644 index 049f9c5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGoto.php +++ /dev/null @@ -1,34 +0,0 @@ -destination = $values['destination']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote.php deleted file mode 100644 index 7d18246..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetGotoRemote.php +++ /dev/null @@ -1,34 +0,0 @@ -file = $values['file']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript.php deleted file mode 100644 index 77ddb6f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetJavascript.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch.php deleted file mode 100644 index 9b31c9a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetLaunch.php +++ /dev/null @@ -1,34 +0,0 @@ -path = $values['path']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed.php deleted file mode 100644 index a7f0121..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetNamed.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported.php deleted file mode 100644 index 31e6c42..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri.php deleted file mode 100644 index 9cd4db9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLinkTargetUri.php +++ /dev/null @@ -1,34 +0,0 @@ -uri = $values['uri']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php deleted file mode 100644 index 7781432..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php +++ /dev/null @@ -1,285 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure $measure; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption $caption; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInteriorColor $interiorColor; - - /** - * @var array $vertices - */ - #[JsonProperty('vertices'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonVerticesItem::class])] - public array $vertices; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * vertices: array, - * intent?: ?value-of, - * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure, - * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInteriorColor, - * rotation?: ?float, - * cloudyIntensity?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->vertices = $values['vertices']; - $this->rotation = $values['rotation'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonBlendMode.php deleted file mode 100644 index fa2474e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -enabled = $values['enabled']; - $this->center = $values['center'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php deleted file mode 100644 index 4adca55..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor.php deleted file mode 100644 index 12d3f64..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags.php deleted file mode 100644 index 1b9de80..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIdentityQuality.php deleted file mode 100644 index 5669822..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex.php deleted file mode 100644 index b3d1e7d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndexRevision.php deleted file mode 100644 index 4fe2318..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm.php deleted file mode 100644 index 4d04eae..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber.php deleted file mode 100644 index 8f4de41..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php deleted file mode 100644 index d23d2d0..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php +++ /dev/null @@ -1,9 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure.php deleted file mode 100644 index 32c10b2..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl $rl - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - */ - public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo $geo - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - */ - public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown $unknown - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - */ - public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl - */ - public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo - */ - public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown - */ - public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php deleted file mode 100644 index b578103..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php deleted file mode 100644 index 9ba914c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php deleted file mode 100644 index 2882139..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php deleted file mode 100644 index a047a69..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php deleted file mode 100644 index c3fca31..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php deleted file mode 100644 index c2b7e1c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php deleted file mode 100644 index f5fb501..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php deleted file mode 100644 index b83a8e8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php deleted file mode 100644 index f270de1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php deleted file mode 100644 index 6342737..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect.php deleted file mode 100644 index 17c91cd..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef.php deleted file mode 100644 index 0a07554..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex.php deleted file mode 100644 index d18763f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndexRevision.php deleted file mode 100644 index e7bf0bb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm.php deleted file mode 100644 index 80a6fa4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber.php deleted file mode 100644 index 11f4059..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonReplyType.php deleted file mode 100644 index 8836e48..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php deleted file mode 100644 index 8b2423b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php +++ /dev/null @@ -1,285 +0,0 @@ - $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure $measure - */ - #[JsonProperty('measure')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure $measure; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption $caption - */ - #[JsonProperty('caption')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption $caption; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef $ref - */ - #[JsonProperty('ref')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef $ref; - - /** - * @var int $pageObjectNumber - */ - #[JsonProperty('pageObjectNumber')] - public int $pageObjectNumber; - - /** - * @var int $index - */ - #[JsonProperty('index')] - public int $index; - - /** - * @var value-of $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInteriorColor $interiorColor; - - /** - * @var array $vertices - */ - #[JsonProperty('vertices'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineVerticesItem::class])] - public array $vertices; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings $lineEndings - */ - #[JsonProperty('lineEndings')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings $lineEndings; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * vertices: array, - * lineEndings: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings, - * intent?: ?value-of, - * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure, - * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInteriorColor, - * rotation?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->intent = $values['intent'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->caption = $values['caption'] ?? null; - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->vertices = $values['vertices']; - $this->rotation = $values['rotation'] ?? null; - $this->lineEndings = $values['lineEndings']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineBlendMode.php deleted file mode 100644 index dc5678a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -enabled = $values['enabled']; - $this->center = $values['center'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php deleted file mode 100644 index a57350c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor.php deleted file mode 100644 index 8958b0c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags.php deleted file mode 100644 index 6a392fe..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIdentityQuality.php deleted file mode 100644 index 927f625..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex.php deleted file mode 100644 index f5e6007..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndexRevision.php deleted file mode 100644 index 65a3c04..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm.php deleted file mode 100644 index a09c3ac..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber.php deleted file mode 100644 index afbeeaf..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php deleted file mode 100644 index b9a444b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php +++ /dev/null @@ -1,8 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings.php deleted file mode 100644 index e78e7ac..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings.php +++ /dev/null @@ -1,42 +0,0 @@ - $start - */ - #[JsonProperty('start')] - public string $start; - - /** - * @var value-of $end - */ - #[JsonProperty('end')] - public string $end; - - /** - * @param array{ - * start: value-of, - * end: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->start = $values['start']; - $this->end = $values['end']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndingsEnd.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndingsEnd.php deleted file mode 100644 index 2c1ff96..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndingsEnd.php +++ /dev/null @@ -1,17 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl $rl - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - */ - public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo $geo - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - */ - public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown $unknown - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - */ - public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl - */ - public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo - */ - public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown - */ - public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php deleted file mode 100644 index 011e374..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php deleted file mode 100644 index 201fdaa..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php deleted file mode 100644 index 916af42..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php deleted file mode 100644 index bd72a12..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php deleted file mode 100644 index 2e54682..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php deleted file mode 100644 index f9bedb0..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php deleted file mode 100644 index 00433fc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php deleted file mode 100644 index 5cdca48..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php deleted file mode 100644 index 564dbc8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php deleted file mode 100644 index 119af21..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect.php deleted file mode 100644 index 7d6539d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef.php deleted file mode 100644 index aad4cd7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex.php deleted file mode 100644 index 82c88a5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndexRevision.php deleted file mode 100644 index d69cd47..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm.php deleted file mode 100644 index 0bfd902..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber.php deleted file mode 100644 index 9aa784e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineReplyType.php deleted file mode 100644 index 84cb44a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact.php deleted file mode 100644 index 3389b69..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedact.php +++ /dev/null @@ -1,269 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItem::class])] - public array $quadPoints; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor $interiorColor; - - /** - * @var ?string $overlayText - */ - #[JsonProperty('overlayText')] - public ?string $overlayText; - - /** - * @var bool $repeat - */ - #[JsonProperty('repeat')] - public bool $repeat; - - /** - * @var value-of $fontFamily - */ - #[JsonProperty('fontFamily')] - public string $fontFamily; - - /** - * @var float $fontSize - */ - #[JsonProperty('fontSize')] - public float $fontSize; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor $fontColor; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect, - * blendMode: value-of, - * quadPoints: array, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactColor, - * opacity: float, - * repeat: bool, - * fontFamily: value-of, - * fontSize: float, - * fontColor: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor, - * textAlign: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor, - * overlayText?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->quadPoints = $values['quadPoints']; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->overlayText = $values['overlayText'] ?? null; - $this->repeat = $values['repeat']; - $this->fontFamily = $values['fontFamily']; - $this->fontSize = $values['fontSize']; - $this->fontColor = $values['fontColor']; - $this->textAlign = $values['textAlign']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactBlendMode.php deleted file mode 100644 index ac4863d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags.php deleted file mode 100644 index 30c59fc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor.php deleted file mode 100644 index e853026..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontFamily.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontFamily.php deleted file mode 100644 index e8667af..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactFontFamily.php +++ /dev/null @@ -1,21 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex.php deleted file mode 100644 index 0b74622..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndexRevision.php deleted file mode 100644 index 873cbf9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm.php deleted file mode 100644 index 8358ec9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber.php deleted file mode 100644 index 92ec814..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor.php deleted file mode 100644 index 6917baa..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItem.php deleted file mode 100644 index c6f1951..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP1.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP1.php deleted file mode 100644 index a16c54b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP2.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP2.php deleted file mode 100644 index 87916ff..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP3.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP3.php deleted file mode 100644 index 11db178..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP4.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP4.php deleted file mode 100644 index 8c51b04..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect.php deleted file mode 100644 index 759df51..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef.php deleted file mode 100644 index 5af5fcc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex.php deleted file mode 100644 index 8084b6d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndexRevision.php deleted file mode 100644 index 0aa5cd4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm.php deleted file mode 100644 index a5ccf49..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber.php deleted file mode 100644 index cccf218..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactReplyType.php deleted file mode 100644 index 770fe51..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemRedactReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?array $dashArray - */ - #[JsonProperty('dashArray'), ArrayType(['float'])] - public ?array $dashArray; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor $interiorColor; - - /** - * @var ?float $cloudyIntensity - */ - #[JsonProperty('cloudyIntensity')] - public ?float $cloudyIntensity; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences $rectDifferences - */ - #[JsonProperty('rectDifferences')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences $rectDifferences; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareColor, - * opacity: float, - * strokeWidth: float, - * borderStyle: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * dashArray?: ?array, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor, - * cloudyIntensity?: ?float, - * rectDifferences?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->dashArray = $values['dashArray'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->cloudyIntensity = $values['cloudyIntensity'] ?? null; - $this->rectDifferences = $values['rectDifferences'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareBlendMode.php deleted file mode 100644 index e5ea11b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags.php deleted file mode 100644 index 2875e8d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareIdentityQuality.php deleted file mode 100644 index 9d07689..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex.php deleted file mode 100644 index 1b3aa43..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndexRevision.php deleted file mode 100644 index 50f1a8f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm.php deleted file mode 100644 index f404872..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber.php deleted file mode 100644 index 757ee61..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor.php deleted file mode 100644 index 25529b7..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect.php deleted file mode 100644 index f7db6d5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences.php deleted file mode 100644 index c9b8b5f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRectDifferences.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->top = $values['top']; - $this->right = $values['right']; - $this->bottom = $values['bottom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef.php deleted file mode 100644 index 2ac71f2..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex.php deleted file mode 100644 index 919a877..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndexRevision.php deleted file mode 100644 index 548ef49..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm.php deleted file mode 100644 index 94f866d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber.php deleted file mode 100644 index a47b3f4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareReplyType.php deleted file mode 100644 index 25b07fc..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquareReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly.php deleted file mode 100644 index 1403196..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquiggly.php +++ /dev/null @@ -1,213 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyBlendMode.php deleted file mode 100644 index 136e74b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags.php deleted file mode 100644 index 0898d4f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyIdentityQuality.php deleted file mode 100644 index b61517b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex.php deleted file mode 100644 index 6b737ab..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndexRevision.php deleted file mode 100644 index a85e457..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm.php deleted file mode 100644 index 43961ea..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber.php deleted file mode 100644 index ee20012..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItem.php deleted file mode 100644 index 0c7a8d4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP1.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP1.php deleted file mode 100644 index 9d9166b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP2.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP2.php deleted file mode 100644 index cb73d6b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP3.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP3.php deleted file mode 100644 index de01d8a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP4.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP4.php deleted file mode 100644 index d3117d6..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect.php deleted file mode 100644 index 0228d5e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef.php deleted file mode 100644 index 1e1d3e0..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex.php deleted file mode 100644 index 43ffb12..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndexRevision.php deleted file mode 100644 index 0ebf591..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm.php deleted file mode 100644 index c40d647..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber.php deleted file mode 100644 index 28afc1c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyReplyType.php deleted file mode 100644 index 6294195..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemSquigglyReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?string $name - */ - #[JsonProperty('name')] - public ?string $name; - - /** - * @var ?float $rotation - */ - #[JsonProperty('rotation')] - public ?float $rotation; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampUnrotatedRect $unrotatedRect - */ - #[JsonProperty('unrotatedRect')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampUnrotatedRect $unrotatedRect; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect, - * blendMode: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * name?: ?string, - * rotation?: ?float, - * unrotatedRect?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampUnrotatedRect, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->name = $values['name'] ?? null; - $this->rotation = $values['rotation'] ?? null; - $this->unrotatedRect = $values['unrotatedRect'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampBlendMode.php deleted file mode 100644 index 5ed1eea..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampIdentityQuality.php deleted file mode 100644 index bcd7162..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex.php deleted file mode 100644 index 51f9b67..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndexRevision.php deleted file mode 100644 index d7f6162..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm.php deleted file mode 100644 index fae7f90..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber.php deleted file mode 100644 index bf8656c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect.php deleted file mode 100644 index 3068e31..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef.php deleted file mode 100644 index 7ad39a3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex.php deleted file mode 100644 index 4d44ed3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndexRevision.php deleted file mode 100644 index 69b0773..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm.php deleted file mode 100644 index 500c319..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber.php deleted file mode 100644 index 5b5327c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampReplyType.php deleted file mode 100644 index efe69aa..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStampReplyType.php +++ /dev/null @@ -1,9 +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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout.php deleted file mode 100644 index 49865c1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeout.php +++ /dev/null @@ -1,221 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItem::class])] - public array $quadPoints; - - /** - * @var ?value-of $intent - */ - #[JsonProperty('intent')] - public ?string $intent; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * intent?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - $this->intent = $values['intent'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutBlendMode.php deleted file mode 100644 index b8159ab..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags.php deleted file mode 100644 index 500ed64..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIdentityQuality.php deleted file mode 100644 index 1a65ad6..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex.php deleted file mode 100644 index ef5e768..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndexRevision.php deleted file mode 100644 index 6e7b708..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm.php deleted file mode 100644 index c111142..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber.php deleted file mode 100644 index 6c14191..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIntent.php deleted file mode 100644 index 9902418..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutIntent.php +++ /dev/null @@ -1,8 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP1.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP1.php deleted file mode 100644 index 3f07ac5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP2.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP2.php deleted file mode 100644 index 45cf4c2..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP3.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP3.php deleted file mode 100644 index 1fd9485..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP4.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP4.php deleted file mode 100644 index 79fd35d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect.php deleted file mode 100644 index ad6507d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef.php deleted file mode 100644 index b3add36..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex.php deleted file mode 100644 index a58ff70..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndexRevision.php deleted file mode 100644 index e4e4da9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm.php deleted file mode 100644 index 8e9d55f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber.php deleted file mode 100644 index 7cf2563..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutReplyType.php deleted file mode 100644 index 1ee49c6..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemStrikeoutReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var value-of $icon - */ - #[JsonProperty('icon')] - public string $icon; - - /** - * @var ?string $state - */ - #[JsonProperty('state')] - public ?string $state; - - /** - * @var ?string $stateModel - */ - #[JsonProperty('stateModel')] - public ?string $stateModel; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextColor, - * opacity: float, - * icon: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * state?: ?string, - * stateModel?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->icon = $values['icon']; - $this->state = $values['state'] ?? null; - $this->stateModel = $values['stateModel'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextBlendMode.php deleted file mode 100644 index 33a455b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags.php deleted file mode 100644 index b19d248..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextIcon.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextIcon.php deleted file mode 100644 index 2c82498..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextIcon.php +++ /dev/null @@ -1,14 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex.php deleted file mode 100644 index 4e126ae..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndexRevision.php deleted file mode 100644 index 4df0a58..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm.php deleted file mode 100644 index ccd1c03..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber.php deleted file mode 100644 index 745ff6b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect.php deleted file mode 100644 index 04b8034..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef.php deleted file mode 100644 index 9911706..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex.php deleted file mode 100644 index 5d9a6ce..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndexRevision.php deleted file mode 100644 index 1c8944e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm.php deleted file mode 100644 index 13d4601..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber.php deleted file mode 100644 index 97999e8..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextReplyType.php deleted file mode 100644 index 216f70e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemTextReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineColor $color - */ - #[JsonProperty('color')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineColor $color; - - /** - * @var float $opacity - */ - #[JsonProperty('opacity')] - public float $opacity; - - /** - * @var array $quadPoints - */ - #[JsonProperty('quadPoints'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItem::class])] - public array $quadPoints; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect, - * blendMode: value-of, - * color: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineColor, - * opacity: float, - * quadPoints: array, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color']; - $this->opacity = $values['opacity']; - $this->quadPoints = $values['quadPoints']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineBlendMode.php deleted file mode 100644 index 64ca9b2..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags.php deleted file mode 100644 index c9c42e6..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineFlags.php +++ /dev/null @@ -1,106 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineIdentityQuality.php deleted file mode 100644 index 31a6602..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex.php deleted file mode 100644 index 1a9515e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndexRevision.php deleted file mode 100644 index 22d5c09..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm.php deleted file mode 100644 index e46a45c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber.php deleted file mode 100644 index 9b09133..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItem.php deleted file mode 100644 index 4e13b36..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -p1 = $values['p1']; - $this->p2 = $values['p2']; - $this->p3 = $values['p3']; - $this->p4 = $values['p4']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP1.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP1.php deleted file mode 100644 index 195e84a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP1.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP2.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP2.php deleted file mode 100644 index 2f34284..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP2.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP3.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP3.php deleted file mode 100644 index 3ed0859..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP3.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP4.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP4.php deleted file mode 100644 index 8e2fe8c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineQuadPointsItemP4.php +++ /dev/null @@ -1,42 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect.php deleted file mode 100644 index 9845ff3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef.php deleted file mode 100644 index f5f6532..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex.php deleted file mode 100644 index 2e37db3..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndexRevision.php deleted file mode 100644 index 3fae19a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm.php deleted file mode 100644 index 255a8c5..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber.php deleted file mode 100644 index 0e20350..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineReplyType.php deleted file mode 100644 index cdef5be..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnderlineReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var int $rawSubtypeCode - */ - #[JsonProperty('rawSubtypeCode')] - public int $rawSubtypeCode; - - /** - * @var ?string $rawSubtypeName - */ - #[JsonProperty('rawSubtypeName')] - public ?string $rawSubtypeName; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect, - * blendMode: value-of, - * rawSubtypeCode: int, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * rawSubtypeName?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->rawSubtypeCode = $values['rawSubtypeCode']; - $this->rawSubtypeName = $values['rawSubtypeName'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedBlendMode.php deleted file mode 100644 index eb75983..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedIdentityQuality.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedIdentityQuality.php deleted file mode 100644 index 2e1f060..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedIdentityQuality.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex.php deleted file mode 100644 index 2b64f5a..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndexRevision.php deleted file mode 100644 index 6b6f972..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm.php deleted file mode 100644 index c22c5eb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber.php deleted file mode 100644 index f33b97d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect.php deleted file mode 100644 index 3cc5912..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef.php deleted file mode 100644 index c144914..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex.php deleted file mode 100644 index 5affbe4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndexRevision.php deleted file mode 100644 index 01cb22f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm.php deleted file mode 100644 index 140d2ef..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber.php deleted file mode 100644 index 00c0e2f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedReplyType.php deleted file mode 100644 index 6758313..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemUnsupportedReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ - $identityQuality - */ - #[JsonProperty('identityQuality')] - public string $identityQuality; - - /** - * @var ?string $nm - */ - #[JsonProperty('nm')] - public ?string $nm; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFlags $flags - */ - #[JsonProperty('flags')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFlags $flags; - - /** - * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect $rect - */ - #[JsonProperty('rect')] - public DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect $rect; - - /** - * @var ?string $contents - */ - #[JsonProperty('contents')] - public ?string $contents; - - /** - * @var ?string $subject - */ - #[JsonProperty('subject')] - public ?string $subject; - - /** - * @var ?string $author - */ - #[JsonProperty('author')] - public ?string $author; - - /** - * @var ?DateTime $created - */ - #[JsonProperty('created'), Date(Date::TYPE_DATETIME)] - public ?DateTime $created; - - /** - * @var ?DateTime $modified - */ - #[JsonProperty('modified'), Date(Date::TYPE_DATETIME)] - public ?DateTime $modified; - - /** - * @var value-of $blendMode - */ - #[JsonProperty('blendMode')] - public string $blendMode; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo $inReplyTo - */ - #[JsonProperty('inReplyTo')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo $inReplyTo; - - /** - * @var ?value-of $replyType - */ - #[JsonProperty('replyType')] - public ?string $replyType; - - /** - * @var ?string $userId - */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @var ?string $updatedBy - */ - #[JsonProperty('updatedBy')] - public ?string $updatedBy; - - /** - * @var ?PdfAnnotationActions $actions - */ - #[JsonProperty('actions')] - public ?PdfAnnotationActions $actions; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetColor $color - */ - #[JsonProperty('color')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetColor $color; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor $interiorColor - */ - #[JsonProperty('interiorColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor $interiorColor; - - /** - * @var float $strokeWidth - */ - #[JsonProperty('strokeWidth')] - public float $strokeWidth; - - /** - * @var value-of $borderStyle - */ - #[JsonProperty('borderStyle')] - public string $borderStyle; - - /** - * @var ?value-of $fontFamily - */ - #[JsonProperty('fontFamily')] - public ?string $fontFamily; - - /** - * @var ?float $fontSize - */ - #[JsonProperty('fontSize')] - public ?float $fontSize; - - /** - * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor $fontColor - */ - #[JsonProperty('fontColor')] - public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor $fontColor; - - /** - * @var value-of $textAlign - */ - #[JsonProperty('textAlign')] - public string $textAlign; - - /** - * @var int $fieldObjectNumber - */ - #[JsonProperty('fieldObjectNumber')] - public int $fieldObjectNumber; - - /** - * @var value-of $fieldFamily - */ - #[JsonProperty('fieldFamily')] - public string $fieldFamily; - - /** - * @param array{ - * ref: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef, - * pageObjectNumber: int, - * index: int, - * identityQuality: value-of, - * flags: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFlags, - * rect: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect, - * blendMode: value-of, - * strokeWidth: float, - * borderStyle: value-of, - * textAlign: value-of, - * fieldObjectNumber: int, - * fieldFamily: value-of, - * nm?: ?string, - * contents?: ?string, - * subject?: ?string, - * author?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * inReplyTo?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo, - * replyType?: ?value-of, - * userId?: ?string, - * groupId?: ?string, - * createdBy?: ?string, - * updatedBy?: ?string, - * actions?: ?PdfAnnotationActions, - * color?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetColor, - * interiorColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor, - * fontFamily?: ?value-of, - * fontSize?: ?float, - * fontColor?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->identityQuality = $values['identityQuality']; - $this->nm = $values['nm'] ?? null; - $this->flags = $values['flags']; - $this->rect = $values['rect']; - $this->contents = $values['contents'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->author = $values['author'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->blendMode = $values['blendMode']; - $this->inReplyTo = $values['inReplyTo'] ?? null; - $this->replyType = $values['replyType'] ?? null; - $this->userId = $values['userId'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->createdBy = $values['createdBy'] ?? null; - $this->updatedBy = $values['updatedBy'] ?? null; - $this->actions = $values['actions'] ?? null; - $this->color = $values['color'] ?? null; - $this->interiorColor = $values['interiorColor'] ?? null; - $this->strokeWidth = $values['strokeWidth']; - $this->borderStyle = $values['borderStyle']; - $this->fontFamily = $values['fontFamily'] ?? null; - $this->fontSize = $values['fontSize'] ?? null; - $this->fontColor = $values['fontColor'] ?? null; - $this->textAlign = $values['textAlign']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->fieldFamily = $values['fieldFamily']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetBlendMode.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetBlendMode.php deleted file mode 100644 index 9da6c64..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetBlendMode.php +++ /dev/null @@ -1,23 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFieldFamily.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFieldFamily.php deleted file mode 100644 index 4535c9c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFieldFamily.php +++ /dev/null @@ -1,15 +0,0 @@ -invisible = $values['invisible']; - $this->hidden = $values['hidden']; - $this->print = $values['print']; - $this->noZoom = $values['noZoom']; - $this->noRotate = $values['noRotate']; - $this->noView = $values['noView']; - $this->readOnly = $values['readOnly']; - $this->locked = $values['locked']; - $this->toggleNoView = $values['toggleNoView']; - $this->lockedContents = $values['lockedContents']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor.php deleted file mode 100644 index 7e03f8b..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontFamily.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontFamily.php deleted file mode 100644 index 5d7c6fb..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetFontFamily.php +++ /dev/null @@ -1,21 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyTo([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex.php deleted file mode 100644 index ac7e94f..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndexRevision.php deleted file mode 100644 index d9986d4..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm.php deleted file mode 100644 index f067e7d..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber.php deleted file mode 100644 index 12f45fe..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInReplyToObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor.php deleted file mode 100644 index f5e2e01..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetInteriorColor.php +++ /dev/null @@ -1,50 +0,0 @@ -r = $values['r']; - $this->g = $values['g']; - $this->b = $values['b']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect.php deleted file mode 100644 index eaebb8e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRect.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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef.php deleted file mode 100644 index 06b5394..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber $objectNumber - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - */ - public static function objectNumber(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber $objectNumber): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm $nm - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - */ - public static function nm(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm $nm): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef([ - 'kind' => 'nm', - 'value' => $nm, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex $index - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - */ - public static function index(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex $index): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef - { - return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRef([ - 'kind' => 'index', - 'value' => $index, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber - */ - public function asObjectNumber(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isNm(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm && $this->kind === 'nm'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm - */ - public function asNm(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm && $this->kind === 'nm')) { - throw new Exception( - "Expected nm; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isIndex(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex && $this->kind === 'index'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex - */ - public function asIndex(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex && $this->kind === 'index')) { - throw new Exception( - "Expected index; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'nm': - $value = $this->asNm()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'index': - $value = $this->asIndex()->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 'objectNumber': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber::jsonDeserialize($data); - break; - case 'nm': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm::jsonDeserialize($data); - break; - case 'index': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex::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/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex.php deleted file mode 100644 index aa66c00..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndex.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->index = $values['index']; - $this->revision = $values['revision']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndexRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndexRevision.php deleted file mode 100644 index 855b93c..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefIndexRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm.php deleted file mode 100644 index db95f3e..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefNm.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->nm = $values['nm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber.php deleted file mode 100644 index 91da2b9..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetRefObjectNumber.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->annotObjectNumber = $values['annotObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetReplyType.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetReplyType.php deleted file mode 100644 index 182b8a1..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemWidgetReplyType.php +++ /dev/null @@ -1,9 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateRevision.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateRevision.php deleted file mode 100644 index 7f24396..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState.php deleted file mode 100644 index fda6b81..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState - */ - public static function unknown(DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState - { - return new DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown $known - * @return DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState - */ - public static function known(DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown $known): DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState - { - return new DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown::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/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown.php deleted file mode 100644 index 95f79df..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown.php deleted file mode 100644 index 4125350..0000000 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemPageStateWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll404Response.php b/src/Types/DocAnnotationsListAll404Response.php deleted file mode 100644 index 50f7ab4..0000000 --- a/src/Types/DocAnnotationsListAll404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll404ResponseCode.php b/src/Types/DocAnnotationsListAll404ResponseCode.php deleted file mode 100644 index 6aae26f..0000000 --- a/src/Types/DocAnnotationsListAll404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsListAll409ResponseCode.php b/src/Types/DocAnnotationsListAll409ResponseCode.php deleted file mode 100644 index 79b1242..0000000 --- a/src/Types/DocAnnotationsListAll409ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var AnnotationMutationMeta $meta + */ + #[JsonProperty('meta')] + public AnnotationMutationMeta $meta; + + /** + * @param array{ + * order: array, + * meta: AnnotationMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200Response.php b/src/Types/DocAnnotationsUpdate200Response.php index 5224cae..a51dae5 100644 --- a/src/Types/DocAnnotationsUpdate200Response.php +++ b/src/Types/DocAnnotationsUpdate200Response.php @@ -8,19 +8,35 @@ class DocAnnotationsUpdate200Response extends JsonSerializableType { /** - * @var DocAnnotationsUpdate200ResponseMeta $meta + * @var Annotation $annotation + */ + #[JsonProperty('annotation')] + public Annotation $annotation; + + /** + * @var DocAnnotationsUpdate200ResponseAppearance $appearance + */ + #[JsonProperty('appearance')] + public DocAnnotationsUpdate200ResponseAppearance $appearance; + + /** + * @var AnnotationMutationMeta $meta */ #[JsonProperty('meta')] - public DocAnnotationsUpdate200ResponseMeta $meta; + public AnnotationMutationMeta $meta; /** * @param array{ - * meta: DocAnnotationsUpdate200ResponseMeta, + * annotation: Annotation, + * appearance: DocAnnotationsUpdate200ResponseAppearance, + * meta: AnnotationMutationMeta, * } $values */ public function __construct( array $values, ) { + $this->annotation = $values['annotation']; + $this->appearance = $values['appearance']; $this->meta = $values['meta']; } diff --git a/src/Types/DocAnnotationsUpdate200ResponseAppearance.php b/src/Types/DocAnnotationsUpdate200ResponseAppearance.php new file mode 100644 index 0000000..524d877 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php b/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php new file mode 100644 index 0000000..6fa9f28 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php @@ -0,0 +1,11 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocAnnotationsUpdate200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocAnnotationsUpdate200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocAnnotationsUpdate200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocAnnotationsUpdate200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItem.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index ba670e6..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index a99344c..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index b261df1..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 549c404..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 0ff451d..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php deleted file mode 100644 index 99b92af..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 8959718..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 08d36c5..0000000 --- a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate400Response.php b/src/Types/DocAnnotationsUpdate400Response.php deleted file mode 100644 index 5663fe3..0000000 --- a/src/Types/DocAnnotationsUpdate400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate400ResponseCode.php b/src/Types/DocAnnotationsUpdate400ResponseCode.php deleted file mode 100644 index 070d8a0..0000000 --- a/src/Types/DocAnnotationsUpdate400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate404ResponseCode.php b/src/Types/DocAnnotationsUpdate404ResponseCode.php deleted file mode 100644 index 6467c3b..0000000 --- a/src/Types/DocAnnotationsUpdate404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $changes + */ + #[JsonProperty('changes'), ArrayType([DocChanges200ResponseChangesItem::class])] + public array $changes; + + /** + * @param array{ + * changes: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->changes = $values['changes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocChanges200ResponseChangesItem.php b/src/Types/DocChanges200ResponseChangesItem.php new file mode 100644 index 0000000..124d7d5 --- /dev/null +++ b/src/Types/DocChanges200ResponseChangesItem.php @@ -0,0 +1,196 @@ +status = $values['status']; + $this->value = $values['value']; + } + + /** + * @param DocChanges200ResponseChangesItemApplied $applied + * @return DocChanges200ResponseChangesItem + */ + public static function applied(DocChanges200ResponseChangesItemApplied $applied): DocChanges200ResponseChangesItem + { + return new DocChanges200ResponseChangesItem([ + 'status' => 'applied', + 'value' => $applied, + ]); + } + + /** + * @param DocChanges200ResponseChangesItemRefused $refused + * @return DocChanges200ResponseChangesItem + */ + public static function refused(DocChanges200ResponseChangesItemRefused $refused): DocChanges200ResponseChangesItem + { + return new DocChanges200ResponseChangesItem([ + 'status' => 'refused', + 'value' => $refused, + ]); + } + + /** + * @return bool + */ + public function isApplied(): bool + { + return $this->value instanceof DocChanges200ResponseChangesItemApplied && $this->status === 'applied'; + } + + /** + * @return DocChanges200ResponseChangesItemApplied + */ + public function asApplied(): DocChanges200ResponseChangesItemApplied + { + if (!($this->value instanceof DocChanges200ResponseChangesItemApplied && $this->status === 'applied')) { + throw new Exception( + "Expected applied; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRefused(): bool + { + return $this->value instanceof DocChanges200ResponseChangesItemRefused && $this->status === 'refused'; + } + + /** + * @return DocChanges200ResponseChangesItemRefused + */ + public function asRefused(): DocChanges200ResponseChangesItemRefused + { + if (!($this->value instanceof DocChanges200ResponseChangesItemRefused && $this->status === 'refused')) { + throw new Exception( + "Expected refused; got " . $this->status . " 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['status'] = $this->status; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->status) { + case 'applied': + $value = $this->asApplied()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'refused': + $value = $this->asRefused()->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('status', $data)) { + throw new Exception( + "JSON data is missing property 'status'", + ); + } + $status = $data['status']; + if (!(is_string($status))) { + throw new Exception( + "Expected property 'status' in JSON data to be string, instead received " . get_debug_type($data['status']), + ); + } + + $args['status'] = $status; + switch ($status) { + case 'applied': + $args['value'] = DocChanges200ResponseChangesItemApplied::jsonDeserialize($data); + break; + case 'refused': + $args['value'] = DocChanges200ResponseChangesItemRefused::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['status'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocChanges200ResponseChangesItemApplied.php b/src/Types/DocChanges200ResponseChangesItemApplied.php new file mode 100644 index 0000000..88aaff3 --- /dev/null +++ b/src/Types/DocChanges200ResponseChangesItemApplied.php @@ -0,0 +1,42 @@ +opId = $values['opId']; + $this->result = $values['result']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocChanges200ResponseChangesItemRefused.php b/src/Types/DocChanges200ResponseChangesItemRefused.php new file mode 100644 index 0000000..c11f1c7 --- /dev/null +++ b/src/Types/DocChanges200ResponseChangesItemRefused.php @@ -0,0 +1,42 @@ +opId = $values['opId']; + $this->error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocDownloadResponse.php b/src/Types/DocDownloadResponse.php deleted file mode 100644 index 3db6480..0000000 --- a/src/Types/DocDownloadResponse.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocDownloadResponseCode.php b/src/Types/DocDownloadResponseCode.php deleted file mode 100644 index 9d5b300..0000000 --- a/src/Types/DocDownloadResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -widget = $values['widget']; + $this->page = $values['page']; + $this->field = $values['field'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsExportDataResponse.php b/src/Types/DocFormsExportDataResponse.php deleted file mode 100644 index efb388e..0000000 --- a/src/Types/DocFormsExportDataResponse.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsExportDataResponseCode.php b/src/Types/DocFormsExportDataResponseCode.php deleted file mode 100644 index 3243519..0000000 --- a/src/Types/DocFormsExportDataResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $formKind - */ - #[JsonProperty('formKind')] - public string $formKind; - - /** - * @var bool $needsAppearances - */ - #[JsonProperty('needsAppearances')] - public bool $needsAppearances; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType([DocFormsGet200ResponseFieldsItem::class])] - public array $fields; - - /** - * @var array $calculationOrder - */ - #[JsonProperty('calculationOrder'), ArrayType([new Union(DocFormsGet200ResponseCalculationOrderItem::class, 'null')])] - public array $calculationOrder; - - /** - * @param array{ - * formKind: value-of, - * needsAppearances: bool, - * fields: array, - * calculationOrder: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->formKind = $values['formKind']; - $this->needsAppearances = $values['needsAppearances']; - $this->fields = $values['fields']; - $this->calculationOrder = $values['calculationOrder']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseCalculationOrderItem.php b/src/Types/DocFormsGet200ResponseCalculationOrderItem.php deleted file mode 100644 index 555cd4b..0000000 --- a/src/Types/DocFormsGet200ResponseCalculationOrderItem.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseCalculationOrderItemObjectNumber $objectNumber - * @return DocFormsGet200ResponseCalculationOrderItem - */ - public static function objectNumber(DocFormsGet200ResponseCalculationOrderItemObjectNumber $objectNumber): DocFormsGet200ResponseCalculationOrderItem - { - return new DocFormsGet200ResponseCalculationOrderItem([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseCalculationOrderItemFqn $fqn - * @return DocFormsGet200ResponseCalculationOrderItem - */ - public static function fqn(DocFormsGet200ResponseCalculationOrderItemFqn $fqn): DocFormsGet200ResponseCalculationOrderItem - { - return new DocFormsGet200ResponseCalculationOrderItem([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseCalculationOrderItemObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseCalculationOrderItemObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseCalculationOrderItemObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseCalculationOrderItemObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseCalculationOrderItemFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseCalculationOrderItemFqn - */ - public function asFqn(): DocFormsGet200ResponseCalculationOrderItemFqn - { - if (!($this->value instanceof DocFormsGet200ResponseCalculationOrderItemFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseCalculationOrderItemObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseCalculationOrderItemFqn::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/DocFormsGet200ResponseCalculationOrderItemFqn.php b/src/Types/DocFormsGet200ResponseCalculationOrderItemFqn.php deleted file mode 100644 index 4f588e6..0000000 --- a/src/Types/DocFormsGet200ResponseCalculationOrderItemFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php b/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php deleted file mode 100644 index f8893ec..0000000 --- a/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItem.php b/src/Types/DocFormsGet200ResponseFieldsItem.php deleted file mode 100644 index 1c84e97..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItem.php +++ /dev/null @@ -1,466 +0,0 @@ -family = $values['family']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemText $text - * @return DocFormsGet200ResponseFieldsItem - */ - public static function text(DocFormsGet200ResponseFieldsItemText $text): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'text', - 'value' => $text, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckbox $checkbox - * @return DocFormsGet200ResponseFieldsItem - */ - public static function checkbox(DocFormsGet200ResponseFieldsItemCheckbox $checkbox): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'checkbox', - 'value' => $checkbox, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadio $radio - * @return DocFormsGet200ResponseFieldsItem - */ - public static function radio(DocFormsGet200ResponseFieldsItemRadio $radio): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'radio', - 'value' => $radio, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCombobox $combobox - * @return DocFormsGet200ResponseFieldsItem - */ - public static function combobox(DocFormsGet200ResponseFieldsItemCombobox $combobox): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'combobox', - 'value' => $combobox, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListbox $listbox - * @return DocFormsGet200ResponseFieldsItem - */ - public static function listbox(DocFormsGet200ResponseFieldsItemListbox $listbox): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'listbox', - 'value' => $listbox, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbutton $pushbutton - * @return DocFormsGet200ResponseFieldsItem - */ - public static function pushbutton(DocFormsGet200ResponseFieldsItemPushbutton $pushbutton): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'pushbutton', - 'value' => $pushbutton, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignature $signature - * @return DocFormsGet200ResponseFieldsItem - */ - public static function signature(DocFormsGet200ResponseFieldsItemSignature $signature): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'signature', - 'value' => $signature, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknown $unknown - * @return DocFormsGet200ResponseFieldsItem - */ - public static function unknown(DocFormsGet200ResponseFieldsItemUnknown $unknown): DocFormsGet200ResponseFieldsItem - { - return new DocFormsGet200ResponseFieldsItem([ - 'family' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isText(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemText && $this->family === 'text'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemText - */ - public function asText(): DocFormsGet200ResponseFieldsItemText - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemText && $this->family === 'text')) { - throw new Exception( - "Expected text; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCheckbox(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckbox && $this->family === 'checkbox'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckbox - */ - public function asCheckbox(): DocFormsGet200ResponseFieldsItemCheckbox - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckbox && $this->family === 'checkbox')) { - throw new Exception( - "Expected checkbox; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isRadio(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadio && $this->family === 'radio'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadio - */ - public function asRadio(): DocFormsGet200ResponseFieldsItemRadio - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadio && $this->family === 'radio')) { - throw new Exception( - "Expected radio; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isCombobox(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCombobox && $this->family === 'combobox'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCombobox - */ - public function asCombobox(): DocFormsGet200ResponseFieldsItemCombobox - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCombobox && $this->family === 'combobox')) { - throw new Exception( - "Expected combobox; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isListbox(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListbox && $this->family === 'listbox'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListbox - */ - public function asListbox(): DocFormsGet200ResponseFieldsItemListbox - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListbox && $this->family === 'listbox')) { - throw new Exception( - "Expected listbox; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isPushbutton(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbutton && $this->family === 'pushbutton'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbutton - */ - public function asPushbutton(): DocFormsGet200ResponseFieldsItemPushbutton - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbutton && $this->family === 'pushbutton')) { - throw new Exception( - "Expected pushbutton; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isSignature(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignature && $this->family === 'signature'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignature - */ - public function asSignature(): DocFormsGet200ResponseFieldsItemSignature - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignature && $this->family === 'signature')) { - throw new Exception( - "Expected signature; got " . $this->family . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknown && $this->family === 'unknown'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknown - */ - public function asUnknown(): DocFormsGet200ResponseFieldsItemUnknown - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknown && $this->family === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->family . " 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['family'] = $this->family; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->family) { - case 'text': - $value = $this->asText()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'checkbox': - $value = $this->asCheckbox()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'radio': - $value = $this->asRadio()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'combobox': - $value = $this->asCombobox()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'listbox': - $value = $this->asListbox()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'pushbutton': - $value = $this->asPushbutton()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'signature': - $value = $this->asSignature()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('family', $data)) { - throw new Exception( - "JSON data is missing property 'family'", - ); - } - $family = $data['family']; - if (!(is_string($family))) { - throw new Exception( - "Expected property 'family' in JSON data to be string, instead received " . get_debug_type($data['family']), - ); - } - - $args['family'] = $family; - switch ($family) { - case 'text': - $args['value'] = DocFormsGet200ResponseFieldsItemText::jsonDeserialize($data); - break; - case 'checkbox': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckbox::jsonDeserialize($data); - break; - case 'radio': - $args['value'] = DocFormsGet200ResponseFieldsItemRadio::jsonDeserialize($data); - break; - case 'combobox': - $args['value'] = DocFormsGet200ResponseFieldsItemCombobox::jsonDeserialize($data); - break; - case 'listbox': - $args['value'] = DocFormsGet200ResponseFieldsItemListbox::jsonDeserialize($data); - break; - case 'pushbutton': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbutton::jsonDeserialize($data); - break; - case 'signature': - $args['value'] = DocFormsGet200ResponseFieldsItemSignature::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['family'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckbox.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckbox.php deleted file mode 100644 index e04299e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckbox.php +++ /dev/null @@ -1,131 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemCheckboxFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemCheckboxFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemCheckboxValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemCheckboxValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem::class])] - public array $widgets; - - /** - * @var bool $checked - */ - #[JsonProperty('checked')] - public bool $checked; - - /** - * @var string $exportValue - */ - #[JsonProperty('exportValue')] - public string $exportValue; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemCheckboxRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemCheckboxFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemCheckboxValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry, - * widgets: array, - * checked: bool, - * exportValue: string, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->checked = $values['checked']; - $this->exportValue = $values['exportValue']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry.php deleted file mode 100644 index c29418b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray.php deleted file mode 100644 index c615620..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php deleted file mode 100644 index 27c1ff7..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php deleted file mode 100644 index c1c63f3..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php deleted file mode 100644 index 401f810..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php deleted file mode 100644 index fca2101..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxOrigin.php deleted file mode 100644 index 814d4db..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemCheckboxRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemCheckboxRef - { - return new DocFormsGet200ResponseFieldsItemCheckboxRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemCheckboxRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemCheckboxRefFqn $fqn): DocFormsGet200ResponseFieldsItemCheckboxRef - { - return new DocFormsGet200ResponseFieldsItemCheckboxRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemCheckboxRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxRefFqn::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/DocFormsGet200ResponseFieldsItemCheckboxRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefFqn.php deleted file mode 100644 index 8c5d760..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php deleted file mode 100644 index 03e5d5b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php deleted file mode 100644 index 0737114..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone $none): DocFormsGet200ResponseFieldsItemCheckboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemCheckboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray $array): DocFormsGet200ResponseFieldsItemCheckboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemCheckboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemCheckboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray.php deleted file mode 100644 index 0e55509..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php deleted file mode 100644 index a98298a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php deleted file mode 100644 index 02d5049..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php deleted file mode 100644 index b861a05..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php deleted file mode 100644 index 4f03b82..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php +++ /dev/null @@ -1,66 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->onState = $values['onState']; - $this->exportValue = $values['exportValue']; - $this->checked = $values['checked']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCombobox.php b/src/Types/DocFormsGet200ResponseFieldsItemCombobox.php deleted file mode 100644 index f8395de..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemCombobox.php +++ /dev/null @@ -1,147 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemComboboxFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemComboboxFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemComboboxValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemComboboxValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemComboboxWidgetsItem::class])] - public array $widgets; - - /** - * @var string $value - */ - #[JsonProperty('value')] - public string $value; - - /** - * @var string $defaultValue - */ - #[JsonProperty('defaultValue')] - public string $defaultValue; - - /** - * @var bool $edit - */ - #[JsonProperty('edit')] - public bool $edit; - - /** - * @var array $options - */ - #[JsonProperty('options'), ArrayType([DocFormsGet200ResponseFieldsItemComboboxOptionsItem::class])] - public array $options; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemComboboxRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemComboboxFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemComboboxValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry, - * widgets: array, - * value: string, - * defaultValue: string, - * edit: bool, - * options: array, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->value = $values['value']; - $this->defaultValue = $values['defaultValue']; - $this->edit = $values['edit']; - $this->options = $values['options']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry.php deleted file mode 100644 index ef594aa..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray.php deleted file mode 100644 index 3059ec4..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php deleted file mode 100644 index 60ecd72..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php deleted file mode 100644 index 6b3a8b2..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php deleted file mode 100644 index 5905086..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php deleted file mode 100644 index 78e3252..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxOptionsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxOptionsItem.php deleted file mode 100644 index 2e4a5d1..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxOptionsItem.php +++ /dev/null @@ -1,50 +0,0 @@ -label = $values['label']; - $this->value = $values['value']; - $this->selected = $values['selected']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxOrigin.php deleted file mode 100644 index 70df73e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemComboboxRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemComboboxRef - { - return new DocFormsGet200ResponseFieldsItemComboboxRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemComboboxRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemComboboxRefFqn $fqn): DocFormsGet200ResponseFieldsItemComboboxRef - { - return new DocFormsGet200ResponseFieldsItemComboboxRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemComboboxRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxRefFqn::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/DocFormsGet200ResponseFieldsItemComboboxRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefFqn.php deleted file mode 100644 index 2d0c7bc..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php deleted file mode 100644 index 8789339..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php deleted file mode 100644 index a5f5ea7..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemComboboxValueEntryNone $none): DocFormsGet200ResponseFieldsItemComboboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemComboboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemComboboxValueEntryArray $array): DocFormsGet200ResponseFieldsItemComboboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemComboboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemComboboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemComboboxValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemComboboxValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemComboboxValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryArray.php deleted file mode 100644 index 68fa180..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php deleted file mode 100644 index c2b7c76..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php deleted file mode 100644 index d2cdc84..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php deleted file mode 100644 index 6ee0b0f..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php deleted file mode 100644 index ac44501..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListbox.php b/src/Types/DocFormsGet200ResponseFieldsItemListbox.php deleted file mode 100644 index ec5915e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListbox.php +++ /dev/null @@ -1,139 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemListboxFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemListboxFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemListboxValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemListboxValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemListboxWidgetsItem::class])] - public array $widgets; - - /** - * @var array $selectedValues - */ - #[JsonProperty('selectedValues'), ArrayType(['string'])] - public array $selectedValues; - - /** - * @var bool $multiSelect - */ - #[JsonProperty('multiSelect')] - public bool $multiSelect; - - /** - * @var array $options - */ - #[JsonProperty('options'), ArrayType([DocFormsGet200ResponseFieldsItemListboxOptionsItem::class])] - public array $options; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemListboxRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemListboxFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemListboxValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry, - * widgets: array, - * selectedValues: array, - * multiSelect: bool, - * options: array, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->selectedValues = $values['selectedValues']; - $this->multiSelect = $values['multiSelect']; - $this->options = $values['options']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry.php deleted file mode 100644 index 10d4c10..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray.php deleted file mode 100644 index fe2031c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php deleted file mode 100644 index 713c6f1..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php deleted file mode 100644 index 0bcb624..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php deleted file mode 100644 index ba333ad..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php deleted file mode 100644 index 59f96a8..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxOptionsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxOptionsItem.php deleted file mode 100644 index 0f34e2b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxOptionsItem.php +++ /dev/null @@ -1,50 +0,0 @@ -label = $values['label']; - $this->value = $values['value']; - $this->selected = $values['selected']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxOrigin.php deleted file mode 100644 index c5e5738..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemListboxRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemListboxRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemListboxRef - { - return new DocFormsGet200ResponseFieldsItemListboxRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemListboxRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemListboxRefFqn $fqn): DocFormsGet200ResponseFieldsItemListboxRef - { - return new DocFormsGet200ResponseFieldsItemListboxRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemListboxRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemListboxRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxRefFqn::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/DocFormsGet200ResponseFieldsItemListboxRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxRefFqn.php deleted file mode 100644 index 8b0689f..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php deleted file mode 100644 index 6c31eeb..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php deleted file mode 100644 index 805848a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemListboxValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemListboxValueEntryNone $none): DocFormsGet200ResponseFieldsItemListboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemListboxValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemListboxValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemListboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemListboxValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemListboxValueEntryArray $array): DocFormsGet200ResponseFieldsItemListboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemListboxValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemListboxValueEntry - { - return new DocFormsGet200ResponseFieldsItemListboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemListboxValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemListboxValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemListboxValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemListboxValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryArray.php deleted file mode 100644 index 9faab20..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php deleted file mode 100644 index 36cdb12..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php deleted file mode 100644 index 5ca0a4c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php deleted file mode 100644 index 626b1dd..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php deleted file mode 100644 index 2b82c16..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbutton.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbutton.php deleted file mode 100644 index b21ddc8..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbutton.php +++ /dev/null @@ -1,115 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemPushbuttonFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemPushbuttonFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemPushbuttonValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemPushbuttonValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem::class])] - public array $widgets; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemPushbuttonRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemPushbuttonFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemPushbuttonValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry, - * widgets: array, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry.php deleted file mode 100644 index 694c469..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray.php deleted file mode 100644 index 523cc12..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php deleted file mode 100644 index 99314fd..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php deleted file mode 100644 index a08b12a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php deleted file mode 100644 index 6ff8108..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php deleted file mode 100644 index c266b82..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonOrigin.php deleted file mode 100644 index 38e41d1..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemPushbuttonRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemPushbuttonRef - { - return new DocFormsGet200ResponseFieldsItemPushbuttonRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemPushbuttonRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemPushbuttonRefFqn $fqn): DocFormsGet200ResponseFieldsItemPushbuttonRef - { - return new DocFormsGet200ResponseFieldsItemPushbuttonRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemPushbuttonRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonRefFqn::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/DocFormsGet200ResponseFieldsItemPushbuttonRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefFqn.php deleted file mode 100644 index fc96c5e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php deleted file mode 100644 index a0e7a7b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php deleted file mode 100644 index 8827ceb..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone $none): DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray $array): DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemPushbuttonValueEntry - { - return new DocFormsGet200ResponseFieldsItemPushbuttonValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray.php deleted file mode 100644 index 549a4b3..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php deleted file mode 100644 index b6e8b17..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php deleted file mode 100644 index 3b5d7b6..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php deleted file mode 100644 index 146b564..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php deleted file mode 100644 index 664c13f..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadio.php b/src/Types/DocFormsGet200ResponseFieldsItemRadio.php deleted file mode 100644 index 08d3e64..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadio.php +++ /dev/null @@ -1,139 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemRadioFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemRadioFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemRadioValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemRadioValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemRadioWidgetsItem::class])] - public array $widgets; - - /** - * @var string $value - */ - #[JsonProperty('value')] - public string $value; - - /** - * @var bool $radiosInUnison - */ - #[JsonProperty('radiosInUnison')] - public bool $radiosInUnison; - - /** - * @var bool $noToggleToOff - */ - #[JsonProperty('noToggleToOff')] - public bool $noToggleToOff; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemRadioRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemRadioFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemRadioValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry, - * widgets: array, - * value: string, - * radiosInUnison: bool, - * noToggleToOff: bool, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->value = $values['value']; - $this->radiosInUnison = $values['radiosInUnison']; - $this->noToggleToOff = $values['noToggleToOff']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry.php deleted file mode 100644 index 98af0a0..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray.php deleted file mode 100644 index e881c77..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php deleted file mode 100644 index 602db40..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php deleted file mode 100644 index ea264d2..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php deleted file mode 100644 index 10da1b5..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php deleted file mode 100644 index 417aba2..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioOrigin.php deleted file mode 100644 index 3bdbfcb..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemRadioRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemRadioRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemRadioRef - { - return new DocFormsGet200ResponseFieldsItemRadioRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemRadioRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemRadioRefFqn $fqn): DocFormsGet200ResponseFieldsItemRadioRef - { - return new DocFormsGet200ResponseFieldsItemRadioRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemRadioRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemRadioRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioRefFqn::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/DocFormsGet200ResponseFieldsItemRadioRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioRefFqn.php deleted file mode 100644 index 7dda3c9..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php deleted file mode 100644 index 8e4c5ad..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php deleted file mode 100644 index 3dbeff0..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemRadioValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemRadioValueEntryNone $none): DocFormsGet200ResponseFieldsItemRadioValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemRadioValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemRadioValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemRadioValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemRadioValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemRadioValueEntryArray $array): DocFormsGet200ResponseFieldsItemRadioValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemRadioValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemRadioValueEntry - { - return new DocFormsGet200ResponseFieldsItemRadioValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemRadioValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemRadioValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemRadioValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemRadioValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryArray.php deleted file mode 100644 index f5cf2a9..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php deleted file mode 100644 index c0e5e8e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php deleted file mode 100644 index a8daa2c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php deleted file mode 100644 index 6e8fb03..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php deleted file mode 100644 index 5238a45..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php +++ /dev/null @@ -1,66 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->onState = $values['onState']; - $this->exportValue = $values['exportValue']; - $this->checked = $values['checked']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignature.php b/src/Types/DocFormsGet200ResponseFieldsItemSignature.php deleted file mode 100644 index d5130ea..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignature.php +++ /dev/null @@ -1,115 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemSignatureFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemSignatureFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemSignatureValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemSignatureValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemSignatureWidgetsItem::class])] - public array $widgets; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemSignatureRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemSignatureFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemSignatureValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry, - * widgets: array, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry.php deleted file mode 100644 index 721346c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray.php deleted file mode 100644 index 15db871..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php deleted file mode 100644 index 0ad7060..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php deleted file mode 100644 index 0b5dc85..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php deleted file mode 100644 index d84a54c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php deleted file mode 100644 index d33a7c1..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureOrigin.php deleted file mode 100644 index 51051ac..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemSignatureRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemSignatureRef - { - return new DocFormsGet200ResponseFieldsItemSignatureRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemSignatureRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemSignatureRefFqn $fqn): DocFormsGet200ResponseFieldsItemSignatureRef - { - return new DocFormsGet200ResponseFieldsItemSignatureRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemSignatureRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureRefFqn::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/DocFormsGet200ResponseFieldsItemSignatureRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefFqn.php deleted file mode 100644 index 12b8073..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php deleted file mode 100644 index fa5b266..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php deleted file mode 100644 index f4a0ceb..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemSignatureValueEntryNone $none): DocFormsGet200ResponseFieldsItemSignatureValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemSignatureValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemSignatureValueEntryArray $array): DocFormsGet200ResponseFieldsItemSignatureValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemSignatureValueEntry - { - return new DocFormsGet200ResponseFieldsItemSignatureValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemSignatureValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemSignatureValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemSignatureValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryArray.php deleted file mode 100644 index aa790b0..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php deleted file mode 100644 index 43dd23a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php deleted file mode 100644 index 9f09c5f..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php deleted file mode 100644 index 31bfe64..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php deleted file mode 100644 index dd3b4db..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemText.php b/src/Types/DocFormsGet200ResponseFieldsItemText.php deleted file mode 100644 index f022c2e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemText.php +++ /dev/null @@ -1,163 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemTextFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemTextFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemTextValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemTextValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemTextDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemTextDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemTextWidgetsItem::class])] - public array $widgets; - - /** - * @var string $value - */ - #[JsonProperty('value')] - public string $value; - - /** - * @var string $defaultValue - */ - #[JsonProperty('defaultValue')] - public string $defaultValue; - - /** - * @var ?int $maxLength - */ - #[JsonProperty('maxLength')] - public ?int $maxLength; - - /** - * @var bool $multiline - */ - #[JsonProperty('multiline')] - public bool $multiline; - - /** - * @var bool $password - */ - #[JsonProperty('password')] - public bool $password; - - /** - * @var bool $comb - */ - #[JsonProperty('comb')] - public bool $comb; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemTextRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemTextFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemTextValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemTextDefaultValueEntry, - * widgets: array, - * value: string, - * defaultValue: string, - * multiline: bool, - * password: bool, - * comb: bool, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * maxLength?: ?int, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->value = $values['value']; - $this->defaultValue = $values['defaultValue']; - $this->maxLength = $values['maxLength'] ?? null; - $this->multiline = $values['multiline']; - $this->password = $values['password']; - $this->comb = $values['comb']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntry.php deleted file mode 100644 index 5f62a46..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemTextDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray.php deleted file mode 100644 index 5b96573..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php deleted file mode 100644 index 0adc6ed..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php deleted file mode 100644 index b68c111..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php deleted file mode 100644 index 575e5bc..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php deleted file mode 100644 index 2e93be4..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemTextOrigin.php deleted file mode 100644 index f41e99a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemTextRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemTextRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemTextRef - { - return new DocFormsGet200ResponseFieldsItemTextRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemTextRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemTextRefFqn $fqn): DocFormsGet200ResponseFieldsItemTextRef - { - return new DocFormsGet200ResponseFieldsItemTextRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemTextRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemTextRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemTextRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemTextRefFqn::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/DocFormsGet200ResponseFieldsItemTextRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemTextRefFqn.php deleted file mode 100644 index 331953e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php deleted file mode 100644 index 4d1694c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php deleted file mode 100644 index 5d29251..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemTextValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemTextValueEntryNone $none): DocFormsGet200ResponseFieldsItemTextValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemTextValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemTextValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemTextValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemTextValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemTextValueEntryArray $array): DocFormsGet200ResponseFieldsItemTextValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemTextValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemTextValueEntry - { - return new DocFormsGet200ResponseFieldsItemTextValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemTextValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemTextValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemTextValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemTextValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemTextValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemTextValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemTextValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryArray.php deleted file mode 100644 index 439cb21..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php deleted file mode 100644 index d4ccf4a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php deleted file mode 100644 index a23686b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php deleted file mode 100644 index 80018ba..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php deleted file mode 100644 index b6e801e..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknown.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknown.php deleted file mode 100644 index f640145..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknown.php +++ /dev/null @@ -1,123 +0,0 @@ - $origin - */ - #[JsonProperty('origin')] - public string $origin; - - /** - * @var DocFormsGet200ResponseFieldsItemUnknownFlags $flags - */ - #[JsonProperty('flags')] - public DocFormsGet200ResponseFieldsItemUnknownFlags $flags; - - /** - * @var ?string $alternateName - */ - #[JsonProperty('alternateName')] - public ?string $alternateName; - - /** - * @var ?string $mappingName - */ - #[JsonProperty('mappingName')] - public ?string $mappingName; - - /** - * @var DocFormsGet200ResponseFieldsItemUnknownValueEntry $valueEntry - */ - #[JsonProperty('valueEntry')] - public DocFormsGet200ResponseFieldsItemUnknownValueEntry $valueEntry; - - /** - * @var DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry $defaultValueEntry - */ - #[JsonProperty('defaultValueEntry')] - public DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry $defaultValueEntry; - - /** - * @var ?PdfFieldActions $actions - */ - #[JsonProperty('actions')] - public ?PdfFieldActions $actions; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([DocFormsGet200ResponseFieldsItemUnknownWidgetsItem::class])] - public array $widgets; - - /** - * @var string $rawValue - */ - #[JsonProperty('rawValue')] - public string $rawValue; - - /** - * @param array{ - * ref: DocFormsGet200ResponseFieldsItemUnknownRef, - * fieldObjectNumber: int, - * name: string, - * origin: value-of, - * flags: DocFormsGet200ResponseFieldsItemUnknownFlags, - * valueEntry: DocFormsGet200ResponseFieldsItemUnknownValueEntry, - * defaultValueEntry: DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry, - * widgets: array, - * rawValue: string, - * alternateName?: ?string, - * mappingName?: ?string, - * actions?: ?PdfFieldActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->fieldObjectNumber = $values['fieldObjectNumber']; - $this->name = $values['name']; - $this->origin = $values['origin']; - $this->flags = $values['flags']; - $this->alternateName = $values['alternateName'] ?? null; - $this->mappingName = $values['mappingName'] ?? null; - $this->valueEntry = $values['valueEntry']; - $this->defaultValueEntry = $values['defaultValueEntry']; - $this->actions = $values['actions'] ?? null; - $this->widgets = $values['widgets']; - $this->rawValue = $values['rawValue']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry.php deleted file mode 100644 index a38d92d..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone $none): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray $array): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray.php deleted file mode 100644 index f45e28f..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php deleted file mode 100644 index d9e7b9c..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php deleted file mode 100644 index 03b61e7..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php deleted file mode 100644 index dfc16c7..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php deleted file mode 100644 index 198d8ee..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php +++ /dev/null @@ -1,58 +0,0 @@ -readOnly = $values['readOnly']; - $this->required = $values['required']; - $this->noExport = $values['noExport']; - $this->raw = $values['raw']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownOrigin.php deleted file mode 100644 index f9d47b6..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownOrigin.php +++ /dev/null @@ -1,9 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber $objectNumber - * @return DocFormsGet200ResponseFieldsItemUnknownRef - */ - public static function objectNumber(DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber $objectNumber): DocFormsGet200ResponseFieldsItemUnknownRef - { - return new DocFormsGet200ResponseFieldsItemUnknownRef([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownRefFqn $fqn - * @return DocFormsGet200ResponseFieldsItemUnknownRef - */ - public static function fqn(DocFormsGet200ResponseFieldsItemUnknownRefFqn $fqn): DocFormsGet200ResponseFieldsItemUnknownRef - { - return new DocFormsGet200ResponseFieldsItemUnknownRef([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber - */ - public function asObjectNumber(): DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownRefFqn && $this->kind === 'fqn'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownRefFqn - */ - public function asFqn(): DocFormsGet200ResponseFieldsItemUnknownRefFqn - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownRefFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownRefFqn::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/DocFormsGet200ResponseFieldsItemUnknownRefFqn.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefFqn.php deleted file mode 100644 index 528bd77..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php deleted file mode 100644 index bfbd9f0..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php deleted file mode 100644 index d4e126a..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownValueEntryNone $none - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntry - */ - public static function none(DocFormsGet200ResponseFieldsItemUnknownValueEntryNone $none): DocFormsGet200ResponseFieldsItemUnknownValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar $scalar - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntry - */ - public static function scalar(DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar $scalar): DocFormsGet200ResponseFieldsItemUnknownValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownValueEntryArray $array - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntry - */ - public static function array(DocFormsGet200ResponseFieldsItemUnknownValueEntryArray $array): DocFormsGet200ResponseFieldsItemUnknownValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported $unsupported - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntry - */ - public static function unsupported(DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported $unsupported): DocFormsGet200ResponseFieldsItemUnknownValueEntry - { - return new DocFormsGet200ResponseFieldsItemUnknownValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryNone && $this->kind === 'none'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntryNone - */ - public function asNone(): DocFormsGet200ResponseFieldsItemUnknownValueEntryNone - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar - */ - public function asScalar(): DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryArray && $this->kind === 'array'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntryArray - */ - public function asArray(): DocFormsGet200ResponseFieldsItemUnknownValueEntryArray - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported - */ - public function asUnsupported(): DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported - { - if (!($this->value instanceof DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; 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 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->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 'none': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported::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/DocFormsGet200ResponseFieldsItemUnknownValueEntryArray.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryArray.php deleted file mode 100644 index ab107e7..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php deleted file mode 100644 index 91ee597..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php deleted file mode 100644 index 7991494..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php deleted file mode 100644 index 060f78b..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php deleted file mode 100644 index 4ae3186..0000000 --- a/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet200ResponseFormKind.php b/src/Types/DocFormsGet200ResponseFormKind.php deleted file mode 100644 index 44b68c4..0000000 --- a/src/Types/DocFormsGet200ResponseFormKind.php +++ /dev/null @@ -1,10 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsGet404ResponseCode.php b/src/Types/DocFormsGet404ResponseCode.php deleted file mode 100644 index 05bbe7d..0000000 --- a/src/Types/DocFormsGet404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMeta.php b/src/Types/DocFormsImportData200ResponseMeta.php deleted file mode 100644 index d7e95b0..0000000 --- a/src/Types/DocFormsImportData200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocFormsImportData200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocFormsImportData200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocFormsImportData200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocFormsImportData200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItem.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 0c83038..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index f2a5e12..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 37c6c32..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 598ecf9..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index a10ce35..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php b/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php deleted file mode 100644 index a3f0480..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocFormsImportData200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index cb854c1..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 7f70ee0..0000000 --- a/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData400Response.php b/src/Types/DocFormsImportData400Response.php deleted file mode 100644 index 8bf34bc..0000000 --- a/src/Types/DocFormsImportData400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData400ResponseCode.php b/src/Types/DocFormsImportData400ResponseCode.php deleted file mode 100644 index ab82db8..0000000 --- a/src/Types/DocFormsImportData400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsImportData404ResponseCode.php b/src/Types/DocFormsImportData404ResponseCode.php deleted file mode 100644 index fec695d..0000000 --- a/src/Types/DocFormsImportData404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $formKind + */ + #[JsonProperty('formKind')] + public string $formKind; + + /** + * @var bool $needsAppearances + */ + #[JsonProperty('needsAppearances')] + public bool $needsAppearances; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var array $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([new Union(FormFieldRef::class, 'null')])] + public array $calculationOrder; + + /** + * @param array{ + * formKind: value-of, + * needsAppearances: bool, + * fields: array, + * widgets: array, + * calculationOrder: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->formKind = $values['formKind']; + $this->needsAppearances = $values['needsAppearances']; + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; + $this->calculationOrder = $values['calculationOrder']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsList200ResponseFormKind.php b/src/Types/DocFormsList200ResponseFormKind.php new file mode 100644 index 0000000..1f754b9 --- /dev/null +++ b/src/Types/DocFormsList200ResponseFormKind.php @@ -0,0 +1,10 @@ + $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * calculationOrder: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->calculationOrder = $values['calculationOrder']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReorderWidgets200Response.php b/src/Types/DocFormsReorderWidgets200Response.php new file mode 100644 index 0000000..70cb39f --- /dev/null +++ b/src/Types/DocFormsReorderWidgets200Response.php @@ -0,0 +1,51 @@ + $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * order: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReset200Response.php b/src/Types/DocFormsReset200Response.php index 0be57bc..1e0f1a7 100644 --- a/src/Types/DocFormsReset200Response.php +++ b/src/Types/DocFormsReset200Response.php @@ -4,23 +4,40 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; class DocFormsReset200Response extends JsonSerializableType { /** - * @var DocFormsReset200ResponseMeta $meta + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta */ #[JsonProperty('meta')] - public DocFormsReset200ResponseMeta $meta; + public FormMutationMeta $meta; /** * @param array{ - * meta: DocFormsReset200ResponseMeta, + * fields: array, + * widgets: array, + * meta: FormMutationMeta, * } $values */ public function __construct( array $values, ) { + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; $this->meta = $values['meta']; } diff --git a/src/Types/DocFormsReset200ResponseMeta.php b/src/Types/DocFormsReset200ResponseMeta.php deleted file mode 100644 index d7c8753..0000000 --- a/src/Types/DocFormsReset200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocFormsReset200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocFormsReset200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocFormsReset200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocFormsReset200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItem.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index a32441a..0000000 --- a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 7d3c0a3..0000000 --- a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 95cec03..0000000 --- a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 81c9bc0..0000000 --- a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index a2e2779..0000000 --- a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaCacheDelta.php b/src/Types/DocFormsReset200ResponseMetaCacheDelta.php deleted file mode 100644 index f190441..0000000 --- a/src/Types/DocFormsReset200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocFormsReset200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index b4cab91..0000000 --- a/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index cf92123..0000000 --- a/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset404Response.php b/src/Types/DocFormsReset404Response.php deleted file mode 100644 index 4a97d6d..0000000 --- a/src/Types/DocFormsReset404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReset404ResponseCode.php b/src/Types/DocFormsReset404ResponseCode.php deleted file mode 100644 index 9977c67..0000000 --- a/src/Types/DocFormsReset404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta */ #[JsonProperty('meta')] - public DocFormsSetValue200ResponseMeta $meta; + public FormMutationMeta $meta; /** * @param array{ - * meta: DocFormsSetValue200ResponseMeta, + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, * } $values */ public function __construct( array $values, ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; $this->meta = $values['meta']; } diff --git a/src/Types/DocFormsSetValue200ResponseMeta.php b/src/Types/DocFormsSetValue200ResponseMeta.php deleted file mode 100644 index 08fd26a..0000000 --- a/src/Types/DocFormsSetValue200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocFormsSetValue200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocFormsSetValue200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocFormsSetValue200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocFormsSetValue200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItem.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 6d09698..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 8889628..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 81d74c9..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 40a38ea..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 85fe353..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php b/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php deleted file mode 100644 index 406413e..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocFormsSetValue200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index ddea8fb..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 8e2f753..0000000 --- a/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue400Response.php b/src/Types/DocFormsSetValue400Response.php deleted file mode 100644 index df17cb4..0000000 --- a/src/Types/DocFormsSetValue400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue400ResponseCode.php b/src/Types/DocFormsSetValue400ResponseCode.php deleted file mode 100644 index 19139d3..0000000 --- a/src/Types/DocFormsSetValue400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValue404ResponseCode.php b/src/Types/DocFormsSetValue404ResponseCode.php deleted file mode 100644 index f063ec2..0000000 --- a/src/Types/DocFormsSetValue404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -widget = $values['widget']; + $this->appearance = $values['appearance']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsUpdateWidget200ResponseAppearance.php b/src/Types/DocFormsUpdateWidget200ResponseAppearance.php new file mode 100644 index 0000000..f724b29 --- /dev/null +++ b/src/Types/DocFormsUpdateWidget200ResponseAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php b/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php new file mode 100644 index 0000000..1f4c9fe --- /dev/null +++ b/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php @@ -0,0 +1,11 @@ + $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocHead404ResponseCode.php b/src/Types/DocHead404ResponseCode.php deleted file mode 100644 index d02c454..0000000 --- a/src/Types/DocHead404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $pages */ @@ -97,10 +109,12 @@ class DocManifest200Response extends JsonSerializableType * actionsVersion?: ?int, * attachmentsVersion?: ?int, * annotationsVersion?: ?int, + * formsVersion?: ?int, * layerVersion?: ?int, * working?: ?bool, * baseByteLength?: ?int, * scopes?: ?DocManifest200ResponseScopes, + * protection?: ?DocManifest200ResponseProtection, * } $values */ public function __construct( @@ -112,12 +126,14 @@ public function __construct( $this->actionsVersion = $values['actionsVersion'] ?? null; $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; $this->annotationsVersion = $values['annotationsVersion'] ?? null; + $this->formsVersion = $values['formsVersion'] ?? null; $this->auditHead = $values['auditHead']; $this->baseSha = $values['baseSha']; $this->layerVersion = $values['layerVersion'] ?? null; $this->working = $values['working'] ?? null; $this->baseByteLength = $values['baseByteLength'] ?? null; $this->scopes = $values['scopes'] ?? null; + $this->protection = $values['protection'] ?? null; $this->pages = $values['pages']; } diff --git a/src/Types/DocManifest200ResponsePagesItem.php b/src/Types/DocManifest200ResponsePagesItem.php index c0481c8..4e0cc8f 100644 --- a/src/Types/DocManifest200ResponsePagesItem.php +++ b/src/Types/DocManifest200ResponsePagesItem.php @@ -8,10 +8,10 @@ class DocManifest200ResponsePagesItem extends JsonSerializableType { /** - * @var DocManifest200ResponsePagesItemState $state + * @var PageRef $page */ - #[JsonProperty('state')] - public DocManifest200ResponsePagesItemState $state; + #[JsonProperty('page')] + public PageRef $page; /** * @var DocManifest200ResponsePagesItemCache $cache @@ -21,14 +21,14 @@ class DocManifest200ResponsePagesItem extends JsonSerializableType /** * @param array{ - * state: DocManifest200ResponsePagesItemState, + * page: PageRef, * cache: DocManifest200ResponsePagesItemCache, * } $values */ public function __construct( array $values, ) { - $this->state = $values['state']; + $this->page = $values['page']; $this->cache = $values['cache']; } diff --git a/src/Types/DocManifest200ResponsePagesItemCache.php b/src/Types/DocManifest200ResponsePagesItemCache.php index 35c6dfc..79b7ad3 100644 --- a/src/Types/DocManifest200ResponsePagesItemCache.php +++ b/src/Types/DocManifest200ResponsePagesItemCache.php @@ -19,10 +19,17 @@ class DocManifest200ResponsePagesItemCache extends JsonSerializableType #[JsonProperty('annotationVersion')] public int $annotationVersion; + /** + * @var int $widgetVersion + */ + #[JsonProperty('widgetVersion')] + public int $widgetVersion; + /** * @param array{ * contentVersion: int, * annotationVersion: int, + * widgetVersion: int, * } $values */ public function __construct( @@ -30,6 +37,7 @@ public function __construct( ) { $this->contentVersion = $values['contentVersion']; $this->annotationVersion = $values['annotationVersion']; + $this->widgetVersion = $values['widgetVersion']; } /** diff --git a/src/Types/DocManifest200ResponsePagesItemState.php b/src/Types/DocManifest200ResponsePagesItemState.php deleted file mode 100644 index a937f0f..0000000 --- a/src/Types/DocManifest200ResponsePagesItemState.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponsePagesItemStateRevision.php b/src/Types/DocManifest200ResponsePagesItemStateRevision.php deleted file mode 100644 index 8ce4d1f..0000000 --- a/src/Types/DocManifest200ResponsePagesItemStateRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationState.php b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationState.php deleted file mode 100644 index fa0f14e..0000000 --- a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown $unknown - * @return DocManifest200ResponsePagesItemStateWeakAnnotationState - */ - public static function unknown(DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown $unknown): DocManifest200ResponsePagesItemStateWeakAnnotationState - { - return new DocManifest200ResponsePagesItemStateWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown $known - * @return DocManifest200ResponsePagesItemStateWeakAnnotationState - */ - public static function known(DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown $known): DocManifest200ResponsePagesItemStateWeakAnnotationState - { - return new DocManifest200ResponsePagesItemStateWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown - */ - public function asUnknown(): DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown - */ - public function asKnown(): DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown - { - if (!($this->value instanceof DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown::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/DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown.php b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown.php deleted file mode 100644 index f7f4175..0000000 --- a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php deleted file mode 100644 index 5d1e30e..0000000 --- a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtection.php b/src/Types/DocManifest200ResponseProtection.php new file mode 100644 index 0000000..9f37dd7 --- /dev/null +++ b/src/Types/DocManifest200ResponseProtection.php @@ -0,0 +1,67 @@ + $enforced + */ + #[JsonProperty('enforced')] + public ?string $enforced; + + /** + * @var ?value-of $judged + */ + #[JsonProperty('judged')] + public ?string $judged; + + /** + * @var ?DocManifest200ResponseProtectionCertification $certification + */ + #[JsonProperty('certification')] + public ?DocManifest200ResponseProtectionCertification $certification; + + /** + * @var array $fieldLocks + */ + #[JsonProperty('fieldLocks'), ArrayType([DocManifest200ResponseProtectionFieldLocksItem::class])] + public array $fieldLocks; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @param array{ + * fieldLocks: array, + * policyVersion: int, + * enforced?: ?value-of, + * judged?: ?value-of, + * certification?: ?DocManifest200ResponseProtectionCertification, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enforced = $values['enforced'] ?? null; + $this->judged = $values['judged'] ?? null; + $this->certification = $values['certification'] ?? null; + $this->fieldLocks = $values['fieldLocks']; + $this->policyVersion = $values['policyVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseProtectionCertification.php b/src/Types/DocManifest200ResponseProtectionCertification.php new file mode 100644 index 0000000..25194bb --- /dev/null +++ b/src/Types/DocManifest200ResponseProtectionCertification.php @@ -0,0 +1,42 @@ +signatureIndex = $values['signatureIndex']; + $this->permission = $values['permission']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseProtectionEnforced.php b/src/Types/DocManifest200ResponseProtectionEnforced.php new file mode 100644 index 0000000..1a629e6 --- /dev/null +++ b/src/Types/DocManifest200ResponseProtectionEnforced.php @@ -0,0 +1,11 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var DocManifest200ResponseProtectionFieldLocksItemSpec $spec + */ + #[JsonProperty('spec')] + public DocManifest200ResponseProtectionFieldLocksItemSpec $spec; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * spec: DocManifest200ResponseProtectionFieldLocksItemSpec, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + $this->spec = $values['spec']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php new file mode 100644 index 0000000..01ca007 --- /dev/null +++ b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php @@ -0,0 +1,9 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType(['string'])] + public array $fields; + + /** + * @var ?float $permission + */ + #[JsonProperty('permission')] + public ?float $permission; + + /** + * @param array{ + * action: value-of, + * fields: array, + * permission?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->fields = $values['fields']; + $this->permission = $values['permission'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php new file mode 100644 index 0000000..0b83cde --- /dev/null +++ b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php @@ -0,0 +1,10 @@ + $forms + */ + #[JsonProperty('forms')] + public string $forms; + /** * @var value-of $layout */ @@ -47,6 +53,7 @@ class DocManifest200ResponseScopes extends JsonSerializableType * @param array{ * content: value-of, * annotations: value-of, + * forms: value-of, * layout: value-of, * attachments: value-of, * metadata: value-of, @@ -58,6 +65,7 @@ public function __construct( ) { $this->content = $values['content']; $this->annotations = $values['annotations']; + $this->forms = $values['forms']; $this->layout = $values['layout']; $this->attachments = $values['attachments']; $this->metadata = $values['metadata']; diff --git a/src/Types/DocManifest200ResponseScopesForms.php b/src/Types/DocManifest200ResponseScopesForms.php new file mode 100644 index 0000000..0370ab2 --- /dev/null +++ b/src/Types/DocManifest200ResponseScopesForms.php @@ -0,0 +1,9 @@ + $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest404ResponseCode.php b/src/Types/DocManifest404ResponseCode.php deleted file mode 100644 index 151b4c1..0000000 --- a/src/Types/DocManifest404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $trapped - */ - #[JsonProperty('trapped')] - public string $trapped; - - /** - * @var array $custom - */ - #[JsonProperty('custom'), ArrayType(['string' => 'string'])] - public array $custom; - - /** - * @param array{ - * trapped: value-of, - * custom: array, - * title?: ?string, - * author?: ?string, - * subject?: ?string, - * keywords?: ?string, - * producer?: ?string, - * creator?: ?string, - * created?: ?DateTime, - * modified?: ?DateTime, - * } $values - */ - public function __construct( - array $values, - ) { - $this->title = $values['title'] ?? null; - $this->author = $values['author'] ?? null; - $this->subject = $values['subject'] ?? null; - $this->keywords = $values['keywords'] ?? null; - $this->producer = $values['producer'] ?? null; - $this->creator = $values['creator'] ?? null; - $this->created = $values['created'] ?? null; - $this->modified = $values['modified'] ?? null; - $this->trapped = $values['trapped']; - $this->custom = $values['custom']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocMetadataGet200ResponseTrapped.php b/src/Types/DocMetadataGet200ResponseTrapped.php deleted file mode 100644 index 14ddca6..0000000 --- a/src/Types/DocMetadataGet200ResponseTrapped.php +++ /dev/null @@ -1,10 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocMetadataGet404ResponseCode.php b/src/Types/DocMetadataGet404ResponseCode.php deleted file mode 100644 index 32d22b7..0000000 --- a/src/Types/DocMetadataGet404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesDelete200ResponseLayout.php b/src/Types/DocPagesDelete200ResponseLayout.php new file mode 100644 index 0000000..6093d67 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesDelete200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesDelete200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..2607b30 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..ee13a2d --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesDelete200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesDelete200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..6775f1e --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..cf9d82b --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..2e6789f --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItem.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..dbf84d9 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesDelete200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesDelete200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesDelete200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesDelete200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesDelete200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesDelete200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesDelete200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesDelete200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..a76176d --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxes.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/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..94a302e --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesArt.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/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..185ac76 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesBleed.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/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..efe06d8 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesCrop.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/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..ef60cb4 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesMedia.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/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..e2e4d0a --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..f5ab108 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..8237185 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..8e34841 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesDelete200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesDelete200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesDelete200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesDelete200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 418a21b..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 52e5e82..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 7263641..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 4d62f06..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 5a55b9d..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php b/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php deleted file mode 100644 index 38f806f..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesDelete200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 16554a3..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 9348c37..0000000 --- a/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete400Response.php b/src/Types/DocPagesDelete400Response.php deleted file mode 100644 index 1d36068..0000000 --- a/src/Types/DocPagesDelete400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete400ResponseCode.php b/src/Types/DocPagesDelete400ResponseCode.php deleted file mode 100644 index 6b50bbb..0000000 --- a/src/Types/DocPagesDelete400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesDelete404ResponseCode.php b/src/Types/DocPagesDelete404ResponseCode.php deleted file mode 100644 index 2e4119b..0000000 --- a/src/Types/DocPagesDelete404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesExtract400ResponseCode.php b/src/Types/DocPagesExtract400ResponseCode.php deleted file mode 100644 index f3a6b7f..0000000 --- a/src/Types/DocPagesExtract400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesExtract404ResponseCode.php b/src/Types/DocPagesExtract404ResponseCode.php deleted file mode 100644 index 7dfd207..0000000 --- a/src/Types/DocPagesExtract404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var value-of $usage + */ + #[JsonProperty('usage')] + public string $usage; + + /** + * @var array $results + */ + #[JsonProperty('results'), ArrayType([DocPagesFlatten200ResponseResultsItem::class])] + public array $results; + + /** + * @var MutationMeta $meta */ #[JsonProperty('meta')] - public DocPagesFlatten200ResponseMeta $meta; + public MutationMeta $meta; /** * @param array{ - * meta: DocPagesFlatten200ResponseMeta, + * pages: array, + * usage: value-of, + * results: array, + * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->pages = $values['pages']; + $this->usage = $values['usage']; + $this->results = $values['results']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesFlatten200ResponseMeta.php b/src/Types/DocPagesFlatten200ResponseMeta.php deleted file mode 100644 index 9eed998..0000000 --- a/src/Types/DocPagesFlatten200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesFlatten200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesFlatten200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesFlatten200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesFlatten200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index ac81128..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index be4f7ae..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 3cde99e..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 343939b..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 5355628..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php b/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php deleted file mode 100644 index 5a744a1..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesFlatten200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index afc3099..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 2169235..0000000 --- a/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseResultsItem.php b/src/Types/DocPagesFlatten200ResponseResultsItem.php new file mode 100644 index 0000000..07b73f9 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseResultsItem.php @@ -0,0 +1,42 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * page: PageRef, + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php b/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php new file mode 100644 index 0000000..a0b7980 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php @@ -0,0 +1,9 @@ + $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten400ResponseCode.php b/src/Types/DocPagesFlatten400ResponseCode.php deleted file mode 100644 index e30d7ea..0000000 --- a/src/Types/DocPagesFlatten400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten404ResponseCode.php b/src/Types/DocPagesFlatten404ResponseCode.php deleted file mode 100644 index e8e1c8c..0000000 --- a/src/Types/DocPagesFlatten404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $insertedPages + */ + #[JsonProperty('insertedPages'), ArrayType([PageRef::class])] + public array $insertedPages; + + /** + * @var DocPagesInsert200ResponseLayout $layout + */ + #[JsonProperty('layout')] + public DocPagesInsert200ResponseLayout $layout; + + /** + * @var MutationMeta $meta */ #[JsonProperty('meta')] - public DocPagesInsert200ResponseMeta $meta; + public MutationMeta $meta; /** * @param array{ - * meta: DocPagesInsert200ResponseMeta, + * insertedPages: array, + * layout: DocPagesInsert200ResponseLayout, + * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->insertedPages = $values['insertedPages']; + $this->layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesInsert200ResponseLayout.php b/src/Types/DocPagesInsert200ResponseLayout.php new file mode 100644 index 0000000..cf6dc67 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesInsert200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesInsert200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..eea9802 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..dbccc41 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesInsert200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsert200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling::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/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..dff0984 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..aea7f1d --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..08473ff --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItem.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..8a761ac --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesInsert200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesInsert200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesInsert200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesInsert200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesInsert200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesInsert200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesInsert200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesInsert200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..15bc69c --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxes.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/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..c1d8cac --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesArt.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/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..da3c582 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesBleed.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/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..944414b --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesCrop.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/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..8c347e6 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesMedia.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/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..9e4efb7 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..367dbe8 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..135e152 --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..005b1af --- /dev/null +++ b/src/Types/DocPagesInsert200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesInsert200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesInsert200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesInsert200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesInsert200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 475aba3..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 5a92486..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 329d250..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 460409e..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 773c809..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaCacheDelta.php b/src/Types/DocPagesInsert200ResponseMetaCacheDelta.php deleted file mode 100644 index 62f36e5..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesInsert200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 84325b3..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 813ad94..0000000 --- a/src/Types/DocPagesInsert200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert400Response.php b/src/Types/DocPagesInsert400Response.php deleted file mode 100644 index ef01b31..0000000 --- a/src/Types/DocPagesInsert400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert400ResponseCode.php b/src/Types/DocPagesInsert400ResponseCode.php deleted file mode 100644 index c4f355c..0000000 --- a/src/Types/DocPagesInsert400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsert404ResponseCode.php b/src/Types/DocPagesInsert404ResponseCode.php deleted file mode 100644 index 0401ee3..0000000 --- a/src/Types/DocPagesInsert404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $insertedPages + */ + #[JsonProperty('insertedPages'), ArrayType([PageRef::class])] + public array $insertedPages; + + /** + * @var DocPagesInsertBlank200ResponseLayout $layout + */ + #[JsonProperty('layout')] + public DocPagesInsertBlank200ResponseLayout $layout; + + /** + * @var MutationMeta $meta */ #[JsonProperty('meta')] - public DocPagesInsertBlank200ResponseMeta $meta; + public MutationMeta $meta; /** * @param array{ - * meta: DocPagesInsertBlank200ResponseMeta, + * insertedPages: array, + * layout: DocPagesInsertBlank200ResponseLayout, + * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->insertedPages = $values['insertedPages']; + $this->layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesInsertBlank200ResponseLayout.php b/src/Types/DocPagesInsertBlank200ResponseLayout.php new file mode 100644 index 0000000..0fe8f6d --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesInsertBlank200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesInsertBlank200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..b69880d --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..4317ab4 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesInsertBlank200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..71b6d85 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..d01324a --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..47b99ce --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..2601d50 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesInsertBlank200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesInsertBlank200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesInsertBlank200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesInsertBlank200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..ce883d9 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxes.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/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..a5ccfb8 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesArt.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/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..4e5fa23 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesBleed.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/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..902bfb9 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesCrop.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/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..5f576f0 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesMedia.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/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..b689a11 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemBoxesTrim.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/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..dd22bfe --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..ff83422 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..03b8904 --- /dev/null +++ b/src/Types/DocPagesInsertBlank200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesInsertBlank200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesInsertBlank200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesInsertBlank200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesInsertBlank200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 7ebb2da..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index c1c3989..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 01f0dd8..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 9dd83b9..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 1254fd1..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.php b/src/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.php deleted file mode 100644 index 3ec589c..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 9139e8c..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 8f0b5a2..0000000 --- a/src/Types/DocPagesInsertBlank200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank400Response.php b/src/Types/DocPagesInsertBlank400Response.php deleted file mode 100644 index 64d6524..0000000 --- a/src/Types/DocPagesInsertBlank400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank400ResponseCode.php b/src/Types/DocPagesInsertBlank400ResponseCode.php deleted file mode 100644 index f70466c..0000000 --- a/src/Types/DocPagesInsertBlank400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesInsertBlank404ResponseCode.php b/src/Types/DocPagesInsertBlank404ResponseCode.php deleted file mode 100644 index 68acbdb..0000000 --- a/src/Types/DocPagesInsertBlank404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMeta.php b/src/Types/DocPagesMove200ResponseMeta.php deleted file mode 100644 index 3ca48ec..0000000 --- a/src/Types/DocPagesMove200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesMove200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesMove200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesMove200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesMove200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index c3eb9f9..0000000 --- a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 65bdf6d..0000000 --- a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 2d86f0f..0000000 --- a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index e7ed9bd..0000000 --- a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 8b0f708..0000000 --- a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaCacheDelta.php b/src/Types/DocPagesMove200ResponseMetaCacheDelta.php deleted file mode 100644 index fe3c215..0000000 --- a/src/Types/DocPagesMove200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesMove200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 9bcf020..0000000 --- a/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index d0413e8..0000000 --- a/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove400Response.php b/src/Types/DocPagesMove400Response.php deleted file mode 100644 index e705932..0000000 --- a/src/Types/DocPagesMove400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove400ResponseCode.php b/src/Types/DocPagesMove400ResponseCode.php deleted file mode 100644 index 7226c0f..0000000 --- a/src/Types/DocPagesMove400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesMove404ResponseCode.php b/src/Types/DocPagesMove404ResponseCode.php deleted file mode 100644 index 15d3a80..0000000 --- a/src/Types/DocPagesMove404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesRemoveName200ResponseLayout.php b/src/Types/DocPagesRemoveName200ResponseLayout.php new file mode 100644 index 0000000..4d6e80d --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesRemoveName200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesRemoveName200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..116a1fa --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..3c29136 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling::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/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..dd7909f --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..f65f9a5 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..289c2d3 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..19d4eeb --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesRemoveName200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesRemoveName200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesRemoveName200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesRemoveName200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..6224266 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.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/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..0798814 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.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/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..d512453 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.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/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..ef41095 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.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/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..f58a35b --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.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/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..f2afa56 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.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/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..73d595d --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..bc821fa --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..52c3296 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesRemoveName200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesRemoveName200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesRemoveName200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesRemoveName200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 08ed266..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 56913b9..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 5467233..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index b219cc9..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 6217bf3..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaCacheDelta.php b/src/Types/DocPagesRemoveName200ResponseMetaCacheDelta.php deleted file mode 100644 index 9b5bcd6..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesRemoveName200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index b7a47f4..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 847818e..0000000 --- a/src/Types/DocPagesRemoveName200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName400Response.php b/src/Types/DocPagesRemoveName400Response.php deleted file mode 100644 index 773d1ad..0000000 --- a/src/Types/DocPagesRemoveName400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName400ResponseCode.php b/src/Types/DocPagesRemoveName400ResponseCode.php deleted file mode 100644 index 2c729cb..0000000 --- a/src/Types/DocPagesRemoveName400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName404ResponseCode.php b/src/Types/DocPagesRemoveName404ResponseCode.php deleted file mode 100644 index 35a3fbc..0000000 --- a/src/Types/DocPagesRemoveName404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var DocPagesReorder200ResponseLayout $layout + */ + #[JsonProperty('layout')] + public DocPagesReorder200ResponseLayout $layout; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * pages: array, + * layout: DocPagesReorder200ResponseLayout, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayout.php b/src/Types/DocPagesReorder200ResponseLayout.php new file mode 100644 index 0000000..b71e1b1 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesReorder200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesReorder200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..a6abac7 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..adb57a3 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesReorder200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesReorder200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling::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/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..d71ab7e --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..c3865c5 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..57ac2b0 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItem.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..64de3bc --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesReorder200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesReorder200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesReorder200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesReorder200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesReorder200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesReorder200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesReorder200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesReorder200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..26d0483 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxes.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/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..5193322 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesArt.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/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..b667d46 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesBleed.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/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..65eb2ce --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesCrop.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/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..0d25818 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesMedia.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/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..88523c7 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemBoxesTrim.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/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..5d5bce5 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..ede9468 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..b0eea10 --- /dev/null +++ b/src/Types/DocPagesReorder200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ +layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesRotate200ResponseLayout.php b/src/Types/DocPagesRotate200ResponseLayout.php new file mode 100644 index 0000000..7d30875 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesRotate200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesRotate200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..162bd53 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..55dca7e --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRotate200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesRotate200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..3dfba54 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..7401111 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..e880c00 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItem.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..b9b97ba --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesRotate200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesRotate200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesRotate200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesRotate200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesRotate200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesRotate200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesRotate200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesRotate200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..cfdece9 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..9829e68 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesArt.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/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..2c19f9c --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesBleed.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/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..fc62be5 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesCrop.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/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..6f5c627 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesMedia.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/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..41dce0c --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..6dc0ce0 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..2999206 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..48502ae --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesRotate200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesRotate200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesRotate200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesRotate200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 69810b2..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index cf3b033..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 09acdeb..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 31d3fb1..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index db76e16..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php b/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php deleted file mode 100644 index 91c8cfd..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesRotate200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index b605ee1..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index d2b7d98..0000000 --- a/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate400Response.php b/src/Types/DocPagesRotate400Response.php deleted file mode 100644 index bf43293..0000000 --- a/src/Types/DocPagesRotate400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate400ResponseCode.php b/src/Types/DocPagesRotate400ResponseCode.php deleted file mode 100644 index 934863e..0000000 --- a/src/Types/DocPagesRotate400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRotate404ResponseCode.php b/src/Types/DocPagesRotate404ResponseCode.php deleted file mode 100644 index 65c8243..0000000 --- a/src/Types/DocPagesRotate404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -layout = $values['layout']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesSetName200ResponseLayout.php b/src/Types/DocPagesSetName200ResponseLayout.php new file mode 100644 index 0000000..395e802 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayout.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesSetName200ResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesSetName200ResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItem.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItem.php new file mode 100644 index 0000000..889fafe --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItem.php @@ -0,0 +1,42 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 0000000..d4d82c5 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesSetName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesSetName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesSetName200ResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage && $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 DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate && $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 DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling && $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'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling::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/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 0000000..37025f4 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 0000000..3f680a6 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 0000000..b1046ca --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php new file mode 100644 index 0000000..4a8d27f --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesSetName200ResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesSetName200ResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesSetName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesSetName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesSetName200ResponseLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: DocPagesSetName200ResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesSetName200ResponseLayoutPagesItemPdfCropBox, + * 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/DocPagesSetName200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxes.php new file mode 100644 index 0000000..3b57aa7 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxes.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/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 0000000..2b7be2a --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.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/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 0000000..2f32f7d --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.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/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 0000000..b976c4d --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.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/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 0000000..691d5ee --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.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/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 0000000..350f1dc --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.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/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 0000000..3bce983 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php new file mode 100644 index 0000000..634c340 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php new file mode 100644 index 0000000..4171c49 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesSetName200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesSetName200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesSetName200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesSetName200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 75a1660..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index b7c3763..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index e43d5b5..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 8881422..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 9675ee7..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaCacheDelta.php b/src/Types/DocPagesSetName200ResponseMetaCacheDelta.php deleted file mode 100644 index 9b9b0dd..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesSetName200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index a50efa4..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 47c0e07..0000000 --- a/src/Types/DocPagesSetName200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName400Response.php b/src/Types/DocPagesSetName400Response.php deleted file mode 100644 index b155a4c..0000000 --- a/src/Types/DocPagesSetName400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName400ResponseCode.php b/src/Types/DocPagesSetName400ResponseCode.php deleted file mode 100644 index f1ced27..0000000 --- a/src/Types/DocPagesSetName400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName404ResponseCode.php b/src/Types/DocPagesSetName404ResponseCode.php deleted file mode 100644 index 9ae37ff..0000000 --- a/src/Types/DocPagesSetName404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; + $this->page = $values['page']; $this->meta = $values['meta']; } diff --git a/src/Types/DocPagesSetScale200ResponseMeta.php b/src/Types/DocPagesSetScale200ResponseMeta.php deleted file mode 100644 index ab5ff2f..0000000 --- a/src/Types/DocPagesSetScale200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocPagesSetScale200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocPagesSetScale200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocPagesSetScale200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocPagesSetScale200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 18d2940..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 937adc1..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index 8c6f7da..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index 6be3a54..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index 7eb1e7e..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php deleted file mode 100644 index 325af92..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesSetScale200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 35670df..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 61c24d6..0000000 --- a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale400Response.php b/src/Types/DocPagesSetScale400Response.php deleted file mode 100644 index 3dfc2ff..0000000 --- a/src/Types/DocPagesSetScale400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale400ResponseCode.php b/src/Types/DocPagesSetScale400ResponseCode.php deleted file mode 100644 index 3a66f38..0000000 --- a/src/Types/DocPagesSetScale400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScale404ResponseCode.php b/src/Types/DocPagesSetScale404ResponseCode.php deleted file mode 100644 index 0da3e39..0000000 --- a/src/Types/DocPagesSetScale404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $viewports + */ + #[JsonProperty('viewports'), ArrayType([DocPagesViewports200ResponseViewportsItem::class])] + public array $viewports; + + /** + * @param array{ + * viewports: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->viewports = $values['viewports']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItem.php b/src/Types/DocPagesViewports200ResponseItem.php deleted file mode 100644 index fd04d5c..0000000 --- a/src/Types/DocPagesViewports200ResponseItem.php +++ /dev/null @@ -1,58 +0,0 @@ -bbox = $values['bbox']; - $this->name = $values['name'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->owned = $values['owned']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseItemBbox.php b/src/Types/DocPagesViewports200ResponseItemBbox.php deleted file mode 100644 index cf08b5e..0000000 --- a/src/Types/DocPagesViewports200ResponseItemBbox.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/DocPagesViewports200ResponseItemMeasure.php b/src/Types/DocPagesViewports200ResponseItemMeasure.php deleted file mode 100644 index 8b3c3d4..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocPagesViewports200ResponseItemMeasureRl $rl - * @return DocPagesViewports200ResponseItemMeasure - */ - public static function rl(DocPagesViewports200ResponseItemMeasureRl $rl): DocPagesViewports200ResponseItemMeasure - { - return new DocPagesViewports200ResponseItemMeasure([ - 'subtype' => 'RL', - 'value' => $rl, - ]); - } - - /** - * @param DocPagesViewports200ResponseItemMeasureGeo $geo - * @return DocPagesViewports200ResponseItemMeasure - */ - public static function geo(DocPagesViewports200ResponseItemMeasureGeo $geo): DocPagesViewports200ResponseItemMeasure - { - return new DocPagesViewports200ResponseItemMeasure([ - 'subtype' => 'GEO', - 'value' => $geo, - ]); - } - - /** - * @param DocPagesViewports200ResponseItemMeasureUnknown $unknown - * @return DocPagesViewports200ResponseItemMeasure - */ - public static function unknown(DocPagesViewports200ResponseItemMeasureUnknown $unknown): DocPagesViewports200ResponseItemMeasure - { - return new DocPagesViewports200ResponseItemMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRl(): bool - { - return $this->value instanceof DocPagesViewports200ResponseItemMeasureRl && $this->subtype === 'RL'; - } - - /** - * @return DocPagesViewports200ResponseItemMeasureRl - */ - public function asRl(): DocPagesViewports200ResponseItemMeasureRl - { - if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureRl && $this->subtype === 'RL')) { - throw new Exception( - "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeo(): bool - { - return $this->value instanceof DocPagesViewports200ResponseItemMeasureGeo && $this->subtype === 'GEO'; - } - - /** - * @return DocPagesViewports200ResponseItemMeasureGeo - */ - public function asGeo(): DocPagesViewports200ResponseItemMeasureGeo - { - if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureGeo && $this->subtype === 'GEO')) { - throw new Exception( - "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesViewports200ResponseItemMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocPagesViewports200ResponseItemMeasureUnknown - */ - public function asUnknown(): DocPagesViewports200ResponseItemMeasureUnknown - { - if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'RL': - $value = $this->asRl()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'GEO': - $value = $this->asGeo()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->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('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'RL': - $args['value'] = DocPagesViewports200ResponseItemMeasureRl::jsonDeserialize($data); - break; - case 'GEO': - $args['value'] = DocPagesViewports200ResponseItemMeasureGeo::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocPagesViewports200ResponseItemMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php b/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php deleted file mode 100644 index 59b2d2b..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRl.php b/src/Types/DocPagesViewports200ResponseItemMeasureRl.php deleted file mode 100644 index f51fb9d..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRl.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocPagesViewports200ResponseItemMeasureRlXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocPagesViewports200ResponseItemMeasureRlYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocPagesViewports200ResponseItemMeasureRlDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocPagesViewports200ResponseItemMeasureRlAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocPagesViewports200ResponseItemMeasureRlAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocPagesViewports200ResponseItemMeasureRlSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocPagesViewports200ResponseItemMeasureRlOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocPagesViewports200ResponseItemMeasureRlOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocPagesViewports200ResponseItemMeasureRlOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $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/DocPagesViewports200ResponseItemMeasureRlAngleItem.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItem.php deleted file mode 100644 index 859bf51..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php deleted file mode 100644 index 800408b..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php deleted file mode 100644 index b3abf68..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php deleted file mode 100644 index 96ac245..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php deleted file mode 100644 index 475d9eb..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php deleted file mode 100644 index bc34633..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php deleted file mode 100644 index 50468df..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $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/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php deleted file mode 100644 index 9335b57..0000000 --- a/src/Types/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItem.php b/src/Types/DocPagesViewports200ResponseViewportsItem.php new file mode 100644 index 0000000..3b0543a --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItem.php @@ -0,0 +1,58 @@ +bbox = $values['bbox']; + $this->name = $values['name'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->owned = $values['owned']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemBbox.php b/src/Types/DocPagesViewports200ResponseViewportsItemBbox.php new file mode 100644 index 0000000..0eb3ffd --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemBbox.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/DocPagesViewports200ResponseViewportsItemMeasure.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasure.php new file mode 100644 index 0000000..33fceb8 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasure.php @@ -0,0 +1,241 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocPagesViewports200ResponseViewportsItemMeasureRectilinear $rectilinear + * @return DocPagesViewports200ResponseViewportsItemMeasure + */ + public static function rectilinear(DocPagesViewports200ResponseViewportsItemMeasureRectilinear $rectilinear): DocPagesViewports200ResponseViewportsItemMeasure + { + return new DocPagesViewports200ResponseViewportsItemMeasure([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param DocPagesViewports200ResponseViewportsItemMeasureGeospatial $geospatial + * @return DocPagesViewports200ResponseViewportsItemMeasure + */ + public static function geospatial(DocPagesViewports200ResponseViewportsItemMeasureGeospatial $geospatial): DocPagesViewports200ResponseViewportsItemMeasure + { + return new DocPagesViewports200ResponseViewportsItemMeasure([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param DocPagesViewports200ResponseViewportsItemMeasureUnknown $unknown + * @return DocPagesViewports200ResponseViewportsItemMeasure + */ + public static function unknown(DocPagesViewports200ResponseViewportsItemMeasureUnknown $unknown): DocPagesViewports200ResponseViewportsItemMeasure + { + return new DocPagesViewports200ResponseViewportsItemMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return DocPagesViewports200ResponseViewportsItemMeasureRectilinear + */ + public function asRectilinear(): DocPagesViewports200ResponseViewportsItemMeasureRectilinear + { + if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return DocPagesViewports200ResponseViewportsItemMeasureGeospatial + */ + public function asGeospatial(): DocPagesViewports200ResponseViewportsItemMeasureGeospatial + { + if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocPagesViewports200ResponseViewportsItemMeasureUnknown + */ + public function asUnknown(): DocPagesViewports200ResponseViewportsItemMeasureUnknown + { + if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " 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['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureRectilinear::jsonDeserialize($data); + break; + case 'geospatial': + $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php new file mode 100644 index 0000000..26771b9 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php new file mode 100644 index 0000000..a57bde5 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.php new file mode 100644 index 0000000..7d3fff8 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.php new file mode 100644 index 0000000..ca4825d --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.php new file mode 100644 index 0000000..2987124 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.php new file mode 100644 index 0000000..0130a61 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.php new file mode 100644 index 0000000..72f7d8c --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.php new file mode 100644 index 0000000..5bb2606 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.php new file mode 100644 index 0000000..0cfaf7d --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.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/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php new file mode 100644 index 0000000..62adbde --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesViewports404Response.php b/src/Types/DocPagesViewports404Response.php deleted file mode 100644 index 100d384..0000000 --- a/src/Types/DocPagesViewports404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports404ResponseCode.php b/src/Types/DocPagesViewports404ResponseCode.php deleted file mode 100644 index 23f06ce..0000000 --- a/src/Types/DocPagesViewports404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $results + */ + #[JsonProperty('results'), ArrayType([DocRedactionsApply200ResponseResultsItem::class])] + public array $results; + + /** + * @var int $removedAnnotationCount + */ + #[JsonProperty('removedAnnotationCount')] + public int $removedAnnotationCount; + + /** + * @var MutationMeta $meta */ #[JsonProperty('meta')] - public DocRedactionsApply200ResponseMeta $meta; + public MutationMeta $meta; /** * @param array{ - * meta: DocRedactionsApply200ResponseMeta, + * scope: DocRedactionsApply200ResponseScope, + * results: array, + * removedAnnotationCount: int, + * meta: MutationMeta, * } $values */ public function __construct( array $values, ) { + $this->scope = $values['scope']; + $this->results = $values['results']; + $this->removedAnnotationCount = $values['removedAnnotationCount']; $this->meta = $values['meta']; } diff --git a/src/Types/DocRedactionsApply200ResponseMeta.php b/src/Types/DocRedactionsApply200ResponseMeta.php deleted file mode 100644 index 475a014..0000000 --- a/src/Types/DocRedactionsApply200ResponseMeta.php +++ /dev/null @@ -1,43 +0,0 @@ - $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocRedactionsApply200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocRedactionsApply200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocRedactionsApply200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocRedactionsApply200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItem.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index d4c20cb..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index fa53b73..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index f08758d..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index cbea5d9..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index e926bf3..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php b/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php deleted file mode 100644 index f8d3aa7..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocRedactionsApply200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index ec55641..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index 0679716..0000000 --- a/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseResultsItem.php b/src/Types/DocRedactionsApply200ResponseResultsItem.php new file mode 100644 index 0000000..bec6392 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseResultsItem.php @@ -0,0 +1,50 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var int $removedAnnotationCount + */ + #[JsonProperty('removedAnnotationCount')] + public int $removedAnnotationCount; + + /** + * @param array{ + * page: PageRef, + * status: value-of, + * removedAnnotationCount: int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->status = $values['status']; + $this->removedAnnotationCount = $values['removedAnnotationCount']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php b/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php new file mode 100644 index 0000000..69dc8e6 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php @@ -0,0 +1,9 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public ?array $pages; + + /** + * @var ?array $annotations + */ + #[JsonProperty('annotations'), ArrayType([AnnotationRef::class])] + public ?array $annotations; + + /** + * @param array{ + * pages?: ?array, + * annotations?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->pages = $values['pages'] ?? null; + $this->annotations = $values['annotations'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApply400Response.php b/src/Types/DocRedactionsApply400Response.php deleted file mode 100644 index 268dc32..0000000 --- a/src/Types/DocRedactionsApply400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply400ResponseCode.php b/src/Types/DocRedactionsApply400ResponseCode.php deleted file mode 100644 index ecdbc11..0000000 --- a/src/Types/DocRedactionsApply400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply404ResponseCode.php b/src/Types/DocRedactionsApply404ResponseCode.php deleted file mode 100644 index 29120bb..0000000 --- a/src/Types/DocRedactionsApply404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRenderResponseCode.php b/src/Types/DocRenderResponseCode.php deleted file mode 100644 index 6afb051..0000000 --- a/src/Types/DocRenderResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @param array{ - * status: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->status = $values['status']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAbort200ResponseStatus.php b/src/Types/DocSignaturesAbort200ResponseStatus.php deleted file mode 100644 index 095e6b4..0000000 --- a/src/Types/DocSignaturesAbort200ResponseStatus.php +++ /dev/null @@ -1,10 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAbort404ResponseCode.php b/src/Types/DocSignaturesAbort404ResponseCode.php deleted file mode 100644 index b0f1ecd..0000000 --- a/src/Types/DocSignaturesAbort404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis400ResponseCode.php b/src/Types/DocSignaturesAnalysis400ResponseCode.php deleted file mode 100644 index ff1d0e8..0000000 --- a/src/Types/DocSignaturesAnalysis400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis404ResponseCode.php b/src/Types/DocSignaturesAnalysis404ResponseCode.php deleted file mode 100644 index d7c1f37..0000000 --- a/src/Types/DocSignaturesAnalysis404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCancel200ResponseStatus.php b/src/Types/DocSignaturesCancel200ResponseStatus.php new file mode 100644 index 0000000..21e3927 --- /dev/null +++ b/src/Types/DocSignaturesCancel200ResponseStatus.php @@ -0,0 +1,10 @@ + $affectedPages - */ - #[JsonProperty('affectedPages'), ArrayType([DocSignaturesComplete200ResponseMetaAffectedPagesItem::class])] - public array $affectedPages; - - /** - * @var ?DocSignaturesComplete200ResponseMetaCacheDelta $cacheDelta - */ - #[JsonProperty('cacheDelta')] - public ?DocSignaturesComplete200ResponseMetaCacheDelta $cacheDelta; - - /** - * @param array{ - * affectedPages: array, - * cacheDelta?: ?DocSignaturesComplete200ResponseMetaCacheDelta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->affectedPages = $values['affectedPages']; - $this->cacheDelta = $values['cacheDelta'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.php b/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.php deleted file mode 100644 index 3f6b1c5..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItem.php +++ /dev/null @@ -1,50 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->revision = $values['revision']; - $this->weakAnnotationState = $values['weakAnnotationState']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.php deleted file mode 100644 index 02a5c3a..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemRevision.php +++ /dev/null @@ -1,50 +0,0 @@ -docSessionId = $values['docSessionId']; - $this->pageObjectNumber = $values['pageObjectNumber']; - $this->generation = $values['generation']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.php deleted file mode 100644 index a79c69e..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown - * @return DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function unknown(DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @param DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known - * @return DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState - */ - public static function known(DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState - { - return new DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationState([ - 'kind' => 'known', - 'value' => $known, - ]); - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; - } - - /** - * @return DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - */ - public function asUnknown(): DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown - { - if (!($this->value instanceof DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isKnown(): bool - { - return $this->value instanceof DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; - } - - /** - * @return DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - */ - public function asKnown(): DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown - { - if (!($this->value instanceof DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { - throw new Exception( - "Expected known; 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 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'known': - $value = $this->asKnown()->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 'unknown': - $args['value'] = DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); - break; - case 'known': - $args['value'] = DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::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/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php deleted file mode 100644 index fa761f7..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php +++ /dev/null @@ -1,34 +0,0 @@ -hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php deleted file mode 100644 index af2cd3d..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaCacheDelta.php b/src/Types/DocSignaturesComplete200ResponseMetaCacheDelta.php deleted file mode 100644 index dd2512a..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaCacheDelta.php +++ /dev/null @@ -1,75 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem::class])] - public array $pages; - - /** - * @param array{ - * previousDocVersion: int, - * docVersion: int, - * pages: array, - * annotationsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->previousDocVersion = $values['previousDocVersion']; - $this->docVersion = $values['docVersion']; - $this->annotationsVersion = $values['annotationsVersion'] ?? null; - $this->layerVersion = $values['layerVersion'] ?? null; - $this->working = $values['working'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.php deleted file mode 100644 index 1dc55fe..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.php deleted file mode 100644 index bd6b680..0000000 --- a/src/Types/DocSignaturesComplete200ResponseMetaCacheDeltaPagesItemCache.php +++ /dev/null @@ -1,42 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignature.php b/src/Types/DocSignaturesComplete200ResponseSignature.php index 71e1c3a..e831bf1 100644 --- a/src/Types/DocSignaturesComplete200ResponseSignature.php +++ b/src/Types/DocSignaturesComplete200ResponseSignature.php @@ -15,10 +15,10 @@ class DocSignaturesComplete200ResponseSignature extends JsonSerializableType public int $index; /** - * @var DocSignaturesComplete200ResponseSignatureField $field + * @var FormFieldRef $field */ #[JsonProperty('field')] - public DocSignaturesComplete200ResponseSignatureField $field; + public FormFieldRef $field; /** * @var string $fieldName @@ -27,10 +27,10 @@ class DocSignaturesComplete200ResponseSignature extends JsonSerializableType public string $fieldName; /** - * @var ?DocSignaturesComplete200ResponseSignatureWidget $widget + * @var ?FormWidget $widget */ #[JsonProperty('widget')] - public ?DocSignaturesComplete200ResponseSignatureWidget $widget; + public ?FormWidget $widget; /** * @var bool $signed @@ -119,14 +119,14 @@ class DocSignaturesComplete200ResponseSignature extends JsonSerializableType /** * @param array{ * index: int, - * field: DocSignaturesComplete200ResponseSignatureField, + * field: FormFieldRef, * fieldName: string, * signed: bool, * kind: value-of, * contentsSize: int, * signer: DocSignaturesComplete200ResponseSignatureSigner, * catalogCertification: bool, - * widget?: ?DocSignaturesComplete200ResponseSignatureWidget, + * widget?: ?FormWidget, * filter?: ?string, * subFilter?: ?string, * byteRange?: ?array, diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureField.php b/src/Types/DocSignaturesComplete200ResponseSignatureField.php deleted file mode 100644 index 9e9818d..0000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureField.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocSignaturesComplete200ResponseSignatureFieldObjectNumber $objectNumber - * @return DocSignaturesComplete200ResponseSignatureField - */ - public static function objectNumber(DocSignaturesComplete200ResponseSignatureFieldObjectNumber $objectNumber): DocSignaturesComplete200ResponseSignatureField - { - return new DocSignaturesComplete200ResponseSignatureField([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocSignaturesComplete200ResponseSignatureFieldFqn $fqn - * @return DocSignaturesComplete200ResponseSignatureField - */ - public static function fqn(DocSignaturesComplete200ResponseSignatureFieldFqn $fqn): DocSignaturesComplete200ResponseSignatureField - { - return new DocSignaturesComplete200ResponseSignatureField([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocSignaturesComplete200ResponseSignatureFieldObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocSignaturesComplete200ResponseSignatureFieldObjectNumber - */ - public function asObjectNumber(): DocSignaturesComplete200ResponseSignatureFieldObjectNumber - { - if (!($this->value instanceof DocSignaturesComplete200ResponseSignatureFieldObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocSignaturesComplete200ResponseSignatureFieldFqn && $this->kind === 'fqn'; - } - - /** - * @return DocSignaturesComplete200ResponseSignatureFieldFqn - */ - public function asFqn(): DocSignaturesComplete200ResponseSignatureFieldFqn - { - if (!($this->value instanceof DocSignaturesComplete200ResponseSignatureFieldFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocSignaturesComplete200ResponseSignatureFieldObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocSignaturesComplete200ResponseSignatureFieldFqn::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/DocSignaturesComplete200ResponseSignatureFieldFqn.php b/src/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.php deleted file mode 100644 index 3ca68fe..0000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureFieldFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.php b/src/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.php deleted file mode 100644 index cbcba29..0000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureFieldObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php b/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php index 0db5e65..8cee15b 100644 --- a/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php +++ b/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php @@ -4,6 +4,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use DateTime; +use CloudPDF\Core\Types\Date; class DocSignaturesComplete200ResponseSignatureSigner extends JsonSerializableType { @@ -32,10 +34,10 @@ class DocSignaturesComplete200ResponseSignatureSigner extends JsonSerializableTy public ?string $contactInfo; /** - * @var ?string $claimedTime + * @var ?DateTime $signedAt */ - #[JsonProperty('claimedTime')] - public ?string $claimedTime; + #[JsonProperty('signedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $signedAt; /** * @param array{ @@ -43,7 +45,7 @@ class DocSignaturesComplete200ResponseSignatureSigner extends JsonSerializableTy * reason?: ?string, * location?: ?string, * contactInfo?: ?string, - * claimedTime?: ?string, + * signedAt?: ?DateTime, * } $values */ public function __construct( @@ -53,7 +55,7 @@ public function __construct( $this->reason = $values['reason'] ?? null; $this->location = $values['location'] ?? null; $this->contactInfo = $values['contactInfo'] ?? null; - $this->claimedTime = $values['claimedTime'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; } /** diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureWidget.php b/src/Types/DocSignaturesComplete200ResponseSignatureWidget.php deleted file mode 100644 index 78f187f..0000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureWidget.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete400Response.php b/src/Types/DocSignaturesComplete400Response.php deleted file mode 100644 index d3bcfca..0000000 --- a/src/Types/DocSignaturesComplete400Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete400ResponseCode.php b/src/Types/DocSignaturesComplete400ResponseCode.php deleted file mode 100644 index dcc84bf..0000000 --- a/src/Types/DocSignaturesComplete400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete404ResponseCode.php b/src/Types/DocSignaturesComplete404ResponseCode.php deleted file mode 100644 index 70a8497..0000000 --- a/src/Types/DocSignaturesComplete404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete409ResponseCode.php b/src/Types/DocSignaturesComplete409ResponseCode.php deleted file mode 100644 index dfa40d1..0000000 --- a/src/Types/DocSignaturesComplete409ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -, * contentsSize: int, * signer: DocSignaturesList200ResponseSignaturesItemSigner, * catalogCertification: bool, - * widget?: ?DocSignaturesList200ResponseSignaturesItemWidget, + * widget?: ?FormWidget, * filter?: ?string, * subFilter?: ?string, * byteRange?: ?array, diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemField.php b/src/Types/DocSignaturesList200ResponseSignaturesItemField.php deleted file mode 100644 index 297ccd7..0000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemField.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocSignaturesList200ResponseSignaturesItemFieldObjectNumber $objectNumber - * @return DocSignaturesList200ResponseSignaturesItemField - */ - public static function objectNumber(DocSignaturesList200ResponseSignaturesItemFieldObjectNumber $objectNumber): DocSignaturesList200ResponseSignaturesItemField - { - return new DocSignaturesList200ResponseSignaturesItemField([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocSignaturesList200ResponseSignaturesItemFieldFqn $fqn - * @return DocSignaturesList200ResponseSignaturesItemField - */ - public static function fqn(DocSignaturesList200ResponseSignaturesItemFieldFqn $fqn): DocSignaturesList200ResponseSignaturesItemField - { - return new DocSignaturesList200ResponseSignaturesItemField([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocSignaturesList200ResponseSignaturesItemFieldObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocSignaturesList200ResponseSignaturesItemFieldObjectNumber - */ - public function asObjectNumber(): DocSignaturesList200ResponseSignaturesItemFieldObjectNumber - { - if (!($this->value instanceof DocSignaturesList200ResponseSignaturesItemFieldObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocSignaturesList200ResponseSignaturesItemFieldFqn && $this->kind === 'fqn'; - } - - /** - * @return DocSignaturesList200ResponseSignaturesItemFieldFqn - */ - public function asFqn(): DocSignaturesList200ResponseSignaturesItemFieldFqn - { - if (!($this->value instanceof DocSignaturesList200ResponseSignaturesItemFieldFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocSignaturesList200ResponseSignaturesItemFieldObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocSignaturesList200ResponseSignaturesItemFieldFqn::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/DocSignaturesList200ResponseSignaturesItemFieldFqn.php b/src/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.php deleted file mode 100644 index 8e0144c..0000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemFieldFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.php b/src/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.php deleted file mode 100644 index c15559d..0000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemFieldObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php b/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php index 30cd32e..24964f6 100644 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php +++ b/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php @@ -4,6 +4,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use DateTime; +use CloudPDF\Core\Types\Date; class DocSignaturesList200ResponseSignaturesItemSigner extends JsonSerializableType { @@ -32,10 +34,10 @@ class DocSignaturesList200ResponseSignaturesItemSigner extends JsonSerializableT public ?string $contactInfo; /** - * @var ?string $claimedTime + * @var ?DateTime $signedAt */ - #[JsonProperty('claimedTime')] - public ?string $claimedTime; + #[JsonProperty('signedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $signedAt; /** * @param array{ @@ -43,7 +45,7 @@ class DocSignaturesList200ResponseSignaturesItemSigner extends JsonSerializableT * reason?: ?string, * location?: ?string, * contactInfo?: ?string, - * claimedTime?: ?string, + * signedAt?: ?DateTime, * } $values */ public function __construct( @@ -53,7 +55,7 @@ public function __construct( $this->reason = $values['reason'] ?? null; $this->location = $values['location'] ?? null; $this->contactInfo = $values['contactInfo'] ?? null; - $this->claimedTime = $values['claimedTime'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; } /** diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemWidget.php b/src/Types/DocSignaturesList200ResponseSignaturesItemWidget.php deleted file mode 100644 index d46713f..0000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemWidget.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList404Response.php b/src/Types/DocSignaturesList404Response.php deleted file mode 100644 index 7478810..0000000 --- a/src/Types/DocSignaturesList404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList404ResponseCode.php b/src/Types/DocSignaturesList404ResponseCode.php deleted file mode 100644 index 67db3bc..0000000 --- a/src/Types/DocSignaturesList404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesPrepare400ResponseCode.php b/src/Types/DocSignaturesPrepare400ResponseCode.php deleted file mode 100644 index 6a92f65..0000000 --- a/src/Types/DocSignaturesPrepare400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesPrepare404ResponseCode.php b/src/Types/DocSignaturesPrepare404ResponseCode.php deleted file mode 100644 index 63f3275..0000000 --- a/src/Types/DocSignaturesPrepare404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesPrepare409ResponseCode.php b/src/Types/DocSignaturesPrepare409ResponseCode.php deleted file mode 100644 index 6dcbf85..0000000 --- a/src/Types/DocSignaturesPrepare409ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocText404ResponseCode.php b/src/Types/DocText404ResponseCode.php deleted file mode 100644 index 439e146..0000000 --- a/src/Types/DocText404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis400ResponseCode.php b/src/Types/DocVersionsAnalysis400ResponseCode.php deleted file mode 100644 index d659af1..0000000 --- a/src/Types/DocVersionsAnalysis400ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis404ResponseCode.php b/src/Types/DocVersionsAnalysis404ResponseCode.php deleted file mode 100644 index 0d8a54a..0000000 --- a/src/Types/DocVersionsAnalysis404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsDownloadResponseCode.php b/src/Types/DocVersionsDownloadResponseCode.php deleted file mode 100644 index 1a5fb42..0000000 --- a/src/Types/DocVersionsDownloadResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsList404ResponseCode.php b/src/Types/DocVersionsList404ResponseCode.php deleted file mode 100644 index ef82c99..0000000 --- a/src/Types/DocVersionsList404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsRevisionResponseCode.php b/src/Types/DocVersionsRevisionResponseCode.php deleted file mode 100644 index 5fa8ff1..0000000 --- a/src/Types/DocVersionsRevisionResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatureContentsResponseCode.php b/src/Types/DocVersionsSignatureContentsResponseCode.php deleted file mode 100644 index aa3c026..0000000 --- a/src/Types/DocVersionsSignatureContentsResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatureDigestResponseCode.php b/src/Types/DocVersionsSignatureDigestResponseCode.php deleted file mode 100644 index 40d2f3b..0000000 --- a/src/Types/DocVersionsSignatureDigestResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -, * contentsSize: int, * signer: DocVersionsSignatures200ResponseSignaturesItemSigner, * catalogCertification: bool, - * widget?: ?DocVersionsSignatures200ResponseSignaturesItemWidget, + * widget?: ?FormWidget, * filter?: ?string, * subFilter?: ?string, * byteRange?: ?array, diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemField.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemField.php deleted file mode 100644 index b517b9b..0000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemField.php +++ /dev/null @@ -1,196 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber $objectNumber - * @return DocVersionsSignatures200ResponseSignaturesItemField - */ - public static function objectNumber(DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber $objectNumber): DocVersionsSignatures200ResponseSignaturesItemField - { - return new DocVersionsSignatures200ResponseSignaturesItemField([ - 'kind' => 'objectNumber', - 'value' => $objectNumber, - ]); - } - - /** - * @param DocVersionsSignatures200ResponseSignaturesItemFieldFqn $fqn - * @return DocVersionsSignatures200ResponseSignaturesItemField - */ - public static function fqn(DocVersionsSignatures200ResponseSignaturesItemFieldFqn $fqn): DocVersionsSignatures200ResponseSignaturesItemField - { - return new DocVersionsSignatures200ResponseSignaturesItemField([ - 'kind' => 'fqn', - 'value' => $fqn, - ]); - } - - /** - * @return bool - */ - public function isObjectNumber(): bool - { - return $this->value instanceof DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber && $this->kind === 'objectNumber'; - } - - /** - * @return DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber - */ - public function asObjectNumber(): DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber - { - if (!($this->value instanceof DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber && $this->kind === 'objectNumber')) { - throw new Exception( - "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFqn(): bool - { - return $this->value instanceof DocVersionsSignatures200ResponseSignaturesItemFieldFqn && $this->kind === 'fqn'; - } - - /** - * @return DocVersionsSignatures200ResponseSignaturesItemFieldFqn - */ - public function asFqn(): DocVersionsSignatures200ResponseSignaturesItemFieldFqn - { - if (!($this->value instanceof DocVersionsSignatures200ResponseSignaturesItemFieldFqn && $this->kind === 'fqn')) { - throw new Exception( - "Expected fqn; 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 'objectNumber': - $value = $this->asObjectNumber()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fqn': - $value = $this->asFqn()->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 'objectNumber': - $args['value'] = DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber::jsonDeserialize($data); - break; - case 'fqn': - $args['value'] = DocVersionsSignatures200ResponseSignaturesItemFieldFqn::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/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.php deleted file mode 100644 index 025175a..0000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldFqn.php +++ /dev/null @@ -1,34 +0,0 @@ -name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.php deleted file mode 100644 index 0a2d85e..0000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldObjectNumber.php +++ /dev/null @@ -1,34 +0,0 @@ -fieldObjectNumber = $values['fieldObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php index b50d692..eac0190 100644 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php +++ b/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php @@ -4,6 +4,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use DateTime; +use CloudPDF\Core\Types\Date; class DocVersionsSignatures200ResponseSignaturesItemSigner extends JsonSerializableType { @@ -32,10 +34,10 @@ class DocVersionsSignatures200ResponseSignaturesItemSigner extends JsonSerializa public ?string $contactInfo; /** - * @var ?string $claimedTime + * @var ?DateTime $signedAt */ - #[JsonProperty('claimedTime')] - public ?string $claimedTime; + #[JsonProperty('signedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $signedAt; /** * @param array{ @@ -43,7 +45,7 @@ class DocVersionsSignatures200ResponseSignaturesItemSigner extends JsonSerializa * reason?: ?string, * location?: ?string, * contactInfo?: ?string, - * claimedTime?: ?string, + * signedAt?: ?DateTime, * } $values */ public function __construct( @@ -53,7 +55,7 @@ public function __construct( $this->reason = $values['reason'] ?? null; $this->location = $values['location'] ?? null; $this->contactInfo = $values['contactInfo'] ?? null; - $this->claimedTime = $values['claimedTime'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; } /** diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.php deleted file mode 100644 index b22cb72..0000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemWidget.php +++ /dev/null @@ -1,42 +0,0 @@ -annotObjectNumber = $values['annotObjectNumber']; - $this->pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures404Response.php b/src/Types/DocVersionsSignatures404Response.php deleted file mode 100644 index 4c57191..0000000 --- a/src/Types/DocVersionsSignatures404Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures404ResponseCode.php b/src/Types/DocVersionsSignatures404ResponseCode.php deleted file mode 100644 index 3a484bb..0000000 --- a/src/Types/DocVersionsSignatures404ResponseCode.php +++ /dev/null @@ -1,32 +0,0 @@ -, * openAction?: ?PdfActionTree, - * openDestination?: ?PdfDestination, + * openDestination?: ?PageDestination, * willClose?: ?PdfActionTree, * willSave?: ?PdfActionTree, * didSave?: ?PdfActionTree, diff --git a/src/Types/DocumentMetadata.php b/src/Types/DocumentMetadata.php new file mode 100644 index 0000000..be1da24 --- /dev/null +++ b/src/Types/DocumentMetadata.php @@ -0,0 +1,100 @@ + $trapped + */ + #[JsonProperty('trapped')] + public string $trapped; + + /** + * @param array{ + * trapped: value-of, + * title?: ?string, + * author?: ?string, + * subject?: ?string, + * keywords?: ?string, + * producer?: ?string, + * creator?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->title = $values['title'] ?? null; + $this->author = $values['author'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->keywords = $values['keywords'] ?? null; + $this->producer = $values['producer'] ?? null; + $this->creator = $values['creator'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->trapped = $values['trapped']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentMetadataTrapped.php b/src/Types/DocumentMetadataTrapped.php new file mode 100644 index 0000000..e99bd18 --- /dev/null +++ b/src/Types/DocumentMetadataTrapped.php @@ -0,0 +1,10 @@ +error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsCommit400ResponseError.php b/src/Types/DocumentsCommit400ResponseError.php deleted file mode 100644 index f5283fe..0000000 --- a/src/Types/DocumentsCommit400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsCommit404Response.php b/src/Types/DocumentsCommit404Response.php deleted file mode 100644 index b79d00f..0000000 --- a/src/Types/DocumentsCommit404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsCommit404ResponseError.php b/src/Types/DocumentsCommit404ResponseError.php deleted file mode 100644 index 0f2311e..0000000 --- a/src/Types/DocumentsCommit404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDelete403Response.php b/src/Types/DocumentsDelete403Response.php deleted file mode 100644 index 5c4948c..0000000 --- a/src/Types/DocumentsDelete403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDelete403ResponseError.php b/src/Types/DocumentsDelete403ResponseError.php deleted file mode 100644 index a009378..0000000 --- a/src/Types/DocumentsDelete403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDelete404Response.php b/src/Types/DocumentsDelete404Response.php deleted file mode 100644 index f79d93c..0000000 --- a/src/Types/DocumentsDelete404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDelete404ResponseError.php b/src/Types/DocumentsDelete404ResponseError.php deleted file mode 100644 index d8e9a94..0000000 --- a/src/Types/DocumentsDelete404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDownload403Response.php b/src/Types/DocumentsDownload403Response.php deleted file mode 100644 index 473fc6d..0000000 --- a/src/Types/DocumentsDownload403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDownload403ResponseError.php b/src/Types/DocumentsDownload403ResponseError.php deleted file mode 100644 index 55c5e1a..0000000 --- a/src/Types/DocumentsDownload403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDownload404Response.php b/src/Types/DocumentsDownload404Response.php deleted file mode 100644 index 3127b28..0000000 --- a/src/Types/DocumentsDownload404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsDownload404ResponseError.php b/src/Types/DocumentsDownload404ResponseError.php deleted file mode 100644 index 74dc73a..0000000 --- a/src/Types/DocumentsDownload404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet403Response.php b/src/Types/DocumentsGet403Response.php deleted file mode 100644 index ab5fd41..0000000 --- a/src/Types/DocumentsGet403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet403ResponseError.php b/src/Types/DocumentsGet403ResponseError.php deleted file mode 100644 index abaeea6..0000000 --- a/src/Types/DocumentsGet403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet404Response.php b/src/Types/DocumentsGet404Response.php deleted file mode 100644 index 3ccbd29..0000000 --- a/src/Types/DocumentsGet404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet404ResponseError.php b/src/Types/DocumentsGet404ResponseError.php deleted file mode 100644 index 9660343..0000000 --- a/src/Types/DocumentsGet404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom400Response.php b/src/Types/DocumentsImportFrom400Response.php deleted file mode 100644 index b8a5874..0000000 --- a/src/Types/DocumentsImportFrom400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom400ResponseError.php b/src/Types/DocumentsImportFrom400ResponseError.php deleted file mode 100644 index 2c62d39..0000000 --- a/src/Types/DocumentsImportFrom400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom403Response.php b/src/Types/DocumentsImportFrom403Response.php deleted file mode 100644 index aa3856f..0000000 --- a/src/Types/DocumentsImportFrom403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom403ResponseError.php b/src/Types/DocumentsImportFrom403ResponseError.php deleted file mode 100644 index b6b75d8..0000000 --- a/src/Types/DocumentsImportFrom403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom502Response.php b/src/Types/DocumentsImportFrom502Response.php deleted file mode 100644 index f703489..0000000 --- a/src/Types/DocumentsImportFrom502Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsImportFrom502ResponseError.php b/src/Types/DocumentsImportFrom502ResponseError.php deleted file mode 100644 index 13a43a3..0000000 --- a/src/Types/DocumentsImportFrom502ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit400Response.php b/src/Types/DocumentsInit400Response.php deleted file mode 100644 index eedf5ed..0000000 --- a/src/Types/DocumentsInit400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit400ResponseError.php b/src/Types/DocumentsInit400ResponseError.php deleted file mode 100644 index 52aec29..0000000 --- a/src/Types/DocumentsInit400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsList400Response.php b/src/Types/DocumentsList400Response.php deleted file mode 100644 index e423491..0000000 --- a/src/Types/DocumentsList400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsList400ResponseError.php b/src/Types/DocumentsList400ResponseError.php deleted file mode 100644 index cc11f1d..0000000 --- a/src/Types/DocumentsList400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUploadProxy400Response.php b/src/Types/DocumentsUploadProxy400Response.php deleted file mode 100644 index 245a7b2..0000000 --- a/src/Types/DocumentsUploadProxy400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUploadProxy400ResponseError.php b/src/Types/DocumentsUploadProxy400ResponseError.php deleted file mode 100644 index d4bf054..0000000 --- a/src/Types/DocumentsUploadProxy400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUploadProxy409Response.php b/src/Types/DocumentsUploadProxy409Response.php deleted file mode 100644 index 4d51540..0000000 --- a/src/Types/DocumentsUploadProxy409Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUploadProxy409ResponseError.php b/src/Types/DocumentsUploadProxy409ResponseError.php deleted file mode 100644 index 2e39963..0000000 --- a/src/Types/DocumentsUploadProxy409ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/EngineErrorPayloadCode.php b/src/Types/EngineErrorPayloadCode.php index bd08e4b..97c6b50 100644 --- a/src/Types/EngineErrorPayloadCode.php +++ b/src/Types/EngineErrorPayloadCode.php @@ -18,8 +18,6 @@ enum EngineErrorPayloadCode: string case NotFound = "NotFound"; case WireFormat = "WireFormat"; case RuntimeUnavailable = "RuntimeUnavailable"; - case InvalidReference = "InvalidReference"; - case WeakAnnotationSessionConflict = "WeakAnnotationSessionConflict"; case LayerVersionConflict = "LayerVersionConflict"; case NotImplemented = "NotImplemented"; case MalformedPdf = "MalformedPdf"; @@ -29,4 +27,10 @@ enum EngineErrorPayloadCode: string case SignatureRefused = "SignatureRefused"; case ProtectedDocument = "ProtectedDocument"; case StaleBase = "StaleBase"; + case PayloadTooLarge = "PayloadTooLarge"; + case ObjectNumberUnavailable = "ObjectNumberUnavailable"; + case LayerFull = "LayerFull"; + case ChangeConflict = "ChangeConflict"; + case UndoUnavailable = "UndoUnavailable"; + case IdempotencyKeyReused = "IdempotencyKeyReused"; } diff --git a/src/Types/FieldActionsPatch.php b/src/Types/FieldActionsPatch.php new file mode 100644 index 0000000..bd5f959 --- /dev/null +++ b/src/Types/FieldActionsPatch.php @@ -0,0 +1,58 @@ +keystroke = $values['keystroke'] ?? null; + $this->format = $values['format'] ?? null; + $this->validate = $values['validate'] ?? null; + $this->calculate = $values['calculate'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldPositionAfter.php b/src/Types/FieldPositionAfter.php new file mode 100644 index 0000000..5afb33c --- /dev/null +++ b/src/Types/FieldPositionAfter.php @@ -0,0 +1,42 @@ +before = $values['before'] ?? null; + $this->after = $values['after'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldPositionZero.php b/src/Types/FieldPositionZero.php new file mode 100644 index 0000000..46643ad --- /dev/null +++ b/src/Types/FieldPositionZero.php @@ -0,0 +1,9 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $script + */ + #[JsonProperty('script')] + public string $script; + + /** + * @var ?array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * type: value-of, + * script: string, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->script = $values['script']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldScriptWriteType.php b/src/Types/FieldScriptWriteType.php new file mode 100644 index 0000000..4feb6ed --- /dev/null +++ b/src/Types/FieldScriptWriteType.php @@ -0,0 +1,8 @@ +family = $values['family']; + $this->value = $values['value']; + } + + /** + * @param FormFieldText $text + * @return FormField + */ + public static function text(FormFieldText $text): FormField + { + return new FormField([ + 'family' => 'text', + 'value' => $text, + ]); + } + + /** + * @param FormFieldCheckbox $checkbox + * @return FormField + */ + public static function checkbox(FormFieldCheckbox $checkbox): FormField + { + return new FormField([ + 'family' => 'checkbox', + 'value' => $checkbox, + ]); + } + + /** + * @param FormFieldRadio $radio + * @return FormField + */ + public static function radio(FormFieldRadio $radio): FormField + { + return new FormField([ + 'family' => 'radio', + 'value' => $radio, + ]); + } + + /** + * @param FormFieldCombobox $combobox + * @return FormField + */ + public static function combobox(FormFieldCombobox $combobox): FormField + { + return new FormField([ + 'family' => 'combobox', + 'value' => $combobox, + ]); + } + + /** + * @param FormFieldListbox $listbox + * @return FormField + */ + public static function listbox(FormFieldListbox $listbox): FormField + { + return new FormField([ + 'family' => 'listbox', + 'value' => $listbox, + ]); + } + + /** + * @param FormFieldPushbutton $pushbutton + * @return FormField + */ + public static function pushbutton(FormFieldPushbutton $pushbutton): FormField + { + return new FormField([ + 'family' => 'pushbutton', + 'value' => $pushbutton, + ]); + } + + /** + * @param FormFieldSignature $signature + * @return FormField + */ + public static function signature(FormFieldSignature $signature): FormField + { + return new FormField([ + 'family' => 'signature', + 'value' => $signature, + ]); + } + + /** + * @param FormFieldUnknown $unknown + * @return FormField + */ + public static function unknown(FormFieldUnknown $unknown): FormField + { + return new FormField([ + 'family' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isText(): bool + { + return $this->value instanceof FormFieldText && $this->family === 'text'; + } + + /** + * @return FormFieldText + */ + public function asText(): FormFieldText + { + if (!($this->value instanceof FormFieldText && $this->family === 'text')) { + throw new Exception( + "Expected text; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCheckbox(): bool + { + return $this->value instanceof FormFieldCheckbox && $this->family === 'checkbox'; + } + + /** + * @return FormFieldCheckbox + */ + public function asCheckbox(): FormFieldCheckbox + { + if (!($this->value instanceof FormFieldCheckbox && $this->family === 'checkbox')) { + throw new Exception( + "Expected checkbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRadio(): bool + { + return $this->value instanceof FormFieldRadio && $this->family === 'radio'; + } + + /** + * @return FormFieldRadio + */ + public function asRadio(): FormFieldRadio + { + if (!($this->value instanceof FormFieldRadio && $this->family === 'radio')) { + throw new Exception( + "Expected radio; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCombobox(): bool + { + return $this->value instanceof FormFieldCombobox && $this->family === 'combobox'; + } + + /** + * @return FormFieldCombobox + */ + public function asCombobox(): FormFieldCombobox + { + if (!($this->value instanceof FormFieldCombobox && $this->family === 'combobox')) { + throw new Exception( + "Expected combobox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isListbox(): bool + { + return $this->value instanceof FormFieldListbox && $this->family === 'listbox'; + } + + /** + * @return FormFieldListbox + */ + public function asListbox(): FormFieldListbox + { + if (!($this->value instanceof FormFieldListbox && $this->family === 'listbox')) { + throw new Exception( + "Expected listbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPushbutton(): bool + { + return $this->value instanceof FormFieldPushbutton && $this->family === 'pushbutton'; + } + + /** + * @return FormFieldPushbutton + */ + public function asPushbutton(): FormFieldPushbutton + { + if (!($this->value instanceof FormFieldPushbutton && $this->family === 'pushbutton')) { + throw new Exception( + "Expected pushbutton; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSignature(): bool + { + return $this->value instanceof FormFieldSignature && $this->family === 'signature'; + } + + /** + * @return FormFieldSignature + */ + public function asSignature(): FormFieldSignature + { + if (!($this->value instanceof FormFieldSignature && $this->family === 'signature')) { + throw new Exception( + "Expected signature; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof FormFieldUnknown && $this->family === 'unknown'; + } + + /** + * @return FormFieldUnknown + */ + public function asUnknown(): FormFieldUnknown + { + if (!($this->value instanceof FormFieldUnknown && $this->family === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->family . " 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['family'] = $this->family; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->family) { + case 'text': + $value = $this->asText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'checkbox': + $value = $this->asCheckbox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'radio': + $value = $this->asRadio()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'combobox': + $value = $this->asCombobox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'listbox': + $value = $this->asListbox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pushbutton': + $value = $this->asPushbutton()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'signature': + $value = $this->asSignature()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->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('family', $data)) { + throw new Exception( + "JSON data is missing property 'family'", + ); + } + $family = $data['family']; + if (!(is_string($family))) { + throw new Exception( + "Expected property 'family' in JSON data to be string, instead received " . get_debug_type($data['family']), + ); + } + + $args['family'] = $family; + switch ($family) { + case 'text': + $args['value'] = FormFieldText::jsonDeserialize($data); + break; + case 'checkbox': + $args['value'] = FormFieldCheckbox::jsonDeserialize($data); + break; + case 'radio': + $args['value'] = FormFieldRadio::jsonDeserialize($data); + break; + case 'combobox': + $args['value'] = FormFieldCombobox::jsonDeserialize($data); + break; + case 'listbox': + $args['value'] = FormFieldListbox::jsonDeserialize($data); + break; + case 'pushbutton': + $args['value'] = FormFieldPushbutton::jsonDeserialize($data); + break; + case 'signature': + $args['value'] = FormFieldSignature::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = FormFieldUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['family'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/FormFieldCheckbox.php b/src/Types/FormFieldCheckbox.php new file mode 100644 index 0000000..294a6fd --- /dev/null +++ b/src/Types/FormFieldCheckbox.php @@ -0,0 +1,197 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldCheckboxValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldCheckboxValueEntry $valueEntry; + + /** + * @var FormFieldCheckboxDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldCheckboxDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormFieldCheckboxWidgetsItem::class])] + public array $widgets; + + /** + * @var bool $checked + */ + #[JsonProperty('checked')] + public bool $checked; + + /** + * @var string $exportValue + */ + #[JsonProperty('exportValue')] + public string $exportValue; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldCheckboxValueEntry, + * defaultValueEntry: FormFieldCheckboxDefaultValueEntry, + * widgets: array, + * checked: bool, + * exportValue: string, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->checked = $values['checked']; + $this->exportValue = $values['exportValue']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntry.php b/src/Types/FormFieldCheckboxDefaultValueEntry.php new file mode 100644 index 0000000..6e8630d --- /dev/null +++ b/src/Types/FormFieldCheckboxDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldCheckboxDefaultValueEntryNone $none + * @return FormFieldCheckboxDefaultValueEntry + */ + public static function none(FormFieldCheckboxDefaultValueEntryNone $none): FormFieldCheckboxDefaultValueEntry + { + return new FormFieldCheckboxDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldCheckboxDefaultValueEntryScalar $scalar + * @return FormFieldCheckboxDefaultValueEntry + */ + public static function scalar(FormFieldCheckboxDefaultValueEntryScalar $scalar): FormFieldCheckboxDefaultValueEntry + { + return new FormFieldCheckboxDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldCheckboxDefaultValueEntryArray $array + * @return FormFieldCheckboxDefaultValueEntry + */ + public static function array(FormFieldCheckboxDefaultValueEntryArray $array): FormFieldCheckboxDefaultValueEntry + { + return new FormFieldCheckboxDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldCheckboxDefaultValueEntryUnsupported $unsupported + * @return FormFieldCheckboxDefaultValueEntry + */ + public static function unsupported(FormFieldCheckboxDefaultValueEntryUnsupported $unsupported): FormFieldCheckboxDefaultValueEntry + { + return new FormFieldCheckboxDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldCheckboxDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldCheckboxDefaultValueEntryNone + */ + public function asNone(): FormFieldCheckboxDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldCheckboxDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldCheckboxDefaultValueEntryScalar + */ + public function asScalar(): FormFieldCheckboxDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldCheckboxDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldCheckboxDefaultValueEntryArray + */ + public function asArray(): FormFieldCheckboxDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldCheckboxDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldCheckboxDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldCheckboxDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldCheckboxDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldCheckboxDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldCheckboxDefaultValueEntryUnsupported::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/FormFieldCheckboxDefaultValueEntryArray.php b/src/Types/FormFieldCheckboxDefaultValueEntryArray.php new file mode 100644 index 0000000..5211e50 --- /dev/null +++ b/src/Types/FormFieldCheckboxDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryNone.php b/src/Types/FormFieldCheckboxDefaultValueEntryNone.php new file mode 100644 index 0000000..0d46e6b --- /dev/null +++ b/src/Types/FormFieldCheckboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php b/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..2962623 --- /dev/null +++ b/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..8bd3a00 --- /dev/null +++ b/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxOrigin.php b/src/Types/FormFieldCheckboxOrigin.php new file mode 100644 index 0000000..1693f23 --- /dev/null +++ b/src/Types/FormFieldCheckboxOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldCheckboxValueEntryNone $none + * @return FormFieldCheckboxValueEntry + */ + public static function none(FormFieldCheckboxValueEntryNone $none): FormFieldCheckboxValueEntry + { + return new FormFieldCheckboxValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldCheckboxValueEntryScalar $scalar + * @return FormFieldCheckboxValueEntry + */ + public static function scalar(FormFieldCheckboxValueEntryScalar $scalar): FormFieldCheckboxValueEntry + { + return new FormFieldCheckboxValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldCheckboxValueEntryArray $array + * @return FormFieldCheckboxValueEntry + */ + public static function array(FormFieldCheckboxValueEntryArray $array): FormFieldCheckboxValueEntry + { + return new FormFieldCheckboxValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldCheckboxValueEntryUnsupported $unsupported + * @return FormFieldCheckboxValueEntry + */ + public static function unsupported(FormFieldCheckboxValueEntryUnsupported $unsupported): FormFieldCheckboxValueEntry + { + return new FormFieldCheckboxValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldCheckboxValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldCheckboxValueEntryNone + */ + public function asNone(): FormFieldCheckboxValueEntryNone + { + if (!($this->value instanceof FormFieldCheckboxValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldCheckboxValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldCheckboxValueEntryScalar + */ + public function asScalar(): FormFieldCheckboxValueEntryScalar + { + if (!($this->value instanceof FormFieldCheckboxValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldCheckboxValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldCheckboxValueEntryArray + */ + public function asArray(): FormFieldCheckboxValueEntryArray + { + if (!($this->value instanceof FormFieldCheckboxValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldCheckboxValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldCheckboxValueEntryUnsupported + */ + public function asUnsupported(): FormFieldCheckboxValueEntryUnsupported + { + if (!($this->value instanceof FormFieldCheckboxValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldCheckboxValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldCheckboxValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldCheckboxValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldCheckboxValueEntryUnsupported::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/FormFieldCheckboxValueEntryArray.php b/src/Types/FormFieldCheckboxValueEntryArray.php new file mode 100644 index 0000000..7a77c58 --- /dev/null +++ b/src/Types/FormFieldCheckboxValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxValueEntryNone.php b/src/Types/FormFieldCheckboxValueEntryNone.php new file mode 100644 index 0000000..5eb78dc --- /dev/null +++ b/src/Types/FormFieldCheckboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxValueEntryScalar.php b/src/Types/FormFieldCheckboxValueEntryScalar.php new file mode 100644 index 0000000..6d99806 --- /dev/null +++ b/src/Types/FormFieldCheckboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxValueEntryUnsupported.php b/src/Types/FormFieldCheckboxValueEntryUnsupported.php new file mode 100644 index 0000000..2010b52 --- /dev/null +++ b/src/Types/FormFieldCheckboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldCheckboxWidgetsItem.php b/src/Types/FormFieldCheckboxWidgetsItem.php new file mode 100644 index 0000000..6f3d19a --- /dev/null +++ b/src/Types/FormFieldCheckboxWidgetsItem.php @@ -0,0 +1,74 @@ +ref = $values['ref'] ?? null; + $this->objectNumber = $values['objectNumber']; + $this->page = $values['page'] ?? null; + $this->onState = $values['onState']; + $this->exportValue = $values['exportValue']; + $this->checked = $values['checked']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldCombobox.php b/src/Types/FormFieldCombobox.php new file mode 100644 index 0000000..a8a1f47 --- /dev/null +++ b/src/Types/FormFieldCombobox.php @@ -0,0 +1,213 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldComboboxValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldComboboxValueEntry $valueEntry; + + /** + * @var FormFieldComboboxDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldComboboxDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @var string $value + */ + #[JsonProperty('value')] + public string $value; + + /** + * @var string $defaultValue + */ + #[JsonProperty('defaultValue')] + public string $defaultValue; + + /** + * @var bool $edit + */ + #[JsonProperty('edit')] + public bool $edit; + + /** + * @var array $options + */ + #[JsonProperty('options'), ArrayType([FormFieldComboboxOptionsItem::class])] + public array $options; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldComboboxValueEntry, + * defaultValueEntry: FormFieldComboboxDefaultValueEntry, + * widgets: array, + * value: string, + * defaultValue: string, + * edit: bool, + * options: array, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->value = $values['value']; + $this->defaultValue = $values['defaultValue']; + $this->edit = $values['edit']; + $this->options = $values['options']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxDefaultValueEntry.php b/src/Types/FormFieldComboboxDefaultValueEntry.php new file mode 100644 index 0000000..21c68a5 --- /dev/null +++ b/src/Types/FormFieldComboboxDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldComboboxDefaultValueEntryNone $none + * @return FormFieldComboboxDefaultValueEntry + */ + public static function none(FormFieldComboboxDefaultValueEntryNone $none): FormFieldComboboxDefaultValueEntry + { + return new FormFieldComboboxDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldComboboxDefaultValueEntryScalar $scalar + * @return FormFieldComboboxDefaultValueEntry + */ + public static function scalar(FormFieldComboboxDefaultValueEntryScalar $scalar): FormFieldComboboxDefaultValueEntry + { + return new FormFieldComboboxDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldComboboxDefaultValueEntryArray $array + * @return FormFieldComboboxDefaultValueEntry + */ + public static function array(FormFieldComboboxDefaultValueEntryArray $array): FormFieldComboboxDefaultValueEntry + { + return new FormFieldComboboxDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldComboboxDefaultValueEntryUnsupported $unsupported + * @return FormFieldComboboxDefaultValueEntry + */ + public static function unsupported(FormFieldComboboxDefaultValueEntryUnsupported $unsupported): FormFieldComboboxDefaultValueEntry + { + return new FormFieldComboboxDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldComboboxDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldComboboxDefaultValueEntryNone + */ + public function asNone(): FormFieldComboboxDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldComboboxDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldComboboxDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldComboboxDefaultValueEntryScalar + */ + public function asScalar(): FormFieldComboboxDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldComboboxDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldComboboxDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldComboboxDefaultValueEntryArray + */ + public function asArray(): FormFieldComboboxDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldComboboxDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldComboboxDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldComboboxDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldComboboxDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldComboboxDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldComboboxDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldComboboxDefaultValueEntryUnsupported::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/FormFieldComboboxDefaultValueEntryArray.php b/src/Types/FormFieldComboboxDefaultValueEntryArray.php new file mode 100644 index 0000000..9a9b186 --- /dev/null +++ b/src/Types/FormFieldComboboxDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryNone.php b/src/Types/FormFieldComboboxDefaultValueEntryNone.php new file mode 100644 index 0000000..a0a186e --- /dev/null +++ b/src/Types/FormFieldComboboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryScalar.php b/src/Types/FormFieldComboboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..cf26e55 --- /dev/null +++ b/src/Types/FormFieldComboboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..5cad6d3 --- /dev/null +++ b/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldComboboxOptionsItem.php b/src/Types/FormFieldComboboxOptionsItem.php new file mode 100644 index 0000000..b5fb768 --- /dev/null +++ b/src/Types/FormFieldComboboxOptionsItem.php @@ -0,0 +1,50 @@ +label = $values['label']; + $this->value = $values['value']; + $this->selected = $values['selected']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxOrigin.php b/src/Types/FormFieldComboboxOrigin.php new file mode 100644 index 0000000..b42fd6b --- /dev/null +++ b/src/Types/FormFieldComboboxOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldComboboxValueEntryNone $none + * @return FormFieldComboboxValueEntry + */ + public static function none(FormFieldComboboxValueEntryNone $none): FormFieldComboboxValueEntry + { + return new FormFieldComboboxValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldComboboxValueEntryScalar $scalar + * @return FormFieldComboboxValueEntry + */ + public static function scalar(FormFieldComboboxValueEntryScalar $scalar): FormFieldComboboxValueEntry + { + return new FormFieldComboboxValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldComboboxValueEntryArray $array + * @return FormFieldComboboxValueEntry + */ + public static function array(FormFieldComboboxValueEntryArray $array): FormFieldComboboxValueEntry + { + return new FormFieldComboboxValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldComboboxValueEntryUnsupported $unsupported + * @return FormFieldComboboxValueEntry + */ + public static function unsupported(FormFieldComboboxValueEntryUnsupported $unsupported): FormFieldComboboxValueEntry + { + return new FormFieldComboboxValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldComboboxValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldComboboxValueEntryNone + */ + public function asNone(): FormFieldComboboxValueEntryNone + { + if (!($this->value instanceof FormFieldComboboxValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldComboboxValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldComboboxValueEntryScalar + */ + public function asScalar(): FormFieldComboboxValueEntryScalar + { + if (!($this->value instanceof FormFieldComboboxValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldComboboxValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldComboboxValueEntryArray + */ + public function asArray(): FormFieldComboboxValueEntryArray + { + if (!($this->value instanceof FormFieldComboboxValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldComboboxValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldComboboxValueEntryUnsupported + */ + public function asUnsupported(): FormFieldComboboxValueEntryUnsupported + { + if (!($this->value instanceof FormFieldComboboxValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldComboboxValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldComboboxValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldComboboxValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldComboboxValueEntryUnsupported::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/FormFieldComboboxValueEntryArray.php b/src/Types/FormFieldComboboxValueEntryArray.php new file mode 100644 index 0000000..5b8705f --- /dev/null +++ b/src/Types/FormFieldComboboxValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxValueEntryNone.php b/src/Types/FormFieldComboboxValueEntryNone.php new file mode 100644 index 0000000..b629bae --- /dev/null +++ b/src/Types/FormFieldComboboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldComboboxValueEntryScalar.php b/src/Types/FormFieldComboboxValueEntryScalar.php new file mode 100644 index 0000000..05171cf --- /dev/null +++ b/src/Types/FormFieldComboboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldComboboxValueEntryUnsupported.php b/src/Types/FormFieldComboboxValueEntryUnsupported.php new file mode 100644 index 0000000..cff88c9 --- /dev/null +++ b/src/Types/FormFieldComboboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldDraft.php b/src/Types/FormFieldDraft.php new file mode 100644 index 0000000..285fb51 --- /dev/null +++ b/src/Types/FormFieldDraft.php @@ -0,0 +1,421 @@ +family = $values['family']; + $this->value = $values['value']; + } + + /** + * @param FormFieldDraftText $text + * @return FormFieldDraft + */ + public static function text(FormFieldDraftText $text): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'text', + 'value' => $text, + ]); + } + + /** + * @param FormFieldDraftCheckbox $checkbox + * @return FormFieldDraft + */ + public static function checkbox(FormFieldDraftCheckbox $checkbox): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'checkbox', + 'value' => $checkbox, + ]); + } + + /** + * @param FormFieldDraftRadio $radio + * @return FormFieldDraft + */ + public static function radio(FormFieldDraftRadio $radio): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'radio', + 'value' => $radio, + ]); + } + + /** + * @param FormFieldDraftCombobox $combobox + * @return FormFieldDraft + */ + public static function combobox(FormFieldDraftCombobox $combobox): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'combobox', + 'value' => $combobox, + ]); + } + + /** + * @param FormFieldDraftListbox $listbox + * @return FormFieldDraft + */ + public static function listbox(FormFieldDraftListbox $listbox): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'listbox', + 'value' => $listbox, + ]); + } + + /** + * @param FormFieldDraftPushbutton $pushbutton + * @return FormFieldDraft + */ + public static function pushbutton(FormFieldDraftPushbutton $pushbutton): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'pushbutton', + 'value' => $pushbutton, + ]); + } + + /** + * @param FormFieldDraftSignature $signature + * @return FormFieldDraft + */ + public static function signature(FormFieldDraftSignature $signature): FormFieldDraft + { + return new FormFieldDraft([ + 'family' => 'signature', + 'value' => $signature, + ]); + } + + /** + * @return bool + */ + public function isText(): bool + { + return $this->value instanceof FormFieldDraftText && $this->family === 'text'; + } + + /** + * @return FormFieldDraftText + */ + public function asText(): FormFieldDraftText + { + if (!($this->value instanceof FormFieldDraftText && $this->family === 'text')) { + throw new Exception( + "Expected text; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCheckbox(): bool + { + return $this->value instanceof FormFieldDraftCheckbox && $this->family === 'checkbox'; + } + + /** + * @return FormFieldDraftCheckbox + */ + public function asCheckbox(): FormFieldDraftCheckbox + { + if (!($this->value instanceof FormFieldDraftCheckbox && $this->family === 'checkbox')) { + throw new Exception( + "Expected checkbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRadio(): bool + { + return $this->value instanceof FormFieldDraftRadio && $this->family === 'radio'; + } + + /** + * @return FormFieldDraftRadio + */ + public function asRadio(): FormFieldDraftRadio + { + if (!($this->value instanceof FormFieldDraftRadio && $this->family === 'radio')) { + throw new Exception( + "Expected radio; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isCombobox(): bool + { + return $this->value instanceof FormFieldDraftCombobox && $this->family === 'combobox'; + } + + /** + * @return FormFieldDraftCombobox + */ + public function asCombobox(): FormFieldDraftCombobox + { + if (!($this->value instanceof FormFieldDraftCombobox && $this->family === 'combobox')) { + throw new Exception( + "Expected combobox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isListbox(): bool + { + return $this->value instanceof FormFieldDraftListbox && $this->family === 'listbox'; + } + + /** + * @return FormFieldDraftListbox + */ + public function asListbox(): FormFieldDraftListbox + { + if (!($this->value instanceof FormFieldDraftListbox && $this->family === 'listbox')) { + throw new Exception( + "Expected listbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isPushbutton(): bool + { + return $this->value instanceof FormFieldDraftPushbutton && $this->family === 'pushbutton'; + } + + /** + * @return FormFieldDraftPushbutton + */ + public function asPushbutton(): FormFieldDraftPushbutton + { + if (!($this->value instanceof FormFieldDraftPushbutton && $this->family === 'pushbutton')) { + throw new Exception( + "Expected pushbutton; got " . $this->family . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSignature(): bool + { + return $this->value instanceof FormFieldDraftSignature && $this->family === 'signature'; + } + + /** + * @return FormFieldDraftSignature + */ + public function asSignature(): FormFieldDraftSignature + { + if (!($this->value instanceof FormFieldDraftSignature && $this->family === 'signature')) { + throw new Exception( + "Expected signature; got " . $this->family . " 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['family'] = $this->family; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->family) { + case 'text': + $value = $this->asText()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'checkbox': + $value = $this->asCheckbox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'radio': + $value = $this->asRadio()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'combobox': + $value = $this->asCombobox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'listbox': + $value = $this->asListbox()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'pushbutton': + $value = $this->asPushbutton()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'signature': + $value = $this->asSignature()->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('family', $data)) { + throw new Exception( + "JSON data is missing property 'family'", + ); + } + $family = $data['family']; + if (!(is_string($family))) { + throw new Exception( + "Expected property 'family' in JSON data to be string, instead received " . get_debug_type($data['family']), + ); + } + + $args['family'] = $family; + switch ($family) { + case 'text': + $args['value'] = FormFieldDraftText::jsonDeserialize($data); + break; + case 'checkbox': + $args['value'] = FormFieldDraftCheckbox::jsonDeserialize($data); + break; + case 'radio': + $args['value'] = FormFieldDraftRadio::jsonDeserialize($data); + break; + case 'combobox': + $args['value'] = FormFieldDraftCombobox::jsonDeserialize($data); + break; + case 'listbox': + $args['value'] = FormFieldDraftListbox::jsonDeserialize($data); + break; + case 'pushbutton': + $args['value'] = FormFieldDraftPushbutton::jsonDeserialize($data); + break; + case 'signature': + $args['value'] = FormFieldDraftSignature::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['family'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/FormFieldDraftCheckbox.php b/src/Types/FormFieldDraftCheckbox.php new file mode 100644 index 0000000..e345d88 --- /dev/null +++ b/src/Types/FormFieldDraftCheckbox.php @@ -0,0 +1,99 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftCombobox.php b/src/Types/FormFieldDraftCombobox.php new file mode 100644 index 0000000..4321f69 --- /dev/null +++ b/src/Types/FormFieldDraftCombobox.php @@ -0,0 +1,123 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @var ?bool $edit + */ + #[JsonProperty('edit')] + public ?bool $edit; + + /** + * @var ?array $options + */ + #[JsonProperty('options'), ArrayType([FormFieldDraftComboboxOptionsItem::class])] + public ?array $options; + + /** + * @var ?string $defaultValue + */ + #[JsonProperty('defaultValue')] + public ?string $defaultValue; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * edit?: ?bool, + * options?: ?array, + * defaultValue?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + $this->edit = $values['edit'] ?? null; + $this->options = $values['options'] ?? null; + $this->defaultValue = $values['defaultValue'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftComboboxOptionsItem.php b/src/Types/FormFieldDraftComboboxOptionsItem.php new file mode 100644 index 0000000..2ab1c07 --- /dev/null +++ b/src/Types/FormFieldDraftComboboxOptionsItem.php @@ -0,0 +1,42 @@ +label = $values['label']; + $this->value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftListbox.php b/src/Types/FormFieldDraftListbox.php new file mode 100644 index 0000000..88f6ee0 --- /dev/null +++ b/src/Types/FormFieldDraftListbox.php @@ -0,0 +1,123 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @var ?bool $multiSelect + */ + #[JsonProperty('multiSelect')] + public ?bool $multiSelect; + + /** + * @var ?array $options + */ + #[JsonProperty('options'), ArrayType([FormFieldDraftListboxOptionsItem::class])] + public ?array $options; + + /** + * @var ?array $defaultValue + */ + #[JsonProperty('defaultValue'), ArrayType(['string'])] + public ?array $defaultValue; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * multiSelect?: ?bool, + * options?: ?array, + * defaultValue?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + $this->multiSelect = $values['multiSelect'] ?? null; + $this->options = $values['options'] ?? null; + $this->defaultValue = $values['defaultValue'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftListboxOptionsItem.php b/src/Types/FormFieldDraftListboxOptionsItem.php new file mode 100644 index 0000000..a83a6fb --- /dev/null +++ b/src/Types/FormFieldDraftListboxOptionsItem.php @@ -0,0 +1,42 @@ +label = $values['label']; + $this->value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftPushbutton.php b/src/Types/FormFieldDraftPushbutton.php new file mode 100644 index 0000000..0e23963 --- /dev/null +++ b/src/Types/FormFieldDraftPushbutton.php @@ -0,0 +1,99 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftRadio.php b/src/Types/FormFieldDraftRadio.php new file mode 100644 index 0000000..e6c9128 --- /dev/null +++ b/src/Types/FormFieldDraftRadio.php @@ -0,0 +1,115 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @var ?bool $radiosInUnison + */ + #[JsonProperty('radiosInUnison')] + public ?bool $radiosInUnison; + + /** + * @var ?bool $noToggleToOff + */ + #[JsonProperty('noToggleToOff')] + public ?bool $noToggleToOff; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * radiosInUnison?: ?bool, + * noToggleToOff?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + $this->radiosInUnison = $values['radiosInUnison'] ?? null; + $this->noToggleToOff = $values['noToggleToOff'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftSignature.php b/src/Types/FormFieldDraftSignature.php new file mode 100644 index 0000000..28050b9 --- /dev/null +++ b/src/Types/FormFieldDraftSignature.php @@ -0,0 +1,99 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldDraftText.php b/src/Types/FormFieldDraftText.php new file mode 100644 index 0000000..0ffdb3b --- /dev/null +++ b/src/Types/FormFieldDraftText.php @@ -0,0 +1,139 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetPlacement::class])] + public ?array $widgets; + + /** + * @var ?string $defaultValue + */ + #[JsonProperty('defaultValue')] + public ?string $defaultValue; + + /** + * @var ?int $maxLength + */ + #[JsonProperty('maxLength')] + public ?int $maxLength; + + /** + * @var ?bool $multiline + */ + #[JsonProperty('multiline')] + public ?bool $multiline; + + /** + * @var ?bool $password + */ + #[JsonProperty('password')] + public ?bool $password; + + /** + * @var ?bool $comb + */ + #[JsonProperty('comb')] + public ?bool $comb; + + /** + * @param array{ + * name: string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * widgets?: ?array, + * defaultValue?: ?string, + * maxLength?: ?int, + * multiline?: ?bool, + * password?: ?bool, + * comb?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->widgets = $values['widgets'] ?? null; + $this->defaultValue = $values['defaultValue'] ?? null; + $this->maxLength = $values['maxLength'] ?? null; + $this->multiline = $values['multiline'] ?? null; + $this->password = $values['password'] ?? null; + $this->comb = $values['comb'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListbox.php b/src/Types/FormFieldListbox.php new file mode 100644 index 0000000..5b268a5 --- /dev/null +++ b/src/Types/FormFieldListbox.php @@ -0,0 +1,221 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldListboxValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldListboxValueEntry $valueEntry; + + /** + * @var FormFieldListboxDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldListboxDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @var array $selectedValues + */ + #[JsonProperty('selectedValues'), ArrayType(['string'])] + public array $selectedValues; + + /** + * @var array $defaultValue + */ + #[JsonProperty('defaultValue'), ArrayType(['string'])] + public array $defaultValue; + + /** + * @var bool $multiSelect + */ + #[JsonProperty('multiSelect')] + public bool $multiSelect; + + /** + * @var array $options + */ + #[JsonProperty('options'), ArrayType([FormFieldListboxOptionsItem::class])] + public array $options; + + /** + * @var int $topIndex + */ + #[JsonProperty('topIndex')] + public int $topIndex; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldListboxValueEntry, + * defaultValueEntry: FormFieldListboxDefaultValueEntry, + * widgets: array, + * selectedValues: array, + * defaultValue: array, + * multiSelect: bool, + * options: array, + * topIndex: int, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->selectedValues = $values['selectedValues']; + $this->defaultValue = $values['defaultValue']; + $this->multiSelect = $values['multiSelect']; + $this->options = $values['options']; + $this->topIndex = $values['topIndex']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxDefaultValueEntry.php b/src/Types/FormFieldListboxDefaultValueEntry.php new file mode 100644 index 0000000..e7550ef --- /dev/null +++ b/src/Types/FormFieldListboxDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldListboxDefaultValueEntryNone $none + * @return FormFieldListboxDefaultValueEntry + */ + public static function none(FormFieldListboxDefaultValueEntryNone $none): FormFieldListboxDefaultValueEntry + { + return new FormFieldListboxDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldListboxDefaultValueEntryScalar $scalar + * @return FormFieldListboxDefaultValueEntry + */ + public static function scalar(FormFieldListboxDefaultValueEntryScalar $scalar): FormFieldListboxDefaultValueEntry + { + return new FormFieldListboxDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldListboxDefaultValueEntryArray $array + * @return FormFieldListboxDefaultValueEntry + */ + public static function array(FormFieldListboxDefaultValueEntryArray $array): FormFieldListboxDefaultValueEntry + { + return new FormFieldListboxDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldListboxDefaultValueEntryUnsupported $unsupported + * @return FormFieldListboxDefaultValueEntry + */ + public static function unsupported(FormFieldListboxDefaultValueEntryUnsupported $unsupported): FormFieldListboxDefaultValueEntry + { + return new FormFieldListboxDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldListboxDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldListboxDefaultValueEntryNone + */ + public function asNone(): FormFieldListboxDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldListboxDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldListboxDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldListboxDefaultValueEntryScalar + */ + public function asScalar(): FormFieldListboxDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldListboxDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldListboxDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldListboxDefaultValueEntryArray + */ + public function asArray(): FormFieldListboxDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldListboxDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldListboxDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldListboxDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldListboxDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldListboxDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldListboxDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldListboxDefaultValueEntryUnsupported::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/FormFieldListboxDefaultValueEntryArray.php b/src/Types/FormFieldListboxDefaultValueEntryArray.php new file mode 100644 index 0000000..3347628 --- /dev/null +++ b/src/Types/FormFieldListboxDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxDefaultValueEntryNone.php b/src/Types/FormFieldListboxDefaultValueEntryNone.php new file mode 100644 index 0000000..c10d5c3 --- /dev/null +++ b/src/Types/FormFieldListboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldListboxDefaultValueEntryScalar.php b/src/Types/FormFieldListboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..e3d3468 --- /dev/null +++ b/src/Types/FormFieldListboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..a8238d3 --- /dev/null +++ b/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldListboxOptionsItem.php b/src/Types/FormFieldListboxOptionsItem.php new file mode 100644 index 0000000..4c2bcaa --- /dev/null +++ b/src/Types/FormFieldListboxOptionsItem.php @@ -0,0 +1,50 @@ +label = $values['label']; + $this->value = $values['value']; + $this->selected = $values['selected']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxOrigin.php b/src/Types/FormFieldListboxOrigin.php new file mode 100644 index 0000000..aca57bf --- /dev/null +++ b/src/Types/FormFieldListboxOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldListboxValueEntryNone $none + * @return FormFieldListboxValueEntry + */ + public static function none(FormFieldListboxValueEntryNone $none): FormFieldListboxValueEntry + { + return new FormFieldListboxValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldListboxValueEntryScalar $scalar + * @return FormFieldListboxValueEntry + */ + public static function scalar(FormFieldListboxValueEntryScalar $scalar): FormFieldListboxValueEntry + { + return new FormFieldListboxValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldListboxValueEntryArray $array + * @return FormFieldListboxValueEntry + */ + public static function array(FormFieldListboxValueEntryArray $array): FormFieldListboxValueEntry + { + return new FormFieldListboxValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldListboxValueEntryUnsupported $unsupported + * @return FormFieldListboxValueEntry + */ + public static function unsupported(FormFieldListboxValueEntryUnsupported $unsupported): FormFieldListboxValueEntry + { + return new FormFieldListboxValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldListboxValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldListboxValueEntryNone + */ + public function asNone(): FormFieldListboxValueEntryNone + { + if (!($this->value instanceof FormFieldListboxValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldListboxValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldListboxValueEntryScalar + */ + public function asScalar(): FormFieldListboxValueEntryScalar + { + if (!($this->value instanceof FormFieldListboxValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldListboxValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldListboxValueEntryArray + */ + public function asArray(): FormFieldListboxValueEntryArray + { + if (!($this->value instanceof FormFieldListboxValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldListboxValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldListboxValueEntryUnsupported + */ + public function asUnsupported(): FormFieldListboxValueEntryUnsupported + { + if (!($this->value instanceof FormFieldListboxValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldListboxValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldListboxValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldListboxValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldListboxValueEntryUnsupported::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/FormFieldListboxValueEntryArray.php b/src/Types/FormFieldListboxValueEntryArray.php new file mode 100644 index 0000000..6749a3b --- /dev/null +++ b/src/Types/FormFieldListboxValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxValueEntryNone.php b/src/Types/FormFieldListboxValueEntryNone.php new file mode 100644 index 0000000..f7c7f48 --- /dev/null +++ b/src/Types/FormFieldListboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldListboxValueEntryScalar.php b/src/Types/FormFieldListboxValueEntryScalar.php new file mode 100644 index 0000000..6276b53 --- /dev/null +++ b/src/Types/FormFieldListboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldListboxValueEntryUnsupported.php b/src/Types/FormFieldListboxValueEntryUnsupported.php new file mode 100644 index 0000000..9a0402e --- /dev/null +++ b/src/Types/FormFieldListboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldPatch.php b/src/Types/FormFieldPatch.php new file mode 100644 index 0000000..aec5f45 --- /dev/null +++ b/src/Types/FormFieldPatch.php @@ -0,0 +1,186 @@ + $family + */ + #[JsonProperty('family')] + public ?string $family; + + /** + * @var ( + * string + * |array + * )|null $defaultValue + */ + #[JsonProperty('defaultValue'), Union('string', ['string'], 'null')] + public string|array|null $defaultValue; + + /** + * @var ?int $maxLength + */ + #[JsonProperty('maxLength')] + public ?int $maxLength; + + /** + * @var ?bool $multiline + */ + #[JsonProperty('multiline')] + public ?bool $multiline; + + /** + * @var ?bool $password + */ + #[JsonProperty('password')] + public ?bool $password; + + /** + * @var ?bool $comb + */ + #[JsonProperty('comb')] + public ?bool $comb; + + /** + * @var ?bool $radiosInUnison + */ + #[JsonProperty('radiosInUnison')] + public ?bool $radiosInUnison; + + /** + * @var ?bool $noToggleToOff + */ + #[JsonProperty('noToggleToOff')] + public ?bool $noToggleToOff; + + /** + * @var ?bool $edit + */ + #[JsonProperty('edit')] + public ?bool $edit; + + /** + * @var ?bool $multiSelect + */ + #[JsonProperty('multiSelect')] + public ?bool $multiSelect; + + /** + * @var ?array $options + */ + #[JsonProperty('options'), ArrayType([FormFieldPatchOptionsItem::class])] + public ?array $options; + + /** + * @param array{ + * name?: ?string, + * readOnly?: ?bool, + * required?: ?bool, + * noExport?: ?bool, + * alternateName?: ?string, + * mappingName?: ?string, + * groupId?: ?string, + * actions?: ?FieldActionsPatch, + * family?: ?value-of, + * defaultValue?: ( + * string + * |array + * )|null, + * maxLength?: ?int, + * multiline?: ?bool, + * password?: ?bool, + * comb?: ?bool, + * radiosInUnison?: ?bool, + * noToggleToOff?: ?bool, + * edit?: ?bool, + * multiSelect?: ?bool, + * options?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->required = $values['required'] ?? null; + $this->noExport = $values['noExport'] ?? null; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->family = $values['family'] ?? null; + $this->defaultValue = $values['defaultValue'] ?? null; + $this->maxLength = $values['maxLength'] ?? null; + $this->multiline = $values['multiline'] ?? null; + $this->password = $values['password'] ?? null; + $this->comb = $values['comb'] ?? null; + $this->radiosInUnison = $values['radiosInUnison'] ?? null; + $this->noToggleToOff = $values['noToggleToOff'] ?? null; + $this->edit = $values['edit'] ?? null; + $this->multiSelect = $values['multiSelect'] ?? null; + $this->options = $values['options'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPatchFamily.php b/src/Types/FormFieldPatchFamily.php new file mode 100644 index 0000000..4b3d42b --- /dev/null +++ b/src/Types/FormFieldPatchFamily.php @@ -0,0 +1,14 @@ +label = $values['label']; + $this->value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbutton.php b/src/Types/FormFieldPushbutton.php new file mode 100644 index 0000000..28f7f80 --- /dev/null +++ b/src/Types/FormFieldPushbutton.php @@ -0,0 +1,181 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldPushbuttonValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldPushbuttonValueEntry $valueEntry; + + /** + * @var FormFieldPushbuttonDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldPushbuttonDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldPushbuttonValueEntry, + * defaultValueEntry: FormFieldPushbuttonDefaultValueEntry, + * widgets: array, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntry.php b/src/Types/FormFieldPushbuttonDefaultValueEntry.php new file mode 100644 index 0000000..c1f2dcd --- /dev/null +++ b/src/Types/FormFieldPushbuttonDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldPushbuttonDefaultValueEntryNone $none + * @return FormFieldPushbuttonDefaultValueEntry + */ + public static function none(FormFieldPushbuttonDefaultValueEntryNone $none): FormFieldPushbuttonDefaultValueEntry + { + return new FormFieldPushbuttonDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldPushbuttonDefaultValueEntryScalar $scalar + * @return FormFieldPushbuttonDefaultValueEntry + */ + public static function scalar(FormFieldPushbuttonDefaultValueEntryScalar $scalar): FormFieldPushbuttonDefaultValueEntry + { + return new FormFieldPushbuttonDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldPushbuttonDefaultValueEntryArray $array + * @return FormFieldPushbuttonDefaultValueEntry + */ + public static function array(FormFieldPushbuttonDefaultValueEntryArray $array): FormFieldPushbuttonDefaultValueEntry + { + return new FormFieldPushbuttonDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldPushbuttonDefaultValueEntryUnsupported $unsupported + * @return FormFieldPushbuttonDefaultValueEntry + */ + public static function unsupported(FormFieldPushbuttonDefaultValueEntryUnsupported $unsupported): FormFieldPushbuttonDefaultValueEntry + { + return new FormFieldPushbuttonDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldPushbuttonDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldPushbuttonDefaultValueEntryNone + */ + public function asNone(): FormFieldPushbuttonDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldPushbuttonDefaultValueEntryScalar + */ + public function asScalar(): FormFieldPushbuttonDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldPushbuttonDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldPushbuttonDefaultValueEntryArray + */ + public function asArray(): FormFieldPushbuttonDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldPushbuttonDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldPushbuttonDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldPushbuttonDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldPushbuttonDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldPushbuttonDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldPushbuttonDefaultValueEntryUnsupported::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/FormFieldPushbuttonDefaultValueEntryArray.php b/src/Types/FormFieldPushbuttonDefaultValueEntryArray.php new file mode 100644 index 0000000..5c8280c --- /dev/null +++ b/src/Types/FormFieldPushbuttonDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php b/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php new file mode 100644 index 0000000..09a06f0 --- /dev/null +++ b/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php b/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php new file mode 100644 index 0000000..5713f61 --- /dev/null +++ b/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php b/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..e37fcdf --- /dev/null +++ b/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonOrigin.php b/src/Types/FormFieldPushbuttonOrigin.php new file mode 100644 index 0000000..fc474f6 --- /dev/null +++ b/src/Types/FormFieldPushbuttonOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldPushbuttonValueEntryNone $none + * @return FormFieldPushbuttonValueEntry + */ + public static function none(FormFieldPushbuttonValueEntryNone $none): FormFieldPushbuttonValueEntry + { + return new FormFieldPushbuttonValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldPushbuttonValueEntryScalar $scalar + * @return FormFieldPushbuttonValueEntry + */ + public static function scalar(FormFieldPushbuttonValueEntryScalar $scalar): FormFieldPushbuttonValueEntry + { + return new FormFieldPushbuttonValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldPushbuttonValueEntryArray $array + * @return FormFieldPushbuttonValueEntry + */ + public static function array(FormFieldPushbuttonValueEntryArray $array): FormFieldPushbuttonValueEntry + { + return new FormFieldPushbuttonValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldPushbuttonValueEntryUnsupported $unsupported + * @return FormFieldPushbuttonValueEntry + */ + public static function unsupported(FormFieldPushbuttonValueEntryUnsupported $unsupported): FormFieldPushbuttonValueEntry + { + return new FormFieldPushbuttonValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldPushbuttonValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldPushbuttonValueEntryNone + */ + public function asNone(): FormFieldPushbuttonValueEntryNone + { + if (!($this->value instanceof FormFieldPushbuttonValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldPushbuttonValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldPushbuttonValueEntryScalar + */ + public function asScalar(): FormFieldPushbuttonValueEntryScalar + { + if (!($this->value instanceof FormFieldPushbuttonValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldPushbuttonValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldPushbuttonValueEntryArray + */ + public function asArray(): FormFieldPushbuttonValueEntryArray + { + if (!($this->value instanceof FormFieldPushbuttonValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldPushbuttonValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldPushbuttonValueEntryUnsupported + */ + public function asUnsupported(): FormFieldPushbuttonValueEntryUnsupported + { + if (!($this->value instanceof FormFieldPushbuttonValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldPushbuttonValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldPushbuttonValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldPushbuttonValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldPushbuttonValueEntryUnsupported::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/FormFieldPushbuttonValueEntryArray.php b/src/Types/FormFieldPushbuttonValueEntryArray.php new file mode 100644 index 0000000..05951c4 --- /dev/null +++ b/src/Types/FormFieldPushbuttonValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonValueEntryNone.php b/src/Types/FormFieldPushbuttonValueEntryNone.php new file mode 100644 index 0000000..6d5433a --- /dev/null +++ b/src/Types/FormFieldPushbuttonValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonValueEntryScalar.php b/src/Types/FormFieldPushbuttonValueEntryScalar.php new file mode 100644 index 0000000..9aa654c --- /dev/null +++ b/src/Types/FormFieldPushbuttonValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldPushbuttonValueEntryUnsupported.php b/src/Types/FormFieldPushbuttonValueEntryUnsupported.php new file mode 100644 index 0000000..8e2c71d --- /dev/null +++ b/src/Types/FormFieldPushbuttonValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldRadio.php b/src/Types/FormFieldRadio.php new file mode 100644 index 0000000..617e172 --- /dev/null +++ b/src/Types/FormFieldRadio.php @@ -0,0 +1,205 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldRadioValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldRadioValueEntry $valueEntry; + + /** + * @var FormFieldRadioDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldRadioDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormFieldRadioWidgetsItem::class])] + public array $widgets; + + /** + * @var string $value + */ + #[JsonProperty('value')] + public string $value; + + /** + * @var bool $radiosInUnison + */ + #[JsonProperty('radiosInUnison')] + public bool $radiosInUnison; + + /** + * @var bool $noToggleToOff + */ + #[JsonProperty('noToggleToOff')] + public bool $noToggleToOff; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldRadioValueEntry, + * defaultValueEntry: FormFieldRadioDefaultValueEntry, + * widgets: array, + * value: string, + * radiosInUnison: bool, + * noToggleToOff: bool, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->value = $values['value']; + $this->radiosInUnison = $values['radiosInUnison']; + $this->noToggleToOff = $values['noToggleToOff']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRadioDefaultValueEntry.php b/src/Types/FormFieldRadioDefaultValueEntry.php new file mode 100644 index 0000000..36d9131 --- /dev/null +++ b/src/Types/FormFieldRadioDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldRadioDefaultValueEntryNone $none + * @return FormFieldRadioDefaultValueEntry + */ + public static function none(FormFieldRadioDefaultValueEntryNone $none): FormFieldRadioDefaultValueEntry + { + return new FormFieldRadioDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldRadioDefaultValueEntryScalar $scalar + * @return FormFieldRadioDefaultValueEntry + */ + public static function scalar(FormFieldRadioDefaultValueEntryScalar $scalar): FormFieldRadioDefaultValueEntry + { + return new FormFieldRadioDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldRadioDefaultValueEntryArray $array + * @return FormFieldRadioDefaultValueEntry + */ + public static function array(FormFieldRadioDefaultValueEntryArray $array): FormFieldRadioDefaultValueEntry + { + return new FormFieldRadioDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldRadioDefaultValueEntryUnsupported $unsupported + * @return FormFieldRadioDefaultValueEntry + */ + public static function unsupported(FormFieldRadioDefaultValueEntryUnsupported $unsupported): FormFieldRadioDefaultValueEntry + { + return new FormFieldRadioDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldRadioDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldRadioDefaultValueEntryNone + */ + public function asNone(): FormFieldRadioDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldRadioDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldRadioDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldRadioDefaultValueEntryScalar + */ + public function asScalar(): FormFieldRadioDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldRadioDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldRadioDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldRadioDefaultValueEntryArray + */ + public function asArray(): FormFieldRadioDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldRadioDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldRadioDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldRadioDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldRadioDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldRadioDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldRadioDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldRadioDefaultValueEntryUnsupported::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/FormFieldRadioDefaultValueEntryArray.php b/src/Types/FormFieldRadioDefaultValueEntryArray.php new file mode 100644 index 0000000..5c32f73 --- /dev/null +++ b/src/Types/FormFieldRadioDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRadioDefaultValueEntryNone.php b/src/Types/FormFieldRadioDefaultValueEntryNone.php new file mode 100644 index 0000000..dd183b4 --- /dev/null +++ b/src/Types/FormFieldRadioDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldRadioDefaultValueEntryScalar.php b/src/Types/FormFieldRadioDefaultValueEntryScalar.php new file mode 100644 index 0000000..5e654de --- /dev/null +++ b/src/Types/FormFieldRadioDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php b/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..64047bf --- /dev/null +++ b/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldRadioOrigin.php b/src/Types/FormFieldRadioOrigin.php new file mode 100644 index 0000000..f1fccf4 --- /dev/null +++ b/src/Types/FormFieldRadioOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldRadioValueEntryNone $none + * @return FormFieldRadioValueEntry + */ + public static function none(FormFieldRadioValueEntryNone $none): FormFieldRadioValueEntry + { + return new FormFieldRadioValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldRadioValueEntryScalar $scalar + * @return FormFieldRadioValueEntry + */ + public static function scalar(FormFieldRadioValueEntryScalar $scalar): FormFieldRadioValueEntry + { + return new FormFieldRadioValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldRadioValueEntryArray $array + * @return FormFieldRadioValueEntry + */ + public static function array(FormFieldRadioValueEntryArray $array): FormFieldRadioValueEntry + { + return new FormFieldRadioValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldRadioValueEntryUnsupported $unsupported + * @return FormFieldRadioValueEntry + */ + public static function unsupported(FormFieldRadioValueEntryUnsupported $unsupported): FormFieldRadioValueEntry + { + return new FormFieldRadioValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldRadioValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldRadioValueEntryNone + */ + public function asNone(): FormFieldRadioValueEntryNone + { + if (!($this->value instanceof FormFieldRadioValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldRadioValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldRadioValueEntryScalar + */ + public function asScalar(): FormFieldRadioValueEntryScalar + { + if (!($this->value instanceof FormFieldRadioValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldRadioValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldRadioValueEntryArray + */ + public function asArray(): FormFieldRadioValueEntryArray + { + if (!($this->value instanceof FormFieldRadioValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldRadioValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldRadioValueEntryUnsupported + */ + public function asUnsupported(): FormFieldRadioValueEntryUnsupported + { + if (!($this->value instanceof FormFieldRadioValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldRadioValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldRadioValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldRadioValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldRadioValueEntryUnsupported::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/FormFieldRadioValueEntryArray.php b/src/Types/FormFieldRadioValueEntryArray.php new file mode 100644 index 0000000..8511158 --- /dev/null +++ b/src/Types/FormFieldRadioValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRadioValueEntryNone.php b/src/Types/FormFieldRadioValueEntryNone.php new file mode 100644 index 0000000..9dbae0e --- /dev/null +++ b/src/Types/FormFieldRadioValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldRadioValueEntryScalar.php b/src/Types/FormFieldRadioValueEntryScalar.php new file mode 100644 index 0000000..50b3e18 --- /dev/null +++ b/src/Types/FormFieldRadioValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRadioValueEntryUnsupported.php b/src/Types/FormFieldRadioValueEntryUnsupported.php new file mode 100644 index 0000000..b198320 --- /dev/null +++ b/src/Types/FormFieldRadioValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldRadioWidgetsItem.php b/src/Types/FormFieldRadioWidgetsItem.php new file mode 100644 index 0000000..c49e28d --- /dev/null +++ b/src/Types/FormFieldRadioWidgetsItem.php @@ -0,0 +1,74 @@ +ref = $values['ref'] ?? null; + $this->objectNumber = $values['objectNumber']; + $this->page = $values['page'] ?? null; + $this->onState = $values['onState']; + $this->exportValue = $values['exportValue']; + $this->checked = $values['checked']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRef.php b/src/Types/FormFieldRef.php new file mode 100644 index 0000000..994e972 --- /dev/null +++ b/src/Types/FormFieldRef.php @@ -0,0 +1,196 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldRefObjectNumber $objectNumber + * @return FormFieldRef + */ + public static function objectNumber(FormFieldRefObjectNumber $objectNumber): FormFieldRef + { + return new FormFieldRef([ + 'kind' => 'objectNumber', + 'value' => $objectNumber, + ]); + } + + /** + * @param FormFieldRefFqn $fqn + * @return FormFieldRef + */ + public static function fqn(FormFieldRefFqn $fqn): FormFieldRef + { + return new FormFieldRef([ + 'kind' => 'fqn', + 'value' => $fqn, + ]); + } + + /** + * @return bool + */ + public function isObjectNumber(): bool + { + return $this->value instanceof FormFieldRefObjectNumber && $this->kind === 'objectNumber'; + } + + /** + * @return FormFieldRefObjectNumber + */ + public function asObjectNumber(): FormFieldRefObjectNumber + { + if (!($this->value instanceof FormFieldRefObjectNumber && $this->kind === 'objectNumber')) { + throw new Exception( + "Expected objectNumber; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFqn(): bool + { + return $this->value instanceof FormFieldRefFqn && $this->kind === 'fqn'; + } + + /** + * @return FormFieldRefFqn + */ + public function asFqn(): FormFieldRefFqn + { + if (!($this->value instanceof FormFieldRefFqn && $this->kind === 'fqn')) { + throw new Exception( + "Expected fqn; 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 'objectNumber': + $value = $this->asObjectNumber()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fqn': + $value = $this->asFqn()->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 'objectNumber': + $args['value'] = FormFieldRefObjectNumber::jsonDeserialize($data); + break; + case 'fqn': + $args['value'] = FormFieldRefFqn::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/FormFieldRefFqn.php b/src/Types/FormFieldRefFqn.php new file mode 100644 index 0000000..6a60535 --- /dev/null +++ b/src/Types/FormFieldRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldRefObjectNumber.php b/src/Types/FormFieldRefObjectNumber.php new file mode 100644 index 0000000..d8ad2f1 --- /dev/null +++ b/src/Types/FormFieldRefObjectNumber.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignature.php b/src/Types/FormFieldSignature.php new file mode 100644 index 0000000..9327e60 --- /dev/null +++ b/src/Types/FormFieldSignature.php @@ -0,0 +1,181 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldSignatureValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldSignatureValueEntry $valueEntry; + + /** + * @var FormFieldSignatureDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldSignatureDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldSignatureValueEntry, + * defaultValueEntry: FormFieldSignatureDefaultValueEntry, + * widgets: array, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignatureDefaultValueEntry.php b/src/Types/FormFieldSignatureDefaultValueEntry.php new file mode 100644 index 0000000..9e93337 --- /dev/null +++ b/src/Types/FormFieldSignatureDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldSignatureDefaultValueEntryNone $none + * @return FormFieldSignatureDefaultValueEntry + */ + public static function none(FormFieldSignatureDefaultValueEntryNone $none): FormFieldSignatureDefaultValueEntry + { + return new FormFieldSignatureDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldSignatureDefaultValueEntryScalar $scalar + * @return FormFieldSignatureDefaultValueEntry + */ + public static function scalar(FormFieldSignatureDefaultValueEntryScalar $scalar): FormFieldSignatureDefaultValueEntry + { + return new FormFieldSignatureDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldSignatureDefaultValueEntryArray $array + * @return FormFieldSignatureDefaultValueEntry + */ + public static function array(FormFieldSignatureDefaultValueEntryArray $array): FormFieldSignatureDefaultValueEntry + { + return new FormFieldSignatureDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldSignatureDefaultValueEntryUnsupported $unsupported + * @return FormFieldSignatureDefaultValueEntry + */ + public static function unsupported(FormFieldSignatureDefaultValueEntryUnsupported $unsupported): FormFieldSignatureDefaultValueEntry + { + return new FormFieldSignatureDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldSignatureDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldSignatureDefaultValueEntryNone + */ + public function asNone(): FormFieldSignatureDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldSignatureDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldSignatureDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldSignatureDefaultValueEntryScalar + */ + public function asScalar(): FormFieldSignatureDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldSignatureDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldSignatureDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldSignatureDefaultValueEntryArray + */ + public function asArray(): FormFieldSignatureDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldSignatureDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldSignatureDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldSignatureDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldSignatureDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldSignatureDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldSignatureDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldSignatureDefaultValueEntryUnsupported::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/FormFieldSignatureDefaultValueEntryArray.php b/src/Types/FormFieldSignatureDefaultValueEntryArray.php new file mode 100644 index 0000000..e41d8c5 --- /dev/null +++ b/src/Types/FormFieldSignatureDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryNone.php b/src/Types/FormFieldSignatureDefaultValueEntryNone.php new file mode 100644 index 0000000..6cdd77a --- /dev/null +++ b/src/Types/FormFieldSignatureDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryScalar.php b/src/Types/FormFieldSignatureDefaultValueEntryScalar.php new file mode 100644 index 0000000..27f2c94 --- /dev/null +++ b/src/Types/FormFieldSignatureDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php b/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..1208852 --- /dev/null +++ b/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldSignatureOrigin.php b/src/Types/FormFieldSignatureOrigin.php new file mode 100644 index 0000000..649c4fe --- /dev/null +++ b/src/Types/FormFieldSignatureOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldSignatureValueEntryNone $none + * @return FormFieldSignatureValueEntry + */ + public static function none(FormFieldSignatureValueEntryNone $none): FormFieldSignatureValueEntry + { + return new FormFieldSignatureValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldSignatureValueEntryScalar $scalar + * @return FormFieldSignatureValueEntry + */ + public static function scalar(FormFieldSignatureValueEntryScalar $scalar): FormFieldSignatureValueEntry + { + return new FormFieldSignatureValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldSignatureValueEntryArray $array + * @return FormFieldSignatureValueEntry + */ + public static function array(FormFieldSignatureValueEntryArray $array): FormFieldSignatureValueEntry + { + return new FormFieldSignatureValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldSignatureValueEntryUnsupported $unsupported + * @return FormFieldSignatureValueEntry + */ + public static function unsupported(FormFieldSignatureValueEntryUnsupported $unsupported): FormFieldSignatureValueEntry + { + return new FormFieldSignatureValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldSignatureValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldSignatureValueEntryNone + */ + public function asNone(): FormFieldSignatureValueEntryNone + { + if (!($this->value instanceof FormFieldSignatureValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldSignatureValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldSignatureValueEntryScalar + */ + public function asScalar(): FormFieldSignatureValueEntryScalar + { + if (!($this->value instanceof FormFieldSignatureValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldSignatureValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldSignatureValueEntryArray + */ + public function asArray(): FormFieldSignatureValueEntryArray + { + if (!($this->value instanceof FormFieldSignatureValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldSignatureValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldSignatureValueEntryUnsupported + */ + public function asUnsupported(): FormFieldSignatureValueEntryUnsupported + { + if (!($this->value instanceof FormFieldSignatureValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldSignatureValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldSignatureValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldSignatureValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldSignatureValueEntryUnsupported::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/FormFieldSignatureValueEntryArray.php b/src/Types/FormFieldSignatureValueEntryArray.php new file mode 100644 index 0000000..b5267e6 --- /dev/null +++ b/src/Types/FormFieldSignatureValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignatureValueEntryNone.php b/src/Types/FormFieldSignatureValueEntryNone.php new file mode 100644 index 0000000..6400274 --- /dev/null +++ b/src/Types/FormFieldSignatureValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldSignatureValueEntryScalar.php b/src/Types/FormFieldSignatureValueEntryScalar.php new file mode 100644 index 0000000..e530b81 --- /dev/null +++ b/src/Types/FormFieldSignatureValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldSignatureValueEntryUnsupported.php b/src/Types/FormFieldSignatureValueEntryUnsupported.php new file mode 100644 index 0000000..3f2a8c7 --- /dev/null +++ b/src/Types/FormFieldSignatureValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldText.php b/src/Types/FormFieldText.php new file mode 100644 index 0000000..089306e --- /dev/null +++ b/src/Types/FormFieldText.php @@ -0,0 +1,229 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldTextValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldTextValueEntry $valueEntry; + + /** + * @var FormFieldTextDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldTextDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @var string $value + */ + #[JsonProperty('value')] + public string $value; + + /** + * @var string $defaultValue + */ + #[JsonProperty('defaultValue')] + public string $defaultValue; + + /** + * @var ?int $maxLength + */ + #[JsonProperty('maxLength')] + public ?int $maxLength; + + /** + * @var bool $multiline + */ + #[JsonProperty('multiline')] + public bool $multiline; + + /** + * @var bool $password + */ + #[JsonProperty('password')] + public bool $password; + + /** + * @var bool $comb + */ + #[JsonProperty('comb')] + public bool $comb; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldTextValueEntry, + * defaultValueEntry: FormFieldTextDefaultValueEntry, + * widgets: array, + * value: string, + * defaultValue: string, + * multiline: bool, + * password: bool, + * comb: bool, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * maxLength?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->value = $values['value']; + $this->defaultValue = $values['defaultValue']; + $this->maxLength = $values['maxLength'] ?? null; + $this->multiline = $values['multiline']; + $this->password = $values['password']; + $this->comb = $values['comb']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldTextDefaultValueEntry.php b/src/Types/FormFieldTextDefaultValueEntry.php new file mode 100644 index 0000000..6fca464 --- /dev/null +++ b/src/Types/FormFieldTextDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldTextDefaultValueEntryNone $none + * @return FormFieldTextDefaultValueEntry + */ + public static function none(FormFieldTextDefaultValueEntryNone $none): FormFieldTextDefaultValueEntry + { + return new FormFieldTextDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldTextDefaultValueEntryScalar $scalar + * @return FormFieldTextDefaultValueEntry + */ + public static function scalar(FormFieldTextDefaultValueEntryScalar $scalar): FormFieldTextDefaultValueEntry + { + return new FormFieldTextDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldTextDefaultValueEntryArray $array + * @return FormFieldTextDefaultValueEntry + */ + public static function array(FormFieldTextDefaultValueEntryArray $array): FormFieldTextDefaultValueEntry + { + return new FormFieldTextDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldTextDefaultValueEntryUnsupported $unsupported + * @return FormFieldTextDefaultValueEntry + */ + public static function unsupported(FormFieldTextDefaultValueEntryUnsupported $unsupported): FormFieldTextDefaultValueEntry + { + return new FormFieldTextDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldTextDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldTextDefaultValueEntryNone + */ + public function asNone(): FormFieldTextDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldTextDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldTextDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldTextDefaultValueEntryScalar + */ + public function asScalar(): FormFieldTextDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldTextDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldTextDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldTextDefaultValueEntryArray + */ + public function asArray(): FormFieldTextDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldTextDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldTextDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldTextDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldTextDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldTextDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldTextDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldTextDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldTextDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldTextDefaultValueEntryUnsupported::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/FormFieldTextDefaultValueEntryArray.php b/src/Types/FormFieldTextDefaultValueEntryArray.php new file mode 100644 index 0000000..1867f1f --- /dev/null +++ b/src/Types/FormFieldTextDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldTextDefaultValueEntryNone.php b/src/Types/FormFieldTextDefaultValueEntryNone.php new file mode 100644 index 0000000..3d61644 --- /dev/null +++ b/src/Types/FormFieldTextDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldTextDefaultValueEntryScalar.php b/src/Types/FormFieldTextDefaultValueEntryScalar.php new file mode 100644 index 0000000..4e42f8d --- /dev/null +++ b/src/Types/FormFieldTextDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldTextDefaultValueEntryUnsupported.php b/src/Types/FormFieldTextDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..c4703c5 --- /dev/null +++ b/src/Types/FormFieldTextDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldTextOrigin.php b/src/Types/FormFieldTextOrigin.php new file mode 100644 index 0000000..e86f24b --- /dev/null +++ b/src/Types/FormFieldTextOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldTextValueEntryNone $none + * @return FormFieldTextValueEntry + */ + public static function none(FormFieldTextValueEntryNone $none): FormFieldTextValueEntry + { + return new FormFieldTextValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldTextValueEntryScalar $scalar + * @return FormFieldTextValueEntry + */ + public static function scalar(FormFieldTextValueEntryScalar $scalar): FormFieldTextValueEntry + { + return new FormFieldTextValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldTextValueEntryArray $array + * @return FormFieldTextValueEntry + */ + public static function array(FormFieldTextValueEntryArray $array): FormFieldTextValueEntry + { + return new FormFieldTextValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldTextValueEntryUnsupported $unsupported + * @return FormFieldTextValueEntry + */ + public static function unsupported(FormFieldTextValueEntryUnsupported $unsupported): FormFieldTextValueEntry + { + return new FormFieldTextValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldTextValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldTextValueEntryNone + */ + public function asNone(): FormFieldTextValueEntryNone + { + if (!($this->value instanceof FormFieldTextValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldTextValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldTextValueEntryScalar + */ + public function asScalar(): FormFieldTextValueEntryScalar + { + if (!($this->value instanceof FormFieldTextValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldTextValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldTextValueEntryArray + */ + public function asArray(): FormFieldTextValueEntryArray + { + if (!($this->value instanceof FormFieldTextValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldTextValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldTextValueEntryUnsupported + */ + public function asUnsupported(): FormFieldTextValueEntryUnsupported + { + if (!($this->value instanceof FormFieldTextValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldTextValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldTextValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldTextValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldTextValueEntryUnsupported::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/FormFieldTextValueEntryArray.php b/src/Types/FormFieldTextValueEntryArray.php new file mode 100644 index 0000000..2e2606d --- /dev/null +++ b/src/Types/FormFieldTextValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldTextValueEntryNone.php b/src/Types/FormFieldTextValueEntryNone.php new file mode 100644 index 0000000..e9e7c34 --- /dev/null +++ b/src/Types/FormFieldTextValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldTextValueEntryScalar.php b/src/Types/FormFieldTextValueEntryScalar.php new file mode 100644 index 0000000..c7b538e --- /dev/null +++ b/src/Types/FormFieldTextValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldTextValueEntryUnsupported.php b/src/Types/FormFieldTextValueEntryUnsupported.php new file mode 100644 index 0000000..8110b47 --- /dev/null +++ b/src/Types/FormFieldTextValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldUnknown.php b/src/Types/FormFieldUnknown.php new file mode 100644 index 0000000..7d88c4c --- /dev/null +++ b/src/Types/FormFieldUnknown.php @@ -0,0 +1,189 @@ + $origin + */ + #[JsonProperty('origin')] + public string $origin; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $required + */ + #[JsonProperty('required')] + public bool $required; + + /** + * @var bool $noExport + */ + #[JsonProperty('noExport')] + public bool $noExport; + + /** + * @var ?string $alternateName + */ + #[JsonProperty('alternateName')] + public ?string $alternateName; + + /** + * @var ?string $mappingName + */ + #[JsonProperty('mappingName')] + public ?string $mappingName; + + /** + * @var FormFieldUnknownValueEntry $valueEntry + */ + #[JsonProperty('valueEntry')] + public FormFieldUnknownValueEntry $valueEntry; + + /** + * @var FormFieldUnknownDefaultValueEntry $defaultValueEntry + */ + #[JsonProperty('defaultValueEntry')] + public FormFieldUnknownDefaultValueEntry $defaultValueEntry; + + /** + * @var ?PdfFieldActions $actions + */ + #[JsonProperty('actions')] + public ?PdfFieldActions $actions; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?string $filledBy + */ + #[JsonProperty('filledBy')] + public ?string $filledBy; + + /** + * @var ?string $filledByName + */ + #[JsonProperty('filledByName')] + public ?string $filledByName; + + /** + * @var ?DateTime $filledAt + */ + #[JsonProperty('filledAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $filledAt; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([FormWidget::class])] + public array $widgets; + + /** + * @var string $rawValue + */ + #[JsonProperty('rawValue')] + public string $rawValue; + + /** + * @param array{ + * ref: FormFieldRef, + * name: string, + * origin: value-of, + * readOnly: bool, + * required: bool, + * noExport: bool, + * valueEntry: FormFieldUnknownValueEntry, + * defaultValueEntry: FormFieldUnknownDefaultValueEntry, + * widgets: array, + * rawValue: string, + * alternateName?: ?string, + * mappingName?: ?string, + * actions?: ?PdfFieldActions, + * groupId?: ?string, + * createdBy?: ?string, + * createdAt?: ?DateTime, + * filledBy?: ?string, + * filledByName?: ?string, + * filledAt?: ?DateTime, + * importedBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->name = $values['name']; + $this->origin = $values['origin']; + $this->readOnly = $values['readOnly']; + $this->required = $values['required']; + $this->noExport = $values['noExport']; + $this->alternateName = $values['alternateName'] ?? null; + $this->mappingName = $values['mappingName'] ?? null; + $this->valueEntry = $values['valueEntry']; + $this->defaultValueEntry = $values['defaultValueEntry']; + $this->actions = $values['actions'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->filledBy = $values['filledBy'] ?? null; + $this->filledByName = $values['filledByName'] ?? null; + $this->filledAt = $values['filledAt'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->widgets = $values['widgets']; + $this->rawValue = $values['rawValue']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldUnknownDefaultValueEntry.php b/src/Types/FormFieldUnknownDefaultValueEntry.php new file mode 100644 index 0000000..bce9a99 --- /dev/null +++ b/src/Types/FormFieldUnknownDefaultValueEntry.php @@ -0,0 +1,286 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldUnknownDefaultValueEntryNone $none + * @return FormFieldUnknownDefaultValueEntry + */ + public static function none(FormFieldUnknownDefaultValueEntryNone $none): FormFieldUnknownDefaultValueEntry + { + return new FormFieldUnknownDefaultValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldUnknownDefaultValueEntryScalar $scalar + * @return FormFieldUnknownDefaultValueEntry + */ + public static function scalar(FormFieldUnknownDefaultValueEntryScalar $scalar): FormFieldUnknownDefaultValueEntry + { + return new FormFieldUnknownDefaultValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldUnknownDefaultValueEntryArray $array + * @return FormFieldUnknownDefaultValueEntry + */ + public static function array(FormFieldUnknownDefaultValueEntryArray $array): FormFieldUnknownDefaultValueEntry + { + return new FormFieldUnknownDefaultValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldUnknownDefaultValueEntryUnsupported $unsupported + * @return FormFieldUnknownDefaultValueEntry + */ + public static function unsupported(FormFieldUnknownDefaultValueEntryUnsupported $unsupported): FormFieldUnknownDefaultValueEntry + { + return new FormFieldUnknownDefaultValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldUnknownDefaultValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldUnknownDefaultValueEntryNone + */ + public function asNone(): FormFieldUnknownDefaultValueEntryNone + { + if (!($this->value instanceof FormFieldUnknownDefaultValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldUnknownDefaultValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldUnknownDefaultValueEntryScalar + */ + public function asScalar(): FormFieldUnknownDefaultValueEntryScalar + { + if (!($this->value instanceof FormFieldUnknownDefaultValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldUnknownDefaultValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldUnknownDefaultValueEntryArray + */ + public function asArray(): FormFieldUnknownDefaultValueEntryArray + { + if (!($this->value instanceof FormFieldUnknownDefaultValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldUnknownDefaultValueEntryUnsupported + */ + public function asUnsupported(): FormFieldUnknownDefaultValueEntryUnsupported + { + if (!($this->value instanceof FormFieldUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldUnknownDefaultValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldUnknownDefaultValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldUnknownDefaultValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldUnknownDefaultValueEntryUnsupported::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/FormFieldUnknownDefaultValueEntryArray.php b/src/Types/FormFieldUnknownDefaultValueEntryArray.php new file mode 100644 index 0000000..91b0da0 --- /dev/null +++ b/src/Types/FormFieldUnknownDefaultValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryNone.php b/src/Types/FormFieldUnknownDefaultValueEntryNone.php new file mode 100644 index 0000000..fe4bd9d --- /dev/null +++ b/src/Types/FormFieldUnknownDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryScalar.php b/src/Types/FormFieldUnknownDefaultValueEntryScalar.php new file mode 100644 index 0000000..031044b --- /dev/null +++ b/src/Types/FormFieldUnknownDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php b/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..3bb6e7d --- /dev/null +++ b/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldUnknownOrigin.php b/src/Types/FormFieldUnknownOrigin.php new file mode 100644 index 0000000..3aeeb9f --- /dev/null +++ b/src/Types/FormFieldUnknownOrigin.php @@ -0,0 +1,9 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormFieldUnknownValueEntryNone $none + * @return FormFieldUnknownValueEntry + */ + public static function none(FormFieldUnknownValueEntryNone $none): FormFieldUnknownValueEntry + { + return new FormFieldUnknownValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormFieldUnknownValueEntryScalar $scalar + * @return FormFieldUnknownValueEntry + */ + public static function scalar(FormFieldUnknownValueEntryScalar $scalar): FormFieldUnknownValueEntry + { + return new FormFieldUnknownValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormFieldUnknownValueEntryArray $array + * @return FormFieldUnknownValueEntry + */ + public static function array(FormFieldUnknownValueEntryArray $array): FormFieldUnknownValueEntry + { + return new FormFieldUnknownValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormFieldUnknownValueEntryUnsupported $unsupported + * @return FormFieldUnknownValueEntry + */ + public static function unsupported(FormFieldUnknownValueEntryUnsupported $unsupported): FormFieldUnknownValueEntry + { + return new FormFieldUnknownValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormFieldUnknownValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormFieldUnknownValueEntryNone + */ + public function asNone(): FormFieldUnknownValueEntryNone + { + if (!($this->value instanceof FormFieldUnknownValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormFieldUnknownValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormFieldUnknownValueEntryScalar + */ + public function asScalar(): FormFieldUnknownValueEntryScalar + { + if (!($this->value instanceof FormFieldUnknownValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormFieldUnknownValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormFieldUnknownValueEntryArray + */ + public function asArray(): FormFieldUnknownValueEntryArray + { + if (!($this->value instanceof FormFieldUnknownValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormFieldUnknownValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormFieldUnknownValueEntryUnsupported + */ + public function asUnsupported(): FormFieldUnknownValueEntryUnsupported + { + if (!($this->value instanceof FormFieldUnknownValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'none': + $args['value'] = FormFieldUnknownValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormFieldUnknownValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormFieldUnknownValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormFieldUnknownValueEntryUnsupported::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/FormFieldUnknownValueEntryArray.php b/src/Types/FormFieldUnknownValueEntryArray.php new file mode 100644 index 0000000..a8b531f --- /dev/null +++ b/src/Types/FormFieldUnknownValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldUnknownValueEntryNone.php b/src/Types/FormFieldUnknownValueEntryNone.php new file mode 100644 index 0000000..ba572a8 --- /dev/null +++ b/src/Types/FormFieldUnknownValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldUnknownValueEntryScalar.php b/src/Types/FormFieldUnknownValueEntryScalar.php new file mode 100644 index 0000000..1bb45b4 --- /dev/null +++ b/src/Types/FormFieldUnknownValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormFieldUnknownValueEntryUnsupported.php b/src/Types/FormFieldUnknownValueEntryUnsupported.php new file mode 100644 index 0000000..e562cb5 --- /dev/null +++ b/src/Types/FormFieldUnknownValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormFieldValue.php b/src/Types/FormFieldValue.php new file mode 100644 index 0000000..2449fd5 --- /dev/null +++ b/src/Types/FormFieldValue.php @@ -0,0 +1,51 @@ + $selectedValues + */ + #[JsonProperty('selectedValues'), ArrayType(['string'])] + public ?array $selectedValues; + + /** + * @param array{ + * value?: ?string, + * checked?: ?bool, + * selectedValues?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->value = $values['value'] ?? null; + $this->checked = $values['checked'] ?? null; + $this->selectedValues = $values['selectedValues'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormMutationMeta.php b/src/Types/FormMutationMeta.php new file mode 100644 index 0000000..597e639 --- /dev/null +++ b/src/Types/FormMutationMeta.php @@ -0,0 +1,83 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([PageRef::class])] + public array $affectedPages; + + /** + * @var ?CacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?CacheDelta $cacheDelta; + + /** + * @var string $opId + */ + #[JsonProperty('opId')] + public string $opId; + + /** + * @var bool $undoable + */ + #[JsonProperty('undoable')] + public bool $undoable; + + /** + * @var array $changedFields + */ + #[JsonProperty('changedFields'), ArrayType([FormFieldRef::class])] + public array $changedFields; + + /** + * @var array $changedWidgets + */ + #[JsonProperty('changedWidgets'), ArrayType([FormWidget::class])] + public array $changedWidgets; + + /** + * @var array $redrawnWidgets + */ + #[JsonProperty('redrawnWidgets'), ArrayType([FormWidget::class])] + public array $redrawnWidgets; + + /** + * @param array{ + * affectedPages: array, + * opId: string, + * undoable: bool, + * changedFields: array, + * changedWidgets: array, + * redrawnWidgets: array, + * cacheDelta?: ?CacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + $this->opId = $values['opId']; + $this->undoable = $values['undoable']; + $this->changedFields = $values['changedFields']; + $this->changedWidgets = $values['changedWidgets']; + $this->redrawnWidgets = $values['redrawnWidgets']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormWidget.php b/src/Types/FormWidget.php new file mode 100644 index 0000000..11bba74 --- /dev/null +++ b/src/Types/FormWidget.php @@ -0,0 +1,50 @@ +ref = $values['ref'] ?? null; + $this->objectNumber = $values['objectNumber']; + $this->page = $values['page'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/MetadataPatch.php b/src/Types/MetadataPatch.php new file mode 100644 index 0000000..5b60037 --- /dev/null +++ b/src/Types/MetadataPatch.php @@ -0,0 +1,100 @@ + $trapped + */ + #[JsonProperty('trapped')] + public ?string $trapped; + + /** + * @param array{ + * title?: ?string, + * author?: ?string, + * subject?: ?string, + * keywords?: ?string, + * producer?: ?string, + * creator?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * trapped?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->title = $values['title'] ?? null; + $this->author = $values['author'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->keywords = $values['keywords'] ?? null; + $this->producer = $values['producer'] ?? null; + $this->creator = $values['creator'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->trapped = $values['trapped'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/MetadataPatchTrapped.php b/src/Types/MetadataPatchTrapped.php new file mode 100644 index 0000000..32ac262 --- /dev/null +++ b/src/Types/MetadataPatchTrapped.php @@ -0,0 +1,10 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([PageRef::class])] + public array $affectedPages; + + /** + * @var ?CacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?CacheDelta $cacheDelta; + + /** + * @var string $opId + */ + #[JsonProperty('opId')] + public string $opId; + + /** + * @var bool $undoable + */ + #[JsonProperty('undoable')] + public bool $undoable; + + /** + * @param array{ + * affectedPages: array, + * opId: string, + * undoable: bool, + * cacheDelta?: ?CacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + $this->opId = $values['opId']; + $this->undoable = $values['undoable']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestination.php b/src/Types/PageDestination.php new file mode 100644 index 0000000..886bc3f --- /dev/null +++ b/src/Types/PageDestination.php @@ -0,0 +1,466 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param PageDestinationXyz $xyz + * @return PageDestination + */ + public static function xyz(PageDestinationXyz $xyz): PageDestination + { + return new PageDestination([ + 'kind' => 'xyz', + 'value' => $xyz, + ]); + } + + /** + * @param PageDestinationFit $fit + * @return PageDestination + */ + public static function fit(PageDestinationFit $fit): PageDestination + { + return new PageDestination([ + 'kind' => 'fit', + 'value' => $fit, + ]); + } + + /** + * @param PageDestinationFitH $fitH + * @return PageDestination + */ + public static function fitH(PageDestinationFitH $fitH): PageDestination + { + return new PageDestination([ + 'kind' => 'fitH', + 'value' => $fitH, + ]); + } + + /** + * @param PageDestinationFitV $fitV + * @return PageDestination + */ + public static function fitV(PageDestinationFitV $fitV): PageDestination + { + return new PageDestination([ + 'kind' => 'fitV', + 'value' => $fitV, + ]); + } + + /** + * @param PageDestinationFitR $fitR + * @return PageDestination + */ + public static function fitR(PageDestinationFitR $fitR): PageDestination + { + return new PageDestination([ + 'kind' => 'fitR', + 'value' => $fitR, + ]); + } + + /** + * @param PageDestinationFitB $fitB + * @return PageDestination + */ + public static function fitB(PageDestinationFitB $fitB): PageDestination + { + return new PageDestination([ + 'kind' => 'fitB', + 'value' => $fitB, + ]); + } + + /** + * @param PageDestinationFitBh $fitBh + * @return PageDestination + */ + public static function fitBh(PageDestinationFitBh $fitBh): PageDestination + { + return new PageDestination([ + 'kind' => 'fitBH', + 'value' => $fitBh, + ]); + } + + /** + * @param PageDestinationFitBv $fitBv + * @return PageDestination + */ + public static function fitBv(PageDestinationFitBv $fitBv): PageDestination + { + return new PageDestination([ + 'kind' => 'fitBV', + 'value' => $fitBv, + ]); + } + + /** + * @return bool + */ + public function isXyz(): bool + { + return $this->value instanceof PageDestinationXyz && $this->kind === 'xyz'; + } + + /** + * @return PageDestinationXyz + */ + public function asXyz(): PageDestinationXyz + { + if (!($this->value instanceof PageDestinationXyz && $this->kind === 'xyz')) { + throw new Exception( + "Expected xyz; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFit(): bool + { + return $this->value instanceof PageDestinationFit && $this->kind === 'fit'; + } + + /** + * @return PageDestinationFit + */ + public function asFit(): PageDestinationFit + { + if (!($this->value instanceof PageDestinationFit && $this->kind === 'fit')) { + throw new Exception( + "Expected fit; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitH(): bool + { + return $this->value instanceof PageDestinationFitH && $this->kind === 'fitH'; + } + + /** + * @return PageDestinationFitH + */ + public function asFitH(): PageDestinationFitH + { + if (!($this->value instanceof PageDestinationFitH && $this->kind === 'fitH')) { + throw new Exception( + "Expected fitH; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitV(): bool + { + return $this->value instanceof PageDestinationFitV && $this->kind === 'fitV'; + } + + /** + * @return PageDestinationFitV + */ + public function asFitV(): PageDestinationFitV + { + if (!($this->value instanceof PageDestinationFitV && $this->kind === 'fitV')) { + throw new Exception( + "Expected fitV; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitR(): bool + { + return $this->value instanceof PageDestinationFitR && $this->kind === 'fitR'; + } + + /** + * @return PageDestinationFitR + */ + public function asFitR(): PageDestinationFitR + { + if (!($this->value instanceof PageDestinationFitR && $this->kind === 'fitR')) { + throw new Exception( + "Expected fitR; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitB(): bool + { + return $this->value instanceof PageDestinationFitB && $this->kind === 'fitB'; + } + + /** + * @return PageDestinationFitB + */ + public function asFitB(): PageDestinationFitB + { + if (!($this->value instanceof PageDestinationFitB && $this->kind === 'fitB')) { + throw new Exception( + "Expected fitB; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitBh(): bool + { + return $this->value instanceof PageDestinationFitBh && $this->kind === 'fitBH'; + } + + /** + * @return PageDestinationFitBh + */ + public function asFitBh(): PageDestinationFitBh + { + if (!($this->value instanceof PageDestinationFitBh && $this->kind === 'fitBH')) { + throw new Exception( + "Expected fitBH; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isFitBv(): bool + { + return $this->value instanceof PageDestinationFitBv && $this->kind === 'fitBV'; + } + + /** + * @return PageDestinationFitBv + */ + public function asFitBv(): PageDestinationFitBv + { + if (!($this->value instanceof PageDestinationFitBv && $this->kind === 'fitBV')) { + throw new Exception( + "Expected fitBV; 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 'xyz': + $value = $this->asXyz()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fit': + $value = $this->asFit()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitH': + $value = $this->asFitH()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitV': + $value = $this->asFitV()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitR': + $value = $this->asFitR()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitB': + $value = $this->asFitB()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitBH': + $value = $this->asFitBh()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'fitBV': + $value = $this->asFitBv()->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 'xyz': + $args['value'] = PageDestinationXyz::jsonDeserialize($data); + break; + case 'fit': + $args['value'] = PageDestinationFit::jsonDeserialize($data); + break; + case 'fitH': + $args['value'] = PageDestinationFitH::jsonDeserialize($data); + break; + case 'fitV': + $args['value'] = PageDestinationFitV::jsonDeserialize($data); + break; + case 'fitR': + $args['value'] = PageDestinationFitR::jsonDeserialize($data); + break; + case 'fitB': + $args['value'] = PageDestinationFitB::jsonDeserialize($data); + break; + case 'fitBH': + $args['value'] = PageDestinationFitBh::jsonDeserialize($data); + break; + case 'fitBV': + $args['value'] = PageDestinationFitBv::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/PageDestinationFit.php b/src/Types/PageDestinationFit.php new file mode 100644 index 0000000..8141bc2 --- /dev/null +++ b/src/Types/PageDestinationFit.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationFitB.php b/src/Types/PageDestinationFitB.php new file mode 100644 index 0000000..61f5728 --- /dev/null +++ b/src/Types/PageDestinationFitB.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationFitBh.php b/src/Types/PageDestinationFitBh.php new file mode 100644 index 0000000..cb23bea --- /dev/null +++ b/src/Types/PageDestinationFitBh.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->y = $values['y'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationFitBv.php b/src/Types/PageDestinationFitBv.php new file mode 100644 index 0000000..1bd4fad --- /dev/null +++ b/src/Types/PageDestinationFitBv.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->x = $values['x'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationFitH.php b/src/Types/PageDestinationFitH.php new file mode 100644 index 0000000..1d6a216 --- /dev/null +++ b/src/Types/PageDestinationFitH.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->y = $values['y'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationFitR.php b/src/Types/PageDestinationFitR.php new file mode 100644 index 0000000..e0a59a3 --- /dev/null +++ b/src/Types/PageDestinationFitR.php @@ -0,0 +1,66 @@ +page = $values['page']; + $this->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/PageDestinationFitV.php b/src/Types/PageDestinationFitV.php new file mode 100644 index 0000000..5e226a2 --- /dev/null +++ b/src/Types/PageDestinationFitV.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->x = $values['x'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageDestinationXyz.php b/src/Types/PageDestinationXyz.php new file mode 100644 index 0000000..cd9ae15 --- /dev/null +++ b/src/Types/PageDestinationXyz.php @@ -0,0 +1,58 @@ +page = $values['page']; + $this->x = $values['x'] ?? null; + $this->y = $values['y'] ?? null; + $this->zoom = $values['zoom'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PagePositionAfter.php b/src/Types/PagePositionAfter.php new file mode 100644 index 0000000..caf654d --- /dev/null +++ b/src/Types/PagePositionAfter.php @@ -0,0 +1,42 @@ +before = $values['before'] ?? null; + $this->after = $values['after'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PagePositionZero.php b/src/Types/PagePositionZero.php new file mode 100644 index 0000000..a93718c --- /dev/null +++ b/src/Types/PagePositionZero.php @@ -0,0 +1,9 @@ + $kind + */ + #[JsonProperty('kind')] + public string $kind; + + /** + * @var int $objectNumber + */ + #[JsonProperty('objectNumber')] + public int $objectNumber; + + /** + * @param array{ + * kind: value-of, + * objectNumber: int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->kind = $values['kind']; + $this->objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PageRefKind.php b/src/Types/PageRefKind.php new file mode 100644 index 0000000..6760575 --- /dev/null +++ b/src/Types/PageRefKind.php @@ -0,0 +1,8 @@ +, - * destination: PdfDestination, + * destination: PageDestination, * } $values */ public function __construct( diff --git a/src/Types/PdfActionWrite.php b/src/Types/PdfActionWrite.php new file mode 100644 index 0000000..7ba40ef --- /dev/null +++ b/src/Types/PdfActionWrite.php @@ -0,0 +1,421 @@ +type = $values['type']; + $this->value = $values['value']; + } + + /** + * @param PdfActionWriteJavascript $javascript + * @return PdfActionWrite + */ + public static function javascript(PdfActionWriteJavascript $javascript): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'javascript', + 'value' => $javascript, + ]); + } + + /** + * @param PdfActionWriteGoto $goto + * @return PdfActionWrite + */ + public static function goto(PdfActionWriteGoto $goto): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'goto', + 'value' => $goto, + ]); + } + + /** + * @param PdfActionWriteUri $uri + * @return PdfActionWrite + */ + public static function uri(PdfActionWriteUri $uri): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'uri', + 'value' => $uri, + ]); + } + + /** + * @param PdfActionWriteNamed $named + * @return PdfActionWrite + */ + public static function named(PdfActionWriteNamed $named): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'named', + 'value' => $named, + ]); + } + + /** + * @param PdfActionWriteHide $hide + * @return PdfActionWrite + */ + public static function hide(PdfActionWriteHide $hide): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'hide', + 'value' => $hide, + ]); + } + + /** + * @param PdfActionWriteResetForm $resetForm + * @return PdfActionWrite + */ + public static function resetForm(PdfActionWriteResetForm $resetForm): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'reset-form', + 'value' => $resetForm, + ]); + } + + /** + * @param PdfActionWriteSubmitForm $submitForm + * @return PdfActionWrite + */ + public static function submitForm(PdfActionWriteSubmitForm $submitForm): PdfActionWrite + { + return new PdfActionWrite([ + 'type' => 'submit-form', + 'value' => $submitForm, + ]); + } + + /** + * @return bool + */ + public function isJavascript(): bool + { + return $this->value instanceof PdfActionWriteJavascript && $this->type === 'javascript'; + } + + /** + * @return PdfActionWriteJavascript + */ + public function asJavascript(): PdfActionWriteJavascript + { + if (!($this->value instanceof PdfActionWriteJavascript && $this->type === 'javascript')) { + throw new Exception( + "Expected javascript; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGoto_(): bool + { + return $this->value instanceof PdfActionWriteGoto && $this->type === 'goto'; + } + + /** + * @return PdfActionWriteGoto + */ + public function asGoto_(): PdfActionWriteGoto + { + if (!($this->value instanceof PdfActionWriteGoto && $this->type === 'goto')) { + throw new Exception( + "Expected goto; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUri(): bool + { + return $this->value instanceof PdfActionWriteUri && $this->type === 'uri'; + } + + /** + * @return PdfActionWriteUri + */ + public function asUri(): PdfActionWriteUri + { + if (!($this->value instanceof PdfActionWriteUri && $this->type === 'uri')) { + throw new Exception( + "Expected uri; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isNamed(): bool + { + return $this->value instanceof PdfActionWriteNamed && $this->type === 'named'; + } + + /** + * @return PdfActionWriteNamed + */ + public function asNamed(): PdfActionWriteNamed + { + if (!($this->value instanceof PdfActionWriteNamed && $this->type === 'named')) { + throw new Exception( + "Expected named; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isHide(): bool + { + return $this->value instanceof PdfActionWriteHide && $this->type === 'hide'; + } + + /** + * @return PdfActionWriteHide + */ + public function asHide(): PdfActionWriteHide + { + if (!($this->value instanceof PdfActionWriteHide && $this->type === 'hide')) { + throw new Exception( + "Expected hide; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isResetForm(): bool + { + return $this->value instanceof PdfActionWriteResetForm && $this->type === 'reset-form'; + } + + /** + * @return PdfActionWriteResetForm + */ + public function asResetForm(): PdfActionWriteResetForm + { + if (!($this->value instanceof PdfActionWriteResetForm && $this->type === 'reset-form')) { + throw new Exception( + "Expected reset-form; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isSubmitForm(): bool + { + return $this->value instanceof PdfActionWriteSubmitForm && $this->type === 'submit-form'; + } + + /** + * @return PdfActionWriteSubmitForm + */ + public function asSubmitForm(): PdfActionWriteSubmitForm + { + if (!($this->value instanceof PdfActionWriteSubmitForm && $this->type === 'submit-form')) { + throw new Exception( + "Expected submit-form; got " . $this->type . " 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['type'] = $this->type; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->type) { + case 'javascript': + $value = $this->asJavascript()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'goto': + $value = $this->asGoto_()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'uri': + $value = $this->asUri()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'named': + $value = $this->asNamed()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'hide': + $value = $this->asHide()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'reset-form': + $value = $this->asResetForm()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'submit-form': + $value = $this->asSubmitForm()->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('type', $data)) { + throw new Exception( + "JSON data is missing property 'type'", + ); + } + $type = $data['type']; + if (!(is_string($type))) { + throw new Exception( + "Expected property 'type' in JSON data to be string, instead received " . get_debug_type($data['type']), + ); + } + + $args['type'] = $type; + switch ($type) { + case 'javascript': + $args['value'] = PdfActionWriteJavascript::jsonDeserialize($data); + break; + case 'goto': + $args['value'] = PdfActionWriteGoto::jsonDeserialize($data); + break; + case 'uri': + $args['value'] = PdfActionWriteUri::jsonDeserialize($data); + break; + case 'named': + $args['value'] = PdfActionWriteNamed::jsonDeserialize($data); + break; + case 'hide': + $args['value'] = PdfActionWriteHide::jsonDeserialize($data); + break; + case 'reset-form': + $args['value'] = PdfActionWriteResetForm::jsonDeserialize($data); + break; + case 'submit-form': + $args['value'] = PdfActionWriteSubmitForm::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['type'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/PdfActionWriteGoto.php b/src/Types/PdfActionWriteGoto.php new file mode 100644 index 0000000..c58f1fc --- /dev/null +++ b/src/Types/PdfActionWriteGoto.php @@ -0,0 +1,43 @@ + $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * destination: PageDestination, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->destination = $values['destination']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteHide.php b/src/Types/PdfActionWriteHide.php new file mode 100644 index 0000000..8c3c7e7 --- /dev/null +++ b/src/Types/PdfActionWriteHide.php @@ -0,0 +1,51 @@ + $targets + */ + #[JsonProperty('targets'), ArrayType([PdfActionTargetRef::class])] + public array $targets; + + /** + * @var bool $hide + */ + #[JsonProperty('hide')] + public bool $hide; + + /** + * @var ?array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * targets: array, + * hide: bool, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->targets = $values['targets']; + $this->hide = $values['hide']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteJavascript.php b/src/Types/PdfActionWriteJavascript.php new file mode 100644 index 0000000..5312e42 --- /dev/null +++ b/src/Types/PdfActionWriteJavascript.php @@ -0,0 +1,43 @@ + $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * script: string, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->script = $values['script']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteNamed.php b/src/Types/PdfActionWriteNamed.php new file mode 100644 index 0000000..4dbdd1f --- /dev/null +++ b/src/Types/PdfActionWriteNamed.php @@ -0,0 +1,43 @@ + $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * name: string, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteResetForm.php b/src/Types/PdfActionWriteResetForm.php new file mode 100644 index 0000000..d62e083 --- /dev/null +++ b/src/Types/PdfActionWriteResetForm.php @@ -0,0 +1,51 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([PdfActionTargetRef::class])] + public ?array $fields; + + /** + * @var bool $exclude + */ + #[JsonProperty('exclude')] + public bool $exclude; + + /** + * @var ?array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * exclude: bool, + * fields?: ?array, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields'] ?? null; + $this->exclude = $values['exclude']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteSubmitForm.php b/src/Types/PdfActionWriteSubmitForm.php new file mode 100644 index 0000000..0328752 --- /dev/null +++ b/src/Types/PdfActionWriteSubmitForm.php @@ -0,0 +1,59 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([PdfActionTargetRef::class])] + public ?array $fields; + + /** + * @var ?int $flags + */ + #[JsonProperty('flags')] + public ?int $flags; + + /** + * @var ?array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * url: string, + * fields?: ?array, + * flags?: ?int, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->url = $values['url']; + $this->fields = $values['fields'] ?? null; + $this->flags = $values['flags'] ?? null; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfActionWriteUri.php b/src/Types/PdfActionWriteUri.php new file mode 100644 index 0000000..89c2be2 --- /dev/null +++ b/src/Types/PdfActionWriteUri.php @@ -0,0 +1,43 @@ + $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public ?array $next; + + /** + * @param array{ + * uri: string, + * next?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->uri = $values['uri']; + $this->next = $values['next'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfDestination.php b/src/Types/PdfDestination.php deleted file mode 100644 index 430b9ff..0000000 --- a/src/Types/PdfDestination.php +++ /dev/null @@ -1,466 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param PdfDestinationXyz $xyz - * @return PdfDestination - */ - public static function xyz(PdfDestinationXyz $xyz): PdfDestination - { - return new PdfDestination([ - 'kind' => 'xyz', - 'value' => $xyz, - ]); - } - - /** - * @param PdfDestinationFit $fit - * @return PdfDestination - */ - public static function fit(PdfDestinationFit $fit): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fit', - 'value' => $fit, - ]); - } - - /** - * @param PdfDestinationFitH $fitH - * @return PdfDestination - */ - public static function fitH(PdfDestinationFitH $fitH): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitH', - 'value' => $fitH, - ]); - } - - /** - * @param PdfDestinationFitV $fitV - * @return PdfDestination - */ - public static function fitV(PdfDestinationFitV $fitV): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitV', - 'value' => $fitV, - ]); - } - - /** - * @param PdfDestinationFitR $fitR - * @return PdfDestination - */ - public static function fitR(PdfDestinationFitR $fitR): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitR', - 'value' => $fitR, - ]); - } - - /** - * @param PdfDestinationFitB $fitB - * @return PdfDestination - */ - public static function fitB(PdfDestinationFitB $fitB): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitB', - 'value' => $fitB, - ]); - } - - /** - * @param PdfDestinationFitBh $fitBh - * @return PdfDestination - */ - public static function fitBh(PdfDestinationFitBh $fitBh): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitBH', - 'value' => $fitBh, - ]); - } - - /** - * @param PdfDestinationFitBv $fitBv - * @return PdfDestination - */ - public static function fitBv(PdfDestinationFitBv $fitBv): PdfDestination - { - return new PdfDestination([ - 'kind' => 'fitBV', - 'value' => $fitBv, - ]); - } - - /** - * @return bool - */ - public function isXyz(): bool - { - return $this->value instanceof PdfDestinationXyz && $this->kind === 'xyz'; - } - - /** - * @return PdfDestinationXyz - */ - public function asXyz(): PdfDestinationXyz - { - if (!($this->value instanceof PdfDestinationXyz && $this->kind === 'xyz')) { - throw new Exception( - "Expected xyz; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFit(): bool - { - return $this->value instanceof PdfDestinationFit && $this->kind === 'fit'; - } - - /** - * @return PdfDestinationFit - */ - public function asFit(): PdfDestinationFit - { - if (!($this->value instanceof PdfDestinationFit && $this->kind === 'fit')) { - throw new Exception( - "Expected fit; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitH(): bool - { - return $this->value instanceof PdfDestinationFitH && $this->kind === 'fitH'; - } - - /** - * @return PdfDestinationFitH - */ - public function asFitH(): PdfDestinationFitH - { - if (!($this->value instanceof PdfDestinationFitH && $this->kind === 'fitH')) { - throw new Exception( - "Expected fitH; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitV(): bool - { - return $this->value instanceof PdfDestinationFitV && $this->kind === 'fitV'; - } - - /** - * @return PdfDestinationFitV - */ - public function asFitV(): PdfDestinationFitV - { - if (!($this->value instanceof PdfDestinationFitV && $this->kind === 'fitV')) { - throw new Exception( - "Expected fitV; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitR(): bool - { - return $this->value instanceof PdfDestinationFitR && $this->kind === 'fitR'; - } - - /** - * @return PdfDestinationFitR - */ - public function asFitR(): PdfDestinationFitR - { - if (!($this->value instanceof PdfDestinationFitR && $this->kind === 'fitR')) { - throw new Exception( - "Expected fitR; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitB(): bool - { - return $this->value instanceof PdfDestinationFitB && $this->kind === 'fitB'; - } - - /** - * @return PdfDestinationFitB - */ - public function asFitB(): PdfDestinationFitB - { - if (!($this->value instanceof PdfDestinationFitB && $this->kind === 'fitB')) { - throw new Exception( - "Expected fitB; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitBh(): bool - { - return $this->value instanceof PdfDestinationFitBh && $this->kind === 'fitBH'; - } - - /** - * @return PdfDestinationFitBh - */ - public function asFitBh(): PdfDestinationFitBh - { - if (!($this->value instanceof PdfDestinationFitBh && $this->kind === 'fitBH')) { - throw new Exception( - "Expected fitBH; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isFitBv(): bool - { - return $this->value instanceof PdfDestinationFitBv && $this->kind === 'fitBV'; - } - - /** - * @return PdfDestinationFitBv - */ - public function asFitBv(): PdfDestinationFitBv - { - if (!($this->value instanceof PdfDestinationFitBv && $this->kind === 'fitBV')) { - throw new Exception( - "Expected fitBV; 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 'xyz': - $value = $this->asXyz()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fit': - $value = $this->asFit()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitH': - $value = $this->asFitH()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitV': - $value = $this->asFitV()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitR': - $value = $this->asFitR()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitB': - $value = $this->asFitB()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitBH': - $value = $this->asFitBh()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'fitBV': - $value = $this->asFitBv()->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 'xyz': - $args['value'] = PdfDestinationXyz::jsonDeserialize($data); - break; - case 'fit': - $args['value'] = PdfDestinationFit::jsonDeserialize($data); - break; - case 'fitH': - $args['value'] = PdfDestinationFitH::jsonDeserialize($data); - break; - case 'fitV': - $args['value'] = PdfDestinationFitV::jsonDeserialize($data); - break; - case 'fitR': - $args['value'] = PdfDestinationFitR::jsonDeserialize($data); - break; - case 'fitB': - $args['value'] = PdfDestinationFitB::jsonDeserialize($data); - break; - case 'fitBH': - $args['value'] = PdfDestinationFitBh::jsonDeserialize($data); - break; - case 'fitBV': - $args['value'] = PdfDestinationFitBv::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/PdfDestinationFit.php b/src/Types/PdfDestinationFit.php deleted file mode 100644 index 2c66eb2..0000000 --- a/src/Types/PdfDestinationFit.php +++ /dev/null @@ -1,34 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationFitB.php b/src/Types/PdfDestinationFitB.php deleted file mode 100644 index a48cb37..0000000 --- a/src/Types/PdfDestinationFitB.php +++ /dev/null @@ -1,34 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationFitBh.php b/src/Types/PdfDestinationFitBh.php deleted file mode 100644 index a30778d..0000000 --- a/src/Types/PdfDestinationFitBh.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->top = $values['top'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationFitBv.php b/src/Types/PdfDestinationFitBv.php deleted file mode 100644 index 6f0bb73..0000000 --- a/src/Types/PdfDestinationFitBv.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->left = $values['left'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationFitH.php b/src/Types/PdfDestinationFitH.php deleted file mode 100644 index 83964d3..0000000 --- a/src/Types/PdfDestinationFitH.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->top = $values['top'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationFitR.php b/src/Types/PdfDestinationFitR.php deleted file mode 100644 index 15eacba..0000000 --- a/src/Types/PdfDestinationFitR.php +++ /dev/null @@ -1,66 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->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/PdfDestinationFitV.php b/src/Types/PdfDestinationFitV.php deleted file mode 100644 index 8026517..0000000 --- a/src/Types/PdfDestinationFitV.php +++ /dev/null @@ -1,42 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->left = $values['left'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfDestinationXyz.php b/src/Types/PdfDestinationXyz.php deleted file mode 100644 index dce2944..0000000 --- a/src/Types/PdfDestinationXyz.php +++ /dev/null @@ -1,58 +0,0 @@ -pageObjectNumber = $values['pageObjectNumber']; - $this->left = $values['left'] ?? null; - $this->top = $values['top'] ?? null; - $this->zoom = $values['zoom'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfLinkTarget.php b/src/Types/PdfLinkTarget.php new file mode 100644 index 0000000..1cf7ce4 --- /dev/null +++ b/src/Types/PdfLinkTarget.php @@ -0,0 +1,421 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param PdfLinkTargetGoto $goto + * @return PdfLinkTarget + */ + public static function goto(PdfLinkTargetGoto $goto): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'goto', + 'value' => $goto, + ]); + } + + /** + * @param PdfLinkTargetUri $uri + * @return PdfLinkTarget + */ + public static function uri(PdfLinkTargetUri $uri): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'uri', + 'value' => $uri, + ]); + } + + /** + * @param PdfLinkTargetGotoRemote $gotoRemote + * @return PdfLinkTarget + */ + public static function gotoRemote(PdfLinkTargetGotoRemote $gotoRemote): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'goto-remote', + 'value' => $gotoRemote, + ]); + } + + /** + * @param PdfLinkTargetLaunch $launch + * @return PdfLinkTarget + */ + public static function launch(PdfLinkTargetLaunch $launch): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'launch', + 'value' => $launch, + ]); + } + + /** + * @param PdfLinkTargetJavascript $javascript + * @return PdfLinkTarget + */ + public static function javascript(PdfLinkTargetJavascript $javascript): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'javascript', + 'value' => $javascript, + ]); + } + + /** + * @param PdfLinkTargetNamed $named + * @return PdfLinkTarget + */ + public static function named(PdfLinkTargetNamed $named): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'named', + 'value' => $named, + ]); + } + + /** + * @param PdfLinkTargetUnsupported $unsupported + * @return PdfLinkTarget + */ + public static function unsupported(PdfLinkTargetUnsupported $unsupported): PdfLinkTarget + { + return new PdfLinkTarget([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isGoto_(): bool + { + return $this->value instanceof PdfLinkTargetGoto && $this->kind === 'goto'; + } + + /** + * @return PdfLinkTargetGoto + */ + public function asGoto_(): PdfLinkTargetGoto + { + if (!($this->value instanceof PdfLinkTargetGoto && $this->kind === 'goto')) { + throw new Exception( + "Expected goto; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUri(): bool + { + return $this->value instanceof PdfLinkTargetUri && $this->kind === 'uri'; + } + + /** + * @return PdfLinkTargetUri + */ + public function asUri(): PdfLinkTargetUri + { + if (!($this->value instanceof PdfLinkTargetUri && $this->kind === 'uri')) { + throw new Exception( + "Expected uri; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGotoRemote(): bool + { + return $this->value instanceof PdfLinkTargetGotoRemote && $this->kind === 'goto-remote'; + } + + /** + * @return PdfLinkTargetGotoRemote + */ + public function asGotoRemote(): PdfLinkTargetGotoRemote + { + if (!($this->value instanceof PdfLinkTargetGotoRemote && $this->kind === 'goto-remote')) { + throw new Exception( + "Expected goto-remote; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isLaunch(): bool + { + return $this->value instanceof PdfLinkTargetLaunch && $this->kind === 'launch'; + } + + /** + * @return PdfLinkTargetLaunch + */ + public function asLaunch(): PdfLinkTargetLaunch + { + if (!($this->value instanceof PdfLinkTargetLaunch && $this->kind === 'launch')) { + throw new Exception( + "Expected launch; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isJavascript(): bool + { + return $this->value instanceof PdfLinkTargetJavascript && $this->kind === 'javascript'; + } + + /** + * @return PdfLinkTargetJavascript + */ + public function asJavascript(): PdfLinkTargetJavascript + { + if (!($this->value instanceof PdfLinkTargetJavascript && $this->kind === 'javascript')) { + throw new Exception( + "Expected javascript; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isNamed(): bool + { + return $this->value instanceof PdfLinkTargetNamed && $this->kind === 'named'; + } + + /** + * @return PdfLinkTargetNamed + */ + public function asNamed(): PdfLinkTargetNamed + { + if (!($this->value instanceof PdfLinkTargetNamed && $this->kind === 'named')) { + throw new Exception( + "Expected named; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof PdfLinkTargetUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return PdfLinkTargetUnsupported + */ + public function asUnsupported(): PdfLinkTargetUnsupported + { + if (!($this->value instanceof PdfLinkTargetUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; 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 'goto': + $value = $this->asGoto_()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'uri': + $value = $this->asUri()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'goto-remote': + $value = $this->asGotoRemote()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'launch': + $value = $this->asLaunch()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'javascript': + $value = $this->asJavascript()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'named': + $value = $this->asNamed()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->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 'goto': + $args['value'] = PdfLinkTargetGoto::jsonDeserialize($data); + break; + case 'uri': + $args['value'] = PdfLinkTargetUri::jsonDeserialize($data); + break; + case 'goto-remote': + $args['value'] = PdfLinkTargetGotoRemote::jsonDeserialize($data); + break; + case 'launch': + $args['value'] = PdfLinkTargetLaunch::jsonDeserialize($data); + break; + case 'javascript': + $args['value'] = PdfLinkTargetJavascript::jsonDeserialize($data); + break; + case 'named': + $args['value'] = PdfLinkTargetNamed::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = PdfLinkTargetUnsupported::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/PdfLinkTargetGoto.php b/src/Types/PdfLinkTargetGoto.php new file mode 100644 index 0000000..88138cd --- /dev/null +++ b/src/Types/PdfLinkTargetGoto.php @@ -0,0 +1,34 @@ +destination = $values['destination']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetGotoRemote.php b/src/Types/PdfLinkTargetGotoRemote.php new file mode 100644 index 0000000..f3ca46b --- /dev/null +++ b/src/Types/PdfLinkTargetGotoRemote.php @@ -0,0 +1,34 @@ +file = $values['file']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetJavascript.php b/src/Types/PdfLinkTargetJavascript.php new file mode 100644 index 0000000..86770b8 --- /dev/null +++ b/src/Types/PdfLinkTargetJavascript.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/PdfLinkTargetLaunch.php b/src/Types/PdfLinkTargetLaunch.php new file mode 100644 index 0000000..5fe9a7e --- /dev/null +++ b/src/Types/PdfLinkTargetLaunch.php @@ -0,0 +1,34 @@ +path = $values['path']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetNamed.php b/src/Types/PdfLinkTargetNamed.php new file mode 100644 index 0000000..c78e5b4 --- /dev/null +++ b/src/Types/PdfLinkTargetNamed.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetUnsupported.php b/src/Types/PdfLinkTargetUnsupported.php new file mode 100644 index 0000000..00ba0ae --- /dev/null +++ b/src/Types/PdfLinkTargetUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/PdfLinkTargetUri.php b/src/Types/PdfLinkTargetUri.php new file mode 100644 index 0000000..95145de --- /dev/null +++ b/src/Types/PdfLinkTargetUri.php @@ -0,0 +1,34 @@ +uri = $values['uri']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetWritable.php b/src/Types/PdfLinkTargetWritable.php new file mode 100644 index 0000000..dfba39c --- /dev/null +++ b/src/Types/PdfLinkTargetWritable.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param PdfLinkTargetWritableGoto $goto + * @return PdfLinkTargetWritable + */ + public static function goto(PdfLinkTargetWritableGoto $goto): PdfLinkTargetWritable + { + return new PdfLinkTargetWritable([ + 'kind' => 'goto', + 'value' => $goto, + ]); + } + + /** + * @param PdfLinkTargetWritableUri $uri + * @return PdfLinkTargetWritable + */ + public static function uri(PdfLinkTargetWritableUri $uri): PdfLinkTargetWritable + { + return new PdfLinkTargetWritable([ + 'kind' => 'uri', + 'value' => $uri, + ]); + } + + /** + * @param PdfLinkTargetWritableNamed $named + * @return PdfLinkTargetWritable + */ + public static function named(PdfLinkTargetWritableNamed $named): PdfLinkTargetWritable + { + return new PdfLinkTargetWritable([ + 'kind' => 'named', + 'value' => $named, + ]); + } + + /** + * @return bool + */ + public function isGoto_(): bool + { + return $this->value instanceof PdfLinkTargetWritableGoto && $this->kind === 'goto'; + } + + /** + * @return PdfLinkTargetWritableGoto + */ + public function asGoto_(): PdfLinkTargetWritableGoto + { + if (!($this->value instanceof PdfLinkTargetWritableGoto && $this->kind === 'goto')) { + throw new Exception( + "Expected goto; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUri(): bool + { + return $this->value instanceof PdfLinkTargetWritableUri && $this->kind === 'uri'; + } + + /** + * @return PdfLinkTargetWritableUri + */ + public function asUri(): PdfLinkTargetWritableUri + { + if (!($this->value instanceof PdfLinkTargetWritableUri && $this->kind === 'uri')) { + throw new Exception( + "Expected uri; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isNamed(): bool + { + return $this->value instanceof PdfLinkTargetWritableNamed && $this->kind === 'named'; + } + + /** + * @return PdfLinkTargetWritableNamed + */ + public function asNamed(): PdfLinkTargetWritableNamed + { + if (!($this->value instanceof PdfLinkTargetWritableNamed && $this->kind === 'named')) { + throw new Exception( + "Expected named; 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 'goto': + $value = $this->asGoto_()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'uri': + $value = $this->asUri()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'named': + $value = $this->asNamed()->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 'goto': + $args['value'] = PdfLinkTargetWritableGoto::jsonDeserialize($data); + break; + case 'uri': + $args['value'] = PdfLinkTargetWritableUri::jsonDeserialize($data); + break; + case 'named': + $args['value'] = PdfLinkTargetWritableNamed::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/PdfLinkTargetWritableGoto.php b/src/Types/PdfLinkTargetWritableGoto.php new file mode 100644 index 0000000..69d149c --- /dev/null +++ b/src/Types/PdfLinkTargetWritableGoto.php @@ -0,0 +1,34 @@ +destination = $values['destination']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetWritableNamed.php b/src/Types/PdfLinkTargetWritableNamed.php new file mode 100644 index 0000000..3be817b --- /dev/null +++ b/src/Types/PdfLinkTargetWritableNamed.php @@ -0,0 +1,34 @@ + $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @param array{ + * name: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfLinkTargetWritableNamedName.php b/src/Types/PdfLinkTargetWritableNamedName.php new file mode 100644 index 0000000..bf13e40 --- /dev/null +++ b/src/Types/PdfLinkTargetWritableNamedName.php @@ -0,0 +1,11 @@ +uri = $values['uri']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SharesCreate400Response.php b/src/Types/SharesCreate400Response.php deleted file mode 100644 index 03150e6..0000000 --- a/src/Types/SharesCreate400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesCreate400ResponseError.php b/src/Types/SharesCreate400ResponseError.php deleted file mode 100644 index 1b02621..0000000 --- a/src/Types/SharesCreate400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesCreate403Response.php b/src/Types/SharesCreate403Response.php deleted file mode 100644 index 3f4a19b..0000000 --- a/src/Types/SharesCreate403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesCreate403ResponseError.php b/src/Types/SharesCreate403ResponseError.php deleted file mode 100644 index c41ff69..0000000 --- a/src/Types/SharesCreate403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesCreate404Response.php b/src/Types/SharesCreate404Response.php deleted file mode 100644 index 353e69a..0000000 --- a/src/Types/SharesCreate404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesCreate404ResponseError.php b/src/Types/SharesCreate404ResponseError.php deleted file mode 100644 index 3d50348..0000000 --- a/src/Types/SharesCreate404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesDeleteResponse.php b/src/Types/SharesDeleteResponse.php deleted file mode 100644 index ae232c6..0000000 --- a/src/Types/SharesDeleteResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesDeleteResponseError.php b/src/Types/SharesDeleteResponseError.php deleted file mode 100644 index 906357a..0000000 --- a/src/Types/SharesDeleteResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange400Response.php b/src/Types/SharesExchange400Response.php deleted file mode 100644 index fd4a415..0000000 --- a/src/Types/SharesExchange400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange400ResponseError.php b/src/Types/SharesExchange400ResponseError.php deleted file mode 100644 index 80675f2..0000000 --- a/src/Types/SharesExchange400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange403Response.php b/src/Types/SharesExchange403Response.php deleted file mode 100644 index 6f240d5..0000000 --- a/src/Types/SharesExchange403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange403ResponseError.php b/src/Types/SharesExchange403ResponseError.php deleted file mode 100644 index 968b1d6..0000000 --- a/src/Types/SharesExchange403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange404Response.php b/src/Types/SharesExchange404Response.php deleted file mode 100644 index 4928107..0000000 --- a/src/Types/SharesExchange404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange404ResponseError.php b/src/Types/SharesExchange404ResponseError.php deleted file mode 100644 index 9f1454e..0000000 --- a/src/Types/SharesExchange404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange410Response.php b/src/Types/SharesExchange410Response.php deleted file mode 100644 index 12bccf5..0000000 --- a/src/Types/SharesExchange410Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange410ResponseError.php b/src/Types/SharesExchange410ResponseError.php deleted file mode 100644 index 0c24c69..0000000 --- a/src/Types/SharesExchange410ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange422Response.php b/src/Types/SharesExchange422Response.php deleted file mode 100644 index 2864901..0000000 --- a/src/Types/SharesExchange422Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesExchange422ResponseError.php b/src/Types/SharesExchange422ResponseError.php deleted file mode 100644 index 0334821..0000000 --- a/src/Types/SharesExchange422ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesGet404Response.php b/src/Types/SharesGet404Response.php deleted file mode 100644 index 05a97a3..0000000 --- a/src/Types/SharesGet404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesGet404ResponseError.php b/src/Types/SharesGet404ResponseError.php deleted file mode 100644 index ad506f4..0000000 --- a/src/Types/SharesGet404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesList400Response.php b/src/Types/SharesList400Response.php deleted file mode 100644 index 17caea5..0000000 --- a/src/Types/SharesList400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesList400ResponseError.php b/src/Types/SharesList400ResponseError.php deleted file mode 100644 index 1d7efb5..0000000 --- a/src/Types/SharesList400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesUpdate400Response.php b/src/Types/SharesUpdate400Response.php deleted file mode 100644 index 882bb5a..0000000 --- a/src/Types/SharesUpdate400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesUpdate400ResponseError.php b/src/Types/SharesUpdate400ResponseError.php deleted file mode 100644 index 9515ea5..0000000 --- a/src/Types/SharesUpdate400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesUpdate404Response.php b/src/Types/SharesUpdate404Response.php deleted file mode 100644 index ec2bcd0..0000000 --- a/src/Types/SharesUpdate404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/SharesUpdate404ResponseError.php b/src/Types/SharesUpdate404ResponseError.php deleted file mode 100644 index e758720..0000000 --- a/src/Types/SharesUpdate404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsCreate400Response.php b/src/Types/TenantsCreate400Response.php deleted file mode 100644 index 3afb3b4..0000000 --- a/src/Types/TenantsCreate400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsCreate400ResponseError.php b/src/Types/TenantsCreate400ResponseError.php deleted file mode 100644 index 8e6ff40..0000000 --- a/src/Types/TenantsCreate400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsDeleteResponse.php b/src/Types/TenantsDeleteResponse.php deleted file mode 100644 index eebf120..0000000 --- a/src/Types/TenantsDeleteResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsDeleteResponseError.php b/src/Types/TenantsDeleteResponseError.php deleted file mode 100644 index 2c34a51..0000000 --- a/src/Types/TenantsDeleteResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsGet404Response.php b/src/Types/TenantsGet404Response.php deleted file mode 100644 index 5967598..0000000 --- a/src/Types/TenantsGet404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsGet404ResponseError.php b/src/Types/TenantsGet404ResponseError.php deleted file mode 100644 index a851312..0000000 --- a/src/Types/TenantsGet404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsList400Response.php b/src/Types/TenantsList400Response.php deleted file mode 100644 index 4e184cc..0000000 --- a/src/Types/TenantsList400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsList400ResponseError.php b/src/Types/TenantsList400ResponseError.php deleted file mode 100644 index c3111a2..0000000 --- a/src/Types/TenantsList400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsResumeResponse.php b/src/Types/TenantsResumeResponse.php deleted file mode 100644 index 048df7a..0000000 --- a/src/Types/TenantsResumeResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsResumeResponseError.php b/src/Types/TenantsResumeResponseError.php deleted file mode 100644 index 26da978..0000000 --- a/src/Types/TenantsResumeResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsSuspendResponse.php b/src/Types/TenantsSuspendResponse.php deleted file mode 100644 index 8086755..0000000 --- a/src/Types/TenantsSuspendResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsSuspendResponseError.php b/src/Types/TenantsSuspendResponseError.php deleted file mode 100644 index ed9ff36..0000000 --- a/src/Types/TenantsSuspendResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsage400Response.php b/src/Types/TenantsUsage400Response.php deleted file mode 100644 index c073275..0000000 --- a/src/Types/TenantsUsage400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsage400ResponseError.php b/src/Types/TenantsUsage400ResponseError.php deleted file mode 100644 index abc41f1..0000000 --- a/src/Types/TenantsUsage400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsage404Response.php b/src/Types/TenantsUsage404Response.php deleted file mode 100644 index 5ca5b41..0000000 --- a/src/Types/TenantsUsage404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsage404ResponseError.php b/src/Types/TenantsUsage404ResponseError.php deleted file mode 100644 index 0e39afa..0000000 --- a/src/Types/TenantsUsage404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue400Response.php b/src/Types/TokensIssue400Response.php deleted file mode 100644 index 5696328..0000000 --- a/src/Types/TokensIssue400Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue400ResponseError.php b/src/Types/TokensIssue400ResponseError.php deleted file mode 100644 index 27b6505..0000000 --- a/src/Types/TokensIssue400ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue403Response.php b/src/Types/TokensIssue403Response.php deleted file mode 100644 index 5a0918b..0000000 --- a/src/Types/TokensIssue403Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue403ResponseError.php b/src/Types/TokensIssue403ResponseError.php deleted file mode 100644 index 11b098c..0000000 --- a/src/Types/TokensIssue403ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue404Response.php b/src/Types/TokensIssue404Response.php deleted file mode 100644 index bcac99a..0000000 --- a/src/Types/TokensIssue404Response.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssue404ResponseError.php b/src/Types/TokensIssue404ResponseError.php deleted file mode 100644 index 16e7e4d..0000000 --- a/src/Types/TokensIssue404ResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssueRequestDoc.php b/src/Types/TokensIssueRequestDoc.php index 5049cad..c7c28a6 100644 --- a/src/Types/TokensIssueRequestDoc.php +++ b/src/Types/TokensIssueRequestDoc.php @@ -33,28 +33,10 @@ class TokensIssueRequestDoc extends JsonSerializableType public array $scope; /** - * @var ?string $userId + * @var ?TokensIssueRequestDocIdentity $identity */ - #[JsonProperty('userId')] - public ?string $userId; - - /** - * @var ?string $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?string $groupId - */ - #[JsonProperty('groupId')] - public ?string $groupId; - - /** - * @var ?array $groups - */ - #[JsonProperty('groups'), ArrayType(['string'])] - public ?array $groups; + #[JsonProperty('identity')] + public ?TokensIssueRequestDocIdentity $identity; /** * @var ?array $origins @@ -75,10 +57,7 @@ class TokensIssueRequestDoc extends JsonSerializableType * scope: array, * expiresIn: int, * layerName?: ?string, - * userId?: ?string, - * displayName?: ?string, - * groupId?: ?string, - * groups?: ?array, + * identity?: ?TokensIssueRequestDocIdentity, * origins?: ?array, * } $values */ @@ -89,10 +68,7 @@ public function __construct( $this->docId = $values['docId']; $this->layerName = $values['layerName'] ?? null; $this->scope = $values['scope']; - $this->userId = $values['userId'] ?? null; - $this->displayName = $values['displayName'] ?? null; - $this->groupId = $values['groupId'] ?? null; - $this->groups = $values['groups'] ?? null; + $this->identity = $values['identity'] ?? null; $this->origins = $values['origins'] ?? null; $this->expiresIn = $values['expiresIn']; } diff --git a/src/Types/TokensIssueRequestDocIdentity.php b/src/Types/TokensIssueRequestDocIdentity.php new file mode 100644 index 0000000..188b931 --- /dev/null +++ b/src/Types/TokensIssueRequestDocIdentity.php @@ -0,0 +1,82 @@ +userId = $values['userId'] ?? null; + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + $this->groupId = $values['groupId'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensRevokeResponse.php b/src/Types/TokensRevokeResponse.php deleted file mode 100644 index 13f5c5b..0000000 --- a/src/Types/TokensRevokeResponse.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensRevokeResponseError.php b/src/Types/TokensRevokeResponseError.php deleted file mode 100644 index 12d3f86..0000000 --- a/src/Types/TokensRevokeResponseError.php +++ /dev/null @@ -1,42 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/WidgetActionsPatch.php b/src/Types/WidgetActionsPatch.php new file mode 100644 index 0000000..f64755a --- /dev/null +++ b/src/Types/WidgetActionsPatch.php @@ -0,0 +1,114 @@ +activate = $values['activate'] ?? null; + $this->cursorEnter = $values['cursorEnter'] ?? null; + $this->cursorExit = $values['cursorExit'] ?? null; + $this->mouseDown = $values['mouseDown'] ?? null; + $this->mouseUp = $values['mouseUp'] ?? null; + $this->focus = $values['focus'] ?? null; + $this->blur = $values['blur'] ?? null; + $this->pageOpen = $values['pageOpen'] ?? null; + $this->pageClose = $values['pageClose'] ?? null; + $this->pageVisible = $values['pageVisible'] ?? null; + $this->pageInvisible = $values['pageInvisible'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetAnnotation.php b/src/Types/WidgetAnnotation.php new file mode 100644 index 0000000..2e0a26c --- /dev/null +++ b/src/Types/WidgetAnnotation.php @@ -0,0 +1,397 @@ + $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var AnnotationRef $ref + */ + #[JsonProperty('ref')] + public AnnotationRef $ref; + + /** + * @var PageRef $page + */ + #[JsonProperty('page')] + public PageRef $page; + + /** + * @var bool $hasAppearance + */ + #[JsonProperty('hasAppearance')] + public bool $hasAppearance; + + /** + * @var ?string $appearanceState + */ + #[JsonProperty('appearanceState')] + public ?string $appearanceState; + + /** + * @var ?string $nm + */ + #[JsonProperty('nm')] + public ?string $nm; + + /** + * @var WidgetAnnotationRect $rect + */ + #[JsonProperty('rect')] + public WidgetAnnotationRect $rect; + + /** + * @var ?string $contents + */ + #[JsonProperty('contents')] + public ?string $contents; + + /** + * @var ?string $subject + */ + #[JsonProperty('subject')] + public ?string $subject; + + /** + * @var value-of $blendMode + */ + #[JsonProperty('blendMode')] + public string $blendMode; + + /** + * @var bool $invisible + */ + #[JsonProperty('invisible')] + public bool $invisible; + + /** + * @var bool $hidden + */ + #[JsonProperty('hidden')] + public bool $hidden; + + /** + * @var bool $print + */ + #[JsonProperty('print')] + public bool $print; + + /** + * @var bool $noZoom + */ + #[JsonProperty('noZoom')] + public bool $noZoom; + + /** + * @var bool $noRotate + */ + #[JsonProperty('noRotate')] + public bool $noRotate; + + /** + * @var bool $noView + */ + #[JsonProperty('noView')] + public bool $noView; + + /** + * @var bool $readOnly + */ + #[JsonProperty('readOnly')] + public bool $readOnly; + + /** + * @var bool $locked + */ + #[JsonProperty('locked')] + public bool $locked; + + /** + * @var bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public bool $toggleNoView; + + /** + * @var bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public bool $lockedContents; + + /** + * @var ?WidgetAnnotationReply $reply + */ + #[JsonProperty('reply')] + public ?WidgetAnnotationReply $reply; + + /** + * @var ?AnnotationRef $popup + */ + #[JsonProperty('popup')] + public ?AnnotationRef $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var ?string $author + */ + #[JsonProperty('author')] + public ?string $author; + + /** + * @var ?DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $createdAt; + + /** + * @var ?DateTime $modifiedAt + */ + #[JsonProperty('modifiedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $modifiedAt; + + /** + * @var ?string $userId + */ + #[JsonProperty('userId')] + public ?string $userId; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @var ?string $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public ?string $modifiedBy; + + /** + * @var ?string $importedBy + */ + #[JsonProperty('importedBy')] + public ?string $importedBy; + + /** + * @var ?PdfAnnotationActions $actions + */ + #[JsonProperty('actions')] + public ?PdfAnnotationActions $actions; + + /** + * @var WidgetAnnotationBox $box + */ + #[JsonProperty('box')] + public WidgetAnnotationBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public float $strokeWidth; + + /** + * @var value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var value-of $textAlign + */ + #[JsonProperty('textAlign')] + public string $textAlign; + + /** + * @var ?string $caption + */ + #[JsonProperty('caption')] + public ?string $caption; + + /** + * @var ?value-of $checkStyle + */ + #[JsonProperty('checkStyle')] + public ?string $checkStyle; + + /** + * @var ?FormFieldRef $field + */ + #[JsonProperty('field')] + public ?FormFieldRef $field; + + /** + * @var value-of $fieldFamily + */ + #[JsonProperty('fieldFamily')] + public string $fieldFamily; + + /** + * @param array{ + * subtype: value-of, + * ref: AnnotationRef, + * page: PageRef, + * hasAppearance: bool, + * rect: WidgetAnnotationRect, + * blendMode: value-of, + * invisible: bool, + * hidden: bool, + * print: bool, + * noZoom: bool, + * noRotate: bool, + * noView: bool, + * readOnly: bool, + * locked: bool, + * toggleNoView: bool, + * lockedContents: bool, + * box: WidgetAnnotationBox, + * strokeWidth: float, + * borderStyle: value-of, + * textAlign: value-of, + * fieldFamily: value-of, + * appearanceState?: ?string, + * nm?: ?string, + * contents?: ?string, + * subject?: ?string, + * reply?: ?WidgetAnnotationReply, + * popup?: ?AnnotationRef, + * groupId?: ?string, + * author?: ?string, + * createdAt?: ?DateTime, + * modifiedAt?: ?DateTime, + * userId?: ?string, + * createdBy?: ?string, + * modifiedBy?: ?string, + * importedBy?: ?string, + * actions?: ?PdfAnnotationActions, + * rotation?: ?float, + * color?: ?string, + * interiorColor?: ?string, + * dashArray?: ?array, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * caption?: ?string, + * checkStyle?: ?value-of, + * field?: ?FormFieldRef, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subtype = $values['subtype']; + $this->ref = $values['ref']; + $this->page = $values['page']; + $this->hasAppearance = $values['hasAppearance']; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect']; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode']; + $this->invisible = $values['invisible']; + $this->hidden = $values['hidden']; + $this->print = $values['print']; + $this->noZoom = $values['noZoom']; + $this->noRotate = $values['noRotate']; + $this->noView = $values['noView']; + $this->readOnly = $values['readOnly']; + $this->locked = $values['locked']; + $this->toggleNoView = $values['toggleNoView']; + $this->lockedContents = $values['lockedContents']; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box']; + $this->rotation = $values['rotation'] ?? null; + $this->color = $values['color'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->strokeWidth = $values['strokeWidth']; + $this->borderStyle = $values['borderStyle']; + $this->dashArray = $values['dashArray'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign']; + $this->caption = $values['caption'] ?? null; + $this->checkStyle = $values['checkStyle'] ?? null; + $this->field = $values['field'] ?? null; + $this->fieldFamily = $values['fieldFamily']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetAnnotationBlendMode.php b/src/Types/WidgetAnnotationBlendMode.php new file mode 100644 index 0000000..66db687 --- /dev/null +++ b/src/Types/WidgetAnnotationBlendMode.php @@ -0,0 +1,23 @@ +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/WidgetAnnotationCheckStyle.php b/src/Types/WidgetAnnotationCheckStyle.php new file mode 100644 index 0000000..004e9c3 --- /dev/null +++ b/src/Types/WidgetAnnotationCheckStyle.php @@ -0,0 +1,13 @@ +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/WidgetAnnotationReply.php b/src/Types/WidgetAnnotationReply.php new file mode 100644 index 0000000..5ecf288 --- /dev/null +++ b/src/Types/WidgetAnnotationReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetAnnotationReplyType.php b/src/Types/WidgetAnnotationReplyType.php new file mode 100644 index 0000000..86f6adf --- /dev/null +++ b/src/Types/WidgetAnnotationReplyType.php @@ -0,0 +1,9 @@ + $subtype + */ + #[JsonProperty('subtype')] + public ?string $subtype; + + /** + * @var mixed $ref + */ + #[JsonProperty('ref')] + public mixed $ref; + + /** + * @var mixed $page + */ + #[JsonProperty('page')] + public mixed $page; + + /** + * @var mixed $hasAppearance + */ + #[JsonProperty('hasAppearance')] + public mixed $hasAppearance; + + /** + * @var mixed $appearanceState + */ + #[JsonProperty('appearanceState')] + public mixed $appearanceState; + + /** + * @var ?string $nm + */ + #[JsonProperty('nm')] + public ?string $nm; + + /** + * @var ?WidgetPatchRect $rect + */ + #[JsonProperty('rect')] + public ?WidgetPatchRect $rect; + + /** + * @var ?string $contents + */ + #[JsonProperty('contents')] + public ?string $contents; + + /** + * @var ?string $subject + */ + #[JsonProperty('subject')] + public ?string $subject; + + /** + * @var ?value-of $blendMode + */ + #[JsonProperty('blendMode')] + public ?string $blendMode; + + /** + * @var ?bool $invisible + */ + #[JsonProperty('invisible')] + public ?bool $invisible; + + /** + * @var ?bool $hidden + */ + #[JsonProperty('hidden')] + public ?bool $hidden; + + /** + * @var ?bool $print + */ + #[JsonProperty('print')] + public ?bool $print; + + /** + * @var ?bool $noZoom + */ + #[JsonProperty('noZoom')] + public ?bool $noZoom; + + /** + * @var ?bool $noRotate + */ + #[JsonProperty('noRotate')] + public ?bool $noRotate; + + /** + * @var ?bool $noView + */ + #[JsonProperty('noView')] + public ?bool $noView; + + /** + * @var ?bool $readOnly + */ + #[JsonProperty('readOnly')] + public ?bool $readOnly; + + /** + * @var ?bool $locked + */ + #[JsonProperty('locked')] + public ?bool $locked; + + /** + * @var ?bool $toggleNoView + */ + #[JsonProperty('toggleNoView')] + public ?bool $toggleNoView; + + /** + * @var ?bool $lockedContents + */ + #[JsonProperty('lockedContents')] + public ?bool $lockedContents; + + /** + * @var ?WidgetPatchReply $reply + */ + #[JsonProperty('reply')] + public ?WidgetPatchReply $reply; + + /** + * @var mixed $popup + */ + #[JsonProperty('popup')] + public mixed $popup; + + /** + * @var ?string $groupId + */ + #[JsonProperty('groupId')] + public ?string $groupId; + + /** + * @var mixed $author + */ + #[JsonProperty('author')] + public mixed $author; + + /** + * @var mixed $createdAt + */ + #[JsonProperty('createdAt')] + public mixed $createdAt; + + /** + * @var mixed $modifiedAt + */ + #[JsonProperty('modifiedAt')] + public mixed $modifiedAt; + + /** + * @var mixed $userId + */ + #[JsonProperty('userId')] + public mixed $userId; + + /** + * @var mixed $createdBy + */ + #[JsonProperty('createdBy')] + public mixed $createdBy; + + /** + * @var mixed $modifiedBy + */ + #[JsonProperty('modifiedBy')] + public mixed $modifiedBy; + + /** + * @var mixed $importedBy + */ + #[JsonProperty('importedBy')] + public mixed $importedBy; + + /** + * @var ( + * WidgetActionsPatch + * |PdfAnnotationActions + * |null + * ) $actions + */ + #[JsonProperty('actions'), Union(new Union(WidgetActionsPatch::class, 'null'), new Union(PdfAnnotationActions::class, 'null'), 'null')] + public WidgetActionsPatch|PdfAnnotationActions|null $actions; + + /** + * @var ?WidgetPatchBox $box + */ + #[JsonProperty('box')] + public ?WidgetPatchBox $box; + + /** + * @var ?float $rotation + */ + #[JsonProperty('rotation')] + public ?float $rotation; + + /** + * @var ?string $color + */ + #[JsonProperty('color')] + public ?string $color; + + /** + * @var ?string $interiorColor + */ + #[JsonProperty('interiorColor')] + public ?string $interiorColor; + + /** + * @var ?float $strokeWidth + */ + #[JsonProperty('strokeWidth')] + public ?float $strokeWidth; + + /** + * @var ?value-of $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @var ?string $caption + */ + #[JsonProperty('caption')] + public ?string $caption; + + /** + * @var ?value-of $checkStyle + */ + #[JsonProperty('checkStyle')] + public ?string $checkStyle; + + /** + * @var mixed $field + */ + #[JsonProperty('field')] + public mixed $field; + + /** + * @var mixed $fieldFamily + */ + #[JsonProperty('fieldFamily')] + public mixed $fieldFamily; + + /** + * @param array{ + * subtype?: ?value-of, + * ref?: mixed, + * page?: mixed, + * hasAppearance?: mixed, + * appearanceState?: mixed, + * nm?: ?string, + * rect?: ?WidgetPatchRect, + * contents?: ?string, + * subject?: ?string, + * blendMode?: ?value-of, + * invisible?: ?bool, + * hidden?: ?bool, + * print?: ?bool, + * noZoom?: ?bool, + * noRotate?: ?bool, + * noView?: ?bool, + * readOnly?: ?bool, + * locked?: ?bool, + * toggleNoView?: ?bool, + * lockedContents?: ?bool, + * reply?: ?WidgetPatchReply, + * popup?: mixed, + * groupId?: ?string, + * author?: mixed, + * createdAt?: mixed, + * modifiedAt?: mixed, + * userId?: mixed, + * createdBy?: mixed, + * modifiedBy?: mixed, + * importedBy?: mixed, + * actions?: ( + * WidgetActionsPatch + * |PdfAnnotationActions + * |null + * ), + * box?: ?WidgetPatchBox, + * rotation?: ?float, + * color?: ?string, + * interiorColor?: ?string, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * textAlign?: ?value-of, + * caption?: ?string, + * checkStyle?: ?value-of, + * field?: mixed, + * fieldFamily?: mixed, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->subtype = $values['subtype'] ?? null; + $this->ref = $values['ref'] ?? null; + $this->page = $values['page'] ?? null; + $this->hasAppearance = $values['hasAppearance'] ?? null; + $this->appearanceState = $values['appearanceState'] ?? null; + $this->nm = $values['nm'] ?? null; + $this->rect = $values['rect'] ?? null; + $this->contents = $values['contents'] ?? null; + $this->subject = $values['subject'] ?? null; + $this->blendMode = $values['blendMode'] ?? null; + $this->invisible = $values['invisible'] ?? null; + $this->hidden = $values['hidden'] ?? null; + $this->print = $values['print'] ?? null; + $this->noZoom = $values['noZoom'] ?? null; + $this->noRotate = $values['noRotate'] ?? null; + $this->noView = $values['noView'] ?? null; + $this->readOnly = $values['readOnly'] ?? null; + $this->locked = $values['locked'] ?? null; + $this->toggleNoView = $values['toggleNoView'] ?? null; + $this->lockedContents = $values['lockedContents'] ?? null; + $this->reply = $values['reply'] ?? null; + $this->popup = $values['popup'] ?? null; + $this->groupId = $values['groupId'] ?? null; + $this->author = $values['author'] ?? null; + $this->createdAt = $values['createdAt'] ?? null; + $this->modifiedAt = $values['modifiedAt'] ?? null; + $this->userId = $values['userId'] ?? null; + $this->createdBy = $values['createdBy'] ?? null; + $this->modifiedBy = $values['modifiedBy'] ?? null; + $this->importedBy = $values['importedBy'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->color = $values['color'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->checkStyle = $values['checkStyle'] ?? null; + $this->field = $values['field'] ?? null; + $this->fieldFamily = $values['fieldFamily'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetPatchBlendMode.php b/src/Types/WidgetPatchBlendMode.php new file mode 100644 index 0000000..1462e77 --- /dev/null +++ b/src/Types/WidgetPatchBlendMode.php @@ -0,0 +1,23 @@ +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/WidgetPatchCheckStyle.php b/src/Types/WidgetPatchCheckStyle.php new file mode 100644 index 0000000..77383c3 --- /dev/null +++ b/src/Types/WidgetPatchCheckStyle.php @@ -0,0 +1,13 @@ +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/WidgetPatchReply.php b/src/Types/WidgetPatchReply.php new file mode 100644 index 0000000..870c221 --- /dev/null +++ b/src/Types/WidgetPatchReply.php @@ -0,0 +1,42 @@ + $type + */ + #[JsonProperty('type')] + public ?string $type; + + /** + * @param array{ + * to: AnnotationRef, + * type?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->to = $values['to']; + $this->type = $values['type'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetPatchReplyType.php b/src/Types/WidgetPatchReplyType.php new file mode 100644 index 0000000..a4f4c42 --- /dev/null +++ b/src/Types/WidgetPatchReplyType.php @@ -0,0 +1,9 @@ + $borderStyle + */ + #[JsonProperty('borderStyle')] + public ?string $borderStyle; + + /** + * @var ?array $dashArray + */ + #[JsonProperty('dashArray'), ArrayType(['float'])] + public ?array $dashArray; + + /** + * @var ?string $fontFamily + */ + #[JsonProperty('fontFamily')] + public ?string $fontFamily; + + /** + * @var ?float $fontSize + */ + #[JsonProperty('fontSize')] + public ?float $fontSize; + + /** + * @var ?string $fontColor + */ + #[JsonProperty('fontColor')] + public ?string $fontColor; + + /** + * @var ?value-of $textAlign + */ + #[JsonProperty('textAlign')] + public ?string $textAlign; + + /** + * @var ?string $caption + */ + #[JsonProperty('caption')] + public ?string $caption; + + /** + * @var ?value-of $checkStyle + */ + #[JsonProperty('checkStyle')] + public ?string $checkStyle; + + /** + * @param array{ + * page: PageRef, + * rect?: ?WidgetPlacementRect, + * box?: ?WidgetPlacementBox, + * rotation?: ?float, + * exportValue?: ?string, + * actions?: ?WidgetActionsPatch, + * color?: ?string, + * interiorColor?: ?string, + * strokeWidth?: ?float, + * borderStyle?: ?value-of, + * dashArray?: ?array, + * fontFamily?: ?string, + * fontSize?: ?float, + * fontColor?: ?string, + * textAlign?: ?value-of, + * caption?: ?string, + * checkStyle?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->rect = $values['rect'] ?? null; + $this->box = $values['box'] ?? null; + $this->rotation = $values['rotation'] ?? null; + $this->exportValue = $values['exportValue'] ?? null; + $this->actions = $values['actions'] ?? null; + $this->color = $values['color'] ?? null; + $this->interiorColor = $values['interiorColor'] ?? null; + $this->strokeWidth = $values['strokeWidth'] ?? null; + $this->borderStyle = $values['borderStyle'] ?? null; + $this->dashArray = $values['dashArray'] ?? null; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->fontSize = $values['fontSize'] ?? null; + $this->fontColor = $values['fontColor'] ?? null; + $this->textAlign = $values['textAlign'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->checkStyle = $values['checkStyle'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetPlacementBorderStyle.php b/src/Types/WidgetPlacementBorderStyle.php new file mode 100644 index 0000000..200b5c7 --- /dev/null +++ b/src/Types/WidgetPlacementBorderStyle.php @@ -0,0 +1,12 @@ +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/WidgetPlacementCheckStyle.php b/src/Types/WidgetPlacementCheckStyle.php new file mode 100644 index 0000000..7caf612 --- /dev/null +++ b/src/Types/WidgetPlacementCheckStyle.php @@ -0,0 +1,13 @@ +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/WidgetPlacementTextAlign.php b/src/Types/WidgetPlacementTextAlign.php new file mode 100644 index 0000000..df1e0ff --- /dev/null +++ b/src/Types/WidgetPlacementTextAlign.php @@ -0,0 +1,10 @@ +