diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 0000000..2ffff18 --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,19 @@ +{ + "cliVersion": "5.91.0", + "generatorName": "fernapi/fern-php-sdk", + "generatorVersion": "2.18.1", + "generatorConfig": { + "namespace": "Cloudpdf", + "packageName": "cloudpdf/cloudpdf", + "composerJson": { + "license": "Apache-2.0", + "homepage": "https://www.cloudpdf.com" + } + }, + "originGitCommit": "232d5e0240d5673a73c9ea7c7ae9e7b937fdd5b3", + "originGitCommitIsDirty": false, + "invokedBy": "ci", + "requestedVersion": "3.0.0-alpha.1", + "ciProvider": "github", + "sdkVersion": "3.0.0-alpha.1" +} \ No newline at end of file diff --git a/.github/workflows/sdk-ci.yml b/.github/workflows/sdk-ci.yml new file mode 100644 index 0000000..a6ffe54 --- /dev/null +++ b/.github/workflows/sdk-ci.yml @@ -0,0 +1,22 @@ +name: SDK CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + build: + name: Build and validate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: composer + - run: find src -type f -name '*.php' -print0 | xargs -0 -P 4 -n1 php -l >/dev/null + - run: composer validate --no-check-publish --no-interaction diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..31a1aeb --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.idea +.php-cs-fixer.cache +.phpunit.result.cache +composer.lock +vendor/ \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0c772cd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,120 @@ +# Contributing + +Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project. + +## Getting Started + +### Prerequisites + +- PHP 8.1+ +- Composer + +### Installation + +Install the project dependencies: + +```bash +composer install +``` + +### Testing + +Run the test suite: + +```bash +composer test +``` + +Or run PHPUnit directly: + +```bash +./vendor/bin/phpunit +``` + +### Linting & Formatting + +Fix code style issues: + +```bash +./vendor/bin/php-cs-fixer fix +``` + +### Static Analysis + +Run static analysis: + +```bash +./vendor/bin/phpstan analyse +``` + +## About Generated Code + +**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated. + +### Generated Files + +The following directories contain generated code: +- `src/` - API client classes and types +- Most PHP files in the project + +### How to Customize + +If you need to customize the SDK, you have two options: + +#### Option 1: Use `.fernignore` + +For custom code that should persist across SDK regenerations: + +1. Create a `.fernignore` file in the project root +2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax) +3. Add your custom code to those files + +Files listed in `.fernignore` will not be overwritten when the SDK is regenerated. + +For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code). + +#### Option 2: Contribute to the Generator + +If you want to change how code is generated for all users of this SDK: + +1. The PHP SDK generator lives in the [Fern repository](https://github.com/fern-api/fern) +2. Generator code is located at `generators/php/` +3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md) +4. Submit a pull request with your changes to the generator + +This approach is best for: +- Bug fixes in generated code +- New features that would benefit all users +- Improvements to code generation patterns + +## Making Changes + +### Workflow + +1. Create a new branch for your changes +2. Make your modifications +3. Run tests to ensure nothing breaks: `composer test` +4. Run formatting: `./vendor/bin/php-cs-fixer fix` +5. Run static analysis: `./vendor/bin/phpstan analyse` +6. Commit your changes with a clear commit message +7. Push your branch and create a pull request + +### Commit Messages + +Write clear, descriptive commit messages that explain what changed and why. + +### Code Style + +This project uses PHP CS Fixer for automated code formatting. Run `./vendor/bin/php-cs-fixer fix` before committing to ensure your code meets the project's style guidelines. + +## Questions or Issues? + +If you have questions or run into issues: + +1. Check the [Fern documentation](https://buildwithfern.com) +2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues) +3. Open a new issue if your question hasn't been addressed + +## License + +By contributing to this project, you agree that your contributions will be licensed under the same license as the project. diff --git a/LICENSE b/LICENSE index 261eeb9..2c656ef 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,19 @@ +Copyright 2026 CloudPDF LTD + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use files in this distribution except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +----------------------------------------------------------------------- + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -174,28 +190,3 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.md b/README.md index d31e83d..ec3b22b 100644 --- a/README.md +++ b/README.md @@ -1 +1,150 @@ -# cloudpdf-sdk-php \ No newline at end of file +# Cloudpdf PHP Library + +[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Cloudpdf%2FPHP) +[![php shield](https://img.shields.io/badge/php-packagist-pink)](https://packagist.org/packages/cloudpdf/cloudpdf) + +The Cloudpdf PHP library provides convenient access to the Cloudpdf APIs from PHP. + +## Table of Contents + +- [Requirements](#requirements) +- [Installation](#installation) +- [Usage](#usage) +- [Exception Handling](#exception-handling) +- [Advanced](#advanced) + - [Custom Client](#custom-client) + - [Retries](#retries) + - [Timeouts](#timeouts) +- [Contributing](#contributing) + +## Requirements + +This SDK requires PHP ^8.1. + +## Installation + +```sh +composer require cloudpdf/cloudpdf +``` + +## Usage + +Instantiate and use the client with the following: + +```php +', +); +$client->tenants->create( + new TenantsCreateRequest([ + 'id' => 'id', + ]), +); + +``` + +## Exception Handling + +When the API returns a non-success status code (4xx or 5xx response), an exception will be thrown. + +```php +use Cloudpdf\Exceptions\CloudpdfApiException; +use Cloudpdf\Exceptions\CloudpdfException; + +try { + $response = $client->tenants->create(...); +} catch (CloudpdfApiException $e) { + echo 'API Exception occurred: ' . $e->getMessage() . "\n"; + echo 'Status Code: ' . $e->getCode() . "\n"; + echo 'Response Body: ' . $e->getBody() . "\n"; + // Optionally, rethrow the exception or handle accordingly. +} +``` + +## Advanced + +### Custom Client + +This SDK is built to work with any HTTP client that implements the [PSR-18](https://www.php-fig.org/psr/psr-18/) `ClientInterface`. +By default, if no client is provided, the SDK will use `php-http/discovery` to find an installed HTTP client. +However, you can pass your own client that adheres to `ClientInterface`: + +```php +use Cloudpdf\CloudpdfClient; + +// Pass any PSR-18 compatible HTTP client implementation. +// For example, using Guzzle: +$customClient = new \GuzzleHttp\Client([ + 'timeout' => 5.0, +]); + +$client = new CloudpdfClient(options: [ + 'client' => $customClient +]); + +// Or using Symfony HttpClient: +// $customClient = (new \Symfony\Component\HttpClient\Psr18Client()) +// ->withOptions(['timeout' => 5.0]); +// +// $client = new CloudpdfClient(options: [ +// 'client' => $customClient +// ]); +``` + +### Retries + +The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long +as the request is deemed retryable and the number of retry attempts has not grown larger than the configured +retry limit (default: 2). + +A request is deemed retryable when any of the following HTTP status codes is returned: + +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (Internal Server Error) + +The `retryStatusCodes` configuration controls which [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) status codes are retried: + +- `legacy` (default): Retries `408`, `429`, and all `>= 500` +- `recommended`: Retries `408`, `429`, `502`, `503`, `504` only (excludes `500 Internal Server Error` to avoid retrying non-idempotent failures) + +Use the `maxRetries` request option to configure this behavior. + +```php +$response = $client->tenants->create( + ..., + options: [ + 'maxRetries' => 0 // Override maxRetries at the request level + ] +); +``` + +### Timeouts + +The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior. + +```php +$response = $client->tenants->create( + ..., + options: [ + 'timeout' => 3.0 // Override timeout at the request level + ] +); +``` + +## Contributing + +While we value open-source contributions to this SDK, this library is generated programmatically. +Additions made directly to this library would have to be moved over to our generation code, +otherwise they would be overwritten upon the next generated release. Feel free to open a PR as +a proof of concept, but know that we will not be able to merge it as-is. We suggest opening +an issue first to discuss with us! + +On the other hand, contributions to the README are always very welcome! diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json new file mode 100644 index 0000000..6d84c9f --- /dev/null +++ b/cloudpdf-generation.json @@ -0,0 +1,17 @@ +{ + "language": "php", + "canonicalVersion": "3.0.0-next.1", + "sdkVersion": "3.0.0-alpha.1", + "source": { + "repository": "embedpdf/embed-pdf-viewer", + "openapi": "cloudpdf/contract/openapi.json", + "openapiSha256": "6858ce7912e9063d8fb171ade95fc473db01c5971a3af241a612dda79cc05100", + "gitCommit": "232d5e0240d5673a73c9ea7c7ae9e7b937fdd5b3", + "gitCommitIsDirty": false + }, + "fern": { + "cliVersion": "5.91.0", + "generatorName": "fernapi/fern-php-sdk", + "generatorVersion": "2.18.1" + } +} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..82b4ebf --- /dev/null +++ b/composer.json @@ -0,0 +1,47 @@ +{ + "name": "cloudpdf/cloudpdf", + "version": "3.0.0-alpha.1", + "description": "Cloudpdf PHP Library", + "keywords": [ + "cloudpdf", + "api", + "sdk" + ], + "license": "Apache-2.0", + "require": { + "php": "^8.1", + "ext-json": "*", + "psr/http-client": "^1.0", + "psr/http-client-implementation": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "php-http/discovery": "^1.0", + "php-http/multipart-stream-builder": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^12.5.22", + "friendsofphp/php-cs-fixer": "3.5.0", + "phpstan/phpstan": "^1.12", + "guzzlehttp/guzzle": "^7.4" + }, + "autoload": { + "psr-4": { + "Cloudpdf\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Cloudpdf\\Tests\\": "tests/" + } + }, + "scripts": { + "build": [ + "@php -l src", + "@php -l tests" + ], + "test": "phpunit", + "analyze": "phpstan analyze src tests --memory-limit=1G" + }, + "homepage": "https://www.cloudpdf.com" +} \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..780706b --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: max + reportUnmatchedIgnoredErrors: false + paths: + - src + - tests \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..54630a5 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,7 @@ + + + + tests + + + \ No newline at end of file diff --git a/reference.md b/reference.md new file mode 100644 index 0000000..913c0b0 --- /dev/null +++ b/reference.md @@ -0,0 +1,2300 @@ +# Reference +## Deployment +
$client->deployment->licenseStatus() -> ?DeploymentLicenseStatusResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->deployment->licenseStatus(); +``` +
+
+
+
+ + +
+
+
+ +## Doc +
$client->doc->head($docId, $request) -> ?DocHead200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->head( + 'docId', + new HeadDocRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->download($docId, $layerName, $request) -> string +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->download( + 'docId', + 'layerName', + new DownloadDocRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->manifest($docId, $layerName, $request) -> ?DocManifest200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->manifest( + 'docId', + 'layerName', + new ManifestDocRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->render($docId, $layerName, $pon, $request) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Render parameters (viewport, format) pass as flat dotted query keys, e.g. `?viewport.kind=width&viewport.width=800`; the full grammar is documented with the viewer. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->render( + 'docId', + 'layerName', + 1, + new RenderDocRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +
$client->doc->text($docId, $layerName, $pon, $request) -> ?DocText200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->text( + 'docId', + 'layerName', + 1, + new TextDocRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$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. + +
+
+
+
+ + +
+
+
+ +## Tenants +
$client->tenants->list($request) -> ?TenantsList200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tenants->list( + new ListTenantsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$cursor:** `?string` + +
+
+
+
+ + +
+
+
+ +
$client->tenants->create($request) -> ?TenantsCreate200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tenants->create( + new TenantsCreateRequest([ + 'id' => 'id', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$id:** `string` + +
+
+ +
+
+ +**$name:** `?string` + +
+
+
+
+ + +
+
+
+ +
$client->tenants->get($tenantId) -> ?TenantsGet200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tenants->get( + 'tenantId', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->tenants->delete($tenantId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Destroys the tenant and everything in its namespace — documents, layers, stored bytes, audit history. Irreversible. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tenants->delete( + 'tenantId', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+
+
+ + +
+
+
+ +## Documents +
$client->documents->list($tenantId, $request) -> ?DocumentsList200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->list( + 'tenantId', + new ListDocumentsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$cursor:** `?string` + +
+
+ +
+
+ +**$state:** `?string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->get($tenantId, $id) -> ?DocumentsGet200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->get( + 'tenantId', + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->delete($tenantId, $id) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->delete( + 'tenantId', + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->commit($tenantId, $id, $request) -> ?DocumentsCommit200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->commit( + 'tenantId', + 'id', + new DocumentsCommitRequest([ + 'sha256' => 'sha256', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+ +
+
+ +**$sha256:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->download($tenantId, $id) -> string +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->download( + 'tenantId', + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->thumbnail($tenantId, $id) -> string +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->thumbnail( + 'tenantId', + 'id', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->uploadDirect($tenantId, $id) -> ?DocumentsUploadDirect200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->uploadDirect($tenantId, $id): ?DocumentsUploadDirect200Response; +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->init($tenantId, $request) -> ?DocumentsInit200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->init( + 'tenantId', + new DocumentsInitRequest([ + 'contentLength' => 1.1, + 'contentSha256' => 'contentSha256', + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$contentLength:** `float` + +
+
+ +
+
+ +**$contentSha256:** `string` + +
+
+ +
+
+ +**$metadata:** `?array` + +
+
+ +
+
+ +**$idempotencyKey:** `?string` + +
+
+ +
+
+ +**$dedupMode:** `?string` + +
+
+ +
+
+ +**$docId:** `?string` + +
+
+ +
+
+ +**$uploadTtlSec:** `?float` + +
+
+
+
+ + +
+
+
+ +## Tokens +
$client->tokens->issue($tenantId, $request) -> ?TokensIssue200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +kind "tenant" requires the API token — authority mints only downward. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tokens->issue( + 'tenantId', + new IssueTokensRequest([ + 'body' => TokensIssueRequest::doc(new TokensIssueRequestDoc([ + 'sub' => 'sub', + 'docId' => 'docId', + 'scope' => [ + 'scope', + ], + 'expiresIn' => 1, + ])), + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$request:** `TokensIssueRequest` + +
+
+
+
+ + +
+
+
+ +
$client->tokens->revoke($tenantId, $jti, $request) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Mounted only when the deployment enables token revocation. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->tokens->revoke( + 'tenantId', + 'jti', + new TokensRevokeRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$jti:** `string` + +
+
+ +
+
+ +**$reason:** `?string` + +
+
+ +
+
+ +**$expiresAtSeconds:** `?int` + +
+
+
+
+ + +
+
+
+ +## Doc Annotations +
$client->doc->annotations->list($docId, $layerName, $pon, $request) -> ?DocAnnotationsList200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->annotations->list( + 'docId', + 'layerName', + 1, + new ListAnnotationsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +
$client->doc->annotations->create($docId, $layerName, $pon, $request) -> ?DocAnnotationsCreate200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Doc JWTs may instead carry collab scopes (annotations:create:self, …) that refine per-annotation authorship rules; the API token is exempt from both. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->annotations->create( + 'docId', + 'layerName', + 1, + new CreateAnnotationsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +
$client->doc->annotations->delete($docId, $layerName, $pon, $annotKey, $request) -> ?DocAnnotationsDelete200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->annotations->delete( + 'docId', + 'layerName', + 1, + 'annotKey', + new DeleteAnnotationsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$annotKey:** `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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->annotations->update($docId, $layerName, $pon, $annotKey, $request) -> ?DocAnnotationsUpdate200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->annotations->update( + 'docId', + 'layerName', + 1, + 'annotKey', + new UpdateAnnotationsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$annotKey:** `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. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +## Doc Forms +
$client->doc->forms->get($docId, $layerName, $request) -> ?DocFormsGet200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->get( + 'docId', + 'layerName', + new GetFormsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->forms->exportData($docId, $layerName, $request) -> string +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->exportData( + 'docId', + 'layerName', + new ExportDataFormsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$format:** `?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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->forms->importData($docId, $layerName, $request) -> ?DocFormsImportData200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->importData( + 'docId', + 'layerName', + new ImportDataFormsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +
$client->doc->forms->reset($docId, $layerName, $fieldKey, $request) -> ?DocFormsReset200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->reset( + 'docId', + 'layerName', + 'fieldKey', + new ResetFormsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$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. + +
+
+
+
+ + +
+
+
+ +
$client->doc->forms->setValue($docId, $layerName, $fieldKey, $request) -> ?DocFormsSetValue200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->forms->setValue( + 'docId', + 'layerName', + 'fieldKey', + new SetValueFormsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$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. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +## Doc Metadata +
$client->doc->metadata->get($docId, $layerName, $request) -> ?DocMetadataGet200Response +
+
+ +#### 🔌 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->delete($docId, $layerName, $request) -> ?DocPagesDelete200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->delete( + 'docId', + 'layerName', + new DeletePagesRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +
$client->doc->pages->flatten($docId, $layerName, $request) -> ?DocPagesFlatten200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->flatten( + 'docId', + 'layerName', + new FlattenPagesRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +
$client->doc->pages->move($docId, $layerName, $request) -> ?DocPagesMove200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->move( + 'docId', + 'layerName', + new MovePagesRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +
$client->doc->pages->rotate($docId, $layerName, $request) -> ?DocPagesRotate200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->rotate( + 'docId', + 'layerName', + new RotatePagesRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ +## Doc Redactions +
$client->doc->redactions->apply($docId, $layerName, $request) -> ?DocRedactionsApply200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->redactions->apply( + 'docId', + 'layerName', + new ApplyRedactionsRequest([ + 'body' => [ + 'key' => "value", + ], + ]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$request:** `array` + +
+
+
+
+ + +
+
+
+ diff --git a/src/CloudpdfClient.php b/src/CloudpdfClient.php new file mode 100644 index 0000000..3383b6e --- /dev/null +++ b/src/CloudpdfClient.php @@ -0,0 +1,95 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param string $token The token to use for authentication. + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + string $token, + ?array $options = null, + ) { + $defaultHeaders = [ + 'Authorization' => "Bearer $token", + 'X-Fern-Language' => 'PHP', + 'X-Fern-SDK-Name' => 'Cloudpdf', + 'X-Fern-SDK-Version' => '3.0.0-alpha.1', + 'User-Agent' => 'cloudpdf/cloudpdf/3.0.0-alpha.1', + ]; + + $this->options = $options ?? []; + + $this->options['headers'] = array_merge( + $defaultHeaders, + $this->options['headers'] ?? [], + ); + + $this->client = new RawClient( + options: $this->options, + ); + + $this->deployment = new DeploymentClient($this->client, $this->options); + $this->doc = new DocClient($this->client, $this->options); + $this->tenants = new TenantsClient($this->client, $this->options); + $this->documents = new DocumentsClient($this->client, $this->options); + $this->tokens = new TokensClient($this->client, $this->options); + } +} diff --git a/src/Core/Client/BaseApiRequest.php b/src/Core/Client/BaseApiRequest.php new file mode 100644 index 0000000..76c0315 --- /dev/null +++ b/src/Core/Client/BaseApiRequest.php @@ -0,0 +1,22 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + */ + public function __construct( + public readonly string $baseUrl, + public readonly string $path, + public readonly HttpMethod $method, + public readonly array $headers = [], + public readonly array $query = [], + ) { + } +} diff --git a/src/Core/Client/HttpClientBuilder.php b/src/Core/Client/HttpClientBuilder.php new file mode 100644 index 0000000..a611545 --- /dev/null +++ b/src/Core/Client/HttpClientBuilder.php @@ -0,0 +1,56 @@ + + */ + private array $responses = []; + + /** + * @var array + */ + private array $requests = []; + + /** + * @param ResponseInterface ...$responses + */ + public function append(ResponseInterface ...$responses): void + { + foreach ($responses as $response) { + $this->responses[] = $response; + } + } + + /** + * @param RequestInterface $request + * @return ResponseInterface + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + $this->requests[] = $request; + + if (empty($this->responses)) { + throw new RuntimeException('No more responses in the queue. Add responses using append().'); + } + + return array_shift($this->responses); + } + + /** + * @return ?RequestInterface + */ + public function getLastRequest(): ?RequestInterface + { + if (empty($this->requests)) { + return null; + } + return $this->requests[count($this->requests) - 1]; + } + + /** + * @return int + */ + public function getRequestCount(): int + { + return count($this->requests); + } + + /** + * Returns the number of remaining responses in the queue. + * + * @return int + */ + public function count(): int + { + return count($this->responses); + } +} diff --git a/src/Core/Client/RawClient.php b/src/Core/Client/RawClient.php new file mode 100644 index 0000000..c078601 --- /dev/null +++ b/src/Core/Client/RawClient.php @@ -0,0 +1,359 @@ + $headers + */ + private array $headers; + + /** + * @var ?(callable(): array) $getAuthHeaders + */ + private $getAuthHeaders; + + /** + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * getAuthHeaders?: callable(): array, + * } $options + */ + public function __construct( + public readonly ?array $options = null, + ) { + $this->client = HttpClientBuilder::build( + $this->options['client'] ?? null, + $this->options['maxRetries'] ?? 2, + ); + $this->requestFactory = HttpClientBuilder::requestFactory(); + $this->streamFactory = HttpClientBuilder::streamFactory(); + $this->headers = $this->options['headers'] ?? []; + $this->getAuthHeaders = $this->options['getAuthHeaders'] ?? null; + } + + /** + * @param BaseApiRequest $request + * @param ?array{ + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ResponseInterface + * @throws ClientExceptionInterface + */ + public function sendRequest( + BaseApiRequest $request, + ?array $options = null, + ): ResponseInterface { + $opts = $options ?? []; + $httpRequest = $this->buildRequest($request, $opts); + + $timeout = $opts['timeout'] ?? $this->options['timeout'] ?? null; + $maxRetries = $opts['maxRetries'] ?? null; + + return $this->client->send($httpRequest, $timeout, $maxRetries); + } + + /** + * @param BaseApiRequest $request + * @param array{ + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return RequestInterface + */ + private function buildRequest( + BaseApiRequest $request, + array $options + ): RequestInterface { + $url = $this->buildUrl($request, $options); + $headers = $this->encodeHeaders($request, $options); + + $httpRequest = $this->requestFactory->createRequest( + $request->method->name, + $url, + ); + + // Encode body and, for multipart, capture the Content-Type with boundary. + if ($request instanceof MultipartApiRequest && $request->body !== null) { + $builder = new MultipartStreamBuilder($this->streamFactory); + $request->body->addToBuilder($builder); + $httpRequest = $httpRequest->withBody($builder->build()); + $headers['Content-Type'] = "multipart/form-data; boundary={$builder->getBoundary()}"; + } else { + $body = $this->encodeRequestBody($request, $options); + if ($body !== null) { + $httpRequest = $httpRequest->withBody($body); + } + } + + foreach ($headers as $name => $value) { + $httpRequest = $httpRequest->withHeader($name, $value); + } + + return $httpRequest; + } + + /** + * @param BaseApiRequest $request + * @param array{ + * headers?: array, + * } $options + * @return array + */ + private function encodeHeaders( + BaseApiRequest $request, + array $options, + ): array { + $authHeaders = $this->getAuthHeaders !== null ? ($this->getAuthHeaders)() : []; + return match (get_class($request)) { + JsonApiRequest::class => array_merge( + [ + "Content-Type" => "application/json", + "Accept" => "*/*", + ], + $this->headers, + $authHeaders, + $request->headers, + $options['headers'] ?? [], + ), + UrlEncodedApiRequest::class => array_merge( + [ + "Content-Type" => "application/x-www-form-urlencoded", + "Accept" => "*/*", + ], + $this->headers, + $authHeaders, + $request->headers, + $options['headers'] ?? [], + ), + MultipartApiRequest::class => array_merge( + $this->headers, + $authHeaders, + $request->headers, + $options['headers'] ?? [], + ), + default => throw new InvalidArgumentException('Unsupported request type: ' . get_class($request)), + }; + } + + /** + * @param BaseApiRequest $request + * @param array{ + * bodyProperties?: array, + * } $options + * @return ?StreamInterface + */ + private function encodeRequestBody( + BaseApiRequest $request, + array $options, + ): ?StreamInterface { + if ($request instanceof JsonApiRequest) { + return $request->body === null ? null : $this->streamFactory->createStream( + JsonEncoder::encode( + $this->buildJsonBody( + $request->body, + $options, + ), + ) + ); + } + + if ($request instanceof UrlEncodedApiRequest) { + if ($request->body === null) { + return null; + } + $body = $this->buildJsonBody($request->body, $options); + if ($body instanceof JsonSerializable) { + $body = $body->jsonSerialize(); + } + if (is_object($body)) { + $body = (array)$body; + } + if (!is_array($body)) { + throw new InvalidArgumentException('URL-encoded request bodies must serialize to an array.'); + } + return $this->streamFactory->createStream(http_build_query($body)); + } + + if ($request instanceof MultipartApiRequest) { + return null; + } + + throw new InvalidArgumentException('Unsupported request type: ' . get_class($request)); + } + + /** + * @param mixed $body + * @param array{ + * bodyProperties?: array, + * } $options + * @return mixed + */ + private function buildJsonBody( + mixed $body, + array $options, + ): mixed { + $overrideProperties = $options['bodyProperties'] ?? []; + if (is_array($body) && (empty($body) || self::isSequential($body))) { + return array_merge($body, $overrideProperties); + } + + if ($body instanceof JsonSerializable) { + $result = $body->jsonSerialize(); + } else { + $result = $body; + } + if (is_array($result)) { + $result = array_merge($result, $overrideProperties); + if (empty($result)) { + // force to be serialized as {} instead of [] + return (object)($result); + } + } + + return $result; + } + + /** + * Percent-encodes a value for use inside a single URL path segment. Encoding happens here, + * where the value is still separate from the path template, so that a value containing "/" + * or ".." cannot change which endpoint the request resolves to. + */ + public static function encodePathParam(mixed $value): string + { + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + if (is_null($value)) { + return ''; + } + if (is_scalar($value)) { + return rawurlencode((string)$value); + } + if (is_object($value) && method_exists($value, '__toString')) { + return rawurlencode((string)$value); + } + return rawurlencode(JsonEncoder::encode($value)); + } + + /** + * @param BaseApiRequest $request + * @param array{ + * queryParameters?: array, + * } $options + * @return string + */ + private function buildUrl( + BaseApiRequest $request, + array $options, + ): string { + $baseUrl = $request->baseUrl; + $trimmedBaseUrl = rtrim($baseUrl, '/'); + $trimmedBasePath = ltrim($request->path, '/'); + $url = "{$trimmedBaseUrl}/{$trimmedBasePath}"; + $query = array_merge( + $request->query, + $options['queryParameters'] ?? [], + ); + if (!empty($query)) { + $url .= '?' . $this->encodeQuery($query); + } + return $url; + } + + /** + * @param array $query + * @return string + */ + private function encodeQuery(array $query): string + { + $parts = []; + foreach ($query as $key => $value) { + if (is_array($value)) { + foreach ($value as $item) { + $parts[] = urlencode($key) . '=' . $this->encodeQueryValue($item); + } + } else { + $parts[] = urlencode($key) . '=' . $this->encodeQueryValue($value); + } + } + return implode('&', $parts); + } + + private function encodeQueryValue(mixed $value): string + { + if (is_string($value)) { + return urlencode($value); + } + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + if (is_scalar($value)) { + return urlencode((string)$value); + } + if (is_null($value)) { + return 'null'; + } + // Unreachable, but included for a best effort. + return urlencode(JsonEncoder::encode($value)); + } + + /** + * Check if an array is sequential, not associative. + * @param mixed[] $arr + * @return bool + */ + private static function isSequential(array $arr): bool + { + if (empty($arr)) { + return false; + } + $length = count($arr); + $keys = array_keys($arr); + for ($i = 0; $i < $length; $i++) { + if ($keys[$i] !== $i) { + return false; + } + } + return true; + } +} diff --git a/src/Core/Client/RetryDecoratingClient.php b/src/Core/Client/RetryDecoratingClient.php new file mode 100644 index 0000000..0bdbc5b --- /dev/null +++ b/src/Core/Client/RetryDecoratingClient.php @@ -0,0 +1,241 @@ +client = $client; + $this->maxRetries = $maxRetries; + $this->baseDelay = $baseDelay; + $this->sleepFunction = $sleepFunction ?? 'usleep'; + } + + /** + * @param RequestInterface $request + * @return ResponseInterface + * @throws ClientExceptionInterface + */ + public function sendRequest(RequestInterface $request): ResponseInterface + { + return $this->send($request); + } + + /** + * Sends a request with optional per-request timeout and retry overrides. + * + * When a Guzzle or Symfony PSR-18 client is detected, the timeout is + * forwarded via the client's native API. For other PSR-18 clients the + * timeout value is silently ignored. + * + * @param RequestInterface $request + * @param ?float $timeout Timeout in seconds, or null to use the client default. + * @param ?int $maxRetries Maximum retry attempts, or null to use the client default. + * @return ResponseInterface + * @throws ClientExceptionInterface + */ + public function send( + RequestInterface $request, + ?float $timeout = null, + ?int $maxRetries = null, + ): ResponseInterface { + $maxRetries = $maxRetries ?? $this->maxRetries; + $retryAttempt = 0; + $lastResponse = null; + + while (true) { + try { + $lastResponse = $this->doSend($request, $timeout); + if (!$this->shouldRetry($retryAttempt, $maxRetries, $lastResponse)) { + return $lastResponse; + } + } catch (ClientExceptionInterface $e) { + if ($retryAttempt >= $maxRetries) { + throw $e; + } + } + + $retryAttempt++; + $delay = $this->getRetryDelay($retryAttempt, $lastResponse); + ($this->sleepFunction)($delay * 1000); // Convert milliseconds to microseconds + + // Rewind the request body so retries don't send an empty body. + $request->getBody()->rewind(); + } + } + + /** + * Dispatches the request to the underlying client, forwarding the timeout + * option to Guzzle or Symfony when available. + * + * @param RequestInterface $request + * @param ?float $timeout + * @return ResponseInterface + * @throws ClientExceptionInterface + */ + private function doSend(RequestInterface $request, ?float $timeout): ResponseInterface + { + static $warned = false; + + if ($timeout === null) { + return $this->client->sendRequest($request); + } + + if (interface_exists('GuzzleHttp\ClientInterface') + && $this->client instanceof \GuzzleHttp\ClientInterface + ) { + return $this->client->send($request, ['timeout' => $timeout]); + } + if (class_exists('Symfony\Component\HttpClient\Psr18Client') + && $this->client instanceof \Symfony\Component\HttpClient\Psr18Client + ) { + /** @var ClientInterface $clientWithTimeout */ + $clientWithTimeout = $this->client->withOptions(['timeout' => $timeout]); + return $clientWithTimeout->sendRequest($request); + } + + if ($warned) { + return $this->client->sendRequest($request); + } + $warned = true; + trigger_error( + 'Timeout option is not supported for the current PSR-18 client (' + . get_class($this->client) + . '). Use Guzzle or Symfony HttpClient for timeout support.', + E_USER_WARNING, + ); + return $this->client->sendRequest($request); + } + + /** + * @param int $retryAttempt + * @param int $maxRetries + * @param ?ResponseInterface $response + * @return bool + */ + private function shouldRetry( + int $retryAttempt, + int $maxRetries, + ?ResponseInterface $response = null, + ): bool { + if ($retryAttempt >= $maxRetries) { + return false; + } + + if ($response !== null) { + return $response->getStatusCode() >= 500 || + in_array($response->getStatusCode(), self::RETRY_STATUS_CODES); + } + + return false; + } + + /** + * Calculate the retry delay based on response headers or exponential backoff. + * + * @param int $retryAttempt + * @param ?ResponseInterface $response + * @return int milliseconds + */ + private function getRetryDelay(int $retryAttempt, ?ResponseInterface $response): int + { + if ($response !== null) { + // Check Retry-After header + $retryAfter = $response->getHeaderLine('Retry-After'); + if ($retryAfter !== '') { + // Try parsing as integer (seconds) + if (is_numeric($retryAfter)) { + $retryAfterSeconds = (int)$retryAfter; + if ($retryAfterSeconds > 0) { + return min($retryAfterSeconds * 1000, self::MAX_RETRY_DELAY); + } + } + + // Try parsing as HTTP date + $retryAfterDate = strtotime($retryAfter); + if ($retryAfterDate !== false) { + $delay = ($retryAfterDate - time()) * 1000; + if ($delay > 0) { + return min(max($delay, 0), self::MAX_RETRY_DELAY); + } + } + } + + // Check X-RateLimit-Reset header + $rateLimitReset = $response->getHeaderLine('X-RateLimit-Reset'); + if ($rateLimitReset !== '' && is_numeric($rateLimitReset)) { + $resetTime = (int)$rateLimitReset; + $delay = ($resetTime * 1000) - (int)(microtime(true) * 1000); + if ($delay > 0) { + return $this->addPositiveJitter(min($delay, self::MAX_RETRY_DELAY)); + } + } + } + + // Fall back to exponential backoff with symmetric jitter + return $this->addSymmetricJitter( + min($this->exponentialDelay($retryAttempt), self::MAX_RETRY_DELAY) + ); + } + + /** + * Add positive jitter (0% to +20%) to the delay. + * + * @param int $delay + * @return int + */ + private function addPositiveJitter(int $delay): int + { + $jitterMultiplier = 1 + (mt_rand() / mt_getrandmax()) * self::JITTER_FACTOR; + return (int)($delay * $jitterMultiplier); + } + + /** + * Add symmetric jitter (-10% to +10%) to the delay. + * + * @param int $delay + * @return int + */ + private function addSymmetricJitter(int $delay): int + { + $jitterMultiplier = 1 + ((mt_rand() / mt_getrandmax()) - 0.5) * self::JITTER_FACTOR; + return (int)($delay * $jitterMultiplier); + } + + /** + * Default exponential backoff delay function. + * + * @return int milliseconds. + */ + private function exponentialDelay(int $retryAttempt): int + { + return 2 ** ($retryAttempt - 1) * $this->baseDelay; + } +} diff --git a/src/Core/Client/UrlEncodedApiRequest.php b/src/Core/Client/UrlEncodedApiRequest.php new file mode 100644 index 0000000..d29a93b --- /dev/null +++ b/src/Core/Client/UrlEncodedApiRequest.php @@ -0,0 +1,25 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + * @param mixed|null $body The form-urlencoded request body (optional) + */ + public function __construct( + string $baseUrl, + string $path, + HttpMethod $method, + array $headers = [], + array $query = [], + public readonly mixed $body = null + ) { + parent::__construct($baseUrl, $path, $method, $headers, $query); + } +} diff --git a/src/Core/Json/JsonApiRequest.php b/src/Core/Json/JsonApiRequest.php new file mode 100644 index 0000000..4488de2 --- /dev/null +++ b/src/Core/Json/JsonApiRequest.php @@ -0,0 +1,28 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + * @param mixed|null $body The JSON request body (optional) + */ + public function __construct( + string $baseUrl, + string $path, + HttpMethod $method, + array $headers = [], + array $query = [], + public readonly mixed $body = null + ) { + parent::__construct($baseUrl, $path, $method, $headers, $query); + } +} diff --git a/src/Core/Json/JsonDecoder.php b/src/Core/Json/JsonDecoder.php new file mode 100644 index 0000000..d291871 --- /dev/null +++ b/src/Core/Json/JsonDecoder.php @@ -0,0 +1,161 @@ + $type The type definition for deserialization. + * @return mixed[]|array The deserialized array. + * @throws JsonException If the decoded value is not an array. + */ + public static function decodeArray(string $json, array $type): array + { + $decoded = self::decode($json); + if (!is_array($decoded)) { + throw new JsonException("Unexpected non-array json value: $json"); + } + return JsonDeserializer::deserializeArray($decoded, $type); + } + + /** + * Decodes a JSON string and deserializes it based on the provided union type definition. + * + * @param string $json The JSON string to decode. + * @param Union $union The union type definition for deserialization. + * @return mixed The deserialized value. + * @throws JsonException If the deserialization for all types in the union fails. + */ + public static function decodeUnion(string $json, Union $union): mixed + { + $decoded = self::decode($json); + return JsonDeserializer::deserializeUnion($decoded, $union); + } + /** + * Decodes a JSON string and returns a mixed. + * + * @param string $json The JSON string to decode. + * @return mixed The decoded mixed. + * @throws JsonException If the decoded value is not an mixed. + */ + public static function decodeMixed(string $json): mixed + { + return self::decode($json); + } + + /** + * Decodes a JSON string into a PHP value. + * + * @param string $json The JSON string to decode. + * @return mixed The decoded value. + * @throws JsonException If an error occurs during JSON decoding. + */ + public static function decode(string $json): mixed + { + return json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR); + } +} diff --git a/src/Core/Json/JsonDeserializer.php b/src/Core/Json/JsonDeserializer.php new file mode 100644 index 0000000..2340f85 --- /dev/null +++ b/src/Core/Json/JsonDeserializer.php @@ -0,0 +1,218 @@ + $data The array to be deserialized. + * @param array $type The type definition from the annotation. + * @return array The deserialized array. + * @throws JsonException If deserialization fails. + */ + public static function deserializeArray(array $data, array $type): array + { + return Utils::isMapType($type) + ? self::deserializeMap($data, $type) + : self::deserializeList($data, $type); + } + + /** + * Deserializes a value based on its type definition. + * + * @param mixed $data The data to deserialize. + * @param mixed $type The type definition. + * @return mixed The deserialized value. + * @throws JsonException If deserialization fails. + */ + private static function deserializeValue(mixed $data, mixed $type): mixed + { + if ($type instanceof Union) { + return self::deserializeUnion($data, $type); + } + + if (is_array($type)) { + return self::deserializeArray((array)$data, $type); + } + + if (gettype($type) !== "string") { + throw new JsonException("Unexpected non-string type."); + } + + return self::deserializeSingleValue($data, $type); + } + + /** + * Deserializes a value based on the possible types in a union type definition. + * + * @param mixed $data The data to deserialize. + * @param Union $type The union type definition. + * @return mixed The deserialized value. + * @throws JsonException If none of the union types can successfully deserialize the value. + */ + public static function deserializeUnion(mixed $data, Union $type): mixed + { + foreach ($type->types as $unionType) { + try { + return self::deserializeValue($data, $unionType); + } catch (\Throwable) { + // Catching Throwable instead of Exception to handle TypeError + // that occurs when assigning null to non-nullable typed properties + continue; + } + } + $readableType = Utils::getReadableType($data); + throw new JsonException( + "Cannot deserialize value of type $readableType with any of the union types: $type" + ); + } + + /** + * Deserializes a single value based on its expected type. + * + * @param mixed $data The data to deserialize. + * @param string $type The expected type. + * @return mixed The deserialized value. + * @throws JsonException If deserialization fails. + */ + private static function deserializeSingleValue(mixed $data, string $type): mixed + { + if ($type === 'null' && $data === null) { + return null; + } + + if ($type === 'date' && is_string($data)) { + return self::deserializeDate($data); + } + + if ($type === 'datetime' && is_string($data)) { + return self::deserializeDateTime($data); + } + + if ($type === 'mixed') { + return $data; + } + + if (class_exists($type) && is_array($data)) { + /** @var array $data */ + return self::deserializeObject($data, $type); + } + + // Handle floats as a special case since gettype($data) returns "double" for float values in PHP, and because + // floats make come through from json_decoded as integers + if ($type === 'float' && (is_numeric($data))) { + return (float) $data; + } + + // Handle bools as a special case since gettype($data) returns "boolean" for bool values in PHP. + if ($type === 'bool' && is_bool($data)) { + return $data; + } + + if (gettype($data) === $type) { + return $data; + } + + throw new JsonException("Unable to deserialize value of type '" . gettype($data) . "' as '$type'."); + } + + /** + * Deserializes an array into an object of the given type. + * + * @param array $data The data to deserialize. + * @param string $type The class name of the object to deserialize into. + * + * @return object The deserialized object. + * + * @throws JsonException If the type does not implement JsonSerializableType. + */ + public static function deserializeObject(array $data, string $type): object + { + if (!is_subclass_of($type, JsonSerializableType::class)) { + throw new JsonException("$type is not a subclass of JsonSerializableType."); + } + return $type::jsonDeserialize($data); + } + + /** + * Deserializes a map (associative array) with defined key and value types. + * + * @param array $data The associative array to deserialize. + * @param array $type The type definition for the map. + * @return array The deserialized map. + * @throws JsonException If deserialization fails. + */ + private static function deserializeMap(array $data, array $type): array + { + $keyType = array_key_first($type); + if ($keyType === null) { + throw new JsonException("Unexpected no key in ArrayType."); + } + $keyType = (string) $keyType; + $valueType = $type[$keyType]; + /** @var array $result */ + $result = []; + + foreach ($data as $key => $item) { + $key = (string) Utils::castKey($key, $keyType); + $result[$key] = self::deserializeValue($item, $valueType); + } + + return $result; + } + + /** + * Deserializes a list (indexed array) with a defined value type. + * + * @param array $data The list to deserialize. + * @param array $type The type definition for the list. + * @return array The deserialized list. + * @throws JsonException If deserialization fails. + */ + private static function deserializeList(array $data, array $type): array + { + $valueType = $type[0]; + /** @var array */ + return array_map(fn ($item) => self::deserializeValue($item, $valueType), $data); + } +} diff --git a/src/Core/Json/JsonEncoder.php b/src/Core/Json/JsonEncoder.php new file mode 100644 index 0000000..34ff9cf --- /dev/null +++ b/src/Core/Json/JsonEncoder.php @@ -0,0 +1,20 @@ + Extra properties from JSON that don't map to class properties */ + private array $__additionalProperties = []; + + /** @var array Properties that have been explicitly set via setter methods */ + private array $__explicitlySetProperties = []; + + /** + * Serializes the object to a JSON string. + * + * @return string JSON-encoded string representation of the object. + * @throws Exception If encoding fails. + */ + public function toJson(): string + { + $serializedObject = $this->jsonSerialize(); + $encoded = JsonEncoder::encode(empty($serializedObject) ? new \stdClass() : $serializedObject); + if (!$encoded) { + throw new Exception("Could not encode type"); + } + return $encoded; + } + + /** + * Serializes the object to an array. + * + * @return mixed[] Array representation of the object. + * @throws JsonException If serialization fails. + */ + public function jsonSerialize(): array + { + $result = []; + $reflectionClass = new \ReflectionClass($this); + foreach ($reflectionClass->getProperties() as $property) { + $jsonKey = self::getJsonKey($property); + if ($jsonKey === null) { + continue; + } + $value = $property->getValue($this); + + // Handle DateTime properties + $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; + if ($dateTypeAttr && $value instanceof DateTime) { + $dateType = $dateTypeAttr->newInstance()->type; + $value = ($dateType === Date::TYPE_DATE) + ? JsonSerializer::serializeDate($value) + : JsonSerializer::serializeDateTime($value); + } + + // Handle Union annotations + $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; + if ($unionTypeAttr) { + $unionType = $unionTypeAttr->newInstance(); + $value = JsonSerializer::serializeUnion($value, $unionType); + } + + // Handle arrays with type annotations + $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; + if ($arrayTypeAttr && is_array($value)) { + $arrayType = $arrayTypeAttr->newInstance()->type; + $value = JsonSerializer::serializeArray($value, $arrayType); + } + + // Handle object (skip stdClass since it's already serialized, e.g. from union processing) + if (is_object($value) && !($value instanceof \stdClass)) { + $value = JsonSerializer::serializeObject($value); + } + + // Include the value if it's not null, OR if it was explicitly set (even to null) + if ($value !== null || array_key_exists($property->getName(), $this->__explicitlySetProperties)) { + $result[$jsonKey] = $value; + } + } + return $result; + } + + /** + * Deserializes a JSON string into an instance of the calling class. + * + * @param string $json JSON string to deserialize. + * @return static Deserialized object. + * @throws JsonException If decoding fails or the result is not an array. + * @throws Exception If deserialization fails. + */ + public static function fromJson(string $json): static + { + $decodedJson = JsonDecoder::decode($json); + if (!is_array($decodedJson)) { + throw new JsonException("Unexpected non-array decoded type: " . gettype($decodedJson)); + } + /** @var array $decodedJson */ + // static:: (not self::) so subclasses' typed jsonDeserialize overrides are dispatched via late static binding. + return static::jsonDeserialize($decodedJson); + } + + /** + * Deserializes an array into an instance of the calling class. + * + * @param array $data Array data to deserialize. + * @return static Deserialized object. + * @throws JsonException If deserialization fails. + */ + public static function jsonDeserialize(array $data): static + { + $reflectionClass = new \ReflectionClass(static::class); + $constructor = $reflectionClass->getConstructor(); + if ($constructor === null) { + throw new JsonException("No constructor found."); + } + + $args = []; + $properties = []; + $additionalProperties = []; + foreach ($reflectionClass->getProperties() as $property) { + $jsonKey = self::getJsonKey($property) ?? $property->getName(); + $properties[$jsonKey] = $property; + } + + foreach ($data as $jsonKey => $value) { + if (!isset($properties[$jsonKey])) { + // This JSON key doesn't map to any class property - add it to additionalProperties + $additionalProperties[$jsonKey] = $value; + continue; + } + + $property = $properties[$jsonKey]; + + // Handle Date annotation + $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; + if ($dateTypeAttr) { + $dateType = $dateTypeAttr->newInstance()->type; + if (!is_string($value)) { + throw new JsonException("Unexpected non-string type for date."); + } + $value = ($dateType === Date::TYPE_DATE) + ? JsonDeserializer::deserializeDate($value) + : JsonDeserializer::deserializeDateTime($value); + } + + // Handle Array annotation + $arrayTypeAttr = $property->getAttributes(ArrayType::class)[0] ?? null; + if (is_array($value) && $arrayTypeAttr) { + $arrayType = $arrayTypeAttr->newInstance()->type; + $value = JsonDeserializer::deserializeArray($value, $arrayType); + } + + // Handle Union annotations + $unionTypeAttr = $property->getAttributes(Union::class)[0] ?? null; + if ($unionTypeAttr) { + $unionType = $unionTypeAttr->newInstance(); + $value = JsonDeserializer::deserializeUnion($value, $unionType); + } + + // Handle object + $type = $property->getType(); + if (is_array($value) && $type instanceof ReflectionNamedType && !$type->isBuiltin()) { + /** @var array $arrayValue */ + $arrayValue = $value; + $value = JsonDeserializer::deserializeObject($arrayValue, $type->getName()); + } + + $args[$property->getName()] = $value; + } + + // Fill in any missing properties with defaults + foreach ($properties as $property) { + if (!isset($args[$property->getName()])) { + $args[$property->getName()] = $property->hasDefaultValue() ? $property->getDefaultValue() : null; + } + } + + // @phpstan-ignore-next-line + $result = new static($args); + $result->__additionalProperties = $additionalProperties; + return $result; + } + + /** + * Get properties from JSON that weren't mapped to class fields + * @return array + */ + public function getAdditionalProperties(): array + { + return $this->__additionalProperties; + } + + /** + * Mark a property as explicitly set. + * This ensures the property will be included in JSON serialization even if null. + * + * @param string $propertyName The name of the property to mark as explicitly set. + */ + protected function _setField(string $propertyName): void + { + $this->__explicitlySetProperties[$propertyName] = true; + } + + /** + * Retrieves the JSON key associated with a property. + * + * @param ReflectionProperty $property The reflection property. + * @return ?string The JSON key, or null if not available. + */ + private static function getJsonKey(ReflectionProperty $property): ?string + { + $jsonPropertyAttr = $property->getAttributes(JsonProperty::class)[0] ?? null; + return $jsonPropertyAttr?->newInstance()?->name; + } +} diff --git a/src/Core/Json/JsonSerializer.php b/src/Core/Json/JsonSerializer.php new file mode 100644 index 0000000..58ec2f2 --- /dev/null +++ b/src/Core/Json/JsonSerializer.php @@ -0,0 +1,212 @@ +format(Constant::DateFormat); + } + + /** + * Serializes a DateTime object into a string using the date-time format. + * Normalizes UTC times to use 'Z' suffix instead of '+00:00'. + * + * @param DateTime $date The DateTime object to serialize. + * @return string The serialized date-time string. + */ + public static function serializeDateTime(DateTime $date): string + { + $formatted = $date->format(Constant::DateTimeFormat); + if (str_ends_with($formatted, '+00:00')) { + return substr($formatted, 0, -6) . 'Z'; + } + return $formatted; + } + + /** + * Serializes an array based on type annotations (either a list or map). + * + * @param array $data The array to be serialized. + * @param array $type The type definition from the annotation. + * @return array|\stdClass The serialized array, or stdClass if empty map. + * @throws JsonException If serialization fails. + */ + public static function serializeArray(array $data, array $type): array|\stdClass + { + return Utils::isMapType($type) + ? self::serializeMap($data, $type) + : self::serializeList($data, $type); + } + + /** + * Serializes a value based on its type definition. + * + * @param mixed $data The value to serialize. + * @param mixed $type The type definition. + * @return mixed The serialized value. + * @throws JsonException If serialization fails. + */ + private static function serializeValue(mixed $data, mixed $type): mixed + { + if ($type instanceof Union) { + return self::serializeUnion($data, $type); + } + + if (is_array($type)) { + return self::serializeArray((array)$data, $type); + } + + if (gettype($type) !== "string") { + throw new JsonException("Unexpected non-string type."); + } + + return self::serializeSingleValue($data, $type); + } + + /** + * Serializes a value for a union type definition. + * + * @param mixed $data The value to serialize. + * @param Union $unionType The union type definition. + * @return mixed The serialized value. + * @throws JsonException If serialization fails for all union types. + */ + public static function serializeUnion(mixed $data, Union $unionType): mixed + { + foreach ($unionType->types as $type) { + try { + return self::serializeValue($data, $type); + } catch (Exception) { + // Try the next type in the union + continue; + } + } + $readableType = Utils::getReadableType($data); + throw new JsonException( + "Cannot serialize value of type $readableType with any of the union types: $unionType" + ); + } + + /** + * Serializes a single value based on its type. + * + * @param mixed $data The value to serialize. + * @param string $type The expected type. + * @return mixed The serialized value. + * @throws JsonException If serialization fails. + */ + private static function serializeSingleValue(mixed $data, string $type): mixed + { + if ($type === 'null' && $data === null) { + return null; + } + + if (($type === 'date' || $type === 'datetime') && $data instanceof DateTime) { + return $type === 'date' ? self::serializeDate($data) : self::serializeDateTime($data); + } + + if ($type === 'mixed') { + return $data; + } + + if (class_exists($type) && $data instanceof $type) { + return self::serializeObject($data); + } + + // Handle floats as a special case since gettype($data) returns "double" for float values in PHP. + if ($type === 'float' && is_float($data)) { + return $data; + } + + // Handle bools as a special case since gettype($data) returns "boolean" for bool values in PHP. + if ($type === 'bool' && is_bool($data)) { + return $data; + } + + if (gettype($data) === $type) { + return $data; + } + + throw new JsonException("Unable to serialize value of type '" . gettype($data) . "' as '$type'."); + } + + /** + * Serializes an object to a JSON-serializable format. + * + * @param object $data The object to serialize. + * @return mixed The serialized data. + * @throws JsonException If the object does not implement JsonSerializable. + */ + public static function serializeObject(object $data): mixed + { + if (!is_subclass_of($data, JsonSerializable::class)) { + $type = get_class($data); + throw new JsonException("Class $type must implement JsonSerializable."); + } + $result = $data->jsonSerialize(); + if (is_array($result) && empty($result)) { + return new \stdClass(); + } + return $result; + } + + /** + * Serializes a map (associative array) with defined key and value types. + * + * @param array $data The associative array to serialize. + * @param array $type The type definition for the map. + * @return array|\stdClass The serialized map, or stdClass if empty. + * @throws JsonException If serialization fails. + */ + private static function serializeMap(array $data, array $type): array|\stdClass + { + if (empty($data)) { + return new \stdClass(); + } + $keyType = array_key_first($type); + if ($keyType === null) { + throw new JsonException("Unexpected no key in ArrayType."); + } + $keyType = (string) $keyType; + $valueType = $type[$keyType]; + /** @var array $result */ + $result = []; + + foreach ($data as $key => $item) { + $key = (string) Utils::castKey($key, $keyType); + $result[$key] = self::serializeValue($item, $valueType); + } + + return $result; + } + + /** + * Serializes a list (indexed array) where only the value type is defined. + * + * @param array $data The list to serialize. + * @param array $type The type definition for the list. + * @return array The serialized list. + * @throws JsonException If serialization fails. + */ + private static function serializeList(array $data, array $type): array + { + $valueType = $type[0]; + /** @var array */ + return array_map(fn ($item) => self::serializeValue($item, $valueType), $data); + } +} diff --git a/src/Core/Json/Utils.php b/src/Core/Json/Utils.php new file mode 100644 index 0000000..3daf656 --- /dev/null +++ b/src/Core/Json/Utils.php @@ -0,0 +1,62 @@ + $type The type definition from the annotation. + * @return bool True if the type is a map, false if it's a list. + */ + public static function isMapType(array $type): bool + { + return count($type) === 1 && !array_is_list($type); + } + + /** + * Casts the key to the appropriate type based on the key type. + * + * @param mixed $key The key to be cast. + * @param string $keyType The type to cast the key to ('string', 'integer', 'float'). + * @return int|string The casted key. + * @throws JsonException + */ + public static function castKey(mixed $key, string $keyType): int|string + { + if (!is_scalar($key)) { + throw new JsonException("Key must be a scalar type."); + } + return match ($keyType) { + 'integer' => (int)$key, + // PHP arrays don't support float keys; truncate to int + 'float' => (int)$key, + 'string' => (string)$key, + default => is_int($key) ? $key : (string)$key, + }; + } + + /** + * Returns a human-readable representation of the input's type. + * + * @param mixed $input The input value to determine the type of. + * @return string A readable description of the input type. + */ + public static function getReadableType(mixed $input): string + { + if (is_object($input)) { + return get_class($input); + } elseif (is_array($input)) { + return 'array(' . count($input) . ' items)'; + } elseif (is_null($input)) { + return 'null'; + } else { + return gettype($input); + } + } +} diff --git a/src/Core/Multipart/MultipartApiRequest.php b/src/Core/Multipart/MultipartApiRequest.php new file mode 100644 index 0000000..7cae3d5 --- /dev/null +++ b/src/Core/Multipart/MultipartApiRequest.php @@ -0,0 +1,28 @@ + $headers Additional headers for the request (optional) + * @param array $query Query parameters for the request (optional) + * @param ?MultipartFormData $body The multipart form data for the request (optional) + */ + public function __construct( + string $baseUrl, + string $path, + HttpMethod $method, + array $headers = [], + array $query = [], + public readonly ?MultipartFormData $body = null + ) { + parent::__construct($baseUrl, $path, $method, $headers, $query); + } +} diff --git a/src/Core/Multipart/MultipartFormData.php b/src/Core/Multipart/MultipartFormData.php new file mode 100644 index 0000000..cb695a4 --- /dev/null +++ b/src/Core/Multipart/MultipartFormData.php @@ -0,0 +1,58 @@ + + */ + private array $parts = []; + + /** + * Adds a new part to the multipart form data. + * + * @param string $name + * @param string|int|bool|float|StreamInterface $value + * @param ?string $contentType + */ + public function add( + string $name, + string|int|bool|float|StreamInterface $value, + ?string $contentType = null, + ): void { + $headers = $contentType !== null ? ['Content-Type' => $contentType] : null; + $this->addPart( + new MultipartFormDataPart( + name: $name, + value: $value, + headers: $headers, + ) + ); + } + + /** + * Adds a new part to the multipart form data. + * + * @param MultipartFormDataPart $part + */ + public function addPart(MultipartFormDataPart $part): void + { + $this->parts[] = $part; + } + + /** + * Adds all parts to a MultipartStreamBuilder. + * + * @param MultipartStreamBuilder $builder + */ + public function addToBuilder(MultipartStreamBuilder $builder): void + { + foreach ($this->parts as $part) { + $part->addToBuilder($builder); + } + } +} diff --git a/src/Core/Multipart/MultipartFormDataPart.php b/src/Core/Multipart/MultipartFormDataPart.php new file mode 100644 index 0000000..95f4a47 --- /dev/null +++ b/src/Core/Multipart/MultipartFormDataPart.php @@ -0,0 +1,62 @@ + + */ + private ?array $headers; + + /** + * @param string $name + * @param string|bool|float|int|StreamInterface $value + * @param ?string $filename + * @param ?array $headers + */ + public function __construct( + string $name, + string|bool|float|int|StreamInterface $value, + ?string $filename = null, + ?array $headers = null + ) { + $this->name = $name; + $this->contents = $value instanceof StreamInterface ? $value : (string)$value; + $this->filename = $filename; + $this->headers = $headers; + } + + /** + * Adds this part to a MultipartStreamBuilder. + * + * @param MultipartStreamBuilder $builder + */ + public function addToBuilder(MultipartStreamBuilder $builder): void + { + $options = array_filter([ + 'filename' => $this->filename, + 'headers' => $this->headers, + ], fn ($value) => $value !== null); + + $builder->addResource($this->name, $this->contents, $options); + } +} diff --git a/src/Core/Types/ArrayType.php b/src/Core/Types/ArrayType.php new file mode 100644 index 0000000..a1dd0a2 --- /dev/null +++ b/src/Core/Types/ArrayType.php @@ -0,0 +1,16 @@ + 'valueType'] for maps, or ['valueType'] for lists + */ + public function __construct(public array $type) + { + } +} diff --git a/src/Core/Types/Constant.php b/src/Core/Types/Constant.php new file mode 100644 index 0000000..757518c --- /dev/null +++ b/src/Core/Types/Constant.php @@ -0,0 +1,12 @@ +> The types allowed for this property, which can be strings, arrays, or nested Union types. + */ + public array $types; + + /** + * Constructor for the Union attribute. + * + * @param string|Union|array ...$types The list of types that the property can accept. + * This can include primitive types (e.g., 'string', 'int'), arrays, or other Union instances. + * + * Example: + * ```php + * #[Union('string', 'null', 'date', new Union('boolean', 'int'))] + * ``` + */ + public function __construct(string|Union|array ...$types) + { + $this->types = $types; + } + + /** + * Converts the Union type to a string representation. + * + * @return string A string representation of the union types. + */ + public function __toString(): string + { + return implode(' | ', array_map(function ($type) { + if (is_string($type)) { + return $type; + } elseif ($type instanceof Union) { + return (string) $type; // Recursively handle nested unions + } elseif (is_array($type)) { + return 'array'; // Handle arrays + } + }, $this->types)); + } +} diff --git a/src/Deployment/DeploymentClient.php b/src/Deployment/DeploymentClient.php new file mode 100644 index 0000000..9a3824b --- /dev/null +++ b/src/Deployment/DeploymentClient.php @@ -0,0 +1,100 @@ +, + * } $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->deployment->licenseStatus(); + * ``` + * + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DeploymentLicenseStatusResponse + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function licenseStatus(?array $options = null): ?DeploymentLicenseStatusResponse + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/deployment/license/status", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DeploymentLicenseStatusResponse::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/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php new file mode 100644 index 0000000..b58a1ef --- /dev/null +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -0,0 +1,329 @@ +, + * } $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->annotations->list( + * 'docId', + * 'layerName', + * 1, + * new ListAnnotationsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param ListAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocAnnotationsList200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function list(string $docId, string $layerName, int $pon, ListAnnotationsRequest $request = new ListAnnotationsRequest(), ?array $options = null): ?DocAnnotationsList200Response + { + $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/{$pon}/items", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocAnnotationsList200Response::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(), + ); + } + + /** + * Doc JWTs may instead carry collab scopes (annotations:create:self, …) that refine per-annotation authorship rules; the API token is exempt from both. + * + * Example: + * ```php + * $client->doc->annotations->create( + * 'docId', + * 'layerName', + * 1, + * new CreateAnnotationsRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param CreateAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocAnnotationsCreate200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function create(string $docId, string $layerName, int $pon, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreate200Response + { + $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/{$pon}/items", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocAnnotationsCreate200Response::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->annotations->delete( + * 'docId', + * 'layerName', + * 1, + * 'annotKey', + * new DeleteAnnotationsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param string $annotKey + * @param DeleteAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocAnnotationsDelete200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function delete(string $docId, string $layerName, int $pon, 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; + } + 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}", + method: HttpMethod::DELETE, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocAnnotationsDelete200Response::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->annotations->update( + * 'docId', + * 'layerName', + * 1, + * 'annotKey', + * new UpdateAnnotationsRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param string $annotKey + * @param UpdateAnnotationsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocAnnotationsUpdate200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function update(string $docId, string $layerName, int $pon, 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; + } + 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}", + method: HttpMethod::PATCH, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocAnnotationsUpdate200Response::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 new file mode 100644 index 0000000..9a42f74 --- /dev/null +++ b/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php @@ -0,0 +1,31 @@ + $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/Annotations/Requests/DeleteAnnotationsRequest.php b/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php new file mode 100644 index 0000000..fe64e97 --- /dev/null +++ b/src/Doc/Annotations/Requests/DeleteAnnotationsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Annotations/Requests/ListAnnotationsRequest.php b/src/Doc/Annotations/Requests/ListAnnotationsRequest.php new file mode 100644 index 0000000..b6cb3e7 --- /dev/null +++ b/src/Doc/Annotations/Requests/ListAnnotationsRequest.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 new file mode 100644 index 0000000..fb9a67f --- /dev/null +++ b/src/Doc/Annotations/Requests/UpdateAnnotationsRequest.php @@ -0,0 +1,31 @@ + $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/DocClient.php b/src/Doc/DocClient.php new file mode 100644 index 0000000..e1f1736 --- /dev/null +++ b/src/Doc/DocClient.php @@ -0,0 +1,394 @@ +, + * } $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 ?? []; + $this->annotations = new AnnotationsClient($this->client, $this->options); + $this->forms = new FormsClient($this->client, $this->options); + $this->metadata = new MetadataClient($this->client, $this->options); + $this->pages = new PagesClient($this->client, $this->options); + $this->redactions = new RedactionsClient($this->client, $this->options); + } + + /** + * Example: + * ```php + * $client->doc->head( + * 'docId', + * new HeadDocRequest([]), + * ); + * ``` + * + * @param string $docId + * @param HeadDocRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocHead200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function head(string $docId, HeadDocRequest $request = new HeadDocRequest(), ?array $options = null): ?DocHead200Response + { + $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}/head", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocHead200Response::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->download( + * 'docId', + * 'layerName', + * new DownloadDocRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param DownloadDocRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function download(string $docId, string $layerName, DownloadDocRequest $request = new DownloadDocRequest(), ?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}/download", + 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->manifest( + * 'docId', + * 'layerName', + * new ManifestDocRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ManifestDocRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocManifest200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function manifest(string $docId, string $layerName, ManifestDocRequest $request = new ManifestDocRequest(), ?array $options = null): ?DocManifest200Response + { + $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}/manifest", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocManifest200Response::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(), + ); + } + + /** + * Render parameters (viewport, format) pass as flat dotted query keys, e.g. `?viewport.kind=width&viewport.width=800`; the full grammar is documented with the viewer. + * + * Example: + * ```php + * $client->doc->render( + * 'docId', + * 'layerName', + * 1, + * new RenderDocRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param RenderDocRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function render(string $docId, string $layerName, int $pon, RenderDocRequest $request = new RenderDocRequest(), ?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}/render/pages/{$pon}/data", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return $response->getBody()->getContents(); + } + } catch (ClientExceptionInterface $e) { + throw new CloudpdfException(message: $e->getMessage(), previous: $e); + } + throw new CloudpdfApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->text( + * 'docId', + * 'layerName', + * 1, + * new TextDocRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param TextDocRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocText200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function text(string $docId, string $layerName, int $pon, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocText200Response + { + $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}/text/pages/{$pon}/data", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocText200Response::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/Forms/FormsClient.php b/src/Doc/Forms/FormsClient.php new file mode 100644 index 0000000..c709455 --- /dev/null +++ b/src/Doc/Forms/FormsClient.php @@ -0,0 +1,381 @@ +, + * } $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->forms->get( + * 'docId', + * 'layerName', + * new GetFormsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param GetFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsGet200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function get(string $docId, string $layerName, GetFormsRequest $request = new GetFormsRequest(), ?array $options = null): ?DocFormsGet200Response + { + $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}/form", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsGet200Response::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->exportData( + * 'docId', + * 'layerName', + * new ExportDataFormsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ExportDataFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function exportData(string $docId, string $layerName, ExportDataFormsRequest $request = new ExportDataFormsRequest(), ?array $options = null): string + { + $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; + } + 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, + headers: $headers, + query: $query, + ), + $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->forms->importData( + * 'docId', + * 'layerName', + * new ImportDataFormsRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ImportDataFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsImportData200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function importData(string $docId, string $layerName, ImportDataFormsRequest $request, ?array $options = null): ?DocFormsImportData200Response + { + $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}/form/data", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsImportData200Response::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->reset( + * 'docId', + * 'layerName', + * 'fieldKey', + * new ResetFormsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $fieldKey + * @param ResetFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsReset200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function reset(string $docId, string $layerName, string $fieldKey, ResetFormsRequest $request = new ResetFormsRequest(), ?array $options = null): ?DocFormsReset200Response + { + $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}/form/fields/{$fieldKey}/reset", + method: HttpMethod::POST, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsReset200Response::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->setValue( + * 'docId', + * 'layerName', + * 'fieldKey', + * new SetValueFormsRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $fieldKey + * @param SetValueFormsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocFormsSetValue200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + 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; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/form/fields/{$fieldKey}/value", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocFormsSetValue200Response::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/Forms/Requests/ExportDataFormsRequest.php b/src/Doc/Forms/Requests/ExportDataFormsRequest.php new file mode 100644 index 0000000..17aee61 --- /dev/null +++ b/src/Doc/Forms/Requests/ExportDataFormsRequest.php @@ -0,0 +1,32 @@ + $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 new file mode 100644 index 0000000..58a29a5 --- /dev/null +++ b/src/Doc/Forms/Requests/GetFormsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Forms/Requests/ImportDataFormsRequest.php b/src/Doc/Forms/Requests/ImportDataFormsRequest.php new file mode 100644 index 0000000..028cc80 --- /dev/null +++ b/src/Doc/Forms/Requests/ImportDataFormsRequest.php @@ -0,0 +1,31 @@ + $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/ResetFormsRequest.php b/src/Doc/Forms/Requests/ResetFormsRequest.php new file mode 100644 index 0000000..e999758 --- /dev/null +++ b/src/Doc/Forms/Requests/ResetFormsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Forms/Requests/SetValueFormsRequest.php b/src/Doc/Forms/Requests/SetValueFormsRequest.php new file mode 100644 index 0000000..3b16526 --- /dev/null +++ b/src/Doc/Forms/Requests/SetValueFormsRequest.php @@ -0,0 +1,31 @@ + $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/Types/ExportDataFormsRequestFormat.php b/src/Doc/Forms/Types/ExportDataFormsRequestFormat.php new file mode 100644 index 0000000..1ffb18f --- /dev/null +++ b/src/Doc/Forms/Types/ExportDataFormsRequestFormat.php @@ -0,0 +1,9 @@ +, + * } $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->get( + * 'docId', + * 'layerName', + * new GetMetadataRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param GetMetadataRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocMetadataGet200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function get(string $docId, string $layerName, GetMetadataRequest $request = new GetMetadataRequest(), ?array $options = null): ?DocMetadataGet200Response + { + $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", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocMetadataGet200Response::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/Metadata/Requests/GetMetadataRequest.php b/src/Doc/Metadata/Requests/GetMetadataRequest.php new file mode 100644 index 0000000..0c4ea91 --- /dev/null +++ b/src/Doc/Metadata/Requests/GetMetadataRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php new file mode 100644 index 0000000..a1d0de3 --- /dev/null +++ b/src/Doc/Pages/PagesClient.php @@ -0,0 +1,325 @@ +, + * } $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->pages->delete( + * 'docId', + * 'layerName', + * new DeletePagesRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param DeletePagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocPagesDelete200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function delete(string $docId, string $layerName, DeletePagesRequest $request, ?array $options = null): ?DocPagesDelete200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/pages/delete", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocPagesDelete200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudpdfException(message: $e->getMessage(), previous: $e); + } + throw new CloudpdfApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->pages->flatten( + * 'docId', + * 'layerName', + * new FlattenPagesRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param FlattenPagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocPagesFlatten200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function flatten(string $docId, string $layerName, FlattenPagesRequest $request, ?array $options = null): ?DocPagesFlatten200Response + { + $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}/pages/flatten", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocPagesFlatten200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudpdfException(message: $e->getMessage(), previous: $e); + } + throw new CloudpdfApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->pages->move( + * 'docId', + * 'layerName', + * new MovePagesRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param MovePagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocPagesMove200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function move(string $docId, string $layerName, MovePagesRequest $request, ?array $options = null): ?DocPagesMove200Response + { + $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}/pages/move", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocPagesMove200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudpdfException(message: $e->getMessage(), previous: $e); + } + throw new CloudpdfApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->pages->rotate( + * 'docId', + * 'layerName', + * new RotatePagesRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param RotatePagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocPagesRotate200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function rotate(string $docId, string $layerName, RotatePagesRequest $request, ?array $options = null): ?DocPagesRotate200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/pages/rotate", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocPagesRotate200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudpdfException(message: $e->getMessage(), previous: $e); + } + throw new CloudpdfApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Doc/Pages/Requests/DeletePagesRequest.php b/src/Doc/Pages/Requests/DeletePagesRequest.php new file mode 100644 index 0000000..8408913 --- /dev/null +++ b/src/Doc/Pages/Requests/DeletePagesRequest.php @@ -0,0 +1,31 @@ + $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/FlattenPagesRequest.php b/src/Doc/Pages/Requests/FlattenPagesRequest.php new file mode 100644 index 0000000..b76725d --- /dev/null +++ b/src/Doc/Pages/Requests/FlattenPagesRequest.php @@ -0,0 +1,31 @@ + $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/MovePagesRequest.php b/src/Doc/Pages/Requests/MovePagesRequest.php new file mode 100644 index 0000000..38f505e --- /dev/null +++ b/src/Doc/Pages/Requests/MovePagesRequest.php @@ -0,0 +1,31 @@ + $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/RotatePagesRequest.php b/src/Doc/Pages/Requests/RotatePagesRequest.php new file mode 100644 index 0000000..879b968 --- /dev/null +++ b/src/Doc/Pages/Requests/RotatePagesRequest.php @@ -0,0 +1,31 @@ + $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/RedactionsClient.php b/src/Doc/Redactions/RedactionsClient.php new file mode 100644 index 0000000..c449ab6 --- /dev/null +++ b/src/Doc/Redactions/RedactionsClient.php @@ -0,0 +1,118 @@ +, + * } $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->redactions->apply( + * 'docId', + * 'layerName', + * new ApplyRedactionsRequest([ + * 'body' => [ + * 'key' => "value", + * ], + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ApplyRedactionsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocRedactionsApply200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function apply(string $docId, string $layerName, ApplyRedactionsRequest $request, ?array $options = null): ?DocRedactionsApply200Response + { + $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}/redactions/apply", + method: HttpMethod::POST, + headers: $headers, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocRedactionsApply200Response::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/Redactions/Requests/ApplyRedactionsRequest.php b/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php new file mode 100644 index 0000000..db93f40 --- /dev/null +++ b/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php @@ -0,0 +1,31 @@ + $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/Requests/DownloadDocRequest.php b/src/Doc/Requests/DownloadDocRequest.php new file mode 100644 index 0000000..342d809 --- /dev/null +++ b/src/Doc/Requests/DownloadDocRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Requests/HeadDocRequest.php b/src/Doc/Requests/HeadDocRequest.php new file mode 100644 index 0000000..85130e0 --- /dev/null +++ b/src/Doc/Requests/HeadDocRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Requests/ManifestDocRequest.php b/src/Doc/Requests/ManifestDocRequest.php new file mode 100644 index 0000000..3a3ee73 --- /dev/null +++ b/src/Doc/Requests/ManifestDocRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Requests/RenderDocRequest.php b/src/Doc/Requests/RenderDocRequest.php new file mode 100644 index 0000000..c08ba45 --- /dev/null +++ b/src/Doc/Requests/RenderDocRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Requests/TextDocRequest.php b/src/Doc/Requests/TextDocRequest.php new file mode 100644 index 0000000..5749359 --- /dev/null +++ b/src/Doc/Requests/TextDocRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Documents/DocumentsClient.php b/src/Documents/DocumentsClient.php new file mode 100644 index 0000000..bace738 --- /dev/null +++ b/src/Documents/DocumentsClient.php @@ -0,0 +1,490 @@ +, + * } $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->documents->list( + * 'tenantId', + * new ListDocumentsRequest([]), + * ); + * ``` + * + * @param string $tenantId + * @param ListDocumentsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsList200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function list(string $tenantId, ListDocumentsRequest $request = new ListDocumentsRequest(), ?array $options = null): ?DocumentsList200Response + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->cursor != null) { + $query['cursor'] = $request->cursor; + } + if ($request->state != null) { + $query['state'] = $request->state; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsList200Response::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->documents->get( + * 'tenantId', + * 'id', + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsGet200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function get(string $tenantId, string $id, ?array $options = null): ?DocumentsGet200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsGet200Response::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->documents->delete( + * 'tenantId', + * 'id', + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function delete(string $tenantId, string $id, ?array $options = null): void + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } 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->documents->commit( + * 'tenantId', + * 'id', + * new DocumentsCommitRequest([ + * 'sha256' => 'sha256', + * ]), + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param DocumentsCommitRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsCommit200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function commit(string $tenantId, string $id, DocumentsCommitRequest $request, ?array $options = null): ?DocumentsCommit200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/commit", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsCommit200Response::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->documents->download( + * 'tenantId', + * 'id', + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function download(string $tenantId, string $id, ?array $options = null): string + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/download", + method: HttpMethod::GET, + ), + $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->documents->thumbnail( + * 'tenantId', + * 'id', + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function thumbnail(string $tenantId, string $id, ?array $options = null): string + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/thumbnail", + method: HttpMethod::GET, + ), + $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(), + ); + } + + /** + * @param string $tenantId + * @param string $id + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsUploadDirect200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function uploadDirect(string $tenantId, string $id, ?array $options = null): ?DocumentsUploadDirect200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/upload-direct", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsUploadDirect200Response::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->documents->init( + * 'tenantId', + * new DocumentsInitRequest([ + * 'contentLength' => 1.1, + * 'contentSha256' => 'contentSha256', + * ]), + * ); + * ``` + * + * @param string $tenantId + * @param DocumentsInitRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsInit200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function init(string $tenantId, DocumentsInitRequest $request, ?array $options = null): ?DocumentsInit200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/init", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsInit200Response::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/Documents/Requests/DocumentsCommitRequest.php b/src/Documents/Requests/DocumentsCommitRequest.php new file mode 100644 index 0000000..0a4e074 --- /dev/null +++ b/src/Documents/Requests/DocumentsCommitRequest.php @@ -0,0 +1,26 @@ +sha256 = $values['sha256']; + } +} diff --git a/src/Documents/Requests/DocumentsInitRequest.php b/src/Documents/Requests/DocumentsInitRequest.php new file mode 100644 index 0000000..72ea47e --- /dev/null +++ b/src/Documents/Requests/DocumentsInitRequest.php @@ -0,0 +1,76 @@ + $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?value-of $dedupMode + */ + #[JsonProperty('dedupMode')] + public ?string $dedupMode; + + /** + * @var ?string $docId + */ + #[JsonProperty('docId')] + public ?string $docId; + + /** + * @var ?float $uploadTtlSec + */ + #[JsonProperty('uploadTtlSec')] + public ?float $uploadTtlSec; + + /** + * @param array{ + * contentLength: float, + * contentSha256: string, + * metadata?: ?array, + * idempotencyKey?: ?string, + * dedupMode?: ?value-of, + * docId?: ?string, + * uploadTtlSec?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->contentLength = $values['contentLength']; + $this->contentSha256 = $values['contentSha256']; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->dedupMode = $values['dedupMode'] ?? null; + $this->docId = $values['docId'] ?? null; + $this->uploadTtlSec = $values['uploadTtlSec'] ?? null; + } +} diff --git a/src/Documents/Requests/ListDocumentsRequest.php b/src/Documents/Requests/ListDocumentsRequest.php new file mode 100644 index 0000000..3e577b0 --- /dev/null +++ b/src/Documents/Requests/ListDocumentsRequest.php @@ -0,0 +1,39 @@ + $state + */ + public ?string $state; + + /** + * @param array{ + * limit?: ?int, + * cursor?: ?string, + * state?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->state = $values['state'] ?? null; + } +} diff --git a/src/Documents/Types/DocumentsInitRequestDedupMode.php b/src/Documents/Types/DocumentsInitRequestDedupMode.php new file mode 100644 index 0000000..7165f98 --- /dev/null +++ b/src/Documents/Types/DocumentsInitRequestDedupMode.php @@ -0,0 +1,9 @@ +body = $body; + parent::__construct($message, $statusCode, $previous); + } + + /** + * Returns the body of the response that triggered the exception. + * + * @return mixed + */ + public function getBody(): mixed + { + return $this->body; + } + + /** + * @return string + */ + public function __toString(): string + { + if (empty($this->body)) { + return $this->message . '; Status Code: ' . $this->getCode() . "\n"; + } + return $this->message . '; Status Code: ' . $this->getCode() . '; Body: ' . print_r($this->body, true) . "\n"; + } +} diff --git a/src/Exceptions/CloudpdfException.php b/src/Exceptions/CloudpdfException.php new file mode 100644 index 0000000..6fed674 --- /dev/null +++ b/src/Exceptions/CloudpdfException.php @@ -0,0 +1,12 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } +} diff --git a/src/Tenants/Requests/TenantsCreateRequest.php b/src/Tenants/Requests/TenantsCreateRequest.php new file mode 100644 index 0000000..39ae447 --- /dev/null +++ b/src/Tenants/Requests/TenantsCreateRequest.php @@ -0,0 +1,34 @@ +id = $values['id']; + $this->name = $values['name'] ?? null; + } +} diff --git a/src/Tenants/TenantsClient.php b/src/Tenants/TenantsClient.php new file mode 100644 index 0000000..a35a0f7 --- /dev/null +++ b/src/Tenants/TenantsClient.php @@ -0,0 +1,272 @@ +, + * } $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->tenants->list( + * new ListTenantsRequest([]), + * ); + * ``` + * + * @param ListTenantsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?TenantsList200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?array $options = null): ?TenantsList200Response + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->cursor != null) { + $query['cursor'] = $request->cursor; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return TenantsList200Response::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->tenants->create( + * new TenantsCreateRequest([ + * 'id' => 'id', + * ]), + * ); + * ``` + * + * @param TenantsCreateRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?TenantsCreate200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function create(TenantsCreateRequest $request, ?array $options = null): ?TenantsCreate200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return TenantsCreate200Response::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->tenants->get( + * 'tenantId', + * ); + * ``` + * + * @param string $tenantId + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?TenantsGet200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function get(string $tenantId, ?array $options = null): ?TenantsGet200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}", + method: HttpMethod::GET, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return TenantsGet200Response::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(), + ); + } + + /** + * Destroys the tenant and everything in its namespace — documents, layers, stored bytes, audit history. Irreversible. + * + * Example: + * ```php + * $client->tenants->delete( + * 'tenantId', + * ); + * ``` + * + * @param string $tenantId + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function delete(string $tenantId, ?array $options = null): void + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } 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/Tokens/Requests/IssueTokensRequest.php b/src/Tokens/Requests/IssueTokensRequest.php new file mode 100644 index 0000000..4a433ea --- /dev/null +++ b/src/Tokens/Requests/IssueTokensRequest.php @@ -0,0 +1,25 @@ +body = $values['body']; + } +} diff --git a/src/Tokens/Requests/TokensRevokeRequest.php b/src/Tokens/Requests/TokensRevokeRequest.php new file mode 100644 index 0000000..9fc25ce --- /dev/null +++ b/src/Tokens/Requests/TokensRevokeRequest.php @@ -0,0 +1,34 @@ +reason = $values['reason'] ?? null; + $this->expiresAtSeconds = $values['expiresAtSeconds'] ?? null; + } +} diff --git a/src/Tokens/TokensClient.php b/src/Tokens/TokensClient.php new file mode 100644 index 0000000..18221fd --- /dev/null +++ b/src/Tokens/TokensClient.php @@ -0,0 +1,172 @@ +, + * } $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 ?? []; + } + + /** + * kind "tenant" requires the API token — authority mints only downward. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key. + * + * Example: + * ```php + * $client->tokens->issue( + * 'tenantId', + * new IssueTokensRequest([ + * 'body' => TokensIssueRequest::doc(new TokensIssueRequestDoc([ + * 'sub' => 'sub', + * 'docId' => 'docId', + * 'scope' => [ + * 'scope', + * ], + * 'expiresIn' => 1, + * ])), + * ]), + * ); + * ``` + * + * @param string $tenantId + * @param IssueTokensRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?TokensIssue200Response + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function issue(string $tenantId, IssueTokensRequest $request, ?array $options = null): ?TokensIssue200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/tokens", + method: HttpMethod::POST, + body: $request->body, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return TokensIssue200Response::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(), + ); + } + + /** + * Mounted only when the deployment enables token revocation. + * + * Example: + * ```php + * $client->tokens->revoke( + * 'tenantId', + * 'jti', + * new TokensRevokeRequest([]), + * ); + * ``` + * + * @param string $tenantId + * @param string $jti + * @param TokensRevokeRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws CloudpdfException + * @throws CloudpdfApiException + */ + public function revoke(string $tenantId, string $jti, TokensRevokeRequest $request = new TokensRevokeRequest(), ?array $options = null): void + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/tokens/{$jti}/revoke", + method: HttpMethod::POST, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } 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/Types/AdminErrorPayload.php b/src/Types/AdminErrorPayload.php new file mode 100644 index 0000000..b0d7b00 --- /dev/null +++ b/src/Types/AdminErrorPayload.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/AdminErrorPayloadError.php b/src/Types/AdminErrorPayloadError.php new file mode 100644 index 0000000..481eca6 --- /dev/null +++ b/src/Types/AdminErrorPayloadError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DeploymentLicenseStatusResponse.php b/src/Types/DeploymentLicenseStatusResponse.php new file mode 100644 index 0000000..965ea89 --- /dev/null +++ b/src/Types/DeploymentLicenseStatusResponse.php @@ -0,0 +1,50 @@ +license = $values['license'] ?? null; + $this->reporting = $values['reporting'] ?? null; + $this->usage = $values['usage'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsCreate200Response.php b/src/Types/DocAnnotationsCreate200Response.php new file mode 100644 index 0000000..04f076a --- /dev/null +++ b/src/Types/DocAnnotationsCreate200Response.php @@ -0,0 +1,34 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsCreate200ResponseMeta.php b/src/Types/DocAnnotationsCreate200ResponseMeta.php new file mode 100644 index 0000000..7c9d7d3 --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..78beed3 --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..d6dc426 --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f3ef3cd --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..f88ba9e --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..b787b4a --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..971a44b --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..3702487 --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..e80683d --- /dev/null +++ b/src/Types/DocAnnotationsCreate200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..214e04a --- /dev/null +++ b/src/Types/DocAnnotationsCreate400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..381b015 --- /dev/null +++ b/src/Types/DocAnnotationsCreate400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..c63bc3a --- /dev/null +++ b/src/Types/DocAnnotationsCreate404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsDelete200ResponseMeta.php b/src/Types/DocAnnotationsDelete200ResponseMeta.php new file mode 100644 index 0000000..3e1088c --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..6ab7d94 --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..125ff75 --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..1fb07ae --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..59f6181 --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..fc7e6ff --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..2c62acf --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..e442cf5 --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..b07c362 --- /dev/null +++ b/src/Types/DocAnnotationsDelete200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3175bbf --- /dev/null +++ b/src/Types/DocAnnotationsDelete404Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..05b3b6c --- /dev/null +++ b/src/Types/DocAnnotationsDelete404ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..0a7b5af --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItem.php @@ -0,0 +1,961 @@ +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 new file mode 100644 index 0000000..b2e9d57 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaret.php @@ -0,0 +1,212 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemCaretActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemCaretActions $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; + + /** + * @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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemCaretInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActions, + * intent?: ?value-of, + * rectDifferences?: ?DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences, + * } $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->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; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActions.php new file mode 100644 index 0000000..17d0f68 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActions.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/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivate.php new file mode 100644 index 0000000..2286d4d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRoot.php new file mode 100644 index 0000000..7e2a703 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRootType.php new file mode 100644 index 0000000..b71de46 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRoot.php new file mode 100644 index 0000000..95aa932 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRootType.php new file mode 100644 index 0000000..22b31a0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRoot.php new file mode 100644 index 0000000..51f2042 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRootType.php new file mode 100644 index 0000000..e76b06b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRoot.php new file mode 100644 index 0000000..c64d09e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRootType.php new file mode 100644 index 0000000..634ed1e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRoot.php new file mode 100644 index 0000000..f5d80cd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRootType.php new file mode 100644 index 0000000..4cb7706 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRoot.php new file mode 100644 index 0000000..d801521 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRootType.php new file mode 100644 index 0000000..35d57b2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRoot.php new file mode 100644 index 0000000..b7553ea --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRootType.php new file mode 100644 index 0000000..4a4c212 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRoot.php new file mode 100644 index 0000000..494d83d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRootType.php new file mode 100644 index 0000000..a6fdcb6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRoot.php new file mode 100644 index 0000000..184a4ed --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRootType.php new file mode 100644 index 0000000..c411fe1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRoot.php new file mode 100644 index 0000000..31b0c02 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRootType.php new file mode 100644 index 0000000..eaaa259 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRoot.php new file mode 100644 index 0000000..3e1a6d0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRootType.php new file mode 100644 index 0000000..7303452 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..d0adb95 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..c0afd45 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..38ce9a7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..7fb8b10 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f0151f3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..889ff32 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..cf71408 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretIntent.php @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000..e527cc6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRectDifferences.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..4911eef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..dc4378e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..9606a3e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..ccf9b3d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..4383c73 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..2926ccd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCaretReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemCircleActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemCircleActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemCircleInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemCircleActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActions.php new file mode 100644 index 0000000..7a4e9c9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActions.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/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivate.php new file mode 100644 index 0000000..040eb8a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRoot.php new file mode 100644 index 0000000..1632df4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRootType.php new file mode 100644 index 0000000..648bec6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRoot.php new file mode 100644 index 0000000..ebb0925 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRootType.php new file mode 100644 index 0000000..717ac3c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRoot.php new file mode 100644 index 0000000..9c55f16 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRootType.php new file mode 100644 index 0000000..98ac6e8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRoot.php new file mode 100644 index 0000000..14ecfa9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRootType.php new file mode 100644 index 0000000..d5adbdf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRoot.php new file mode 100644 index 0000000..a171a3e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRootType.php new file mode 100644 index 0000000..ef1cd8c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRoot.php new file mode 100644 index 0000000..5c26a50 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRootType.php new file mode 100644 index 0000000..52070d1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRoot.php new file mode 100644 index 0000000..22d42a8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRootType.php new file mode 100644 index 0000000..450fa2b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRoot.php new file mode 100644 index 0000000..29c62a8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRootType.php new file mode 100644 index 0000000..45854f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRoot.php new file mode 100644 index 0000000..8ef9dd7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRootType.php new file mode 100644 index 0000000..81d36b8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRoot.php new file mode 100644 index 0000000..8cea2a9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRootType.php new file mode 100644 index 0000000..c5f26ea --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRoot.php new file mode 100644 index 0000000..61b30b9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRootType.php new file mode 100644 index 0000000..f96d23d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..3ea87a8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..7e3156a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..93d8d16 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e282130 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..5567140 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..7a3e678 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..ae7cf2e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleInteriorColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a7b8936 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRect.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/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php new file mode 100644 index 0000000..b6447be --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRectDifferences.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..c7200b8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..21b5430 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..1e1eda3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..638cb76 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..27fcb09 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..31756e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemCircleReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..d102f72 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachment.php @@ -0,0 +1,212 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions, + * } $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->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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions.php new file mode 100644 index 0000000..4cab5fa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActions.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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivate.php new file mode 100644 index 0000000..d93fdb3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRoot.php new file mode 100644 index 0000000..b209c47 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRootType.php new file mode 100644 index 0000000..40cd569 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRoot.php new file mode 100644 index 0000000..449e1c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRootType.php new file mode 100644 index 0000000..509c448 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRoot.php new file mode 100644 index 0000000..00e1530 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRootType.php new file mode 100644 index 0000000..33a809a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRoot.php new file mode 100644 index 0000000..6d8e6d7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRootType.php new file mode 100644 index 0000000..4ea674d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRoot.php new file mode 100644 index 0000000..1b62192 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRootType.php new file mode 100644 index 0000000..7259e53 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRoot.php new file mode 100644 index 0000000..7da9a96 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRootType.php new file mode 100644 index 0000000..a8acdd1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRoot.php new file mode 100644 index 0000000..40c5823 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRootType.php new file mode 100644 index 0000000..614366f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRoot.php new file mode 100644 index 0000000..eb34a20 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRootType.php new file mode 100644 index 0000000..9d4fee6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRoot.php new file mode 100644 index 0000000..58eac68 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRootType.php new file mode 100644 index 0000000..12bb69d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRoot.php new file mode 100644 index 0000000..29792cd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRootType.php new file mode 100644 index 0000000..df0768e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRoot.php new file mode 100644 index 0000000..55fc1ae --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRootType.php new file mode 100644 index 0000000..1b58a78 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..7578c84 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFile.php @@ -0,0 +1,74 @@ +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 new file mode 100644 index 0000000..8befe35 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..708d4f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentIcon.php @@ -0,0 +1,11 @@ +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 new file mode 100644 index 0000000..af9d8e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..8d1e287 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..20154b5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..22ce09d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..d12a2b4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRect.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/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php new file mode 100644 index 0000000..ad3bd3d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..ea38b50 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..7af2819 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..7eb5798 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..f63153f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..f37e187 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFileAttachmentReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActions $actions; + + /** + * @var value-of $intent + */ + #[JsonProperty('intent')] + public string $intent; + + /** + * @var value-of $fontFamily + */ + #[JsonProperty('fontFamily')] + public string $fontFamily; + + /** + * @var float $fontSize + */ + #[JsonProperty('fontSize')] + public float $fontSize; + + /** + * @var value-of $textAlign + */ + #[JsonProperty('textAlign')] + public string $textAlign; + + /** + * @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: value-of, + * fontSize: float, + * textAlign: value-of, + * color: DocAnnotationsList200ResponseAnnotationsItemFreeTextColor, + * opacity: float, + * strokeWidth: float, + * borderStyle: value-of, + * nm?: ?string, + * contents?: ?string, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActions, + * 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->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->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/DocAnnotationsList200ResponseAnnotationsItemFreeTextActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActions.php new file mode 100644 index 0000000..cec50ed --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActions.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/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivate.php new file mode 100644 index 0000000..aa5869d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRoot.php new file mode 100644 index 0000000..a9547e4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRootType.php new file mode 100644 index 0000000..3a0d64f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRoot.php new file mode 100644 index 0000000..06cb625 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRootType.php new file mode 100644 index 0000000..bb3ccdf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRoot.php new file mode 100644 index 0000000..53e9e93 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRootType.php new file mode 100644 index 0000000..1e5ae8f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRoot.php new file mode 100644 index 0000000..2ae04a0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRootType.php new file mode 100644 index 0000000..d45fd6c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRoot.php new file mode 100644 index 0000000..f122ef7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRootType.php new file mode 100644 index 0000000..ebc0e5b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRoot.php new file mode 100644 index 0000000..10cefec --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRootType.php new file mode 100644 index 0000000..89c5de0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRoot.php new file mode 100644 index 0000000..33f8540 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRootType.php new file mode 100644 index 0000000..b17c9f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRoot.php new file mode 100644 index 0000000..073a3d3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRootType.php new file mode 100644 index 0000000..cc54c11 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRoot.php new file mode 100644 index 0000000..c4db8f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRootType.php new file mode 100644 index 0000000..4869a5c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRoot.php new file mode 100644 index 0000000..3371fde --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRootType.php new file mode 100644 index 0000000..a007c2d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRoot.php new file mode 100644 index 0000000..465a34a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRootType.php new file mode 100644 index 0000000..03feff0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..7adf498 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..a98beae --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontColor.php @@ -0,0 +1,50 @@ +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/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.php new file mode 100644 index 0000000..f0b3f6f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextFontFamily.php @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..cb388b3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..07c3549 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..5b66e0e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3f7da26 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..4ea03d3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextIntent.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..7fa91c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextLineEnding.php @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000..1752e5c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRectDifferences.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..1ba5108 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..a39899f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..3914798 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..b4cd486 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..79ad83a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..1d06262 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemFreeTextReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..86c9396 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlight.php @@ -0,0 +1,205 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemHighlightActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemHighlightActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActions, + * } $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->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/DocAnnotationsList200ResponseAnnotationsItemHighlightActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActions.php new file mode 100644 index 0000000..d04bc57 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActions.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/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivate.php new file mode 100644 index 0000000..a408857 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRoot.php new file mode 100644 index 0000000..bdf8215 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRootType.php new file mode 100644 index 0000000..a430827 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRoot.php new file mode 100644 index 0000000..4da4848 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRootType.php new file mode 100644 index 0000000..fff54bb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRoot.php new file mode 100644 index 0000000..7df259e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRootType.php new file mode 100644 index 0000000..86a8e08 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRoot.php new file mode 100644 index 0000000..3efdc34 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRootType.php new file mode 100644 index 0000000..784a9d8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRoot.php new file mode 100644 index 0000000..71010fb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRootType.php new file mode 100644 index 0000000..2d964ff --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRoot.php new file mode 100644 index 0000000..5239b48 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRootType.php new file mode 100644 index 0000000..f87456a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRoot.php new file mode 100644 index 0000000..faa1199 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRootType.php new file mode 100644 index 0000000..4798ed3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRoot.php new file mode 100644 index 0000000..dcf2b3f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRootType.php new file mode 100644 index 0000000..e3c412c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRoot.php new file mode 100644 index 0000000..d46e10a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRootType.php new file mode 100644 index 0000000..fc57d96 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRoot.php new file mode 100644 index 0000000..b10f31a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRootType.php new file mode 100644 index 0000000..c751e0b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRoot.php new file mode 100644 index 0000000..a9d3c67 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRootType.php new file mode 100644 index 0000000..bdee534 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..01edff1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..4476adb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..288a1ff --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..06270e0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..23f9cfc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..39df7e0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..c1db634 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItem.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..46e9b5d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP1.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/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.php new file mode 100644 index 0000000..56b937d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP2.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/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.php new file mode 100644 index 0000000..1729b45 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP3.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/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.php new file mode 100644 index 0000000..75c40d9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightQuadPointsItemP4.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/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.php new file mode 100644 index 0000000..b41e2c5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRect.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/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php new file mode 100644 index 0000000..103f389 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..7abf6d6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..d79c185 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..5984b96 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..9e27ab8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..a2a6901 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemHighlightReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemInkActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemInkActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemInkInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemInkActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemInkActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActions.php new file mode 100644 index 0000000..c2a8f9d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActions.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/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivate.php new file mode 100644 index 0000000..0c049f3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRoot.php new file mode 100644 index 0000000..1acf8d6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRootType.php new file mode 100644 index 0000000..496897b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRoot.php new file mode 100644 index 0000000..5fd924e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRootType.php new file mode 100644 index 0000000..1206f9e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRoot.php new file mode 100644 index 0000000..bb826bd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRootType.php new file mode 100644 index 0000000..2519f47 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRoot.php new file mode 100644 index 0000000..6382da3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRootType.php new file mode 100644 index 0000000..157ffea --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRoot.php new file mode 100644 index 0000000..1beadaa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRootType.php new file mode 100644 index 0000000..814d1ef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRoot.php new file mode 100644 index 0000000..1fe3464 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRootType.php new file mode 100644 index 0000000..28538fb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRoot.php new file mode 100644 index 0000000..6b1cc6a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRootType.php new file mode 100644 index 0000000..4b3bb49 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRoot.php new file mode 100644 index 0000000..ad44d82 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRootType.php new file mode 100644 index 0000000..9747eba --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRoot.php new file mode 100644 index 0000000..aeda4f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRootType.php new file mode 100644 index 0000000..e40bc86 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRoot.php new file mode 100644 index 0000000..74838a5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRootType.php new file mode 100644 index 0000000..66cc368 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRoot.php new file mode 100644 index 0000000..fd20238 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRootType.php new file mode 100644 index 0000000..e4993b3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..ccc8d43 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..ac6f16b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..c9a4551 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..2dd659f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..58bbdef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..2c7f759 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..0529638 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkInkListItemItem.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/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php new file mode 100644 index 0000000..3a96709 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkIntent.php @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000..1c08941 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..7b4e8cf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..57c615d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..4596dd6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..9b4e3a9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..82447f7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemInkReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemLineActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineActions $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, + * nm?: ?string, + * contents?: ?string, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemLineInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemLineActions, + * dashArray?: ?array, + * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemLineActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActions.php new file mode 100644 index 0000000..fbf9edf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActions.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/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivate.php new file mode 100644 index 0000000..9d8afe1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRoot.php new file mode 100644 index 0000000..6ad6088 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRootType.php new file mode 100644 index 0000000..aab0157 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRoot.php new file mode 100644 index 0000000..6b8b9bc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRootType.php new file mode 100644 index 0000000..e40ea3d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRoot.php new file mode 100644 index 0000000..3992f15 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRootType.php new file mode 100644 index 0000000..6aa1485 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRoot.php new file mode 100644 index 0000000..fd6f22a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRootType.php new file mode 100644 index 0000000..57d6a4b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRoot.php new file mode 100644 index 0000000..1583ba2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRootType.php new file mode 100644 index 0000000..4943ad9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRoot.php new file mode 100644 index 0000000..f1f0ee5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRootType.php new file mode 100644 index 0000000..b42f5f1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRoot.php new file mode 100644 index 0000000..e2b44e3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRootType.php new file mode 100644 index 0000000..98eaf36 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRoot.php new file mode 100644 index 0000000..f1573f6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRootType.php new file mode 100644 index 0000000..e6803f4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRoot.php new file mode 100644 index 0000000..d2100c6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRootType.php new file mode 100644 index 0000000..71e3f16 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRoot.php new file mode 100644 index 0000000..1bcd4ef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRootType.php new file mode 100644 index 0000000..d310ad9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRoot.php new file mode 100644 index 0000000..40ffc47 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRootType.php new file mode 100644 index 0000000..1750868 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..c22c7e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..7937aac --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..0e2168f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..2b4d517 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..acc0e54 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..895e2fe --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->annotObjectNumber = $values['annotObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor.php new file mode 100644 index 0000000..bd46828 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineInteriorColor.php @@ -0,0 +1,50 @@ +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/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.php new file mode 100644 index 0000000..333b09c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndings.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/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.php new file mode 100644 index 0000000..50b15d9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLineEndingsEnd.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/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.php new file mode 100644 index 0000000..0b2039e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsEnd.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/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.php new file mode 100644 index 0000000..68b4dcd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineLinePointsStart.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/DocAnnotationsList200ResponseAnnotationsItemLineRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRect.php new file mode 100644 index 0000000..f293919 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRect.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/DocAnnotationsList200ResponseAnnotationsItemLineRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRef.php new file mode 100644 index 0000000..1b4105e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..b119864 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e64f751 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..334068a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..ccaad54 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..f18dee9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemLinkActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemLinkActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemLinkInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemLinkActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActions.php new file mode 100644 index 0000000..c239e28 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActions.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/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivate.php new file mode 100644 index 0000000..bb4981a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRoot.php new file mode 100644 index 0000000..373e362 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRootType.php new file mode 100644 index 0000000..d6a7bb8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRoot.php new file mode 100644 index 0000000..0d10660 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRootType.php new file mode 100644 index 0000000..340283b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRoot.php new file mode 100644 index 0000000..e18071d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRootType.php new file mode 100644 index 0000000..cf8f7c5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRoot.php new file mode 100644 index 0000000..d6c49e6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRootType.php new file mode 100644 index 0000000..682467f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRoot.php new file mode 100644 index 0000000..3665aa8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRootType.php new file mode 100644 index 0000000..7432aa6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRoot.php new file mode 100644 index 0000000..a1ad52d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRootType.php new file mode 100644 index 0000000..516b663 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRoot.php new file mode 100644 index 0000000..a1f5972 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRootType.php new file mode 100644 index 0000000..58c9f4a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRoot.php new file mode 100644 index 0000000..e90675d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRootType.php new file mode 100644 index 0000000..b390ba8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRoot.php new file mode 100644 index 0000000..f85c02e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRootType.php new file mode 100644 index 0000000..ea5065c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRoot.php new file mode 100644 index 0000000..289fbe9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRootType.php new file mode 100644 index 0000000..34c8936 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRoot.php new file mode 100644 index 0000000..11d440a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRootType.php new file mode 100644 index 0000000..f785486 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..db0d67a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..62cb185 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..2acaa6f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..ee8b655 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..e4dd38e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..dcac6e7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRect.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/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php new file mode 100644 index 0000000..0a164ad --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..fc394f4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..42e80c0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..80aa87d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..735d803 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..cc100a3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..a774f22 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGoto.php @@ -0,0 +1,34 @@ +destination = $values['destination']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination.php new file mode 100644 index 0000000..00df10c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination.php @@ -0,0 +1,466 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz $xyz + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function xyz(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz $xyz): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'xyz', + 'value' => $xyz, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit $fit + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fit(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit $fit): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fit', + 'value' => $fit, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH $fitH + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitH(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH $fitH): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitH', + 'value' => $fitH, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV $fitV + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitV(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV $fitV): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitV', + 'value' => $fitV, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR $fitR + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitR(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR $fitR): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitR', + 'value' => $fitR, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB $fitB + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitB(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB $fitB): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitB', + 'value' => $fitB, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh $fitBh + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitBh(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh $fitBh): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitBH', + 'value' => $fitBh, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv $fitBv + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + */ + public static function fitBv(DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv $fitBv): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination + { + return new DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestination([ + 'kind' => 'fitBV', + 'value' => $fitBv, + ]); + } + + /** + * @return bool + */ + public function isXyz(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz && $this->kind === 'xyz'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz + */ + public function asXyz(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit && $this->kind === 'fit'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit + */ + public function asFit(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH && $this->kind === 'fitH'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH + */ + public function asFitH(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV && $this->kind === 'fitV'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV + */ + public function asFitV(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR && $this->kind === 'fitR'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR + */ + public function asFitR(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB && $this->kind === 'fitB'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB + */ + public function asFitB(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh && $this->kind === 'fitBH'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh + */ + public function asFitBh(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh && $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 DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv && $this->kind === 'fitBV'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv + */ + public function asFitBv(): DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv && $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'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz::jsonDeserialize($data); + break; + case 'fit': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit::jsonDeserialize($data); + break; + case 'fitH': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH::jsonDeserialize($data); + break; + case 'fitV': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV::jsonDeserialize($data); + break; + case 'fitR': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR::jsonDeserialize($data); + break; + case 'fitB': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB::jsonDeserialize($data); + break; + case 'fitBH': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh::jsonDeserialize($data); + break; + case 'fitBV': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv::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/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit.php new file mode 100644 index 0000000..6bc00f8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFit.php @@ -0,0 +1,34 @@ +pageObjectNumber = $values['pageObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB.php new file mode 100644 index 0000000..44f6808 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitB.php @@ -0,0 +1,34 @@ +pageObjectNumber = $values['pageObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh.php new file mode 100644 index 0000000..0b51e8c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBh.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->top = $values['top'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv.php new file mode 100644 index 0000000..216ff3c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitBv.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->left = $values['left'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH.php new file mode 100644 index 0000000..c31d188 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitH.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->top = $values['top'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR.php new file mode 100644 index 0000000..27a01cb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitR.php @@ -0,0 +1,66 @@ +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/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV.php new file mode 100644 index 0000000..7a5dbf2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationFitV.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->left = $values['left'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz.php new file mode 100644 index 0000000..6e73ac3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoDestinationXyz.php @@ -0,0 +1,58 @@ +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/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php new file mode 100644 index 0000000..a2831e5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetGotoRemote.php @@ -0,0 +1,34 @@ +file = $values['file']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php new file mode 100644 index 0000000..233278a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetJavascript.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php new file mode 100644 index 0000000..4f80db1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetLaunch.php @@ -0,0 +1,34 @@ +path = $values['path']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php new file mode 100644 index 0000000..b41e8a0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetNamed.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php new file mode 100644 index 0000000..bb4fb9b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php new file mode 100644 index 0000000..992c030 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLinkTargetUri.php @@ -0,0 +1,34 @@ +uri = $values['uri']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php new file mode 100644 index 0000000..87b981f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php @@ -0,0 +1,253 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemPolygonActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolygonActions $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, + * nm?: ?string, + * contents?: ?string, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActions, + * dashArray?: ?array, + * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor, + * rotation?: ?float, + * cloudyIntensity?: ?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->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/DocAnnotationsList200ResponseAnnotationsItemPolygonActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActions.php new file mode 100644 index 0000000..b6bad0e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActions.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/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivate.php new file mode 100644 index 0000000..0711793 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRoot.php new file mode 100644 index 0000000..f4ec4aa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRootType.php new file mode 100644 index 0000000..885daae --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRoot.php new file mode 100644 index 0000000..d0ac9ff --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRootType.php new file mode 100644 index 0000000..6035006 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRoot.php new file mode 100644 index 0000000..90b4872 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRootType.php new file mode 100644 index 0000000..0f01228 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRoot.php new file mode 100644 index 0000000..3c4e999 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRootType.php new file mode 100644 index 0000000..a31643c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRoot.php new file mode 100644 index 0000000..8d6b3e5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRootType.php new file mode 100644 index 0000000..b228968 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRoot.php new file mode 100644 index 0000000..d2c0b6d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRootType.php new file mode 100644 index 0000000..fb5a77c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRoot.php new file mode 100644 index 0000000..2f144d4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRootType.php new file mode 100644 index 0000000..545d6d9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRoot.php new file mode 100644 index 0000000..41728b7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRootType.php new file mode 100644 index 0000000..f1e9517 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRoot.php new file mode 100644 index 0000000..4decd35 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRootType.php new file mode 100644 index 0000000..4f7171a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRoot.php new file mode 100644 index 0000000..c96a5e2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRootType.php new file mode 100644 index 0000000..a23219d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRoot.php new file mode 100644 index 0000000..7868b1f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRootType.php new file mode 100644 index 0000000..2110366 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..19792aa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..ef1bee1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..2bdf96a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..b38c2e4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..6d0ec01 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..ccce2b1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->annotObjectNumber = $values['annotObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor.php new file mode 100644 index 0000000..83b6142 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonInteriorColor.php @@ -0,0 +1,50 @@ +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/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.php new file mode 100644 index 0000000..b7a6506 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRect.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/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php new file mode 100644 index 0000000..47c3509 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..5797239 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..c3a0068 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..bcf701d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..b44931f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..831c7b9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonReplyType.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/DocAnnotationsList200ResponseAnnotationsItemPolyline.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php new file mode 100644 index 0000000..898139e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php @@ -0,0 +1,253 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemPolylineActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolylineActions $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, + * nm?: ?string, + * contents?: ?string, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActions, + * dashArray?: ?array, + * interiorColor?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemPolylineActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActions.php new file mode 100644 index 0000000..226d063 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActions.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/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivate.php new file mode 100644 index 0000000..93ce6a1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRoot.php new file mode 100644 index 0000000..5e9c5d4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRootType.php new file mode 100644 index 0000000..f1c6423 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRoot.php new file mode 100644 index 0000000..381c323 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRootType.php new file mode 100644 index 0000000..bb1214b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRoot.php new file mode 100644 index 0000000..7308a60 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRootType.php new file mode 100644 index 0000000..16abefc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRoot.php new file mode 100644 index 0000000..23ef8e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRootType.php new file mode 100644 index 0000000..c742f14 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRoot.php new file mode 100644 index 0000000..4915165 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRootType.php new file mode 100644 index 0000000..b90486d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRoot.php new file mode 100644 index 0000000..50b37dc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRootType.php new file mode 100644 index 0000000..902aad9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRoot.php new file mode 100644 index 0000000..cc64dec --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRootType.php new file mode 100644 index 0000000..84ad304 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRoot.php new file mode 100644 index 0000000..0074065 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRootType.php new file mode 100644 index 0000000..0069eef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRoot.php new file mode 100644 index 0000000..6ffaffd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRootType.php new file mode 100644 index 0000000..600e2a3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRoot.php new file mode 100644 index 0000000..7b8118d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRootType.php new file mode 100644 index 0000000..7b8c798 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRoot.php new file mode 100644 index 0000000..f7130af --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRootType.php new file mode 100644 index 0000000..c39268d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..4aec37f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..5750c5d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..68863e8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..ff132f6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..66cfe6a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..94482e5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->annotObjectNumber = $values['annotObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor.php new file mode 100644 index 0000000..90b14be --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineInteriorColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..04733ed --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings.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/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php new file mode 100644 index 0000000..8c3826c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndingsEnd.php @@ -0,0 +1,17 @@ +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 new file mode 100644 index 0000000..b0791e0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..5268333 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a88cb56 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..6f432b9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..d290edc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..ec2a5a5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineReplyType.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/DocAnnotationsList200ResponseAnnotationsItemRedact.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedact.php new file mode 100644 index 0000000..6e2645a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedact.php @@ -0,0 +1,261 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemRedactActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemRedactActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemRedactInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemRedactActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActions.php new file mode 100644 index 0000000..e6659c3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActions.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/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivate.php new file mode 100644 index 0000000..4e34c71 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRoot.php new file mode 100644 index 0000000..b604bd0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRootType.php new file mode 100644 index 0000000..30eb230 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRoot.php new file mode 100644 index 0000000..2397091 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRootType.php new file mode 100644 index 0000000..4bcfa36 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRoot.php new file mode 100644 index 0000000..fb3837c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRootType.php new file mode 100644 index 0000000..c361b37 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRoot.php new file mode 100644 index 0000000..9590ac2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRootType.php new file mode 100644 index 0000000..6d8916a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRoot.php new file mode 100644 index 0000000..c694a03 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRootType.php new file mode 100644 index 0000000..e80e4af --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRoot.php new file mode 100644 index 0000000..5c4bd04 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRootType.php new file mode 100644 index 0000000..b2b75b6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRoot.php new file mode 100644 index 0000000..b327923 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRootType.php new file mode 100644 index 0000000..3584f52 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRoot.php new file mode 100644 index 0000000..ccd40eb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRootType.php new file mode 100644 index 0000000..f452af0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRoot.php new file mode 100644 index 0000000..f039829 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRootType.php new file mode 100644 index 0000000..4d813ac --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRoot.php new file mode 100644 index 0000000..5c4290b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRootType.php new file mode 100644 index 0000000..4189041 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRoot.php new file mode 100644 index 0000000..59a1328 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRootType.php new file mode 100644 index 0000000..0b0fb66 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..2819a71 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..71d3d0e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..b72a4c4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactFontFamily.php @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..5df679b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..7d3ae7b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..d4901dc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..aa9fcdb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..5964277 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactInteriorColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..cadcf90 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItem.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..6e71a6f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP1.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/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.php new file mode 100644 index 0000000..55b8ce7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP2.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/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.php new file mode 100644 index 0000000..5a8bf9b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP3.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/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.php new file mode 100644 index 0000000..38d1617 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactQuadPointsItemP4.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/DocAnnotationsList200ResponseAnnotationsItemRedactRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRect.php new file mode 100644 index 0000000..0c2c436 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRect.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/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php new file mode 100644 index 0000000..ba58c64 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..19fb3af --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..36b797b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..3a0dbc4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..fc8990f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..aa38502 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemRedactReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemSquareActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemSquareActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemSquareInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemSquareActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActions.php new file mode 100644 index 0000000..e91e82e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActions.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/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivate.php new file mode 100644 index 0000000..9862350 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRoot.php new file mode 100644 index 0000000..0c1efa7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRootType.php new file mode 100644 index 0000000..5b36174 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRoot.php new file mode 100644 index 0000000..52d39c1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRootType.php new file mode 100644 index 0000000..e4b312d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRoot.php new file mode 100644 index 0000000..b209e38 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRootType.php new file mode 100644 index 0000000..f76fbb0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRoot.php new file mode 100644 index 0000000..000bd53 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRootType.php new file mode 100644 index 0000000..960cd44 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRoot.php new file mode 100644 index 0000000..a94cd78 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRootType.php new file mode 100644 index 0000000..70358d9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRoot.php new file mode 100644 index 0000000..55b4afa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRootType.php new file mode 100644 index 0000000..a671359 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRoot.php new file mode 100644 index 0000000..bc3c2c5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRootType.php new file mode 100644 index 0000000..23f1443 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRoot.php new file mode 100644 index 0000000..f60d211 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRootType.php new file mode 100644 index 0000000..6f48d10 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRoot.php new file mode 100644 index 0000000..26a1f58 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRootType.php new file mode 100644 index 0000000..23466fd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRoot.php new file mode 100644 index 0000000..01981c7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRootType.php new file mode 100644 index 0000000..a8b0bb8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRoot.php new file mode 100644 index 0000000..165c0ba --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRootType.php new file mode 100644 index 0000000..84ee484 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..7e1b5eb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..57e6b22 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..20f898d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e9d4b72 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..9c4a27e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..9a089e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3a19853 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareInteriorColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..bef2ab6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRect.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/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php new file mode 100644 index 0000000..a3bb76d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRectDifferences.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..7d8572f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..0a965ad --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..1084adf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..560cb08 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..453f097 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..7ed17a9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquareReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..f639b33 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquiggly.php @@ -0,0 +1,205 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActions, + * } $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->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/DocAnnotationsList200ResponseAnnotationsItemSquigglyActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActions.php new file mode 100644 index 0000000..2ff2c7a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActions.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivate.php new file mode 100644 index 0000000..80e61ab --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRoot.php new file mode 100644 index 0000000..062995d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRootType.php new file mode 100644 index 0000000..d117a10 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRoot.php new file mode 100644 index 0000000..e809171 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRootType.php new file mode 100644 index 0000000..314fe73 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRoot.php new file mode 100644 index 0000000..8ac070e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRootType.php new file mode 100644 index 0000000..41ab825 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRoot.php new file mode 100644 index 0000000..d912a8e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRootType.php new file mode 100644 index 0000000..c7dee1a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRoot.php new file mode 100644 index 0000000..c49437e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRootType.php new file mode 100644 index 0000000..6b47b0f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRoot.php new file mode 100644 index 0000000..9af8e2c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRootType.php new file mode 100644 index 0000000..03492e6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRoot.php new file mode 100644 index 0000000..b235b73 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRootType.php new file mode 100644 index 0000000..ec10e1a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRoot.php new file mode 100644 index 0000000..2a75729 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRootType.php new file mode 100644 index 0000000..feb08c0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRoot.php new file mode 100644 index 0000000..88b1123 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRootType.php new file mode 100644 index 0000000..4912cea --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRoot.php new file mode 100644 index 0000000..cdc96ce --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRootType.php new file mode 100644 index 0000000..e1247d8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRoot.php new file mode 100644 index 0000000..b79d4df --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRootType.php new file mode 100644 index 0000000..b309033 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..9a8db56 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..a669067 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..da0cd27 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..0629833 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..091d953 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..389e0b0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..28b453a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItem.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..86e68a7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP1.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.php new file mode 100644 index 0000000..7a99523 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP2.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.php new file mode 100644 index 0000000..0e9799f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP3.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.php new file mode 100644 index 0000000..c781563 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyQuadPointsItemP4.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.php new file mode 100644 index 0000000..74920f1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRect.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/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php new file mode 100644 index 0000000..69c0d8a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..5191680 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e2d38b0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..0d95337 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..2a80ab1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..90ac189 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemSquigglyReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemStampActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemStampActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemStampInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemStampActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemStampActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActions.php new file mode 100644 index 0000000..fbc64bf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActions.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/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivate.php new file mode 100644 index 0000000..5abffb8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRoot.php new file mode 100644 index 0000000..0918181 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRootType.php new file mode 100644 index 0000000..9fa3d54 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRoot.php new file mode 100644 index 0000000..dbe6843 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRootType.php new file mode 100644 index 0000000..1f6be45 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRoot.php new file mode 100644 index 0000000..b63285f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRootType.php new file mode 100644 index 0000000..263082b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRoot.php new file mode 100644 index 0000000..790afef --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRootType.php new file mode 100644 index 0000000..afcf1d3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRoot.php new file mode 100644 index 0000000..858b3a4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRootType.php new file mode 100644 index 0000000..9781c0c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRoot.php new file mode 100644 index 0000000..cfddd9a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRootType.php new file mode 100644 index 0000000..0bbaf7e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRoot.php new file mode 100644 index 0000000..0ab9d0d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRootType.php new file mode 100644 index 0000000..ccf5984 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRoot.php new file mode 100644 index 0000000..4287006 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRootType.php new file mode 100644 index 0000000..a4cc790 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRoot.php new file mode 100644 index 0000000..396e720 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRootType.php new file mode 100644 index 0000000..dc54eac --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRoot.php new file mode 100644 index 0000000..24bca1f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRootType.php new file mode 100644 index 0000000..440a1c9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRoot.php new file mode 100644 index 0000000..a31dce8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRootType.php new file mode 100644 index 0000000..e0a94ad --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..06d71d3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..c09456c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..b0e1178 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..4259094 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..4f30711 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..bcecb7d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRect.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/DocAnnotationsList200ResponseAnnotationsItemStampRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRef.php new file mode 100644 index 0000000..0cd0203 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..a5e16a7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..868b8bc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..d5746da --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..99106c3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..4e5cabf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStampReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..52b0698 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeout.php @@ -0,0 +1,213 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions.php new file mode 100644 index 0000000..66e114a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActions.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivate.php new file mode 100644 index 0000000..aa4ca03 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRoot.php new file mode 100644 index 0000000..d9c125d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRootType.php new file mode 100644 index 0000000..8aa581e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRoot.php new file mode 100644 index 0000000..dfa4a04 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRootType.php new file mode 100644 index 0000000..957fb36 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRoot.php new file mode 100644 index 0000000..0d0c3e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRootType.php new file mode 100644 index 0000000..b953c95 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRoot.php new file mode 100644 index 0000000..7429a39 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRootType.php new file mode 100644 index 0000000..2b98097 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRoot.php new file mode 100644 index 0000000..959c2a4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRootType.php new file mode 100644 index 0000000..b63fec6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRoot.php new file mode 100644 index 0000000..0e8b5ca --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRootType.php new file mode 100644 index 0000000..6aec296 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRoot.php new file mode 100644 index 0000000..b879e3b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRootType.php new file mode 100644 index 0000000..067f98c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRoot.php new file mode 100644 index 0000000..b588e3f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRootType.php new file mode 100644 index 0000000..3a08c0a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRoot.php new file mode 100644 index 0000000..9cf6927 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRootType.php new file mode 100644 index 0000000..93f9f6c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRoot.php new file mode 100644 index 0000000..ff7b30c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRootType.php new file mode 100644 index 0000000..86be11d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRoot.php new file mode 100644 index 0000000..7c36e72 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRootType.php new file mode 100644 index 0000000..cc87914 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..a4c036e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..8eaf3e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..6b8dec3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..5d2a090 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..18ddf1d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3426bf2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..730ab72 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutIntent.php @@ -0,0 +1,8 @@ +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 new file mode 100644 index 0000000..07974d0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP1.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.php new file mode 100644 index 0000000..a913104 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP2.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.php new file mode 100644 index 0000000..fc50a93 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP3.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.php new file mode 100644 index 0000000..56de155 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutQuadPointsItemP4.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.php new file mode 100644 index 0000000..7683799 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRect.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/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php new file mode 100644 index 0000000..3edf706 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..7944158 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..78813da --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f8624b5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..590e619 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..c902adb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemStrikeoutReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemTextActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemTextActions $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; + + /** + * @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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemTextInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemTextActions, + * } $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->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']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActions.php new file mode 100644 index 0000000..08fda2f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActions.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/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivate.php new file mode 100644 index 0000000..60b965e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRoot.php new file mode 100644 index 0000000..3532857 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRootType.php new file mode 100644 index 0000000..d90dcbd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRoot.php new file mode 100644 index 0000000..d9e39d4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRootType.php new file mode 100644 index 0000000..5a29a96 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRoot.php new file mode 100644 index 0000000..5bb7f0b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRootType.php new file mode 100644 index 0000000..feef209 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRoot.php new file mode 100644 index 0000000..0f6e064 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRootType.php new file mode 100644 index 0000000..6318f90 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRoot.php new file mode 100644 index 0000000..b61537c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRootType.php new file mode 100644 index 0000000..59bc38a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRoot.php new file mode 100644 index 0000000..62ea7b0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRootType.php new file mode 100644 index 0000000..9de2876 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRoot.php new file mode 100644 index 0000000..ccdb93c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRootType.php new file mode 100644 index 0000000..64e3867 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRoot.php new file mode 100644 index 0000000..d0e6f71 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRootType.php new file mode 100644 index 0000000..fcfb499 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRoot.php new file mode 100644 index 0000000..c0577e2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRootType.php new file mode 100644 index 0000000..cc68972 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRoot.php new file mode 100644 index 0000000..ee7b08f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRootType.php new file mode 100644 index 0000000..f597cd7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRoot.php new file mode 100644 index 0000000..c0f86f2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRootType.php new file mode 100644 index 0000000..b353e51 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..17bebbe --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..9ba7752 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextIcon.php @@ -0,0 +1,14 @@ +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 new file mode 100644 index 0000000..50cefb8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..dc053ee --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..54c01d6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..56c6578 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..929f2da --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRect.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/DocAnnotationsList200ResponseAnnotationsItemTextRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRef.php new file mode 100644 index 0000000..d08ce4c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..fde2585 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..e4504af --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..c34c176 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..83c21e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..8ddbc55 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemTextReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActions, + * } $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->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/DocAnnotationsList200ResponseAnnotationsItemUnderlineActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActions.php new file mode 100644 index 0000000..fd932bc --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActions.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivate.php new file mode 100644 index 0000000..fc0ed72 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRoot.php new file mode 100644 index 0000000..d4885eb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRootType.php new file mode 100644 index 0000000..d46429d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRoot.php new file mode 100644 index 0000000..0a8b949 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRootType.php new file mode 100644 index 0000000..9f3c542 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRoot.php new file mode 100644 index 0000000..42ab99e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRootType.php new file mode 100644 index 0000000..1ac5fac --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRoot.php new file mode 100644 index 0000000..9b2752f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRootType.php new file mode 100644 index 0000000..ed6e320 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRoot.php new file mode 100644 index 0000000..971d6b0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRootType.php new file mode 100644 index 0000000..bf34e6c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRoot.php new file mode 100644 index 0000000..8923325 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRootType.php new file mode 100644 index 0000000..5b4bd90 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRoot.php new file mode 100644 index 0000000..b254026 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRootType.php new file mode 100644 index 0000000..d7a371a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRoot.php new file mode 100644 index 0000000..bb2ab64 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRootType.php new file mode 100644 index 0000000..8b222a4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRoot.php new file mode 100644 index 0000000..8b138c7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRootType.php new file mode 100644 index 0000000..5765759 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRoot.php new file mode 100644 index 0000000..b0e2203 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRootType.php new file mode 100644 index 0000000..d9b6058 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRoot.php new file mode 100644 index 0000000..6003658 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRootType.php new file mode 100644 index 0000000..a58723b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..e28399d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineFlags.php @@ -0,0 +1,106 @@ +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 new file mode 100644 index 0000000..17db83b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..fd914a3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..92f2dda --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..db413c5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..18a5443 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..72229cd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItem.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..d7d42ce --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP1.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.php new file mode 100644 index 0000000..b03ce86 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP2.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.php new file mode 100644 index 0000000..4a67a06 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP3.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.php new file mode 100644 index 0000000..bf2bb23 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineQuadPointsItemP4.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.php new file mode 100644 index 0000000..8d45856 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRect.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/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php new file mode 100644 index 0000000..f7c4f04 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..e5b44e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a4833f8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..504e3b2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3f9911d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..f6bc981 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnderlineReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions.php new file mode 100644 index 0000000..a2b88a1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActions.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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivate.php new file mode 100644 index 0000000..c1ad166 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRoot.php new file mode 100644 index 0000000..5de20be --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRootType.php new file mode 100644 index 0000000..852caf3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRoot.php new file mode 100644 index 0000000..5108878 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRootType.php new file mode 100644 index 0000000..f8c3c01 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRoot.php new file mode 100644 index 0000000..37286c5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRootType.php new file mode 100644 index 0000000..8a6cc7c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRoot.php new file mode 100644 index 0000000..ddb1980 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRootType.php new file mode 100644 index 0000000..7bd9ee6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRoot.php new file mode 100644 index 0000000..4b3eb34 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRootType.php new file mode 100644 index 0000000..6132202 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRoot.php new file mode 100644 index 0000000..ecf3bac --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRootType.php new file mode 100644 index 0000000..c7f9ff4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRoot.php new file mode 100644 index 0000000..35078e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRootType.php new file mode 100644 index 0000000..048d045 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRoot.php new file mode 100644 index 0000000..05d10c9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRootType.php new file mode 100644 index 0000000..342caed --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRoot.php new file mode 100644 index 0000000..bd4d07e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRootType.php new file mode 100644 index 0000000..9dbbd7e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRoot.php new file mode 100644 index 0000000..0064e10 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRootType.php new file mode 100644 index 0000000..5912c6f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRoot.php new file mode 100644 index 0000000..1574b6b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRootType.php new file mode 100644 index 0000000..a4dbc7e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..e315226 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedIdentityQuality.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..e019cff --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a8a9fb1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a3bb553 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..5adc52d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..17f0356 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRect.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/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php new file mode 100644 index 0000000..ff1b7c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..9de6453 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..bd9ec4b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..80137d4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..a455726 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..f4c5a1a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemUnsupportedReplyType.php @@ -0,0 +1,9 @@ + $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 $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 ?DocAnnotationsList200ResponseAnnotationsItemWidgetActions $actions + */ + #[JsonProperty('actions')] + public ?DocAnnotationsList200ResponseAnnotationsItemWidgetActions $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, + * author?: ?string, + * created?: ?DateTime, + * modified?: ?DateTime, + * inReplyTo?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyTo, + * replyType?: ?value-of, + * userId?: ?string, + * groupId?: ?string, + * createdBy?: ?string, + * updatedBy?: ?string, + * actions?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActions, + * 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->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/DocAnnotationsList200ResponseAnnotationsItemWidgetActions.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActions.php new file mode 100644 index 0000000..2ff131f --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActions.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/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivate.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivate.php new file mode 100644 index 0000000..9ec9753 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRoot.php new file mode 100644 index 0000000..59260f4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRootType.php new file mode 100644 index 0000000..2c420fb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsActivateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRoot.php new file mode 100644 index 0000000..efbe3f5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRootType.php new file mode 100644 index 0000000..d1e2c68 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsBlurRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRoot.php new file mode 100644 index 0000000..a068b34 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRootType.php new file mode 100644 index 0000000..224898a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorEnterRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRoot.php new file mode 100644 index 0000000..c3b7143 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRootType.php new file mode 100644 index 0000000..921ea38 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsCursorExitRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRoot.php new file mode 100644 index 0000000..32dd0ed --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRootType.php new file mode 100644 index 0000000..2d45c62 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsFocusRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRoot.php new file mode 100644 index 0000000..64d3d18 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRootType.php new file mode 100644 index 0000000..e6bb8ba --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseDownRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRoot.php new file mode 100644 index 0000000..2cd5f84 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRootType.php new file mode 100644 index 0000000..d6a0fbf --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsMouseUpRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRoot.php new file mode 100644 index 0000000..6cf1c9a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRootType.php new file mode 100644 index 0000000..49e0cea --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageCloseRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRoot.php new file mode 100644 index 0000000..3d15fa5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRootType.php new file mode 100644 index 0000000..e9a8a3b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageInvisibleRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRoot.php new file mode 100644 index 0000000..3e2e4e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRootType.php new file mode 100644 index 0000000..b615f50 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageOpenRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRoot.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRoot.php new file mode 100644 index 0000000..ff5468e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRootType.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRootType.php new file mode 100644 index 0000000..3f5997d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetActionsPageVisibleRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..2ec4d4c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFieldFamily.php @@ -0,0 +1,15 @@ +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 new file mode 100644 index 0000000..9eee599 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f8a9cdb --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetFontFamily.php @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..9ef8d38 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..5192348 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..04ca89c --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..2f88f14 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInReplyToObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..b0718c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetInteriorColor.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..92f6c27 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRect.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/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php new file mode 100644 index 0000000..ba3a415 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRef.php @@ -0,0 +1,241 @@ +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 new file mode 100644 index 0000000..c230fd5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndex.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..fa69c46 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefIndexRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..efe6741 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefNm.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..32ba6cd --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetRefObjectNumber.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..e5a07c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemWidgetReplyType.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..a67c0c2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponsePageStateRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..112a186 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..d096674 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..bbd3ee6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponsePageStateWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList404Response.php b/src/Types/DocAnnotationsList404Response.php new file mode 100644 index 0000000..b53933e --- /dev/null +++ b/src/Types/DocAnnotationsList404Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..bbe3295 --- /dev/null +++ b/src/Types/DocAnnotationsList404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMeta.php b/src/Types/DocAnnotationsUpdate200ResponseMeta.php new file mode 100644 index 0000000..3aea66d --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..7830c32 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..151348b --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..f535b39 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..f08e5ff --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..a0a103a --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..f0c6d3e --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..35ec08d --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..69eeb27 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..5bbb382 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..a92d309 --- /dev/null +++ b/src/Types/DocAnnotationsUpdate400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..03a84bf --- /dev/null +++ b/src/Types/DocAnnotationsUpdate404ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..5e2f96c --- /dev/null +++ b/src/Types/DocDownloadResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..32ad135 --- /dev/null +++ b/src/Types/DocFormsExportDataResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..6b57830 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseCalculationOrderItem.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..6b84d3c --- /dev/null +++ b/src/Types/DocFormsGet200ResponseCalculationOrderItemFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php b/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php new file mode 100644 index 0000000..c08bdf4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseCalculationOrderItemObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItem.php b/src/Types/DocFormsGet200ResponseFieldsItem.php new file mode 100644 index 0000000..0d819ec --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItem.php @@ -0,0 +1,466 @@ +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 new file mode 100644 index 0000000..555794a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckbox.php @@ -0,0 +1,131 @@ + $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 ?DocFormsGet200ResponseFieldsItemCheckboxActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemCheckboxActions $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?: ?DocFormsGet200ResponseFieldsItemCheckboxActions, + * } $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/DocFormsGet200ResponseFieldsItemCheckboxActions.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActions.php new file mode 100644 index 0000000..cf0ed6e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActions.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/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculate.php new file mode 100644 index 0000000..831a933 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRoot.php new file mode 100644 index 0000000..daed426 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRootType.php new file mode 100644 index 0000000..1f5a003 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRoot.php new file mode 100644 index 0000000..f297317 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRootType.php new file mode 100644 index 0000000..6d860cb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRoot.php new file mode 100644 index 0000000..6511a88 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRootType.php new file mode 100644 index 0000000..ebe7c99 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRoot.php new file mode 100644 index 0000000..4ed68a1 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRootType.php new file mode 100644 index 0000000..ed24b15 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..360325d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php new file mode 100644 index 0000000..112d6e0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..e09f608 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..34bcd00 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php new file mode 100644 index 0000000..c84951d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..f3ced53 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..a251dc0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php new file mode 100644 index 0000000..04e362e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php new file mode 100644 index 0000000..b30a3b3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..b7d5de3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryArray.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/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php new file mode 100644 index 0000000..0dc4e6c --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php new file mode 100644 index 0000000..4f9df5e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php new file mode 100644 index 0000000..21258ea --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php new file mode 100644 index 0000000..8f3cb08 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCheckboxWidgetsItem.php @@ -0,0 +1,66 @@ +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 new file mode 100644 index 0000000..886406e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemCombobox.php @@ -0,0 +1,147 @@ + $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 ?DocFormsGet200ResponseFieldsItemComboboxActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemComboboxActions $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?: ?DocFormsGet200ResponseFieldsItemComboboxActions, + * } $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/DocFormsGet200ResponseFieldsItemComboboxActions.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActions.php new file mode 100644 index 0000000..070ba34 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActions.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/DocFormsGet200ResponseFieldsItemComboboxActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculate.php new file mode 100644 index 0000000..913f607 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRoot.php new file mode 100644 index 0000000..da95343 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRootType.php new file mode 100644 index 0000000..6f7ebf4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemComboboxActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRoot.php new file mode 100644 index 0000000..5d019a6 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRootType.php new file mode 100644 index 0000000..1efc1fb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRoot.php new file mode 100644 index 0000000..b045288 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRootType.php new file mode 100644 index 0000000..a91b5f1 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemComboboxActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRoot.php new file mode 100644 index 0000000..82fa49a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRootType.php new file mode 100644 index 0000000..bf6dc06 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..543f27b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php new file mode 100644 index 0000000..4ef7dc0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..33b2529 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..f68aab4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php new file mode 100644 index 0000000..6e0a957 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..e7bd1aa --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxOptionsItem.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/DocFormsGet200ResponseFieldsItemComboboxOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxOrigin.php new file mode 100644 index 0000000..ee683b8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..6b78f72 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php new file mode 100644 index 0000000..c81e82f --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php new file mode 100644 index 0000000..c465764 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..53ed94d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryArray.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/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php new file mode 100644 index 0000000..32f8de7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php new file mode 100644 index 0000000..40a5d07 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php new file mode 100644 index 0000000..cefcc1d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php new file mode 100644 index 0000000..e9a9079 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemComboboxWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..8afaa00 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListbox.php @@ -0,0 +1,139 @@ + $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 ?DocFormsGet200ResponseFieldsItemListboxActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemListboxActions $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?: ?DocFormsGet200ResponseFieldsItemListboxActions, + * } $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/DocFormsGet200ResponseFieldsItemListboxActions.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActions.php new file mode 100644 index 0000000..0635b10 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActions.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/DocFormsGet200ResponseFieldsItemListboxActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculate.php new file mode 100644 index 0000000..6bbb51b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemListboxActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRoot.php new file mode 100644 index 0000000..ddd9ba6 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRootType.php new file mode 100644 index 0000000..d3a1ab5 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemListboxActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRoot.php new file mode 100644 index 0000000..0e1dc7c --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRootType.php new file mode 100644 index 0000000..83c064a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRoot.php new file mode 100644 index 0000000..2aba835 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRootType.php new file mode 100644 index 0000000..eb61509 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemListboxActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRoot.php new file mode 100644 index 0000000..439298a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRootType.php new file mode 100644 index 0000000..bff61b0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..48ede10 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php new file mode 100644 index 0000000..6912504 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php new file mode 100644 index 0000000..18aa596 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..bc6a89d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php new file mode 100644 index 0000000..82ab5c8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..c832519 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxOptionsItem.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/DocFormsGet200ResponseFieldsItemListboxOrigin.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxOrigin.php new file mode 100644 index 0000000..eb60760 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..99d8238 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php new file mode 100644 index 0000000..87eef5e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php new file mode 100644 index 0000000..e259a2a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..2a7cd61 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryArray.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/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php new file mode 100644 index 0000000..a5d71dc --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php new file mode 100644 index 0000000..1df8cba --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php new file mode 100644 index 0000000..d9ac397 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php new file mode 100644 index 0000000..f08d27d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemListboxWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..8252ecc --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbutton.php @@ -0,0 +1,115 @@ + $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 ?DocFormsGet200ResponseFieldsItemPushbuttonActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemPushbuttonActions $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?: ?DocFormsGet200ResponseFieldsItemPushbuttonActions, + * } $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/DocFormsGet200ResponseFieldsItemPushbuttonActions.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActions.php new file mode 100644 index 0000000..4376bfd --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActions.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/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculate.php new file mode 100644 index 0000000..7dc8886 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRoot.php new file mode 100644 index 0000000..f32de9a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRootType.php new file mode 100644 index 0000000..ca991d8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRoot.php new file mode 100644 index 0000000..e898689 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRootType.php new file mode 100644 index 0000000..b5d38e1 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRoot.php new file mode 100644 index 0000000..72ae828 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRootType.php new file mode 100644 index 0000000..a8eceb1 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRoot.php new file mode 100644 index 0000000..29a7eba --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRootType.php new file mode 100644 index 0000000..99b0cee --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..7548648 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php new file mode 100644 index 0000000..a8fd563 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php new file mode 100644 index 0000000..9d93070 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..443f9d7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php new file mode 100644 index 0000000..cf2a993 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..24290cb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..51dcba0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php new file mode 100644 index 0000000..de70918 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php new file mode 100644 index 0000000..9013951 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..3e07b6e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryArray.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/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php new file mode 100644 index 0000000..da5a920 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php new file mode 100644 index 0000000..29497cf --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php new file mode 100644 index 0000000..ccdcb06 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php new file mode 100644 index 0000000..fceb67a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemPushbuttonWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..7238062 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadio.php @@ -0,0 +1,139 @@ + $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 ?DocFormsGet200ResponseFieldsItemRadioActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemRadioActions $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?: ?DocFormsGet200ResponseFieldsItemRadioActions, + * } $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/DocFormsGet200ResponseFieldsItemRadioActions.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActions.php new file mode 100644 index 0000000..dc42a5e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActions.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/DocFormsGet200ResponseFieldsItemRadioActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculate.php new file mode 100644 index 0000000..a9105ce --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemRadioActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRoot.php new file mode 100644 index 0000000..504b2c3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRootType.php new file mode 100644 index 0000000..74eaf4a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemRadioActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRoot.php new file mode 100644 index 0000000..6649622 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRootType.php new file mode 100644 index 0000000..63916ce --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRoot.php new file mode 100644 index 0000000..387156a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRootType.php new file mode 100644 index 0000000..fe5b50f --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemRadioActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRoot.php new file mode 100644 index 0000000..00cb06c --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRootType.php new file mode 100644 index 0000000..7f0b92b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..125f427 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php new file mode 100644 index 0000000..272c5b8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php new file mode 100644 index 0000000..6997d96 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..c5818af --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php new file mode 100644 index 0000000..ba20df7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..03150cb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..360df4b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php new file mode 100644 index 0000000..5531215 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php new file mode 100644 index 0000000..9e04f95 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..d6fe714 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryArray.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/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php new file mode 100644 index 0000000..24d2273 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php new file mode 100644 index 0000000..33de4ea --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php new file mode 100644 index 0000000..262a9ad --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php new file mode 100644 index 0000000..7c80a23 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemRadioWidgetsItem.php @@ -0,0 +1,66 @@ +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 new file mode 100644 index 0000000..be0d2fe --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignature.php @@ -0,0 +1,115 @@ + $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 ?DocFormsGet200ResponseFieldsItemSignatureActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemSignatureActions $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?: ?DocFormsGet200ResponseFieldsItemSignatureActions, + * } $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/DocFormsGet200ResponseFieldsItemSignatureActions.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActions.php new file mode 100644 index 0000000..0beb3cb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActions.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/DocFormsGet200ResponseFieldsItemSignatureActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculate.php new file mode 100644 index 0000000..85a2971 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRoot.php new file mode 100644 index 0000000..b450cc7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRootType.php new file mode 100644 index 0000000..6d3f0a3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemSignatureActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRoot.php new file mode 100644 index 0000000..5314fdc --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRootType.php new file mode 100644 index 0000000..a35b1ea --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRoot.php new file mode 100644 index 0000000..e873217 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRootType.php new file mode 100644 index 0000000..b9ae47e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemSignatureActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRoot.php new file mode 100644 index 0000000..a6cfbe4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRootType.php new file mode 100644 index 0000000..c343da4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..c3e9f45 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php new file mode 100644 index 0000000..212f2cd --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php new file mode 100644 index 0000000..81d30e3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..af1808d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php new file mode 100644 index 0000000..5666ba2 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..9bab4fa --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..8ada6fb --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php new file mode 100644 index 0000000..c0cfc01 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php new file mode 100644 index 0000000..468d367 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..21d6018 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryArray.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/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php new file mode 100644 index 0000000..2aabf2b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php new file mode 100644 index 0000000..6081ff4 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php new file mode 100644 index 0000000..4b4b8ab --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php new file mode 100644 index 0000000..3d85697 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemSignatureWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..0f7eb30 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemText.php @@ -0,0 +1,163 @@ + $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 ?DocFormsGet200ResponseFieldsItemTextActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemTextActions $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?: ?DocFormsGet200ResponseFieldsItemTextActions, + * 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/DocFormsGet200ResponseFieldsItemTextActions.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActions.php new file mode 100644 index 0000000..29c741b --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActions.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/DocFormsGet200ResponseFieldsItemTextActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculate.php new file mode 100644 index 0000000..e964759 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemTextActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRoot.php new file mode 100644 index 0000000..ad68f63 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRootType.php new file mode 100644 index 0000000..d646996 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemTextActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRoot.php new file mode 100644 index 0000000..39d8c37 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRootType.php new file mode 100644 index 0000000..1118bce --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRoot.php new file mode 100644 index 0000000..6856aa2 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRootType.php new file mode 100644 index 0000000..4a4a6fa --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemTextActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRoot.php new file mode 100644 index 0000000..dd7efd9 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRootType.php new file mode 100644 index 0000000..38ece3a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..9e522ee --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php new file mode 100644 index 0000000..36d68fe --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php new file mode 100644 index 0000000..889858e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..6876835 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php new file mode 100644 index 0000000..ae78760 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..b104ed8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..f29fc4d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php new file mode 100644 index 0000000..5d9d0c7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php new file mode 100644 index 0000000..9016655 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..54a0dc1 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryArray.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/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php new file mode 100644 index 0000000..9b62d0e --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php new file mode 100644 index 0000000..48d6e6f --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php new file mode 100644 index 0000000..5b94470 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php new file mode 100644 index 0000000..3550002 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemTextWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..1950a41 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknown.php @@ -0,0 +1,123 @@ + $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 ?DocFormsGet200ResponseFieldsItemUnknownActions $actions + */ + #[JsonProperty('actions')] + public ?DocFormsGet200ResponseFieldsItemUnknownActions $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?: ?DocFormsGet200ResponseFieldsItemUnknownActions, + * } $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/DocFormsGet200ResponseFieldsItemUnknownActions.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActions.php new file mode 100644 index 0000000..38fe6b7 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActions.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/DocFormsGet200ResponseFieldsItemUnknownActionsCalculate.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculate.php new file mode 100644 index 0000000..e12ea30 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculate.php @@ -0,0 +1,59 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRoot.php new file mode 100644 index 0000000..7ab605c --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRootType.php new file mode 100644 index 0000000..61095b2 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsCalculateRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemUnknownActionsFormatRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRoot.php new file mode 100644 index 0000000..49d6e12 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRootType.php new file mode 100644 index 0000000..75eefbf --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsFormatRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRoot.php new file mode 100644 index 0000000..123e0b5 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRootType.php new file mode 100644 index 0000000..9c0a8a0 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsKeystrokeRootType.php @@ -0,0 +1,26 @@ +> $warnings + */ + #[JsonProperty('warnings'), ArrayType(['string'])] + public array $warnings; + + /** + * @param array{ + * incomplete: bool, + * warningFlags: int, + * warnings: array>, + * root?: ?DocFormsGet200ResponseFieldsItemUnknownActionsValidateRoot, + * } $values + */ + public function __construct( + array $values, + ) { + $this->root = $values['root'] ?? null; + $this->incomplete = $values['incomplete']; + $this->warningFlags = $values['warningFlags']; + $this->warnings = $values['warnings']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRoot.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRoot.php new file mode 100644 index 0000000..7fd7cd8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRoot.php @@ -0,0 +1,59 @@ + $type + */ + #[JsonProperty('type')] + public string $type; + + /** + * @var string $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $script + */ + #[JsonProperty('script')] + public ?string $script; + + /** + * @var array $next + */ + #[JsonProperty('next'), ArrayType(['mixed'])] + public array $next; + + /** + * @param array{ + * type: value-of, + * subtype: string, + * next: array, + * script?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->type = $values['type']; + $this->subtype = $values['subtype']; + $this->script = $values['script'] ?? null; + $this->next = $values['next']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRootType.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRootType.php new file mode 100644 index 0000000..0c8a53a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownActionsValidateRootType.php @@ -0,0 +1,26 @@ +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 new file mode 100644 index 0000000..f269abe --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryArray.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/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php new file mode 100644 index 0000000..f143e9a --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php new file mode 100644 index 0000000..2305d10 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php new file mode 100644 index 0000000..e45d9b5 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownDefaultValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php new file mode 100644 index 0000000..bac4fa3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownFlags.php @@ -0,0 +1,58 @@ +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 new file mode 100644 index 0000000..2cfbb80 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownOrigin.php @@ -0,0 +1,9 @@ +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 new file mode 100644 index 0000000..7434fe3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefFqn.php @@ -0,0 +1,34 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php new file mode 100644 index 0000000..5d9d6a8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownRefObjectNumber.php @@ -0,0 +1,34 @@ +fieldObjectNumber = $values['fieldObjectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php new file mode 100644 index 0000000..5ade3a8 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntry.php @@ -0,0 +1,286 @@ +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 new file mode 100644 index 0000000..4dc8529 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryArray.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/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php new file mode 100644 index 0000000..78b605f --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php new file mode 100644 index 0000000..12fbed5 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php new file mode 100644 index 0000000..1d936d3 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php b/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php new file mode 100644 index 0000000..0f1876d --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFieldsItemUnknownWidgetsItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..1f4bf18 --- /dev/null +++ b/src/Types/DocFormsGet200ResponseFormKind.php @@ -0,0 +1,10 @@ + $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 new file mode 100644 index 0000000..7a51a05 --- /dev/null +++ b/src/Types/DocFormsGet404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsImportData200ResponseMeta.php b/src/Types/DocFormsImportData200ResponseMeta.php new file mode 100644 index 0000000..eda025b --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..c7a44c2 --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..c1033e9 --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..c5a47ea --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..7d7438b --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..c7aa31c --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php b/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..3af165e --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocFormsImportData200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..e95b3dc --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..804fa0c --- /dev/null +++ b/src/Types/DocFormsImportData200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..3485250 --- /dev/null +++ b/src/Types/DocFormsImportData400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..055598a --- /dev/null +++ b/src/Types/DocFormsImportData400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..60cd848 --- /dev/null +++ b/src/Types/DocFormsImportData404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReset200ResponseMeta.php b/src/Types/DocFormsReset200ResponseMeta.php new file mode 100644 index 0000000..9131d0f --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..f13f323 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..c5aa99f --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..0696f06 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..4dac5ae --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..c02faa3 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsReset200ResponseMetaCacheDelta.php b/src/Types/DocFormsReset200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..ff4f9f4 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocFormsReset200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..ab42a19 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..13636b1 --- /dev/null +++ b/src/Types/DocFormsReset200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..67de8cd --- /dev/null +++ b/src/Types/DocFormsReset404Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..57db13f --- /dev/null +++ b/src/Types/DocFormsReset404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsSetValue200ResponseMeta.php b/src/Types/DocFormsSetValue200ResponseMeta.php new file mode 100644 index 0000000..211e17c --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..d0eaa3c --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a517cf7 --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..eb81dc7 --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..19ceea8 --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..536219b --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php b/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..8458670 --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocFormsSetValue200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..23062b3 --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..27be04b --- /dev/null +++ b/src/Types/DocFormsSetValue200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..1e5f7f9 --- /dev/null +++ b/src/Types/DocFormsSetValue400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..ff825c3 --- /dev/null +++ b/src/Types/DocFormsSetValue400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..b842da4 --- /dev/null +++ b/src/Types/DocFormsSetValue404ResponseCode.php @@ -0,0 +1,25 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var DocHead200ResponseEncryption $encryption + */ + #[JsonProperty('encryption')] + public DocHead200ResponseEncryption $encryption; + + /** + * @var DocHead200ResponsePermissions $permissions + */ + #[JsonProperty('permissions')] + public DocHead200ResponsePermissions $permissions; + + /** + * @var DocHead200ResponseAccess $access + */ + #[JsonProperty('access')] + public DocHead200ResponseAccess $access; + + /** + * @param array{ + * id: string, + * baseSha: string, + * storageSizeBytes: int, + * docVersion: int, + * state: value-of, + * encryption: DocHead200ResponseEncryption, + * permissions: DocHead200ResponsePermissions, + * access: DocHead200ResponseAccess, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->baseSha = $values['baseSha']; + $this->storageSizeBytes = $values['storageSizeBytes']; + $this->docVersion = $values['docVersion']; + $this->state = $values['state']; + $this->encryption = $values['encryption']; + $this->permissions = $values['permissions']; + $this->access = $values['access']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHead200ResponseAccess.php b/src/Types/DocHead200ResponseAccess.php new file mode 100644 index 0000000..ec2eb26 --- /dev/null +++ b/src/Types/DocHead200ResponseAccess.php @@ -0,0 +1,51 @@ +> $reasons + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var ?string $endpoint + */ + #[JsonProperty('endpoint')] + public ?string $endpoint; + + /** + * @param array{ + * required: bool, + * reasons: array>, + * endpoint?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->required = $values['required']; + $this->reasons = $values['reasons']; + $this->endpoint = $values['endpoint'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHead200ResponseAccessReasonsItem.php b/src/Types/DocHead200ResponseAccessReasonsItem.php new file mode 100644 index 0000000..c75ce00 --- /dev/null +++ b/src/Types/DocHead200ResponseAccessReasonsItem.php @@ -0,0 +1,10 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?bool $requiresPassword + */ + #[JsonProperty('requiresPassword')] + public ?bool $requiresPassword; + + /** + * @param array{ + * state: value-of, + * requiresPassword?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->state = $values['state']; + $this->requiresPassword = $values['requiresPassword'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHead200ResponseEncryptionState.php b/src/Types/DocHead200ResponseEncryptionState.php new file mode 100644 index 0000000..dc79203 --- /dev/null +++ b/src/Types/DocHead200ResponseEncryptionState.php @@ -0,0 +1,11 @@ + $openedAs + */ + #[JsonProperty('openedAs')] + public ?string $openedAs; + + /** + * @var ?int $securityHandlerRevision + */ + #[JsonProperty('securityHandlerRevision')] + public ?int $securityHandlerRevision; + + /** + * @var bool $canUpgradeToOwner + */ + #[JsonProperty('canUpgradeToOwner')] + public bool $canUpgradeToOwner; + + /** + * @param array{ + * known: bool, + * canUpgradeToOwner: bool, + * bits?: ?int, + * allAllowed?: ?bool, + * openedAs?: ?value-of, + * securityHandlerRevision?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->known = $values['known']; + $this->bits = $values['bits'] ?? null; + $this->allAllowed = $values['allAllowed'] ?? null; + $this->openedAs = $values['openedAs'] ?? null; + $this->securityHandlerRevision = $values['securityHandlerRevision'] ?? null; + $this->canUpgradeToOwner = $values['canUpgradeToOwner']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHead200ResponsePermissionsOpenedAs.php b/src/Types/DocHead200ResponsePermissionsOpenedAs.php new file mode 100644 index 0000000..5357250 --- /dev/null +++ b/src/Types/DocHead200ResponsePermissionsOpenedAs.php @@ -0,0 +1,10 @@ + $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 new file mode 100644 index 0000000..d42db5a --- /dev/null +++ b/src/Types/DocHead404ResponseCode.php @@ -0,0 +1,25 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocManifest200ResponsePagesItem::class])] + public array $pages; + + /** + * @param array{ + * docVersion: int, + * layoutVersion: int, + * metadataVersion: int, + * auditHead: int, + * baseSha: string, + * pages: array, + * actionsVersion?: ?int, + * attachmentsVersion?: ?int, + * scopes?: ?DocManifest200ResponseScopes, + * } $values + */ + public function __construct( + array $values, + ) { + $this->docVersion = $values['docVersion']; + $this->layoutVersion = $values['layoutVersion']; + $this->metadataVersion = $values['metadataVersion']; + $this->actionsVersion = $values['actionsVersion'] ?? null; + $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; + $this->auditHead = $values['auditHead']; + $this->baseSha = $values['baseSha']; + $this->scopes = $values['scopes'] ?? null; + $this->pages = $values['pages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponsePagesItem.php b/src/Types/DocManifest200ResponsePagesItem.php new file mode 100644 index 0000000..7158c07 --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItem.php @@ -0,0 +1,42 @@ +state = $values['state']; + $this->cache = $values['cache']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponsePagesItemCache.php b/src/Types/DocManifest200ResponsePagesItemCache.php new file mode 100644 index 0000000..433204c --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemCache.php @@ -0,0 +1,42 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponsePagesItemState.php b/src/Types/DocManifest200ResponsePagesItemState.php new file mode 100644 index 0000000..59b8584 --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemState.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..ffc87ca --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemStateRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..17abed1 --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..ebbb3b1 --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..78a2ee0 --- /dev/null +++ b/src/Types/DocManifest200ResponsePagesItemStateWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseScopes.php b/src/Types/DocManifest200ResponseScopes.php new file mode 100644 index 0000000..b1ca899 --- /dev/null +++ b/src/Types/DocManifest200ResponseScopes.php @@ -0,0 +1,74 @@ + $content + */ + #[JsonProperty('content')] + public string $content; + + /** + * @var value-of $annotations + */ + #[JsonProperty('annotations')] + public string $annotations; + + /** + * @var value-of $layout + */ + #[JsonProperty('layout')] + public string $layout; + + /** + * @var value-of $attachments + */ + #[JsonProperty('attachments')] + public string $attachments; + + /** + * @var value-of $metadata + */ + #[JsonProperty('metadata')] + public string $metadata; + + /** + * @var value-of $actions + */ + #[JsonProperty('actions')] + public string $actions; + + /** + * @param array{ + * content: value-of, + * annotations: value-of, + * layout: value-of, + * attachments: value-of, + * metadata: value-of, + * actions: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->content = $values['content']; + $this->annotations = $values['annotations']; + $this->layout = $values['layout']; + $this->attachments = $values['attachments']; + $this->metadata = $values['metadata']; + $this->actions = $values['actions']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifest200ResponseScopesActions.php b/src/Types/DocManifest200ResponseScopesActions.php new file mode 100644 index 0000000..4e624af --- /dev/null +++ b/src/Types/DocManifest200ResponseScopesActions.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 new file mode 100644 index 0000000..cd70934 --- /dev/null +++ b/src/Types/DocManifest404ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..e5f2205 --- /dev/null +++ b/src/Types/DocMetadataGet200ResponseTrapped.php @@ -0,0 +1,10 @@ + $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 new file mode 100644 index 0000000..d5e840e --- /dev/null +++ b/src/Types/DocMetadataGet404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseMeta.php b/src/Types/DocPagesDelete200ResponseMeta.php new file mode 100644 index 0000000..36d1bcd --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..c60d6ab --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..fd07017 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..bd3d9ac --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..21b3398 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..fb46c10 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php b/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..8239110 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesDelete200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..12e0945 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..4c40041 --- /dev/null +++ b/src/Types/DocPagesDelete200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..8cb6299 --- /dev/null +++ b/src/Types/DocPagesDelete400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..89de6c5 --- /dev/null +++ b/src/Types/DocPagesDelete400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..99b0d5d --- /dev/null +++ b/src/Types/DocPagesDelete404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlatten200ResponseMeta.php b/src/Types/DocPagesFlatten200ResponseMeta.php new file mode 100644 index 0000000..c6e09b5 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..70e32e6 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..9454254 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..6668cd0 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..1c9b232 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..85dc60f --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php b/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..5dec197 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesFlatten200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..15a3763 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..e4821a8 --- /dev/null +++ b/src/Types/DocPagesFlatten200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlatten400Response.php b/src/Types/DocPagesFlatten400Response.php new file mode 100644 index 0000000..20f828d --- /dev/null +++ b/src/Types/DocPagesFlatten400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..fa7c9b9 --- /dev/null +++ b/src/Types/DocPagesFlatten400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..914a4db --- /dev/null +++ b/src/Types/DocPagesFlatten404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesMove200ResponseMeta.php b/src/Types/DocPagesMove200ResponseMeta.php new file mode 100644 index 0000000..3ef5967 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..11996fc --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..d65ffc3 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..56573b1 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..75055c4 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..e956f33 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesMove200ResponseMetaCacheDelta.php b/src/Types/DocPagesMove200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..72260c0 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesMove200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..2f471df --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..2cfcd91 --- /dev/null +++ b/src/Types/DocPagesMove200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..5b50ad6 --- /dev/null +++ b/src/Types/DocPagesMove400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..8986b74 --- /dev/null +++ b/src/Types/DocPagesMove400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..06c8ff4 --- /dev/null +++ b/src/Types/DocPagesMove404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseMeta.php b/src/Types/DocPagesRotate200ResponseMeta.php new file mode 100644 index 0000000..ac4bf84 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..8eda1d8 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..badaed5 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..728a777 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..91cbe24 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..7c6fb23 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php b/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..88d6051 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesRotate200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..d4db4a5 --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..6dd125d --- /dev/null +++ b/src/Types/DocPagesRotate200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..376c7d1 --- /dev/null +++ b/src/Types/DocPagesRotate400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..aa6ebf9 --- /dev/null +++ b/src/Types/DocPagesRotate400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..8deb6aa --- /dev/null +++ b/src/Types/DocPagesRotate404ResponseCode.php @@ -0,0 +1,25 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApply200ResponseMeta.php b/src/Types/DocRedactionsApply200ResponseMeta.php new file mode 100644 index 0000000..62de2ea --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMeta.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 0000000..0f994ab --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..384ae66 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +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 new file mode 100644 index 0000000..a15f443 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +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 new file mode 100644 index 0000000..edb459a --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..b5a646b --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php b/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..25b7461 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaCacheDelta.php @@ -0,0 +1,51 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocRedactionsApply200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $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 new file mode 100644 index 0000000..d63a0cc --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..40734c5 --- /dev/null +++ b/src/Types/DocRedactionsApply200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApply400Response.php b/src/Types/DocRedactionsApply400Response.php new file mode 100644 index 0000000..8578ca3 --- /dev/null +++ b/src/Types/DocRedactionsApply400Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..c1cc574 --- /dev/null +++ b/src/Types/DocRedactionsApply400ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..684e67b --- /dev/null +++ b/src/Types/DocRedactionsApply404ResponseCode.php @@ -0,0 +1,25 @@ + $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 new file mode 100644 index 0000000..44b655e --- /dev/null +++ b/src/Types/DocRenderResponseCode.php @@ -0,0 +1,25 @@ +text = $values['text']; + $this->charCount = $values['charCount']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocText404Response.php b/src/Types/DocText404Response.php new file mode 100644 index 0000000..7bcacd9 --- /dev/null +++ b/src/Types/DocText404Response.php @@ -0,0 +1,59 @@ + $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 new file mode 100644 index 0000000..822f379 --- /dev/null +++ b/src/Types/DocText404ResponseCode.php @@ -0,0 +1,25 @@ +document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommit200ResponseDocument.php b/src/Types/DocumentsCommit200ResponseDocument.php new file mode 100644 index 0000000..8c6688d --- /dev/null +++ b/src/Types/DocumentsCommit200ResponseDocument.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommit200ResponseDocumentState.php b/src/Types/DocumentsCommit200ResponseDocumentState.php new file mode 100644 index 0000000..0cc425d --- /dev/null +++ b/src/Types/DocumentsCommit200ResponseDocumentState.php @@ -0,0 +1,11 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommit400ResponseError.php b/src/Types/DocumentsCommit400ResponseError.php new file mode 100644 index 0000000..a060715 --- /dev/null +++ b/src/Types/DocumentsCommit400ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..0482fd2 --- /dev/null +++ b/src/Types/DocumentsCommit404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommit404ResponseError.php b/src/Types/DocumentsCommit404ResponseError.php new file mode 100644 index 0000000..a40a9f9 --- /dev/null +++ b/src/Types/DocumentsCommit404ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..65d685f --- /dev/null +++ b/src/Types/DocumentsDelete403Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsDelete403ResponseError.php b/src/Types/DocumentsDelete403ResponseError.php new file mode 100644 index 0000000..170f97f --- /dev/null +++ b/src/Types/DocumentsDelete403ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..dc447e2 --- /dev/null +++ b/src/Types/DocumentsDelete404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsDelete404ResponseError.php b/src/Types/DocumentsDelete404ResponseError.php new file mode 100644 index 0000000..ba53af9 --- /dev/null +++ b/src/Types/DocumentsDelete404ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..af0c280 --- /dev/null +++ b/src/Types/DocumentsDownload403Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsDownload403ResponseError.php b/src/Types/DocumentsDownload403ResponseError.php new file mode 100644 index 0000000..805408c --- /dev/null +++ b/src/Types/DocumentsDownload403ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..58af843 --- /dev/null +++ b/src/Types/DocumentsDownload404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsDownload404ResponseError.php b/src/Types/DocumentsDownload404ResponseError.php new file mode 100644 index 0000000..8179c56 --- /dev/null +++ b/src/Types/DocumentsDownload404ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGet200Response.php b/src/Types/DocumentsGet200Response.php new file mode 100644 index 0000000..e6eb115 --- /dev/null +++ b/src/Types/DocumentsGet200Response.php @@ -0,0 +1,34 @@ +document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGet200ResponseDocument.php b/src/Types/DocumentsGet200ResponseDocument.php new file mode 100644 index 0000000..9a7aeba --- /dev/null +++ b/src/Types/DocumentsGet200ResponseDocument.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGet200ResponseDocumentState.php b/src/Types/DocumentsGet200ResponseDocumentState.php new file mode 100644 index 0000000..36c4807 --- /dev/null +++ b/src/Types/DocumentsGet200ResponseDocumentState.php @@ -0,0 +1,11 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGet403ResponseError.php b/src/Types/DocumentsGet403ResponseError.php new file mode 100644 index 0000000..4d2960c --- /dev/null +++ b/src/Types/DocumentsGet403ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..d09f9b8 --- /dev/null +++ b/src/Types/DocumentsGet404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGet404ResponseError.php b/src/Types/DocumentsGet404ResponseError.php new file mode 100644 index 0000000..3fdc7f8 --- /dev/null +++ b/src/Types/DocumentsGet404ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200Response.php b/src/Types/DocumentsInit200Response.php new file mode 100644 index 0000000..081b52b --- /dev/null +++ b/src/Types/DocumentsInit200Response.php @@ -0,0 +1,241 @@ +tag = $values['tag']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInit200ResponseCreated $created + * @return DocumentsInit200Response + */ + public static function created(DocumentsInit200ResponseCreated $created): DocumentsInit200Response + { + return new DocumentsInit200Response([ + 'tag' => 'created', + 'value' => $created, + ]); + } + + /** + * @param DocumentsInit200ResponseResumed $resumed + * @return DocumentsInit200Response + */ + public static function resumed(DocumentsInit200ResponseResumed $resumed): DocumentsInit200Response + { + return new DocumentsInit200Response([ + 'tag' => 'resumed', + 'value' => $resumed, + ]); + } + + /** + * @param DocumentsInit200ResponseDeduped $deduped + * @return DocumentsInit200Response + */ + public static function deduped(DocumentsInit200ResponseDeduped $deduped): DocumentsInit200Response + { + return new DocumentsInit200Response([ + 'tag' => 'deduped', + 'value' => $deduped, + ]); + } + + /** + * @return bool + */ + public function isCreated(): bool + { + return $this->value instanceof DocumentsInit200ResponseCreated && $this->tag === 'created'; + } + + /** + * @return DocumentsInit200ResponseCreated + */ + public function asCreated(): DocumentsInit200ResponseCreated + { + if (!($this->value instanceof DocumentsInit200ResponseCreated && $this->tag === 'created')) { + throw new Exception( + "Expected created; got " . $this->tag . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isResumed(): bool + { + return $this->value instanceof DocumentsInit200ResponseResumed && $this->tag === 'resumed'; + } + + /** + * @return DocumentsInit200ResponseResumed + */ + public function asResumed(): DocumentsInit200ResponseResumed + { + if (!($this->value instanceof DocumentsInit200ResponseResumed && $this->tag === 'resumed')) { + throw new Exception( + "Expected resumed; got " . $this->tag . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDeduped(): bool + { + return $this->value instanceof DocumentsInit200ResponseDeduped && $this->tag === 'deduped'; + } + + /** + * @return DocumentsInit200ResponseDeduped + */ + public function asDeduped(): DocumentsInit200ResponseDeduped + { + if (!($this->value instanceof DocumentsInit200ResponseDeduped && $this->tag === 'deduped')) { + throw new Exception( + "Expected deduped; got " . $this->tag . " 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['tag'] = $this->tag; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->tag) { + case 'created': + $value = $this->asCreated()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'resumed': + $value = $this->asResumed()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'deduped': + $value = $this->asDeduped()->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('tag', $data)) { + throw new Exception( + "JSON data is missing property 'tag'", + ); + } + $tag = $data['tag']; + if (!(is_string($tag))) { + throw new Exception( + "Expected property 'tag' in JSON data to be string, instead received " . get_debug_type($data['tag']), + ); + } + + $args['tag'] = $tag; + switch ($tag) { + case 'created': + $args['value'] = DocumentsInit200ResponseCreated::jsonDeserialize($data); + break; + case 'resumed': + $args['value'] = DocumentsInit200ResponseResumed::jsonDeserialize($data); + break; + case 'deduped': + $args['value'] = DocumentsInit200ResponseDeduped::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['tag'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreated.php b/src/Types/DocumentsInit200ResponseCreated.php new file mode 100644 index 0000000..185ea5b --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreated.php @@ -0,0 +1,42 @@ +document = $values['document']; + $this->upload = $values['upload']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreatedDocument.php b/src/Types/DocumentsInit200ResponseCreatedDocument.php new file mode 100644 index 0000000..bdd0739 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedDocument.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreatedDocumentState.php b/src/Types/DocumentsInit200ResponseCreatedDocumentState.php new file mode 100644 index 0000000..a8c0553 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedDocumentState.php @@ -0,0 +1,11 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInit200ResponseCreatedUploadPresigned $presigned + * @return DocumentsInit200ResponseCreatedUpload + */ + public static function presigned(DocumentsInit200ResponseCreatedUploadPresigned $presigned): DocumentsInit200ResponseCreatedUpload + { + return new DocumentsInit200ResponseCreatedUpload([ + 'kind' => 'presigned', + 'value' => $presigned, + ]); + } + + /** + * @param DocumentsInit200ResponseCreatedUploadDirect $direct + * @return DocumentsInit200ResponseCreatedUpload + */ + public static function direct(DocumentsInit200ResponseCreatedUploadDirect $direct): DocumentsInit200ResponseCreatedUpload + { + return new DocumentsInit200ResponseCreatedUpload([ + 'kind' => 'direct', + 'value' => $direct, + ]); + } + + /** + * @return bool + */ + public function isPresigned(): bool + { + return $this->value instanceof DocumentsInit200ResponseCreatedUploadPresigned && $this->kind === 'presigned'; + } + + /** + * @return DocumentsInit200ResponseCreatedUploadPresigned + */ + public function asPresigned(): DocumentsInit200ResponseCreatedUploadPresigned + { + if (!($this->value instanceof DocumentsInit200ResponseCreatedUploadPresigned && $this->kind === 'presigned')) { + throw new Exception( + "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDirect(): bool + { + return $this->value instanceof DocumentsInit200ResponseCreatedUploadDirect && $this->kind === 'direct'; + } + + /** + * @return DocumentsInit200ResponseCreatedUploadDirect + */ + public function asDirect(): DocumentsInit200ResponseCreatedUploadDirect + { + if (!($this->value instanceof DocumentsInit200ResponseCreatedUploadDirect && $this->kind === 'direct')) { + throw new Exception( + "Expected direct; 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 'presigned': + $value = $this->asPresigned()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'direct': + $value = $this->asDirect()->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 'presigned': + $args['value'] = DocumentsInit200ResponseCreatedUploadPresigned::jsonDeserialize($data); + break; + case 'direct': + $args['value'] = DocumentsInit200ResponseCreatedUploadDirect::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/DocumentsInit200ResponseCreatedUploadDirect.php b/src/Types/DocumentsInit200ResponseCreatedUploadDirect.php new file mode 100644 index 0000000..7b90b02 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedUploadDirect.php @@ -0,0 +1,42 @@ +url = $values['url']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreatedUploadPresigned.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresigned.php new file mode 100644 index 0000000..f0afeed --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedUploadPresigned.php @@ -0,0 +1,42 @@ +presigned = $values['presigned']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php new file mode 100644 index 0000000..305f17c --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php @@ -0,0 +1,59 @@ + $headers + */ + #[JsonProperty('headers'), ArrayType(['string' => 'string'])] + public array $headers; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @var float $expiresAt + */ + #[JsonProperty('expiresAt')] + public float $expiresAt; + + /** + * @param array{ + * url: string, + * headers: array, + * method: value-of, + * expiresAt: float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->url = $values['url']; + $this->headers = $values['headers']; + $this->method = $values['method']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php new file mode 100644 index 0000000..1b1827c --- /dev/null +++ b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php @@ -0,0 +1,8 @@ +document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseDedupedDocument.php b/src/Types/DocumentsInit200ResponseDedupedDocument.php new file mode 100644 index 0000000..aef3b38 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseDedupedDocument.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseDedupedDocumentState.php b/src/Types/DocumentsInit200ResponseDedupedDocumentState.php new file mode 100644 index 0000000..97a204c --- /dev/null +++ b/src/Types/DocumentsInit200ResponseDedupedDocumentState.php @@ -0,0 +1,11 @@ +document = $values['document']; + $this->upload = $values['upload']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseResumedDocument.php b/src/Types/DocumentsInit200ResponseResumedDocument.php new file mode 100644 index 0000000..f85b3ec --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedDocument.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseResumedDocumentState.php b/src/Types/DocumentsInit200ResponseResumedDocumentState.php new file mode 100644 index 0000000..d4c74b6 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedDocumentState.php @@ -0,0 +1,11 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInit200ResponseResumedUploadPresigned $presigned + * @return DocumentsInit200ResponseResumedUpload + */ + public static function presigned(DocumentsInit200ResponseResumedUploadPresigned $presigned): DocumentsInit200ResponseResumedUpload + { + return new DocumentsInit200ResponseResumedUpload([ + 'kind' => 'presigned', + 'value' => $presigned, + ]); + } + + /** + * @param DocumentsInit200ResponseResumedUploadDirect $direct + * @return DocumentsInit200ResponseResumedUpload + */ + public static function direct(DocumentsInit200ResponseResumedUploadDirect $direct): DocumentsInit200ResponseResumedUpload + { + return new DocumentsInit200ResponseResumedUpload([ + 'kind' => 'direct', + 'value' => $direct, + ]); + } + + /** + * @return bool + */ + public function isPresigned(): bool + { + return $this->value instanceof DocumentsInit200ResponseResumedUploadPresigned && $this->kind === 'presigned'; + } + + /** + * @return DocumentsInit200ResponseResumedUploadPresigned + */ + public function asPresigned(): DocumentsInit200ResponseResumedUploadPresigned + { + if (!($this->value instanceof DocumentsInit200ResponseResumedUploadPresigned && $this->kind === 'presigned')) { + throw new Exception( + "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDirect(): bool + { + return $this->value instanceof DocumentsInit200ResponseResumedUploadDirect && $this->kind === 'direct'; + } + + /** + * @return DocumentsInit200ResponseResumedUploadDirect + */ + public function asDirect(): DocumentsInit200ResponseResumedUploadDirect + { + if (!($this->value instanceof DocumentsInit200ResponseResumedUploadDirect && $this->kind === 'direct')) { + throw new Exception( + "Expected direct; 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 'presigned': + $value = $this->asPresigned()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'direct': + $value = $this->asDirect()->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 'presigned': + $args['value'] = DocumentsInit200ResponseResumedUploadPresigned::jsonDeserialize($data); + break; + case 'direct': + $args['value'] = DocumentsInit200ResponseResumedUploadDirect::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/DocumentsInit200ResponseResumedUploadDirect.php b/src/Types/DocumentsInit200ResponseResumedUploadDirect.php new file mode 100644 index 0000000..83a7ab5 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedUploadDirect.php @@ -0,0 +1,42 @@ +url = $values['url']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseResumedUploadPresigned.php b/src/Types/DocumentsInit200ResponseResumedUploadPresigned.php new file mode 100644 index 0000000..77fc91a --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedUploadPresigned.php @@ -0,0 +1,42 @@ +presigned = $values['presigned']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php new file mode 100644 index 0000000..8d46690 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php @@ -0,0 +1,59 @@ + $headers + */ + #[JsonProperty('headers'), ArrayType(['string' => 'string'])] + public array $headers; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @var float $expiresAt + */ + #[JsonProperty('expiresAt')] + public float $expiresAt; + + /** + * @param array{ + * url: string, + * headers: array, + * method: value-of, + * expiresAt: float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->url = $values['url']; + $this->headers = $values['headers']; + $this->method = $values['method']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php new file mode 100644 index 0000000..7d62ab7 --- /dev/null +++ b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php @@ -0,0 +1,8 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInit400ResponseError.php b/src/Types/DocumentsInit400ResponseError.php new file mode 100644 index 0000000..401f2bd --- /dev/null +++ b/src/Types/DocumentsInit400ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsList200Response.php b/src/Types/DocumentsList200Response.php new file mode 100644 index 0000000..d52a02c --- /dev/null +++ b/src/Types/DocumentsList200Response.php @@ -0,0 +1,43 @@ + $documents + */ + #[JsonProperty('documents'), ArrayType([DocumentsList200ResponseDocumentsItem::class])] + public array $documents; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * documents: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documents = $values['documents']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsList200ResponseDocumentsItem.php b/src/Types/DocumentsList200ResponseDocumentsItem.php new file mode 100644 index 0000000..bf3a895 --- /dev/null +++ b/src/Types/DocumentsList200ResponseDocumentsItem.php @@ -0,0 +1,131 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha + */ + #[JsonProperty('baseSha')] + public ?string $baseSha; + + /** + * @var ?float $storageSizeBytes + */ + #[JsonProperty('storageSizeBytes')] + public ?float $storageSizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var ?value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public ?string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var float $createdAt + */ + #[JsonProperty('createdAt')] + public float $createdAt; + + /** + * @var float $updatedAt + */ + #[JsonProperty('updatedAt')] + public float $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * state: value-of, + * createdAt: float, + * updatedAt: float, + * baseSha?: ?string, + * storageSizeBytes?: ?float, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailState?: ?value-of, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->state = $values['state']; + $this->baseSha = $values['baseSha'] ?? null; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsList200ResponseDocumentsItemState.php b/src/Types/DocumentsList200ResponseDocumentsItemState.php new file mode 100644 index 0000000..0f4ec67 --- /dev/null +++ b/src/Types/DocumentsList200ResponseDocumentsItemState.php @@ -0,0 +1,11 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsList400ResponseError.php b/src/Types/DocumentsList400ResponseError.php new file mode 100644 index 0000000..e7ab999 --- /dev/null +++ b/src/Types/DocumentsList400ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsThumbnailResponse.php b/src/Types/DocumentsThumbnailResponse.php new file mode 100644 index 0000000..72750e4 --- /dev/null +++ b/src/Types/DocumentsThumbnailResponse.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsThumbnailResponseError.php b/src/Types/DocumentsThumbnailResponseError.php new file mode 100644 index 0000000..b75e23c --- /dev/null +++ b/src/Types/DocumentsThumbnailResponseError.php @@ -0,0 +1,50 @@ +code = $values['code']; + $this->message = $values['message']; + $this->state = $values['state']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsUploadDirect200Response.php b/src/Types/DocumentsUploadDirect200Response.php new file mode 100644 index 0000000..52b0fce --- /dev/null +++ b/src/Types/DocumentsUploadDirect200Response.php @@ -0,0 +1,34 @@ +sha256 = $values['sha256']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsUploadDirect400Response.php b/src/Types/DocumentsUploadDirect400Response.php new file mode 100644 index 0000000..141c562 --- /dev/null +++ b/src/Types/DocumentsUploadDirect400Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsUploadDirect400ResponseError.php b/src/Types/DocumentsUploadDirect400ResponseError.php new file mode 100644 index 0000000..3849894 --- /dev/null +++ b/src/Types/DocumentsUploadDirect400ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EngineErrorPayload.php b/src/Types/EngineErrorPayload.php new file mode 100644 index 0000000..da00072 --- /dev/null +++ b/src/Types/EngineErrorPayload.php @@ -0,0 +1,59 @@ + $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/EngineErrorPayloadCode.php b/src/Types/EngineErrorPayloadCode.php new file mode 100644 index 0000000..06eff6f --- /dev/null +++ b/src/Types/EngineErrorPayloadCode.php @@ -0,0 +1,25 @@ +tenant = $values['tenant']; + $this->created = $values['created']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreate200ResponseTenant.php b/src/Types/TenantsCreate200ResponseTenant.php new file mode 100644 index 0000000..e370c05 --- /dev/null +++ b/src/Types/TenantsCreate200ResponseTenant.php @@ -0,0 +1,58 @@ +id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreate400Response.php b/src/Types/TenantsCreate400Response.php new file mode 100644 index 0000000..a7c2a5d --- /dev/null +++ b/src/Types/TenantsCreate400Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreate400ResponseError.php b/src/Types/TenantsCreate400ResponseError.php new file mode 100644 index 0000000..d8f68fa --- /dev/null +++ b/src/Types/TenantsCreate400ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..c248e45 --- /dev/null +++ b/src/Types/TenantsDeleteResponse.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsDeleteResponseError.php b/src/Types/TenantsDeleteResponseError.php new file mode 100644 index 0000000..b7008cd --- /dev/null +++ b/src/Types/TenantsDeleteResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGet200Response.php b/src/Types/TenantsGet200Response.php new file mode 100644 index 0000000..445431f --- /dev/null +++ b/src/Types/TenantsGet200Response.php @@ -0,0 +1,34 @@ +tenant = $values['tenant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGet200ResponseTenant.php b/src/Types/TenantsGet200ResponseTenant.php new file mode 100644 index 0000000..f8a2723 --- /dev/null +++ b/src/Types/TenantsGet200ResponseTenant.php @@ -0,0 +1,58 @@ +id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGet404Response.php b/src/Types/TenantsGet404Response.php new file mode 100644 index 0000000..eb8031b --- /dev/null +++ b/src/Types/TenantsGet404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGet404ResponseError.php b/src/Types/TenantsGet404ResponseError.php new file mode 100644 index 0000000..5836909 --- /dev/null +++ b/src/Types/TenantsGet404ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsList200Response.php b/src/Types/TenantsList200Response.php new file mode 100644 index 0000000..473fc23 --- /dev/null +++ b/src/Types/TenantsList200Response.php @@ -0,0 +1,43 @@ + $tenants + */ + #[JsonProperty('tenants'), ArrayType([TenantsList200ResponseTenantsItem::class])] + public array $tenants; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * tenants: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->tenants = $values['tenants']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsList200ResponseTenantsItem.php b/src/Types/TenantsList200ResponseTenantsItem.php new file mode 100644 index 0000000..e8db7c5 --- /dev/null +++ b/src/Types/TenantsList200ResponseTenantsItem.php @@ -0,0 +1,58 @@ +id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsList400Response.php b/src/Types/TenantsList400Response.php new file mode 100644 index 0000000..83f33d1 --- /dev/null +++ b/src/Types/TenantsList400Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsList400ResponseError.php b/src/Types/TenantsList400ResponseError.php new file mode 100644 index 0000000..60b830d --- /dev/null +++ b/src/Types/TenantsList400ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue200Response.php b/src/Types/TokensIssue200Response.php new file mode 100644 index 0000000..bd59a28 --- /dev/null +++ b/src/Types/TokensIssue200Response.php @@ -0,0 +1,50 @@ +token = $values['token']; + $this->jti = $values['jti']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue400Response.php b/src/Types/TokensIssue400Response.php new file mode 100644 index 0000000..d382b20 --- /dev/null +++ b/src/Types/TokensIssue400Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue400ResponseError.php b/src/Types/TokensIssue400ResponseError.php new file mode 100644 index 0000000..12c0354 --- /dev/null +++ b/src/Types/TokensIssue400ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..fc7a9be --- /dev/null +++ b/src/Types/TokensIssue403Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue403ResponseError.php b/src/Types/TokensIssue403ResponseError.php new file mode 100644 index 0000000..99988bc --- /dev/null +++ b/src/Types/TokensIssue403ResponseError.php @@ -0,0 +1,42 @@ +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 new file mode 100644 index 0000000..fbaa9fa --- /dev/null +++ b/src/Types/TokensIssue404Response.php @@ -0,0 +1,34 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue404ResponseError.php b/src/Types/TokensIssue404ResponseError.php new file mode 100644 index 0000000..4d70698 --- /dev/null +++ b/src/Types/TokensIssue404ResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssueRequest.php b/src/Types/TokensIssueRequest.php new file mode 100644 index 0000000..3d67657 --- /dev/null +++ b/src/Types/TokensIssueRequest.php @@ -0,0 +1,196 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param TokensIssueRequestDoc $doc + * @return TokensIssueRequest + */ + public static function doc(TokensIssueRequestDoc $doc): TokensIssueRequest + { + return new TokensIssueRequest([ + 'kind' => 'doc', + 'value' => $doc, + ]); + } + + /** + * @param TokensIssueRequestTenant $tenant + * @return TokensIssueRequest + */ + public static function tenant(TokensIssueRequestTenant $tenant): TokensIssueRequest + { + return new TokensIssueRequest([ + 'kind' => 'tenant', + 'value' => $tenant, + ]); + } + + /** + * @return bool + */ + public function isDoc(): bool + { + return $this->value instanceof TokensIssueRequestDoc && $this->kind === 'doc'; + } + + /** + * @return TokensIssueRequestDoc + */ + public function asDoc(): TokensIssueRequestDoc + { + if (!($this->value instanceof TokensIssueRequestDoc && $this->kind === 'doc')) { + throw new Exception( + "Expected doc; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTenant(): bool + { + return $this->value instanceof TokensIssueRequestTenant && $this->kind === 'tenant'; + } + + /** + * @return TokensIssueRequestTenant + */ + public function asTenant(): TokensIssueRequestTenant + { + if (!($this->value instanceof TokensIssueRequestTenant && $this->kind === 'tenant')) { + throw new Exception( + "Expected tenant; 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 'doc': + $value = $this->asDoc()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'tenant': + $value = $this->asTenant()->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 'doc': + $args['value'] = TokensIssueRequestDoc::jsonDeserialize($data); + break; + case 'tenant': + $args['value'] = TokensIssueRequestTenant::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/TokensIssueRequestDoc.php b/src/Types/TokensIssueRequestDoc.php new file mode 100644 index 0000000..d77bf4a --- /dev/null +++ b/src/Types/TokensIssueRequestDoc.php @@ -0,0 +1,99 @@ + $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?string $userId + */ + #[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; + + /** + * @var int $expiresIn + */ + #[JsonProperty('expiresIn')] + public int $expiresIn; + + /** + * @param array{ + * sub: string, + * docId: string, + * scope: array, + * expiresIn: int, + * layerName?: ?string, + * userId?: ?string, + * displayName?: ?string, + * groupId?: ?string, + * groups?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->sub = $values['sub']; + $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->expiresIn = $values['expiresIn']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssueRequestTenant.php b/src/Types/TokensIssueRequestTenant.php new file mode 100644 index 0000000..c2b721d --- /dev/null +++ b/src/Types/TokensIssueRequestTenant.php @@ -0,0 +1,57 @@ + + * |value-of + * )> $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var int $expiresIn + */ + #[JsonProperty('expiresIn')] + public int $expiresIn; + + /** + * @param array{ + * sub: string, + * scope: array<( + * value-of + * |value-of + * )>, + * expiresIn: int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->sub = $values['sub']; + $this->scope = $values['scope']; + $this->expiresIn = $values['expiresIn']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssueRequestTenantScopeItemOne.php b/src/Types/TokensIssueRequestTenantScopeItemOne.php new file mode 100644 index 0000000..b7f41ff --- /dev/null +++ b/src/Types/TokensIssueRequestTenantScopeItemOne.php @@ -0,0 +1,12 @@ +error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensRevokeResponseError.php b/src/Types/TokensRevokeResponseError.php new file mode 100644 index 0000000..af40a76 --- /dev/null +++ b/src/Types/TokensRevokeResponseError.php @@ -0,0 +1,42 @@ +code = $values['code']; + $this->message = $values['message']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Utils/File.php b/src/Utils/File.php new file mode 100644 index 0000000..9e6d9ea --- /dev/null +++ b/src/Utils/File.php @@ -0,0 +1,129 @@ +filename = $filename; + $this->contentType = $contentType; + $this->stream = $stream; + } + + /** + * Creates a File instance from a filepath. + * + * @param string $filepath + * @param ?string $filename + * @param ?string $contentType + * @return File + * @throws Exception + */ + public static function createFromFilepath( + string $filepath, + ?string $filename = null, + ?string $contentType = null, + ): File { + $resource = @fopen($filepath, 'r'); + if (!$resource) { + throw new Exception("Unable to open file $filepath"); + } + $stream = Psr17FactoryDiscovery::findStreamFactory()->createStreamFromResource($resource); + if (!$stream->isReadable()) { + throw new Exception("File $filepath is not readable"); + } + return new self( + stream: $stream, + filename: $filename ?? basename($filepath), + contentType: $contentType, + ); + } + + /** + * Creates a File instance from a string. + * + * @param string $content + * @param ?string $filename + * @param ?string $contentType + * @return File + */ + public static function createFromString( + string $content, + ?string $filename, + ?string $contentType = null, + ): File { + return new self( + stream: Psr17FactoryDiscovery::findStreamFactory()->createStream($content), + filename: $filename, + contentType: $contentType, + ); + } + + /** + * Maps this File into a multipart form data part. + * + * @param string $name The name of the multipart form data part. + * @param ?string $contentType Overrides the Content-Type associated with the file, if any. + * @return MultipartFormDataPart + */ + public function toMultipartFormDataPart(string $name, ?string $contentType = null): MultipartFormDataPart + { + $contentType ??= $this->contentType; + $headers = $contentType !== null + ? ['Content-Type' => $contentType] + : null; + + return new MultipartFormDataPart( + name: $name, + value: $this->stream, + filename: $this->filename, + headers: $headers, + ); + } + + /** + * Closes the file stream. + */ + public function close(): void + { + $this->stream->close(); + } + + /** + * Destructor to ensure stream is closed. + */ + public function __destruct() + { + try { + $this->close(); + } catch (\Throwable) { + // Swallow errors during garbage collection to avoid fatal errors. + } + } +} diff --git a/tests/Core/Client/RawClientTest.php b/tests/Core/Client/RawClientTest.php new file mode 100644 index 0000000..560e133 --- /dev/null +++ b/tests/Core/Client/RawClientTest.php @@ -0,0 +1,1249 @@ +name = $values['name']; + } + + /** + * @return string + */ + public function getName(): ?string + { + return $this->name; + } +} + +class RawClientTest extends TestCase +{ + private string $baseUrl = 'https://api.example.com'; + private MockHttpClient $mockClient; + private RawClient $rawClient; + + protected function setUp(): void + { + $this->mockClient = new MockHttpClient(); + $this->rawClient = new RawClient(['client' => $this->mockClient, 'maxRetries' => 0]); + } + + /** + * @throws ClientExceptionInterface + */ + public function testHeaders(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ['X-Custom-Header' => 'TestValue'] + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('TestValue', $lastRequest->getHeaderLine('X-Custom-Header')); + } + + /** + * @throws ClientExceptionInterface + */ + public function testQueryParameters(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + [], + ['param1' => 'value1', 'param2' => ['a', 'b'], 'param3' => 'true'] + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals( + 'https://api.example.com/test?param1=value1¶m2=a¶m2=b¶m3=true', + (string)$lastRequest->getUri() + ); + } + + public function testEncodePathParam(): void + { + $this->assertEquals('..%2Fconnections', RawClient::encodePathParam('../connections')); + $this->assertEquals('user%20id%3F', RawClient::encodePathParam('user id?')); + $this->assertEquals('user_1', RawClient::encodePathParam('user_1')); + $this->assertEquals('42', RawClient::encodePathParam(42)); + $this->assertEquals('true', RawClient::encodePathParam(true)); + $this->assertEquals('false', RawClient::encodePathParam(false)); + $this->assertEquals('', RawClient::encodePathParam(null)); + } + + /** + * @throws ClientExceptionInterface + */ + public function testEncodedPathParamDoesNotTraverse(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/users/' . RawClient::encodePathParam('../connections'), + HttpMethod::GET + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals( + 'https://api.example.com/users/..%2Fconnections', + (string)$lastRequest->getUri() + ); + } + + /** + * @throws ClientExceptionInterface + */ + public function testJsonBody(): void + { + $this->mockClient->append(self::createResponse(200)); + + $body = ['key' => 'value']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(JsonEncoder::encode($body), (string)$lastRequest->getBody()); + } + + public function testAdditionalHeaders(): void + { + $this->mockClient->append(self::createResponse(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $headers = [ + 'X-API-Version' => '1.0.0', + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + $headers, + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'headers' => [ + 'X-Tenancy' => 'test' + ] + ] + ); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('1.0.0', $lastRequest->getHeaderLine('X-API-Version')); + $this->assertEquals('test', $lastRequest->getHeaderLine('X-Tenancy')); + } + + public function testOverrideAdditionalHeaders(): void + { + $this->mockClient->append(self::createResponse(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $headers = [ + 'X-API-Version' => '1.0.0', + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + $headers, + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'headers' => [ + 'X-API-Version' => '2.0.0' + ] + ] + ); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('2.0.0', $lastRequest->getHeaderLine('X-API-Version')); + } + + public function testAdditionalBodyProperties(): void + { + $this->mockClient->append(self::createResponse(200)); + + $body = new JsonRequest([ + 'name' => 'john.doe' + ]); + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'bodyProperties' => [ + 'age' => 42 + ] + ] + ); + + $expectedJson = [ + 'name' => 'john.doe', + 'age' => 42 + ]; + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(JsonEncoder::encode($expectedJson), (string)$lastRequest->getBody()); + } + + public function testOverrideAdditionalBodyProperties(): void + { + $this->mockClient->append(self::createResponse(200)); + + $body = [ + 'name' => 'john.doe' + ]; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + $body + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'bodyProperties' => [ + 'name' => 'jane.doe' + ] + ] + ); + + $expectedJson = [ + 'name' => 'jane.doe', + ]; + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals(JsonEncoder::encode($expectedJson), (string)$lastRequest->getBody()); + } + + public function testAdditionalQueryParameters(): void + { + $this->mockClient->append(self::createResponse(200)); + + $query = ['key' => 'value']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + $query, + [] + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'queryParameters' => [ + 'extra' => 42 + ] + ] + ); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('key=value&extra=42', $lastRequest->getUri()->getQuery()); + } + + public function testOverrideQueryParameters(): void + { + $this->mockClient->append(self::createResponse(200)); + + $query = ['key' => 'invalid']; + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + $query, + [] + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'queryParameters' => [ + 'key' => 'value' + ] + ] + ); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('application/json', $lastRequest->getHeaderLine('Content-Type')); + $this->assertEquals('key=value', $lastRequest->getUri()->getQuery()); + } + + public function testDefaultRetries(): void + { + $this->mockClient->append(self::createResponse(500)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET + ); + + $response = $this->rawClient->sendRequest($request); + $this->assertEquals(500, $response->getStatusCode()); + $this->assertEquals(0, $this->mockClient->count()); + } + + /** + * @throws ClientExceptionInterface + */ + public function testExplicitRetriesSuccess(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(500), self::createResponse(500), self::createResponse(200)); + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->sendRequest($request); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertEquals(0, $mockClient->count()); + } + + public function testExplicitRetriesFailure(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(500), self::createResponse(500), self::createResponse(500)); + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->sendRequest($request); + + $this->assertEquals(500, $response->getStatusCode()); + $this->assertEquals(0, $mockClient->count()); + } + + /** + * @throws ClientExceptionInterface + */ + public function testShouldRetryOnStatusCodes(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(408), + self::createResponse(429), + self::createResponse(500), + self::createResponse(501), + self::createResponse(502), + self::createResponse(503), + self::createResponse(504), + self::createResponse(505), + self::createResponse(599), + self::createResponse(200), + ); + $countOfErrorRequests = $mockClient->count() - 1; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: $countOfErrorRequests, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->sendRequest($request); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertEquals(0, $mockClient->count()); + } + + public function testShouldFailOn400Response(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(400), self::createResponse(200)); + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->sendRequest($request); + + $this->assertEquals(400, $response->getStatusCode()); + $this->assertEquals(1, $mockClient->count()); + } + + public function testRetryAfterSecondsHeaderControlsDelay(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(503, ['Retry-After' => '10']), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); // Convert microseconds to milliseconds + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThanOrEqual(10000, $capturedDelays[0]); + $this->assertLessThanOrEqual(12000, $capturedDelays[0]); + } + + public function testRetryAfterHttpDateHeaderIsHandled(): void + { + $retryAfterDate = gmdate('D, d M Y H:i:s \G\M\T', time() + 5); + + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(503, ['Retry-After' => $retryAfterDate]), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThan(0, $capturedDelays[0]); + $this->assertLessThanOrEqual(60000, $capturedDelays[0]); + } + + public function testRateLimitResetHeaderControlsDelay(): void + { + $resetTime = (int) floor(microtime(true)) + 5; + + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(429, ['X-RateLimit-Reset' => (string) $resetTime]), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThan(0, $capturedDelays[0]); + $this->assertLessThanOrEqual(60000, $capturedDelays[0]); + } + + public function testRateLimitResetHeaderRespectsMaxDelayAndPositiveJitter(): void + { + $resetTime = (int) floor(microtime(true)) + 1000; + + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(429, ['X-RateLimit-Reset' => (string) $resetTime]), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 1, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThanOrEqual(60000, $capturedDelays[0]); + $this->assertLessThanOrEqual(72000, $capturedDelays[0]); + } + + public function testExponentialBackoffWithSymmetricJitterWhenNoHeaders(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(503), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 1, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThanOrEqual(900, $capturedDelays[0]); + $this->assertLessThanOrEqual(1100, $capturedDelays[0]); + } + + public function testRetryAfterHeaderTakesPrecedenceOverRateLimitReset(): void + { + $resetTime = (int) floor(microtime(true)) + 30; + + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(503, [ + 'Retry-After' => '5', + 'X-RateLimit-Reset' => (string) $resetTime, + ]), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThanOrEqual(5000, $capturedDelays[0]); + $this->assertLessThanOrEqual(6000, $capturedDelays[0]); + } + + public function testMaxDelayCapIsApplied(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append( + self::createResponse(503, ['Retry-After' => '120']), + self::createResponse(200), + ); + + $capturedDelays = []; + $sleepFunction = function (int $microseconds) use (&$capturedDelays): void { + $capturedDelays[] = (int) ($microseconds / 1000); + }; + + $retryClient = new RetryDecoratingClient( + $mockClient, + maxRetries: 2, + baseDelay: 1000, + sleepFunction: $sleepFunction, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $retryClient->sendRequest($request); + + $this->assertCount(1, $capturedDelays); + $this->assertGreaterThanOrEqual(60000, $capturedDelays[0]); + $this->assertLessThanOrEqual(72000, $capturedDelays[0]); + } + + public function testMultipartContentTypeIncludesBoundary(): void + { + $this->mockClient->append(self::createResponse(200)); + + $formData = new MultipartFormData(); + $formData->add('field', 'value'); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/upload', + HttpMethod::POST, + [], + [], + $formData, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $contentType = $lastRequest->getHeaderLine('Content-Type'); + $this->assertStringStartsWith('multipart/form-data; boundary=', $contentType); + + $boundary = substr($contentType, strlen('multipart/form-data; boundary=')); + $body = (string) $lastRequest->getBody(); + $this->assertStringContainsString("--{$boundary}\r\n", $body); + $this->assertStringContainsString("Content-Disposition: form-data; name=\"field\"\r\n", $body); + $this->assertStringContainsString("value", $body); + $this->assertStringContainsString("--{$boundary}--\r\n", $body); + } + + public function testMultipartWithFilename(): void + { + $this->mockClient->append(self::createResponse(200)); + + $formData = new MultipartFormData(); + $formData->addPart(new MultipartFormDataPart( + name: 'document', + value: 'file-contents', + filename: 'report.pdf', + headers: ['Content-Type' => 'application/pdf'], + )); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/upload', + HttpMethod::POST, + [], + [], + $formData, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $body = (string) $lastRequest->getBody(); + $this->assertStringContainsString( + 'Content-Disposition: form-data; name="document"; filename="report.pdf"', + $body, + ); + $this->assertStringContainsString('Content-Type: application/pdf', $body); + $this->assertStringContainsString('file-contents', $body); + } + + public function testMultipartWithMultipleParts(): void + { + $this->mockClient->append(self::createResponse(200)); + + $formData = new MultipartFormData(); + $formData->add('name', 'John'); + $formData->add('age', 30); + $formData->addPart(new MultipartFormDataPart( + name: 'avatar', + value: 'image-data', + filename: 'avatar.png', + )); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/profile', + HttpMethod::POST, + [], + [], + $formData, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $body = (string) $lastRequest->getBody(); + $this->assertStringContainsString('name="name"', $body); + $this->assertStringContainsString('John', $body); + $this->assertStringContainsString('name="age"', $body); + $this->assertStringContainsString('30', $body); + $this->assertStringContainsString('name="avatar"; filename="avatar.png"', $body); + $this->assertStringContainsString('image-data', $body); + } + + public function testMultipartDoesNotIncludeJsonContentType(): void + { + $this->mockClient->append(self::createResponse(200)); + + $formData = new MultipartFormData(); + $formData->add('field', 'value'); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/upload', + HttpMethod::POST, + [], + [], + $formData, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $contentType = $lastRequest->getHeaderLine('Content-Type'); + $this->assertStringStartsWith('multipart/form-data; boundary=', $contentType); + $this->assertStringNotContainsString('application/json', $contentType); + } + + public function testMultipartNullBodySendsNoBody(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/upload', + HttpMethod::POST, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $this->assertEquals('', (string) $lastRequest->getBody()); + $this->assertStringNotContainsString('multipart/form-data', $lastRequest->getHeaderLine('Content-Type')); + } + + public function testJsonNullBodySendsNoBody(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + ); + + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $this->assertEquals('', (string) $lastRequest->getBody()); + } + + public function testEmptyJsonBodySerializesAsObject(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::POST, + [], + [], + ['key' => 'value'], + ); + + $this->rawClient->sendRequest( + $request, + options: [ + 'bodyProperties' => [ + 'key' => 'value', + ], + ], + ); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + // When bodyProperties override all keys, the merged result should still + // serialize as a JSON object {}, not an array []. + $decoded = json_decode((string) $lastRequest->getBody(), true); + $this->assertIsArray($decoded); + $this->assertEquals('value', $decoded['key']); + } + + public function testAuthHeadersAreIncluded(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(200)); + + $rawClient = new RawClient([ + 'client' => $mockClient, + 'maxRetries' => 0, + 'getAuthHeaders' => fn () => ['Authorization' => 'Bearer test-token'], + ]); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ); + + $rawClient->sendRequest($request); + + $lastRequest = $mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $this->assertEquals('Bearer test-token', $lastRequest->getHeaderLine('Authorization')); + } + + public function testAuthHeadersAreIncludedInMultipart(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(200)); + + $rawClient = new RawClient([ + 'client' => $mockClient, + 'maxRetries' => 0, + 'getAuthHeaders' => fn () => ['Authorization' => 'Bearer test-token'], + ]); + + $formData = new MultipartFormData(); + $formData->add('field', 'value'); + + $request = new MultipartApiRequest( + $this->baseUrl, + '/upload', + HttpMethod::POST, + [], + [], + $formData, + ); + + $rawClient->sendRequest($request); + + $lastRequest = $mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + + $this->assertEquals('Bearer test-token', $lastRequest->getHeaderLine('Authorization')); + $this->assertStringStartsWith('multipart/form-data; boundary=', $lastRequest->getHeaderLine('Content-Type')); + } + + /** + * Creates a PSR-7 response using discovery, without depending on any specific implementation. + * + * @param int $statusCode + * @param array $headers + * @param string $body + * @return ResponseInterface + */ + private static function createResponse( + int $statusCode = 200, + array $headers = [], + string $body = '', + ): ResponseInterface { + $response = \Http\Discovery\Psr17FactoryDiscovery::findResponseFactory() + ->createResponse($statusCode); + foreach ($headers as $name => $value) { + $response = $response->withHeader($name, $value); + } + if ($body !== '') { + $response = $response->withBody( + \Http\Discovery\Psr17FactoryDiscovery::findStreamFactory() + ->createStream($body), + ); + } + return $response; + } + + + public function testTimeoutOptionIsAccepted(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ); + + // MockHttpClient is not Guzzle/Symfony, so a warning is triggered once. + set_error_handler(static function (int $errno, string $errstr): bool { + return $errno === E_USER_WARNING + && str_contains($errstr, 'Timeout option is not supported'); + }); + + try { + $response = $this->rawClient->sendRequest( + $request, + options: [ + 'timeout' => 3.0 + ] + ); + + $this->assertEquals(200, $response->getStatusCode()); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + } finally { + restore_error_handler(); + } + } + + public function testClientLevelTimeoutIsAccepted(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(200)); + + $rawClient = new RawClient([ + 'client' => $mockClient, + 'maxRetries' => 0, + 'timeout' => 5.0, + ]); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ); + + set_error_handler(static function (int $errno, string $errstr): bool { + return $errno === E_USER_WARNING + && str_contains($errstr, 'Timeout option is not supported'); + }); + + try { + $response = $rawClient->sendRequest($request); + $this->assertEquals(200, $response->getStatusCode()); + } finally { + restore_error_handler(); + } + } + + public function testPerRequestTimeoutOverridesClientTimeout(): void + { + $mockClient = new MockHttpClient(); + $mockClient->append(self::createResponse(200)); + + $rawClient = new RawClient([ + 'client' => $mockClient, + 'maxRetries' => 0, + 'timeout' => 5.0, + ]); + + $request = new JsonApiRequest( + $this->baseUrl, + '/test', + HttpMethod::GET, + ); + + set_error_handler(static function (int $errno, string $errstr): bool { + return $errno === E_USER_WARNING + && str_contains($errstr, 'Timeout option is not supported'); + }); + + try { + $response = $rawClient->sendRequest( + $request, + options: [ + 'timeout' => 1.0 + ] + ); + + $this->assertEquals(200, $response->getStatusCode()); + } finally { + restore_error_handler(); + } + } + + public function testDiscoveryFindsHttpClient(): void + { + // HttpClientBuilder::build() with no client arg uses Psr18ClientDiscovery. + $client = HttpClientBuilder::build(); + $this->assertInstanceOf(\Psr\Http\Client\ClientInterface::class, $client); + } + + public function testDiscoveryFindsFactories(): void + { + $requestFactory = HttpClientBuilder::requestFactory(); + $this->assertInstanceOf(\Psr\Http\Message\RequestFactoryInterface::class, $requestFactory); + + $streamFactory = HttpClientBuilder::streamFactory(); + $this->assertInstanceOf(\Psr\Http\Message\StreamFactoryInterface::class, $streamFactory); + + // Verify they produce usable objects + $request = $requestFactory->createRequest('GET', 'https://example.com'); + $this->assertEquals('GET', $request->getMethod()); + + $stream = $streamFactory->createStream('hello'); + $this->assertEquals('hello', (string) $stream); + } + + public function testInterfaceExistsDetectsGuzzle(): void + { + $this->assertTrue( + interface_exists('GuzzleHttp\ClientInterface'), + 'interface_exists should detect GuzzleHttp\ClientInterface when Guzzle is installed', + ); + } + + public function testTimeoutForwardsToGuzzleSend(): void + { + $expectedResponse = self::createResponse(200); + + $guzzleClient = new class ($expectedResponse) implements \Psr\Http\Client\ClientInterface, \GuzzleHttp\ClientInterface { + private ResponseInterface $response; + /** @var array */ + public array $lastOptions = []; + + public function __construct(ResponseInterface $response) + { + $this->response = $response; + } + + /** @param array $options */ + public function send(\Psr\Http\Message\RequestInterface $request, array $options = []): ResponseInterface + { + $this->lastOptions = $options; + return $this->response; + } + + /** @param array $options */ + public function sendAsync(\Psr\Http\Message\RequestInterface $request, array $options = []): \GuzzleHttp\Promise\PromiseInterface + { + throw new \RuntimeException('Not implemented'); + } + + /** @param array $options */ + public function request(string $method, $uri, array $options = []): ResponseInterface + { + throw new \RuntimeException('Not implemented'); + } + + /** @param array $options */ + public function requestAsync(string $method, $uri, array $options = []): \GuzzleHttp\Promise\PromiseInterface + { + throw new \RuntimeException('Not implemented'); + } + + public function getConfig(?string $option = null) + { + return null; + } + + public function sendRequest(\Psr\Http\Message\RequestInterface $request): ResponseInterface + { + return $this->response; + } + }; + + $retryClient = new RetryDecoratingClient( + $guzzleClient, + maxRetries: 0, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->send($request, timeout: 5.0); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertArrayHasKey('timeout', $guzzleClient->lastOptions); + $this->assertEquals(5.0, $guzzleClient->lastOptions['timeout']); + } + + public function testNoTimeoutDoesNotCallGuzzleSend(): void + { + $expectedResponse = self::createResponse(200); + + $guzzleClient = new class ($expectedResponse) implements \Psr\Http\Client\ClientInterface, \GuzzleHttp\ClientInterface { + private ResponseInterface $response; + public bool $sendCalled = false; + + public function __construct(ResponseInterface $response) + { + $this->response = $response; + } + + /** @param array $options */ + public function send(\Psr\Http\Message\RequestInterface $request, array $options = []): ResponseInterface + { + $this->sendCalled = true; + return $this->response; + } + + /** @param array $options */ + public function sendAsync(\Psr\Http\Message\RequestInterface $request, array $options = []): \GuzzleHttp\Promise\PromiseInterface + { + throw new \RuntimeException('Not implemented'); + } + + /** @param array $options */ + public function request(string $method, $uri, array $options = []): ResponseInterface + { + throw new \RuntimeException('Not implemented'); + } + + /** @param array $options */ + public function requestAsync(string $method, $uri, array $options = []): \GuzzleHttp\Promise\PromiseInterface + { + throw new \RuntimeException('Not implemented'); + } + + public function getConfig(?string $option = null) + { + return null; + } + + public function sendRequest(\Psr\Http\Message\RequestInterface $request): ResponseInterface + { + return $this->response; + } + }; + + $retryClient = new RetryDecoratingClient( + $guzzleClient, + maxRetries: 0, + sleepFunction: function (int $_microseconds): void { + }, + ); + + $requestFactory = \Http\Discovery\Psr17FactoryDiscovery::findRequestFactory(); + $request = $requestFactory->createRequest('GET', $this->baseUrl . '/test'); + + $response = $retryClient->send($request, timeout: null); + + $this->assertEquals(200, $response->getStatusCode()); + $this->assertFalse($guzzleClient->sendCalled, 'Guzzle send() should not be called when timeout is null'); + } + +} diff --git a/tests/Core/Json/AdditionalPropertiesTest.php b/tests/Core/Json/AdditionalPropertiesTest.php new file mode 100644 index 0000000..900c4eb --- /dev/null +++ b/tests/Core/Json/AdditionalPropertiesTest.php @@ -0,0 +1,76 @@ +name; + } + + /** + * @return string|null + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @param array{ + * name: string, + * email?: string|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->email = $values['email'] ?? null; + } +} + +class AdditionalPropertiesTest extends TestCase +{ + public function testExtraProperties(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'name' => 'john.doe', + 'email' => 'john.doe@example.com', + 'age' => 42 + ], + ); + + $person = Person::fromJson($expectedJson); + $this->assertEquals('john.doe', $person->getName()); + $this->assertEquals('john.doe@example.com', $person->getEmail()); + $this->assertEquals( + [ + 'age' => 42 + ], + $person->getAdditionalProperties(), + ); + } +} diff --git a/tests/Core/Json/DateArrayTest.php b/tests/Core/Json/DateArrayTest.php new file mode 100644 index 0000000..86420ce --- /dev/null +++ b/tests/Core/Json/DateArrayTest.php @@ -0,0 +1,54 @@ +dates = $values['dates']; + } +} + +class DateArrayTest extends TestCase +{ + public function testDateTimeInArrays(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'dates' => ['2023-01-01', '2023-02-01', '2023-03-01'] + ], + ); + + $object = DateArray::fromJson($expectedJson); + $this->assertInstanceOf(DateTime::class, $object->dates[0], 'dates[0] should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->dates[0]->format('Y-m-d'), 'dates[0] should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->dates[1], 'dates[1] should be a DateTime instance.'); + $this->assertEquals('2023-02-01', $object->dates[1]->format('Y-m-d'), 'dates[1] should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->dates[2], 'dates[2] should be a DateTime instance.'); + $this->assertEquals('2023-03-01', $object->dates[2]->format('Y-m-d'), 'dates[2] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for dates array.'); + } +} diff --git a/tests/Core/Json/EmptyArrayTest.php b/tests/Core/Json/EmptyArrayTest.php new file mode 100644 index 0000000..01d3bae --- /dev/null +++ b/tests/Core/Json/EmptyArrayTest.php @@ -0,0 +1,78 @@ + $emptyMapArray + */ + #[JsonProperty('empty_map_array')] + #[ArrayType(['integer' => new Union('string', 'null')])] + public array $emptyMapArray; + + /** + * @var array $emptyDatesArray + */ + #[ArrayType([new Union('date', 'null')])] + #[JsonProperty('empty_dates_array')] + public array $emptyDatesArray; + + /** + * @param array{ + * emptyStringArray: string[], + * emptyMapArray: array, + * emptyDatesArray: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->emptyStringArray = $values['emptyStringArray']; + $this->emptyMapArray = $values['emptyMapArray']; + $this->emptyDatesArray = $values['emptyDatesArray']; + } +} + +class EmptyArrayTest extends TestCase +{ + public function testEmptyArray(): void + { + $inputJson = JsonEncoder::encode( + [ + 'empty_string_array' => [], + 'empty_map_array' => [], + 'empty_dates_array' => [] + ], + ); + + $object = EmptyArray::fromJson($inputJson); + $this->assertEmpty($object->emptyStringArray, 'empty_string_array should be empty.'); + $this->assertEmpty($object->emptyMapArray, 'empty_map_array should be empty.'); + $this->assertEmpty($object->emptyDatesArray, 'empty_dates_array should be empty.'); + + $actualJson = $object->toJson(); + $expectedJson = JsonEncoder::encode( + [ + 'empty_string_array' => [], + 'empty_map_array' => new \stdClass(), + 'empty_dates_array' => [] + ], + ); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match expected JSON for EmptyArraysType.'); + } +} diff --git a/tests/Core/Json/EmptyObjectTest.php b/tests/Core/Json/EmptyObjectTest.php new file mode 100644 index 0000000..ac200ee --- /dev/null +++ b/tests/Core/Json/EmptyObjectTest.php @@ -0,0 +1,409 @@ +optionalField = $values['optionalField'] ?? null; + } +} + +class EmptyObjectWithNestedObject extends JsonSerializableType +{ + /** + * @var string $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var EmptyObject $nested + */ + #[JsonProperty('nested')] + public EmptyObject $nested; + + /** + * @param array{ + * name: string, + * nested: EmptyObject, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->nested = $values['nested']; + } +} + +class ObjectWithEmptyMap extends JsonSerializableType +{ + /** + * @var array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'string'])] + public array $metadata; + + /** + * @param array{ + * metadata: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->metadata = $values['metadata']; + } +} + +class ObjectWithListAndMap extends JsonSerializableType +{ + /** + * @var string[] $list + */ + #[ArrayType(['string'])] + #[JsonProperty('list')] + public array $list; + + /** + * @var array $map + */ + #[ArrayType(['string' => 'string'])] + #[JsonProperty('map')] + public array $map; + + /** + * @param array{ + * list: string[], + * map: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->list = $values['list']; + $this->map = $values['map']; + } +} + +class EmptyUnionMember extends JsonSerializableType +{ + /** + * @var string|null $tag + */ + #[JsonProperty('tag')] + public ?string $tag; + + /** + * @param array{ + * tag?: string|null, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->tag = $values['tag'] ?? null; + } +} + +class ObjectWithUnionEmpty extends JsonSerializableType +{ + /** + * @var string|EmptyUnionMember|null $value + */ + #[Union('string', EmptyUnionMember::class, 'null')] + #[JsonProperty('value')] + public mixed $value; + + /** + * @param array{ + * value: string|EmptyUnionMember|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->value = $values['value']; + } +} + +class ObjectWithListOfMaps extends JsonSerializableType +{ + /** + * @var array> $items + */ + #[ArrayType([['string' => 'string']])] + #[JsonProperty('items')] + public array $items; + + /** + * @param array{ + * items: array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->items = $values['items']; + } +} + +class ObjectWithMapOfObjects extends JsonSerializableType +{ + /** + * @var array $entries + */ + #[ArrayType(['string' => EmptyUnionMember::class])] + #[JsonProperty('entries')] + public array $entries; + + /** + * @param array{ + * entries: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->entries = $values['entries']; + } +} + +class ObjectWithAdditionalOnly extends JsonSerializableType +{ + /** + * @var string|null $name + */ + #[JsonProperty('name')] + public ?string $name; + + /** + * @param array{ + * name?: string|null, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->name = $values['name'] ?? null; + } +} + +class EmptyObjectTest extends TestCase +{ + public function testEmptyObjectSerializesToObject(): void + { + $object = new EmptyObject([]); + $json = $object->toJson(); + $this->assertEquals('{}', $json, 'Empty object should serialize to {} not [].'); + } + + public function testEmptyObjectWithFieldSetSerializesCorrectly(): void + { + $object = new EmptyObject(['optionalField' => 'value']); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString('{"optional_field": "value"}', $json); + } + + public function testNestedEmptyObjectSerializesToObject(): void + { + $parent = new EmptyObjectWithNestedObject([ + 'name' => 'test', + 'nested' => new EmptyObject([]), + ]); + $json = $parent->toJson(); + $expected = '{"name": "test", "nested": {}}'; + $this->assertJsonStringEqualsJsonString($expected, $json, 'Nested empty object should serialize to {} not [].'); + } + + public function testDeserializeEmptyObject(): void + { + $json = '{}'; + $object = EmptyObject::fromJson($json); + $this->assertNull($object->optionalField); + $this->assertEquals('{}', $object->toJson(), 'Deserialized empty object should re-serialize to {}.'); + } + + public function testEmptyMapSerializesToObject(): void + { + $object = new ObjectWithEmptyMap(['metadata' => []]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString('{"metadata":{}}', $json, 'Empty map should serialize to {} not [].'); + } + + public function testNonEmptyMapSerializesCorrectly(): void + { + $object = new ObjectWithEmptyMap(['metadata' => ['key' => 'value']]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString('{"metadata":{"key":"value"}}', $json); + } + + public function testEmptyListAndEmptyMapSideBySide(): void + { + $object = new ObjectWithListAndMap(['list' => [], 'map' => []]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"list":[],"map":{}}', + $json, + 'Empty list should serialize as [] and empty map as {} on the same object.' + ); + } + + public function testNonEmptyListAndEmptyMap(): void + { + $object = new ObjectWithListAndMap(['list' => ['a', 'b'], 'map' => []]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"list":["a","b"],"map":{}}', + $json + ); + } + + public function testEmptyListAndNonEmptyMap(): void + { + $object = new ObjectWithListAndMap(['list' => [], 'map' => ['key' => 'val']]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"list":[],"map":{"key":"val"}}', + $json + ); + } + + public function testUnionWithEmptyObject(): void + { + $object = new ObjectWithUnionEmpty(['value' => new EmptyUnionMember([])]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"value":{}}', + $json, + 'Union containing an empty object should serialize to {} via the stdClass guard path.' + ); + } + + public function testUnionWithNonEmptyObject(): void + { + $object = new ObjectWithUnionEmpty(['value' => new EmptyUnionMember(['tag' => 'hello'])]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"value":{"tag":"hello"}}', + $json + ); + } + + public function testUnionWithStringFallback(): void + { + $object = new ObjectWithUnionEmpty(['value' => 'plain string']); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"value":"plain string"}', + $json + ); + } + + public function testListOfEmptyMaps(): void + { + $object = new ObjectWithListOfMaps(['items' => [[], []]]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"items":[{},{}]}', + $json, + 'A list of empty maps should produce [{},{}] — each empty map is {} but the list stays [].' + ); + } + + public function testListOfMixedMaps(): void + { + $object = new ObjectWithListOfMaps(['items' => [['a' => 'b'], [], ['c' => 'd']]]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"items":[{"a":"b"},{},{"c":"d"}]}', + $json + ); + } + + public function testMapOfEmptyObjects(): void + { + $object = new ObjectWithMapOfObjects([ + 'entries' => [ + 'first' => new EmptyUnionMember([]), + 'second' => new EmptyUnionMember([]), + ] + ]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"entries":{"first":{},"second":{}}}', + $json, + 'A map whose values are empty objects should produce {"a":{},"b":{}}.' + ); + } + + public function testMapOfMixedObjects(): void + { + $object = new ObjectWithMapOfObjects([ + 'entries' => [ + 'empty' => new EmptyUnionMember([]), + 'filled' => new EmptyUnionMember(['tag' => 'present']), + ] + ]); + $json = $object->toJson(); + $this->assertJsonStringEqualsJsonString( + '{"entries":{"empty":{},"filled":{"tag":"present"}}}', + $json + ); + } + + public function testEmptyObjectWithAdditionalPropertiesOnly(): void + { + $json = '{"extra_key":"extra_value"}'; + $object = ObjectWithAdditionalOnly::fromJson($json); + $this->assertNull($object->name); + $this->assertEquals(['extra_key' => 'extra_value'], $object->getAdditionalProperties()); + + $reserialized = $object->toJson(); + $this->assertEquals('{}', $reserialized, 'Object with only additional properties (no declared fields set) should serialize to {}.'); + } + + public function testEmptyObjectNoAdditionalProperties(): void + { + $object = new ObjectWithAdditionalOnly([]); + $json = $object->toJson(); + $this->assertEquals('{}', $json, 'Object with all null properties and no additional properties should serialize to {}.'); + } + + public function testRoundTripListAndMap(): void + { + $inputJson = '{"list":[],"map":{}}'; + $object = ObjectWithListAndMap::fromJson($inputJson); + $this->assertEmpty($object->list); + $this->assertEmpty($object->map); + $this->assertJsonStringEqualsJsonString($inputJson, $object->toJson()); + } + + public function testRoundTripUnionWithEmptyObject(): void + { + $inputJson = '{"value":{}}'; + $object = ObjectWithUnionEmpty::fromJson($inputJson); + $this->assertInstanceOf(EmptyUnionMember::class, $object->value); + $this->assertJsonStringEqualsJsonString($inputJson, $object->toJson()); + } +} diff --git a/tests/Core/Json/EnumTest.php b/tests/Core/Json/EnumTest.php new file mode 100644 index 0000000..6e8fcf0 --- /dev/null +++ b/tests/Core/Json/EnumTest.php @@ -0,0 +1,77 @@ +value; + } +} + +class ShapeType extends JsonSerializableType +{ + /** + * @var Shape $shape + */ + #[JsonProperty('shape')] + public Shape $shape; + + /** + * @var Shape[] $shapes + */ + #[ArrayType([Shape::class])] + #[JsonProperty('shapes')] + public array $shapes; + + /** + * @param Shape $shape + * @param Shape[] $shapes + */ + public function __construct( + Shape $shape, + array $shapes, + ) { + $this->shape = $shape; + $this->shapes = $shapes; + } +} + +class EnumTest extends TestCase +{ + public function testEnumSerialization(): void + { + $object = new ShapeType( + Shape::Circle, + [Shape::Square, Shape::Circle, Shape::Triangle] + ); + + $expectedJson = JsonEncoder::encode([ + 'shape' => 'CIRCLE', + 'shapes' => ['SQUARE', 'CIRCLE', 'TRIANGLE'] + ]); + + $actualJson = $object->toJson(); + + $this->assertJsonStringEqualsJsonString( + $expectedJson, + $actualJson, + 'Serialized JSON does not match expected JSON for shape and shapes properties.' + ); + } +} diff --git a/tests/Core/Json/ExhaustiveTest.php b/tests/Core/Json/ExhaustiveTest.php new file mode 100644 index 0000000..768de4e --- /dev/null +++ b/tests/Core/Json/ExhaustiveTest.php @@ -0,0 +1,197 @@ +nestedProperty = $values['nestedProperty']; + } +} + +class Type extends JsonSerializableType +{ + /** + * @var Nested nestedType + */ + #[JsonProperty('nested_type')] + public Nested $nestedType; /** + + * @var string $simpleProperty + */ + #[JsonProperty('simple_property')] + public string $simpleProperty; + + /** + * @var DateTime $dateProperty + */ + #[Date(Date::TYPE_DATE)] + #[JsonProperty('date_property')] + public DateTime $dateProperty; + + /** + * @var DateTime $datetimeProperty + */ + #[Date(Date::TYPE_DATETIME)] + #[JsonProperty('datetime_property')] + public DateTime $datetimeProperty; + + /** + * @var array $stringArray + */ + #[ArrayType(['string'])] + #[JsonProperty('string_array')] + public array $stringArray; + + /** + * @var array $mapProperty + */ + #[ArrayType(['string' => 'integer'])] + #[JsonProperty('map_property')] + public array $mapProperty; + + /** + * @var array $objectArray + */ + #[ArrayType(['integer' => new Union(Nested::class, 'null')])] + #[JsonProperty('object_array')] + public array $objectArray; + + /** + * @var array> $nestedArray + */ + #[ArrayType(['integer' => ['integer' => new Union('string', 'null')]])] + #[JsonProperty('nested_array')] + public array $nestedArray; + + /** + * @var array $datesArray + */ + #[ArrayType([new Union('date', 'null')])] + #[JsonProperty('dates_array')] + public array $datesArray; + + /** + * @var string|null $nullableProperty + */ + #[JsonProperty('nullable_property')] + public ?string $nullableProperty; + + /** + * @param array{ + * nestedType: Nested, + * simpleProperty: string, + * dateProperty: DateTime, + * datetimeProperty: DateTime, + * stringArray: array, + * mapProperty: array, + * objectArray: array, + * nestedArray: array>, + * datesArray: array, + * nullableProperty?: string|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nestedType = $values['nestedType']; + $this->simpleProperty = $values['simpleProperty']; + $this->dateProperty = $values['dateProperty']; + $this->datetimeProperty = $values['datetimeProperty']; + $this->stringArray = $values['stringArray']; + $this->mapProperty = $values['mapProperty']; + $this->objectArray = $values['objectArray']; + $this->nestedArray = $values['nestedArray']; + $this->datesArray = $values['datesArray']; + $this->nullableProperty = $values['nullableProperty'] ?? null; + } +} + +class ExhaustiveTest extends TestCase +{ + /** + * Test serialization and deserialization of all types in Type. + */ + public function testExhaustive(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'nested_type' => ['nested_property' => '1995-07-20'], + 'simple_property' => 'Test String', + // Omit 'nullable_property' to test null serialization + 'date_property' => '2023-01-01', + 'datetime_property' => '2023-01-01T12:34:56Z', + 'string_array' => ['one', 'two', 'three'], + 'map_property' => ['key1' => 1, 'key2' => 2], + 'object_array' => [ + 1 => ['nested_property' => '2021-07-20'], + 2 => null, // Testing nullable objects in array + ], + 'nested_array' => [ + 1 => [1 => 'value1', 2 => null], // Testing nullable strings in nested array + 2 => [3 => 'value3', 4 => 'value4'] + ], + 'dates_array' => ['2023-01-01', null, '2023-03-01'] // Testing nullable dates in array> + ], + ); + + $object = Type::fromJson($expectedJson); + + // Check that nullable property is null and not included in JSON + $this->assertNull($object->nullableProperty, 'Nullable property should be null.'); + + // Check date properties + $this->assertInstanceOf(DateTime::class, $object->dateProperty, 'date_property should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->dateProperty->format('Y-m-d'), 'date_property should have the correct date.'); + $this->assertInstanceOf(DateTime::class, $object->datetimeProperty, 'datetime_property should be a DateTime instance.'); + $this->assertEquals('2023-01-01 12:34:56', $object->datetimeProperty->format('Y-m-d H:i:s'), 'datetime_property should have the correct datetime.'); + + // Check scalar arrays + $this->assertEquals(['one', 'two', 'three'], $object->stringArray, 'string_array should match the original data.'); + $this->assertEquals(['key1' => 1, 'key2' => 2], $object->mapProperty, 'map_property should match the original data.'); + + // Check object array with nullable elements + $this->assertInstanceOf(Nested::class, $object->objectArray[1], 'object_array[1] should be an instance of TestNestedType1.'); + $this->assertEquals('2021-07-20', $object->objectArray[1]->nestedProperty->format('Y-m-d'), 'object_array[1]->nestedProperty should match the original data.'); + $this->assertNull($object->objectArray[2], 'object_array[2] should be null.'); + + // Check nested array with nullable strings + $this->assertEquals('value1', $object->nestedArray[1][1], 'nested_array[1][1] should match the original data.'); + $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); + $this->assertEquals('value3', $object->nestedArray[2][3], 'nested_array[2][3] should match the original data.'); + $this->assertEquals('value4', $object->nestedArray[2][4], 'nested_array[2][4] should match the original data.'); + + // Check dates array with nullable DateTime objects + $this->assertInstanceOf(DateTime::class, $object->datesArray[0], 'dates_array[0] should be a DateTime instance.'); + $this->assertEquals('2023-01-01', $object->datesArray[0]->format('Y-m-d'), 'dates_array[0] should have the correct date.'); + $this->assertNull($object->datesArray[1], 'dates_array[1] should be null.'); + $this->assertInstanceOf(DateTime::class, $object->datesArray[2], 'dates_array[2] should be a DateTime instance.'); + $this->assertEquals('2023-03-01', $object->datesArray[2]->format('Y-m-d'), 'dates_array[2] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'The serialized JSON does not match the original JSON.'); + } +} diff --git a/tests/Core/Json/InvalidTest.php b/tests/Core/Json/InvalidTest.php new file mode 100644 index 0000000..74273c8 --- /dev/null +++ b/tests/Core/Json/InvalidTest.php @@ -0,0 +1,42 @@ +integerProperty = $values['integerProperty']; + } +} + +class InvalidTest extends TestCase +{ + public function testInvalidJsonThrowsException(): void + { + $this->expectException(\TypeError::class); + $json = JsonEncoder::encode( + [ + 'integer_property' => 'not_an_integer' + ], + ); + Invalid::fromJson($json); + } +} diff --git a/tests/Core/Json/NestedUnionArrayTest.php b/tests/Core/Json/NestedUnionArrayTest.php new file mode 100644 index 0000000..8243e31 --- /dev/null +++ b/tests/Core/Json/NestedUnionArrayTest.php @@ -0,0 +1,89 @@ +nestedProperty = $values['nestedProperty']; + } +} + +class NestedUnionArray extends JsonSerializableType +{ + /** + * @var array> $nestedArray + */ + #[ArrayType(['integer' => ['integer' => new Union(UnionObject::class, 'null', 'date')]])] + #[JsonProperty('nested_array')] + public array $nestedArray; + + /** + * @param array{ + * nestedArray: array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nestedArray = $values['nestedArray']; + } +} + +class NestedUnionArrayTest extends TestCase +{ + public function testNestedUnionArray(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'nested_array' => [ + 1 => [ + 1 => ['nested_property' => 'Nested One'], + 2 => null, + 4 => '2023-01-02' + ], + 2 => [ + 5 => ['nested_property' => 'Nested Two'], + 7 => '2023-02-02' + ] + ] + ], + ); + + $object = NestedUnionArray::fromJson($expectedJson); + $this->assertInstanceOf(UnionObject::class, $object->nestedArray[1][1], 'nested_array[1][1] should be an instance of Object.'); + $this->assertEquals('Nested One', $object->nestedArray[1][1]->nestedProperty, 'nested_array[1][1]->nestedProperty should match the original data.'); + $this->assertNull($object->nestedArray[1][2], 'nested_array[1][2] should be null.'); + $this->assertInstanceOf(DateTime::class, $object->nestedArray[1][4], 'nested_array[1][4] should be a DateTime instance.'); + $this->assertEquals('2023-01-02T00:00:00+00:00', $object->nestedArray[1][4]->format(Constant::DateTimeFormat), 'nested_array[1][4] should have the correct datetime.'); + $this->assertInstanceOf(UnionObject::class, $object->nestedArray[2][5], 'nested_array[2][5] should be an instance of Object.'); + $this->assertEquals('Nested Two', $object->nestedArray[2][5]->nestedProperty, 'nested_array[2][5]->nestedProperty should match the original data.'); + $this->assertInstanceOf(DateTime::class, $object->nestedArray[2][7], 'nested_array[1][4] should be a DateTime instance.'); + $this->assertEquals('2023-02-02', $object->nestedArray[2][7]->format('Y-m-d'), 'nested_array[1][4] should have the correct date.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nested_array.'); + } +} diff --git a/tests/Core/Json/NullPropertyTest.php b/tests/Core/Json/NullPropertyTest.php new file mode 100644 index 0000000..fd59e3e --- /dev/null +++ b/tests/Core/Json/NullPropertyTest.php @@ -0,0 +1,53 @@ +nonNullProperty = $values['nonNullProperty']; + $this->nullProperty = $values['nullProperty'] ?? null; + } +} + +class NullPropertyTest extends TestCase +{ + public function testNullPropertiesAreOmitted(): void + { + $object = new NullProperty( + [ + "nonNullProperty" => "Test String", + "nullProperty" => null + ] + ); + + $serialized = $object->jsonSerialize(); + $this->assertArrayHasKey('non_null_property', $serialized, 'non_null_property should be present in the serialized JSON.'); + $this->assertArrayNotHasKey('null_property', $serialized, 'null_property should be omitted from the serialized JSON.'); + $this->assertEquals('Test String', $serialized['non_null_property'], 'non_null_property should have the correct value.'); + } +} diff --git a/tests/Core/Json/NullableArrayTest.php b/tests/Core/Json/NullableArrayTest.php new file mode 100644 index 0000000..199c972 --- /dev/null +++ b/tests/Core/Json/NullableArrayTest.php @@ -0,0 +1,49 @@ + $nullableStringArray + */ + #[ArrayType([new Union('string', 'null')])] + #[JsonProperty('nullable_string_array')] + public array $nullableStringArray; + + /** + * @param array{ + * nullableStringArray: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->nullableStringArray = $values['nullableStringArray']; + } +} + +class NullableArrayTest extends TestCase +{ + public function testNullableArray(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'nullable_string_array' => ['one', null, 'three'] + ], + ); + + $object = NullableArray::fromJson($expectedJson); + $this->assertEquals(['one', null, 'three'], $object->nullableStringArray, 'nullable_string_array should match the original data.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for nullable_string_array.'); + } +} diff --git a/tests/Core/Json/ScalarTest.php b/tests/Core/Json/ScalarTest.php new file mode 100644 index 0000000..24be68b --- /dev/null +++ b/tests/Core/Json/ScalarTest.php @@ -0,0 +1,116 @@ + $intFloatArray + */ + #[ArrayType([new Union('integer', 'float')])] + #[JsonProperty('int_float_array')] + public array $intFloatArray; + + /** + * @var array $floatArray + */ + #[ArrayType(['float'])] + #[JsonProperty('float_array')] + public array $floatArray; + + /** + * @var bool|null $nullableBooleanProperty + */ + #[JsonProperty('nullable_boolean_property')] + public ?bool $nullableBooleanProperty; + + /** + * @param array{ + * integerProperty: int, + * floatProperty: float, + * otherFloatProperty: float, + * booleanProperty: bool, + * stringProperty: string, + * intFloatArray: array, + * floatArray: array, + * nullableBooleanProperty?: bool|null, + * } $values + */ + public function __construct( + array $values, + ) { + $this->integerProperty = $values['integerProperty']; + $this->floatProperty = $values['floatProperty']; + $this->otherFloatProperty = $values['otherFloatProperty']; + $this->booleanProperty = $values['booleanProperty']; + $this->stringProperty = $values['stringProperty']; + $this->intFloatArray = $values['intFloatArray']; + $this->floatArray = $values['floatArray']; + $this->nullableBooleanProperty = $values['nullableBooleanProperty'] ?? null; + } +} + +class ScalarTest extends TestCase +{ + public function testAllScalarTypesIncludingFloat(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'integer_property' => 42, + 'float_property' => 3.14159, + 'other_float_property' => 3, + 'boolean_property' => true, + 'string_property' => 'Hello, World!', + 'int_float_array' => [1, 2.5, 3, 4.75], + 'float_array' => [1, 2, 3, 4] // Ensure we handle "integer-looking" floats + ], + ); + + $object = Scalar::fromJson($expectedJson); + $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); + $this->assertEquals(3.14159, $object->floatProperty, 'float_property should be 3.14159.'); + $this->assertTrue($object->booleanProperty, 'boolean_property should be true.'); + $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); + $this->assertNull($object->nullableBooleanProperty, 'nullable_boolean_property should be null.'); + $this->assertEquals([1, 2.5, 3, 4.75], $object->intFloatArray, 'int_float_array should match the original data.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTest.'); + } +} diff --git a/tests/Core/Json/TraitTest.php b/tests/Core/Json/TraitTest.php new file mode 100644 index 0000000..25be2b9 --- /dev/null +++ b/tests/Core/Json/TraitTest.php @@ -0,0 +1,60 @@ +integerProperty = $values['integerProperty']; + $this->stringProperty = $values['stringProperty']; + } +} + +class TraitTest extends TestCase +{ + public function testTraitPropertyAndString(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'integer_property' => 42, + 'string_property' => 'Hello, World!', + ], + ); + + $object = TypeWithTrait::fromJson($expectedJson); + $this->assertEquals(42, $object->integerProperty, 'integer_property should be 42.'); + $this->assertEquals('Hello, World!', $object->stringProperty, 'string_property should be "Hello, World!".'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for ScalarTypesTestWithTrait.'); + } +} diff --git a/tests/Core/Json/UnionArrayTest.php b/tests/Core/Json/UnionArrayTest.php new file mode 100644 index 0000000..b96df8e --- /dev/null +++ b/tests/Core/Json/UnionArrayTest.php @@ -0,0 +1,57 @@ + $mixedDates + */ + #[ArrayType(['integer' => new Union('datetime', 'string', 'null')])] + #[JsonProperty('mixed_dates')] + public array $mixedDates; + + /** + * @param array{ + * mixedDates: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->mixedDates = $values['mixedDates']; + } +} + +class UnionArrayTest extends TestCase +{ + public function testUnionArray(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'mixed_dates' => [ + 1 => '2023-01-01T12:00:00Z', + 2 => null, + 3 => 'Some String' + ] + ], + ); + + $object = UnionArray::fromJson($expectedJson); + $this->assertInstanceOf(DateTime::class, $object->mixedDates[1], 'mixed_dates[1] should be a DateTime instance.'); + $this->assertEquals('2023-01-01 12:00:00', $object->mixedDates[1]->format('Y-m-d H:i:s'), 'mixed_dates[1] should have the correct datetime.'); + $this->assertNull($object->mixedDates[2], 'mixed_dates[2] should be null.'); + $this->assertEquals('Some String', $object->mixedDates[3], 'mixed_dates[3] should be "Some String".'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match original JSON for mixed_dates.'); + } +} diff --git a/tests/Core/Json/UnionPropertyTest.php b/tests/Core/Json/UnionPropertyTest.php new file mode 100644 index 0000000..7db2888 --- /dev/null +++ b/tests/Core/Json/UnionPropertyTest.php @@ -0,0 +1,109 @@ + 'integer'], UnionProperty::class)] + #[JsonProperty('complexUnion')] + public mixed $complexUnion; + + /** + * @param array{ + * complexUnion: string|int|null|array|UnionProperty + * } $values + */ + public function __construct( + array $values, + ) { + $this->complexUnion = $values['complexUnion']; + } +} + +class UnionPropertyTest extends TestCase +{ + public function testWithMapOfIntToInt(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'complexUnion' => [1 => 100, 2 => 200] + ], + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsArray($object->complexUnion, 'complexUnion should be an array.'); + $this->assertEquals([1 => 100, 2 => 200], $object->complexUnion, 'complexUnion should match the original map of int => int.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithNestedUnionPropertyType(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'complexUnion' => new UnionProperty( + [ + 'complexUnion' => 'Nested String' + ] + ) + ], + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertInstanceOf(UnionProperty::class, $object->complexUnion, 'complexUnion should be an instance of UnionPropertyType.'); + $this->assertEquals('Nested String', $object->complexUnion->complexUnion, 'Nested complexUnion should match the original value.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithNull(): void + { + $expectedJson = '{}'; + + $object = UnionProperty::fromJson($expectedJson); + $this->assertNull($object->complexUnion, 'complexUnion should be null.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithInteger(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'complexUnion' => 42 + ], + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsInt($object->complexUnion, 'complexUnion should be an integer.'); + $this->assertEquals(42, $object->complexUnion, 'complexUnion should match the original integer.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } + + public function testWithString(): void + { + $expectedJson = JsonEncoder::encode( + [ + 'complexUnion' => 'Some String' + ], + ); + + $object = UnionProperty::fromJson($expectedJson); + $this->assertIsString($object->complexUnion, 'complexUnion should be a string.'); + $this->assertEquals('Some String', $object->complexUnion, 'complexUnion should match the original string.'); + + $actualJson = $object->toJson(); + $this->assertJsonStringEqualsJsonString($expectedJson, $actualJson, 'Serialized JSON does not match the original JSON.'); + } +}