diff --git a/.fern/metadata.json b/.fern/metadata.json index 7f17ec2e..7b0a48af 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "0606e988ebff3773183ef02e0a820c36b3a25f8d", + "originGitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.19", + "requestedVersion": "3.0.0-alpha.20", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.19" + "sdkVersion": "3.0.0-alpha.20" } \ No newline at end of file diff --git a/README.md b/README.md index 576d2004..52df4155 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ The official PHP SDK for the CloudPDF API. - [Requirements](#requirements) - [Installation](#installation) - [Usage](#usage) +- [Environments](#environments) - [Exception Handling](#exception-handling) - [Advanced](#advanced) - [Custom Client](#custom-client) @@ -57,6 +58,29 @@ $client->doc->changes( ``` +## Environments + +This SDK allows you to configure different environments for API requests. + +```php +The SDK defaults to the `Saas` environment. To use a different environment, pass it to the client constructor: + +```php +use CloudPDF\CloudPDFClient; +use CloudPDF\Environments; + +$client = new CloudPDFClient( + token: '', + options: [ + 'baseUrl' => Environments::Staging->value + ] +); +``` + +Available environments: +- `Environments::Saas` +``` + ## Exception Handling When the API returns a non-success status code (4xx or 5xx response), an exception will be thrown. diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 5bb4c58e..ed92d9b3 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.19", - "sdkVersion": "3.0.0-alpha.19", + "canonicalVersion": "3.0.0-next.20", + "sdkVersion": "3.0.0-alpha.20", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "e88e02ed71f422ad08b2393abeda474e8dcf6707b6e753af74ba2f40da8e7d6b", - "gitCommit": "0606e988ebff3773183ef02e0a820c36b3a25f8d", + "openapiSha256": "47d739acb956ce8ba0c3990117e505be2e9406038d9e0cd1729608921a40b2d9", + "gitCommit": "622018abaf6e4578d1f4d8377982c48b92c9ced3", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index f92f75b8..f3d102a3 100644 --- a/reference.md +++ b/reference.md @@ -697,7 +697,7 @@ $client->grants->list(
-The returned id is what a link page or an embed opens. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. +The returned id is what a link page or an embed opens. Its scope gives only document permissions the caller holds itself, as tokens.issue does. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does.
@@ -1829,6 +1829,20 @@ $client->documents->update(
+#### 📝 Description + +
+
+ +
+
+ +An upload token commits only the documents it started; any other document answers 404. +
+
+
+
+ #### 🔌 Usage
@@ -2001,7 +2015,7 @@ $client->documents->thumbnail(
-This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. +This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. An upload token sends files only to the documents it started.
@@ -2194,6 +2208,20 @@ $client->documents->importFrom(
+#### 📝 Description + +
+
+ +
+
+ +With an upload token, the document goes into the token's folder with the token's metadata, whatever the request says; contentLength must be within the token's maxBytes, and the token makes at most maxFiles documents (403 after). docId, idempotencyKey and dedupMode reuse-existing are refused (400): each could reach a document the token didn't make. +
+
+
+
+ #### 🔌 Usage
@@ -2755,7 +2783,7 @@ $client->folders->moveInto(
-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. +Authority mints only downward: kind "doc" gives only document permissions the caller holds itself, kind "tenant" requires the API token, and kind "upload" requires docs.create instead of tokens.issue-doc, since an upload token can do only what docs.create allows. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key.
@@ -3930,6 +3958,143 @@ $client->doc->attachments->list(
+ +
+ + +## Doc Fonts +
$client->doc->fonts->list($docId, $layerName, $request) -> ?FontList +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->fonts->list( + 'docId', + 'layerName', + new ListFontsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ 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->fonts->resolve($docId, $layerName, $request) -> ?FontResolution +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->fonts->resolve( + 'docId', + 'layerName', + new ResolveFontsRequest([ + 'body' => new FontResolveRequest([ + 'runs' => [ + new FontResolveRun([ + 'text' => 'text', + ]), + ], + ]), + ]), +); +``` +
+
+
+
+ +#### ⚙️ 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:** `FontResolveRequest` + +
+
+
+
+ +
@@ -6253,6 +6418,159 @@ $client->doc->versions->signatureDigest( + + + + +## Doc Fonts Programs +
$client->doc->fonts->programs->download($docId, $layerName, $displayHash, $request) -> string +
+
+ +#### 📝 Description + +
+
+ +
+
+ +A document token needs any one of the listed capabilities: one that may write text in the document. A file the list says can't be downloaded (`canDownload: false`) is not found. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->fonts->programs->download( + 'docId', + 'layerName', + 'displayHash', + new DownloadProgramsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$displayHash:** `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->fonts->programs->get($docId, $layerName, $displayHash, $request) -> ?FontProgramInfo +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->fonts->programs->get( + 'docId', + 'layerName', + 'displayHash', + new GetProgramsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$displayHash:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ +
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 54a2e51e..6b37e26b 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -82,8 +82,8 @@ public function __construct( $defaultHeaders = [ 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0-alpha.19', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.19', + 'X-Fern-SDK-Version' => '3.0.0-alpha.20', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.20', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Deployment/DeploymentClient.php b/src/Deployment/DeploymentClient.php index ede63dd2..0c83f6af 100644 --- a/src/Deployment/DeploymentClient.php +++ b/src/Deployment/DeploymentClient.php @@ -8,6 +8,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -72,7 +73,7 @@ public function licenseStatus(?array $options = null): ?DeploymentLicenseStatusR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/deployment/license/status", method: HttpMethod::GET, ), diff --git a/src/Doc/Annotations/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php index 5af7d96a..40b825dd 100644 --- a/src/Doc/Annotations/AnnotationsClient.php +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -100,7 +101,7 @@ public function listAll(string $docId, string $layerName, ListAllAnnotationsRequ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/items", method: HttpMethod::GET, headers: $headers, @@ -164,7 +165,7 @@ public function list(string $docId, string $layerName, string $pageKey, ListAnno try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items", method: HttpMethod::GET, headers: $headers, @@ -237,7 +238,7 @@ public function create(string $docId, string $layerName, string $pageKey, Create try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items", method: HttpMethod::POST, headers: $headers, @@ -307,7 +308,7 @@ public function delete(string $docId, string $layerName, string $pageKey, string try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", method: HttpMethod::DELETE, headers: $headers, @@ -380,7 +381,7 @@ public function update(string $docId, string $layerName, string $pageKey, string try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", method: HttpMethod::PATCH, headers: $headers, @@ -447,7 +448,7 @@ public function readAppearance(string $docId, string $layerName, string $pageKey try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/appearance", method: HttpMethod::GET, headers: $headers, @@ -509,7 +510,7 @@ public function readFile(string $docId, string $layerName, string $pageKey, stri try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/file", method: HttpMethod::GET, headers: $headers, @@ -573,7 +574,7 @@ public function exportAppearance(string $docId, string $layerName, string $pageK try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/appearance", method: HttpMethod::POST, headers: $headers, @@ -639,7 +640,7 @@ public function flatten(string $docId, string $layerName, string $pageKey, Flatt try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/flatten", method: HttpMethod::POST, headers: $headers, @@ -718,7 +719,7 @@ public function reorder(string $docId, string $layerName, string $pageKey, DocAn try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/reorder", method: HttpMethod::POST, headers: $headers, diff --git a/src/Doc/Attachments/AttachmentsClient.php b/src/Doc/Attachments/AttachmentsClient.php index ae213a7d..9b621e62 100644 --- a/src/Doc/Attachments/AttachmentsClient.php +++ b/src/Doc/Attachments/AttachmentsClient.php @@ -8,6 +8,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Attachments\Requests\ListAttachmentsRequest; @@ -89,7 +90,7 @@ public function download(string $docId, string $layerName, string $fileKey, Down try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/attachment-files/{$fileKey}/data", method: HttpMethod::GET, headers: $headers, @@ -147,7 +148,7 @@ public function list(string $docId, string $layerName, ListAttachmentsRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/attachments", method: HttpMethod::GET, headers: $headers, diff --git a/src/Doc/DocClient.php b/src/Doc/DocClient.php index 1399e25d..fe95f95f 100644 --- a/src/Doc/DocClient.php +++ b/src/Doc/DocClient.php @@ -4,6 +4,7 @@ use CloudPDF\Doc\Annotations\AnnotationsClient; use CloudPDF\Doc\Attachments\AttachmentsClient; +use CloudPDF\Doc\Fonts\FontsClient; use CloudPDF\Doc\Forms\FormsClient; use CloudPDF\Doc\Metadata\MetadataClient; use CloudPDF\Doc\Outline\OutlineClient; @@ -18,6 +19,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -44,6 +46,11 @@ class DocClient */ public AttachmentsClient $attachments; + /** + * @var FontsClient $fonts + */ + public FontsClient $fonts; + /** * @var FormsClient $forms */ @@ -113,6 +120,7 @@ public function __construct( $this->options = $options ?? []; $this->annotations = new AnnotationsClient($this->client, $this->options); $this->attachments = new AttachmentsClient($this->client, $this->options); + $this->fonts = new FontsClient($this->client, $this->options); $this->forms = new FormsClient($this->client, $this->options); $this->metadata = new MetadataClient($this->client, $this->options); $this->outline = new OutlineClient($this->client, $this->options); @@ -155,7 +163,7 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/head", method: HttpMethod::GET, headers: $headers, @@ -225,7 +233,7 @@ public function changes(string $docId, string $layerName, DocChangesRequest $req try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/changes", method: HttpMethod::POST, headers: $headers, @@ -288,7 +296,7 @@ public function download(string $docId, string $layerName, DownloadDocRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/download", method: HttpMethod::GET, headers: $headers, @@ -346,7 +354,7 @@ public function downloadLink(string $docId, string $layerName, DocDownloadLinkRe try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/download-link", method: HttpMethod::POST, headers: $headers, @@ -409,7 +417,7 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/manifest", method: HttpMethod::GET, headers: $headers, @@ -475,7 +483,7 @@ public function render(string $docId, string $layerName, string $pageKey, Render try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/render/pages/{$pageKey}/data", method: HttpMethod::GET, headers: $headers, @@ -533,7 +541,7 @@ public function text(string $docId, string $layerName, string $pageKey, TextDocR try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/text/pages/{$pageKey}/data", method: HttpMethod::GET, headers: $headers, diff --git a/src/Doc/Fonts/FontsClient.php b/src/Doc/Fonts/FontsClient.php new file mode 100644 index 00000000..382ec308 --- /dev/null +++ b/src/Doc/Fonts/FontsClient.php @@ -0,0 +1,194 @@ +, + * } $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->programs = new ProgramsClient($this->client, $this->options); + } + + /** + * Example: + * ```php + * $client->doc->fonts->list( + * 'docId', + * 'layerName', + * new ListFontsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ListFontsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?FontList + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function list(string $docId, string $layerName, ListFontsRequest $request = new ListFontsRequest(), ?array $options = null): ?FontList + { + $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'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/fonts", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return FontList::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->fonts->resolve( + * 'docId', + * 'layerName', + * new ResolveFontsRequest([ + * 'body' => new FontResolveRequest([ + * 'runs' => [ + * new FontResolveRun([ + * 'text' => 'text', + * ]), + * ], + * ]), + * ]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ResolveFontsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?FontResolution + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function resolve(string $docId, string $layerName, ResolveFontsRequest $request, ?array $options = null): ?FontResolution + { + $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'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/fonts/resolve", + 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 FontResolution::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/Fonts/Programs/ProgramsClient.php b/src/Doc/Fonts/Programs/ProgramsClient.php new file mode 100644 index 00000000..d9be1432 --- /dev/null +++ b/src/Doc/Fonts/Programs/ProgramsClient.php @@ -0,0 +1,177 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * A document token needs any one of the listed capabilities: one that may write text in the document. A file the list says can't be downloaded (`canDownload: false`) is not found. + * + * Example: + * ```php + * $client->doc->fonts->programs->download( + * 'docId', + * 'layerName', + * 'displayHash', + * new DownloadProgramsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $displayHash + * @param DownloadProgramsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return string + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function download(string $docId, string $layerName, string $displayHash, DownloadProgramsRequest $request = new DownloadProgramsRequest(), ?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'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/font-program-files/{$displayHash}", + 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->fonts->programs->get( + * 'docId', + * 'layerName', + * 'displayHash', + * new GetProgramsRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param string $displayHash + * @param GetProgramsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?FontProgramInfo + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function get(string $docId, string $layerName, string $displayHash, GetProgramsRequest $request = new GetProgramsRequest(), ?array $options = null): ?FontProgramInfo + { + $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'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/font-programs/{$displayHash}", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return FontProgramInfo::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/Fonts/Programs/Requests/DownloadProgramsRequest.php b/src/Doc/Fonts/Programs/Requests/DownloadProgramsRequest.php new file mode 100644 index 00000000..4359f888 --- /dev/null +++ b/src/Doc/Fonts/Programs/Requests/DownloadProgramsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Fonts/Programs/Requests/GetProgramsRequest.php b/src/Doc/Fonts/Programs/Requests/GetProgramsRequest.php new file mode 100644 index 00000000..e53202ad --- /dev/null +++ b/src/Doc/Fonts/Programs/Requests/GetProgramsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Fonts/Requests/ListFontsRequest.php b/src/Doc/Fonts/Requests/ListFontsRequest.php new file mode 100644 index 00000000..f95e151d --- /dev/null +++ b/src/Doc/Fonts/Requests/ListFontsRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Fonts/Requests/ResolveFontsRequest.php b/src/Doc/Fonts/Requests/ResolveFontsRequest.php new file mode 100644 index 00000000..4721f0b9 --- /dev/null +++ b/src/Doc/Fonts/Requests/ResolveFontsRequest.php @@ -0,0 +1,32 @@ +documentPassword = $values['documentPassword'] ?? null; + $this->body = $values['body']; + } +} diff --git a/src/Doc/Forms/FormsClient.php b/src/Doc/Forms/FormsClient.php index 139edd65..d1321a5b 100644 --- a/src/Doc/Forms/FormsClient.php +++ b/src/Doc/Forms/FormsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -96,7 +97,7 @@ public function list(string $docId, string $layerName, ListFormsRequest $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form", method: HttpMethod::GET, headers: $headers, @@ -168,7 +169,7 @@ public function reorderCalculations(string $docId, string $layerName, DocFormsRe try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/calculations/reorder", method: HttpMethod::POST, headers: $headers, @@ -240,7 +241,7 @@ public function setValue(string $docId, string $layerName, string $fieldKey, Set try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/fields/{$fieldKey}/value", method: HttpMethod::POST, headers: $headers, @@ -306,7 +307,7 @@ public function reset(string $docId, string $layerName, DocFormsResetRequest $re try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/reset", method: HttpMethod::POST, headers: $headers, @@ -376,7 +377,7 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", method: HttpMethod::DELETE, headers: $headers, @@ -447,7 +448,7 @@ public function updateWidget(string $docId, string $layerName, string $pageKey, try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", method: HttpMethod::PATCH, headers: $headers, @@ -526,7 +527,7 @@ public function reorderWidgets(string $docId, string $layerName, string $pageKey try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/reorder", method: HttpMethod::POST, headers: $headers, diff --git a/src/Doc/Metadata/Custom/CustomClient.php b/src/Doc/Metadata/Custom/CustomClient.php index 9a8b8bea..52196190 100644 --- a/src/Doc/Metadata/Custom/CustomClient.php +++ b/src/Doc/Metadata/Custom/CustomClient.php @@ -8,6 +8,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use CloudPDF\Core\Json\JsonDecoder; use JsonException; @@ -84,7 +85,7 @@ public function get(string $docId, string $layerName, GetCustomRequest $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/metadata/custom", method: HttpMethod::GET, headers: $headers, diff --git a/src/Doc/Metadata/MetadataClient.php b/src/Doc/Metadata/MetadataClient.php index e4ff001b..6755141f 100644 --- a/src/Doc/Metadata/MetadataClient.php +++ b/src/Doc/Metadata/MetadataClient.php @@ -10,6 +10,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -91,7 +92,7 @@ public function get(string $docId, string $layerName, GetMetadataRequest $reques try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/metadata", method: HttpMethod::GET, headers: $headers, diff --git a/src/Doc/Outline/OutlineClient.php b/src/Doc/Outline/OutlineClient.php index 17c9bd26..5041222f 100644 --- a/src/Doc/Outline/OutlineClient.php +++ b/src/Doc/Outline/OutlineClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -84,7 +85,7 @@ public function get(string $docId, string $layerName, GetOutlineRequest $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/outline", method: HttpMethod::GET, headers: $headers, diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php index 4b46dd28..74cf4e36 100644 --- a/src/Doc/Pages/PagesClient.php +++ b/src/Doc/Pages/PagesClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -98,7 +99,7 @@ public function setScale(string $docId, string $layerName, string $pageKey, DocP try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pageKey}/scale", method: HttpMethod::PUT, headers: $headers, @@ -163,7 +164,7 @@ public function viewports(string $docId, string $layerName, string $pageKey, Vie try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pageKey}/viewports", method: HttpMethod::GET, headers: $headers, @@ -233,7 +234,7 @@ public function extract(string $docId, string $layerName, ExtractPagesRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/extract", method: HttpMethod::POST, headers: $headers, @@ -297,7 +298,7 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/flatten", method: HttpMethod::POST, headers: $headers, @@ -367,7 +368,7 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/names", method: HttpMethod::POST, headers: $headers, @@ -437,7 +438,7 @@ public function removeName(string $docId, string $layerName, RemoveNamePagesRequ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/pages/names/delete", method: HttpMethod::POST, headers: $headers, diff --git a/src/Doc/Redactions/RedactionsClient.php b/src/Doc/Redactions/RedactionsClient.php index c4d0be9a..7400c511 100644 --- a/src/Doc/Redactions/RedactionsClient.php +++ b/src/Doc/Redactions/RedactionsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -87,7 +88,7 @@ public function apply(string $docId, string $layerName, DocRedactionsApplyReques try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/redactions/apply", method: HttpMethod::POST, headers: $headers, diff --git a/src/Doc/Signatures/SignaturesClient.php b/src/Doc/Signatures/SignaturesClient.php index f30be4f0..98a841b0 100644 --- a/src/Doc/Signatures/SignaturesClient.php +++ b/src/Doc/Signatures/SignaturesClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -96,7 +97,7 @@ public function list(string $docId, string $layerName, ListSignaturesRequest $re try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/signatures", method: HttpMethod::GET, headers: $headers, @@ -160,7 +161,7 @@ public function cancel(string $docId, string $layerName, string $signingId, Canc try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/signatures/{$signingId}", method: HttpMethod::DELETE, headers: $headers, @@ -232,7 +233,7 @@ public function complete(string $docId, string $layerName, string $signingId, Do try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/signatures/{$signingId}/complete", method: HttpMethod::POST, headers: $headers, @@ -307,7 +308,7 @@ public function analysis(string $docId, string $layerName, AnalysisSignaturesReq try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/signatures/analysis", method: HttpMethod::GET, headers: $headers, @@ -375,7 +376,7 @@ public function prepare(string $docId, string $layerName, PrepareSignaturesReque try { $response = $this->client->sendRequest( new MultipartApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/signatures/prepare", method: HttpMethod::POST, headers: $headers, diff --git a/src/Doc/Versions/VersionsClient.php b/src/Doc/Versions/VersionsClient.php index f8383655..7fcee37e 100644 --- a/src/Doc/Versions/VersionsClient.php +++ b/src/Doc/Versions/VersionsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -95,7 +96,7 @@ public function list(string $docId, string $layerName, ListVersionsRequest $requ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions", method: HttpMethod::GET, headers: $headers, @@ -177,7 +178,7 @@ public function analysis(string $docId, string $layerName, string $sha, Analysis try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/analysis/{$sha}", method: HttpMethod::GET, headers: $headers, @@ -242,7 +243,7 @@ public function download(string $docId, string $layerName, string $sha, Download try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/download/{$sha}", method: HttpMethod::GET, headers: $headers, @@ -302,7 +303,7 @@ public function revision(string $docId, string $layerName, string $sha, int $ind try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/revisions/{$sha}/{$index}", method: HttpMethod::GET, headers: $headers, @@ -360,7 +361,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}", method: HttpMethod::GET, headers: $headers, @@ -428,7 +429,7 @@ public function signatureContents(string $docId, string $layerName, string $sha, try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}/{$fieldKey}/contents", method: HttpMethod::GET, headers: $headers, @@ -492,7 +493,7 @@ public function signatureDigest(string $docId, string $layerName, string $sha, s try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}/{$fieldKey}/digest/{$algorithm}", method: HttpMethod::GET, headers: $headers, diff --git a/src/Documents/DocumentsClient.php b/src/Documents/DocumentsClient.php index 56ca31ff..02bd6daa 100644 --- a/src/Documents/DocumentsClient.php +++ b/src/Documents/DocumentsClient.php @@ -10,6 +10,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -120,7 +121,7 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents", method: HttpMethod::GET, query: $query, @@ -176,7 +177,7 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}", method: HttpMethod::GET, ), @@ -230,7 +231,7 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}", method: HttpMethod::DELETE, ), @@ -285,7 +286,7 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}", method: HttpMethod::PATCH, body: $request, @@ -313,6 +314,8 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req } /** + * An upload token commits only the documents it started; any other document answers 404. + * * Example: * ```php * $client->documents->commit( @@ -345,7 +348,7 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/commit", method: HttpMethod::POST, body: $request, @@ -401,7 +404,7 @@ public function download(string $tenantId, string $id, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/download", method: HttpMethod::GET, ), @@ -450,7 +453,7 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/thumbnail", method: HttpMethod::GET, ), @@ -471,7 +474,7 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): } /** - * This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. + * This bounded origin-mediated fallback must only be used after documents.init returns upload.kind=proxy. Auto mode prefers a presigned object-store PUT whenever available. An upload token sends files only to the documents it started. * * Example: * ```php @@ -506,7 +509,7 @@ public function uploadProxy(string $tenantId, string $id, UploadProxyDocumentsRe try { $response = $this->client->sendRequest( new MultipartApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/upload-proxy", method: HttpMethod::POST, body: $body, @@ -568,7 +571,7 @@ public function importFrom(string $tenantId, DocumentsImportFromRequest $request try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/import", method: HttpMethod::POST, body: $request, @@ -596,6 +599,8 @@ public function importFrom(string $tenantId, DocumentsImportFromRequest $request } /** + * With an upload token, the document goes into the token's folder with the token's metadata, whatever the request says; contentLength must be within the token's maxBytes, and the token makes at most maxFiles documents (403 after). docId, idempotencyKey and dedupMode reuse-existing are refused (400): each could reach a document the token didn't make. + * * Example: * ```php * $client->documents->init( @@ -627,7 +632,7 @@ public function init(string $tenantId, DocumentsInitRequest $request, ?array $op try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/init", method: HttpMethod::POST, body: $request, diff --git a/src/Documents/Layers/LayersClient.php b/src/Documents/Layers/LayersClient.php index 57430619..477a1308 100644 --- a/src/Documents/Layers/LayersClient.php +++ b/src/Documents/Layers/LayersClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -90,7 +91,7 @@ public function list(string $tenantId, string $id, ListLayersRequest $request = try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/layers", method: HttpMethod::GET, query: $query, @@ -147,7 +148,7 @@ public function delete(string $tenantId, string $id, string $layerName, ?array $ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/documents/{$id}/layers/{$layerName}", method: HttpMethod::DELETE, ), diff --git a/src/Environments.php b/src/Environments.php new file mode 100644 index 00000000..8a2573b8 --- /dev/null +++ b/src/Environments.php @@ -0,0 +1,8 @@ +client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders", method: HttpMethod::GET, query: $query, @@ -155,7 +156,7 @@ public function create(string $tenantId, FoldersCreateRequest $request, ?array $ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders", method: HttpMethod::POST, body: $request, @@ -211,7 +212,7 @@ public function get(string $tenantId, string $folderId, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders/{$folderId}", method: HttpMethod::GET, ), @@ -273,7 +274,7 @@ public function delete(string $tenantId, string $folderId, DeleteFoldersRequest try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders/{$folderId}", method: HttpMethod::DELETE, query: $query, @@ -329,7 +330,7 @@ public function update(string $tenantId, string $folderId, FoldersUpdateRequest try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders/{$folderId}", method: HttpMethod::PATCH, body: $request, @@ -388,7 +389,7 @@ public function moveInto(string $tenantId, string $folderId, FoldersMoveIntoRequ try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/folders/{$folderId}/move-into", method: HttpMethod::POST, body: $request, diff --git a/src/Grants/GrantsClient.php b/src/Grants/GrantsClient.php index 45d3e8aa..c5174cae 100644 --- a/src/Grants/GrantsClient.php +++ b/src/Grants/GrantsClient.php @@ -10,6 +10,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -95,7 +96,7 @@ public function exchange(GrantsExchangeRequest $request, ?array $options = null) try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/grant-sessions", method: HttpMethod::POST, body: $request, @@ -164,7 +165,7 @@ public function list(string $tenantId, ListGrantsRequest $request = new ListGran try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants", method: HttpMethod::GET, query: $query, @@ -192,7 +193,7 @@ public function list(string $tenantId, ListGrantsRequest $request = new ListGran } /** - * The returned id is what a link page or an embed opens. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. + * The returned id is what a link page or an embed opens. Its scope gives only document permissions the caller holds itself, as tokens.issue does. Mounted only when the deployment can sign (HS256 mode) — exchange mints session JWTs, so grants exist only where minting does. * * Example: * ```php @@ -227,7 +228,7 @@ public function create(string $tenantId, GrantsCreateRequest $request, ?array $o try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants", method: HttpMethod::POST, body: $request, @@ -283,7 +284,7 @@ public function get(string $tenantId, string $grantId, ?array $options = null): try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}", method: HttpMethod::GET, ), @@ -337,7 +338,7 @@ public function delete(string $tenantId, string $grantId, ?array $options = null try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}", method: HttpMethod::DELETE, ), @@ -388,7 +389,7 @@ public function update(string $tenantId, string $grantId, GrantsUpdateRequest $r try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}", method: HttpMethod::PATCH, body: $request, @@ -446,7 +447,7 @@ public function archive(string $tenantId, string $grantId, ?array $options = nul try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}/archive", method: HttpMethod::POST, ), diff --git a/src/Grants/Visitors/VisitorsClient.php b/src/Grants/Visitors/VisitorsClient.php index 55bcaf77..7a6b3586 100644 --- a/src/Grants/Visitors/VisitorsClient.php +++ b/src/Grants/Visitors/VisitorsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -89,7 +90,7 @@ public function list(string $tenantId, string $grantId, ListVisitorsRequest $req try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}/visitors", method: HttpMethod::GET, query: $query, @@ -148,7 +149,7 @@ public function delete(string $tenantId, string $grantId, string $visitorId, ?ar try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/grants/{$grantId}/visitors/{$visitorId}", method: HttpMethod::DELETE, ), diff --git a/src/Tenants/TenantsClient.php b/src/Tenants/TenantsClient.php index 9dc0f60b..eb6de8e0 100644 --- a/src/Tenants/TenantsClient.php +++ b/src/Tenants/TenantsClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -89,7 +90,7 @@ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?ar try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants", method: HttpMethod::GET, query: $query, @@ -145,7 +146,7 @@ public function create(TenantsCreateRequest $request, ?array $options = null): ? try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants", method: HttpMethod::POST, body: $request, @@ -199,7 +200,7 @@ public function get(string $tenantId, ?array $options = null): ?TenantsGet200Res try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}", method: HttpMethod::GET, ), @@ -253,7 +254,7 @@ public function delete(string $tenantId, ?array $options = null): void try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}", method: HttpMethod::DELETE, ), @@ -299,7 +300,7 @@ public function resume(string $tenantId, ?array $options = null): void try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/resume", method: HttpMethod::POST, ), @@ -349,7 +350,7 @@ public function suspend(string $tenantId, TenantsSuspendRequest $request = new T try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/suspend", method: HttpMethod::POST, body: $request, @@ -405,7 +406,7 @@ public function usage(string $tenantId, UsageTenantsRequest $request = new Usage try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/usage", method: HttpMethod::GET, query: $query, diff --git a/src/Tokens/TokensClient.php b/src/Tokens/TokensClient.php index c71b2450..4e77da16 100644 --- a/src/Tokens/TokensClient.php +++ b/src/Tokens/TokensClient.php @@ -9,6 +9,7 @@ use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; +use CloudPDF\Environments; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; @@ -51,7 +52,7 @@ public function __construct( } /** - * 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. + * Authority mints only downward: kind "doc" gives only document permissions the caller holds itself, kind "tenant" requires the API token, and kind "upload" requires docs.create instead of tokens.issue-doc, since an upload token can do only what docs.create allows. Mounted only when the deployment can sign (HS256 mode); asymmetric deployments mint with their own private key. * * Example: * ```php @@ -90,7 +91,7 @@ public function issue(string $tenantId, IssueTokensRequest $request, ?array $opt try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/tokens", method: HttpMethod::POST, body: $request->body, @@ -149,7 +150,7 @@ public function revoke(string $tenantId, string $jti, TokensRevokeRequest $reque try { $response = $this->client->sendRequest( new JsonApiRequest( - baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, path: "v1/tenants/{$tenantId}/tokens/{$jti}/revoke", method: HttpMethod::POST, body: $request, diff --git a/src/Types/AnnotationCaret.php b/src/Types/AnnotationCaret.php index fdc41ed0..a7c734d6 100644 --- a/src/Types/AnnotationCaret.php +++ b/src/Types/AnnotationCaret.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationCaret extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -240,6 +247,7 @@ class AnnotationCaret extends JsonSerializableType * opacity: float, * box: AnnotationCaretBox, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -265,6 +273,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationCircle.php b/src/Types/AnnotationCircle.php index 1d194f6d..d0645085 100644 --- a/src/Types/AnnotationCircle.php +++ b/src/Types/AnnotationCircle.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationCircle extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationCircle extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -267,6 +273,7 @@ class AnnotationCircle extends JsonSerializableType * borderStyle: value-of, * box: AnnotationCircleBox, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -294,6 +301,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftCaret.php b/src/Types/AnnotationDraftCaret.php index 8da9d8ce..f0692e2f 100644 --- a/src/Types/AnnotationDraftCaret.php +++ b/src/Types/AnnotationDraftCaret.php @@ -31,6 +31,12 @@ class AnnotationDraftCaret extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -223,6 +229,7 @@ class AnnotationDraftCaret extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftCaretRect, * contents?: ?string, @@ -263,6 +270,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftCircle.php b/src/Types/AnnotationDraftCircle.php index 947b87e7..f031bf0e 100644 --- a/src/Types/AnnotationDraftCircle.php +++ b/src/Types/AnnotationDraftCircle.php @@ -32,6 +32,12 @@ class AnnotationDraftCircle extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -248,6 +254,7 @@ class AnnotationDraftCircle extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftCircleRect, * contents?: ?string, @@ -292,6 +299,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftFileAttachment.php b/src/Types/AnnotationDraftFileAttachment.php index 08b58c87..0bec198e 100644 --- a/src/Types/AnnotationDraftFileAttachment.php +++ b/src/Types/AnnotationDraftFileAttachment.php @@ -31,6 +31,12 @@ class AnnotationDraftFileAttachment extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -218,6 +224,7 @@ class AnnotationDraftFileAttachment extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -256,6 +263,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftFreeText.php b/src/Types/AnnotationDraftFreeText.php index 9ca6d196..91896481 100644 --- a/src/Types/AnnotationDraftFreeText.php +++ b/src/Types/AnnotationDraftFreeText.php @@ -32,6 +32,12 @@ class AnnotationDraftFreeText extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -302,6 +308,7 @@ class AnnotationDraftFreeText extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftFreeTextRect, * contents?: ?string, @@ -355,6 +362,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftHighlight.php b/src/Types/AnnotationDraftHighlight.php index 878b676f..c4b622ac 100644 --- a/src/Types/AnnotationDraftHighlight.php +++ b/src/Types/AnnotationDraftHighlight.php @@ -32,6 +32,12 @@ class AnnotationDraftHighlight extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -213,6 +219,7 @@ class AnnotationDraftHighlight extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftHighlightRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftInk.php b/src/Types/AnnotationDraftInk.php index 98e71093..63e07f2a 100644 --- a/src/Types/AnnotationDraftInk.php +++ b/src/Types/AnnotationDraftInk.php @@ -32,6 +32,12 @@ class AnnotationDraftInk extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -243,6 +249,7 @@ class AnnotationDraftInk extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftInkRect, * contents?: ?string, @@ -285,6 +292,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftLine.php b/src/Types/AnnotationDraftLine.php index dbf15f4e..94a727ed 100644 --- a/src/Types/AnnotationDraftLine.php +++ b/src/Types/AnnotationDraftLine.php @@ -32,6 +32,12 @@ class AnnotationDraftLine extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -285,6 +291,7 @@ class AnnotationDraftLine extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftLineRect, * contents?: ?string, @@ -334,6 +341,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftLink.php b/src/Types/AnnotationDraftLink.php index 7788720a..3ffd23fd 100644 --- a/src/Types/AnnotationDraftLink.php +++ b/src/Types/AnnotationDraftLink.php @@ -31,6 +31,12 @@ class AnnotationDraftLink extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -200,6 +206,7 @@ class AnnotationDraftLink extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -235,6 +242,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftPolygon.php b/src/Types/AnnotationDraftPolygon.php index 34b82885..42c9ab0e 100644 --- a/src/Types/AnnotationDraftPolygon.php +++ b/src/Types/AnnotationDraftPolygon.php @@ -32,6 +32,12 @@ class AnnotationDraftPolygon extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -273,6 +279,7 @@ class AnnotationDraftPolygon extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftPolygonRect, * contents?: ?string, @@ -320,6 +327,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftPolyline.php b/src/Types/AnnotationDraftPolyline.php index 8c115dc4..819c8834 100644 --- a/src/Types/AnnotationDraftPolyline.php +++ b/src/Types/AnnotationDraftPolyline.php @@ -32,6 +32,12 @@ class AnnotationDraftPolyline extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -273,6 +279,7 @@ class AnnotationDraftPolyline extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftPolylineRect, * contents?: ?string, @@ -320,6 +327,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftPopup.php b/src/Types/AnnotationDraftPopup.php index d84d6cf8..e172b978 100644 --- a/src/Types/AnnotationDraftPopup.php +++ b/src/Types/AnnotationDraftPopup.php @@ -31,6 +31,12 @@ class AnnotationDraftPopup extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -207,6 +213,7 @@ class AnnotationDraftPopup extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -242,6 +249,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftRedact.php b/src/Types/AnnotationDraftRedact.php index 9e7914d1..56ad5de2 100644 --- a/src/Types/AnnotationDraftRedact.php +++ b/src/Types/AnnotationDraftRedact.php @@ -32,6 +32,12 @@ class AnnotationDraftRedact extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -254,6 +260,7 @@ class AnnotationDraftRedact extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftRedactRect, * contents?: ?string, @@ -299,6 +306,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftSquare.php b/src/Types/AnnotationDraftSquare.php index 5077ca87..47e61752 100644 --- a/src/Types/AnnotationDraftSquare.php +++ b/src/Types/AnnotationDraftSquare.php @@ -32,6 +32,12 @@ class AnnotationDraftSquare extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -248,6 +254,7 @@ class AnnotationDraftSquare extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftSquareRect, * contents?: ?string, @@ -292,6 +299,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftSquiggly.php b/src/Types/AnnotationDraftSquiggly.php index f0196147..d8e47918 100644 --- a/src/Types/AnnotationDraftSquiggly.php +++ b/src/Types/AnnotationDraftSquiggly.php @@ -32,6 +32,12 @@ class AnnotationDraftSquiggly extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -213,6 +219,7 @@ class AnnotationDraftSquiggly extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftSquigglyRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftStamp.php b/src/Types/AnnotationDraftStamp.php index 976cef71..234a0e36 100644 --- a/src/Types/AnnotationDraftStamp.php +++ b/src/Types/AnnotationDraftStamp.php @@ -31,6 +31,12 @@ class AnnotationDraftStamp extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -223,6 +229,7 @@ class AnnotationDraftStamp extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftStampRect, * contents?: ?string, @@ -263,6 +270,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftStrikeout.php b/src/Types/AnnotationDraftStrikeout.php index 8b66773e..f04e4b36 100644 --- a/src/Types/AnnotationDraftStrikeout.php +++ b/src/Types/AnnotationDraftStrikeout.php @@ -32,6 +32,12 @@ class AnnotationDraftStrikeout extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -219,6 +225,7 @@ class AnnotationDraftStrikeout extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftStrikeoutRect, * contents?: ?string, @@ -257,6 +264,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftText.php b/src/Types/AnnotationDraftText.php index 553689e1..80417bdb 100644 --- a/src/Types/AnnotationDraftText.php +++ b/src/Types/AnnotationDraftText.php @@ -31,6 +31,12 @@ class AnnotationDraftText extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -230,6 +236,7 @@ class AnnotationDraftText extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -270,6 +277,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftUnderline.php b/src/Types/AnnotationDraftUnderline.php index a6f35656..6dc4a674 100644 --- a/src/Types/AnnotationDraftUnderline.php +++ b/src/Types/AnnotationDraftUnderline.php @@ -32,6 +32,12 @@ class AnnotationDraftUnderline extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -213,6 +219,7 @@ class AnnotationDraftUnderline extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftUnderlineRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationDraftWidget.php b/src/Types/AnnotationDraftWidget.php index 9d061a36..c5fdfb06 100644 --- a/src/Types/AnnotationDraftWidget.php +++ b/src/Types/AnnotationDraftWidget.php @@ -32,6 +32,12 @@ class AnnotationDraftWidget extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -284,6 +290,7 @@ class AnnotationDraftWidget extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationDraftWidgetRect, * contents?: ?string, @@ -334,6 +341,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationFileAttachment.php b/src/Types/AnnotationFileAttachment.php index 50c441b9..4a9dbf47 100644 --- a/src/Types/AnnotationFileAttachment.php +++ b/src/Types/AnnotationFileAttachment.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationFileAttachment extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -234,6 +241,7 @@ class AnnotationFileAttachment extends JsonSerializableType * opacity: float, * icon: value-of, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -258,6 +266,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationFreeText.php b/src/Types/AnnotationFreeText.php index 8211f4fa..f8b26dfe 100644 --- a/src/Types/AnnotationFreeText.php +++ b/src/Types/AnnotationFreeText.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationFreeText extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationFreeText extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -328,6 +334,7 @@ class AnnotationFreeText extends JsonSerializableType * strokeWidth: float, * borderStyle: value-of, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -357,6 +364,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationHighlight.php b/src/Types/AnnotationHighlight.php index ab05a461..eea17e34 100644 --- a/src/Types/AnnotationHighlight.php +++ b/src/Types/AnnotationHighlight.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationHighlight extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationHighlight extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -229,6 +235,7 @@ class AnnotationHighlight extends JsonSerializableType * opacity: float, * quadPoints: array, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -252,6 +259,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationInk.php b/src/Types/AnnotationInk.php index f28f70b3..ab5cb12d 100644 --- a/src/Types/AnnotationInk.php +++ b/src/Types/AnnotationInk.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationInk extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationInk extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -261,6 +267,7 @@ class AnnotationInk extends JsonSerializableType * borderStyle: value-of, * inkList: array>, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -287,6 +294,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationLine.php b/src/Types/AnnotationLine.php index 68fc4038..b965f2a3 100644 --- a/src/Types/AnnotationLine.php +++ b/src/Types/AnnotationLine.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationLine extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationLine extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -305,6 +311,7 @@ class AnnotationLine extends JsonSerializableType * lineEndings: AnnotationLineLineEndings, * captionPosition: value-of, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -336,6 +343,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationLink.php b/src/Types/AnnotationLink.php index efa2650e..447800ef 100644 --- a/src/Types/AnnotationLink.php +++ b/src/Types/AnnotationLink.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationLink extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -213,6 +220,7 @@ class AnnotationLink extends JsonSerializableType * toggleNoView: bool, * lockedContents: bool, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -237,6 +245,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationMutationMeta.php b/src/Types/AnnotationMutationMeta.php index a3dd6fbe..576d02e8 100644 --- a/src/Types/AnnotationMutationMeta.php +++ b/src/Types/AnnotationMutationMeta.php @@ -32,6 +32,12 @@ class AnnotationMutationMeta extends JsonSerializableType #[JsonProperty('undoable')] public bool $undoable; + /** + * @var ?array $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public ?array $missingCharacters; + /** * @var array $changed */ @@ -45,6 +51,7 @@ class AnnotationMutationMeta extends JsonSerializableType * undoable: bool, * changed: array, * cacheDelta?: ?CacheDelta, + * missingCharacters?: ?array, * } $values */ public function __construct( @@ -54,6 +61,7 @@ public function __construct( $this->cacheDelta = $values['cacheDelta'] ?? null; $this->opId = $values['opId']; $this->undoable = $values['undoable']; + $this->missingCharacters = $values['missingCharacters'] ?? null; $this->changed = $values['changed']; } diff --git a/src/Types/AnnotationPatchCaret.php b/src/Types/AnnotationPatchCaret.php index 5705e94f..9ab0e5cd 100644 --- a/src/Types/AnnotationPatchCaret.php +++ b/src/Types/AnnotationPatchCaret.php @@ -31,6 +31,12 @@ class AnnotationPatchCaret extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -223,6 +229,7 @@ class AnnotationPatchCaret extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchCaretRect, * contents?: ?string, @@ -263,6 +270,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchCircle.php b/src/Types/AnnotationPatchCircle.php index 4f59778e..19d16150 100644 --- a/src/Types/AnnotationPatchCircle.php +++ b/src/Types/AnnotationPatchCircle.php @@ -33,6 +33,12 @@ class AnnotationPatchCircle extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -252,6 +258,7 @@ class AnnotationPatchCircle extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchCircleRect, * contents?: ?string, @@ -299,6 +306,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchFileAttachment.php b/src/Types/AnnotationPatchFileAttachment.php index d5f2731a..0ab32260 100644 --- a/src/Types/AnnotationPatchFileAttachment.php +++ b/src/Types/AnnotationPatchFileAttachment.php @@ -31,6 +31,12 @@ class AnnotationPatchFileAttachment extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -217,6 +223,7 @@ class AnnotationPatchFileAttachment extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchFileAttachmentRect, * contents?: ?string, @@ -256,6 +263,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchFreeText.php b/src/Types/AnnotationPatchFreeText.php index 7606a3bc..5fe36d7e 100644 --- a/src/Types/AnnotationPatchFreeText.php +++ b/src/Types/AnnotationPatchFreeText.php @@ -33,6 +33,12 @@ class AnnotationPatchFreeText extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -309,6 +315,7 @@ class AnnotationPatchFreeText extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchFreeTextRect, * contents?: ?string, @@ -368,6 +375,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchHighlight.php b/src/Types/AnnotationPatchHighlight.php index df07cdd5..08516c43 100644 --- a/src/Types/AnnotationPatchHighlight.php +++ b/src/Types/AnnotationPatchHighlight.php @@ -32,6 +32,12 @@ class AnnotationPatchHighlight extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -212,6 +218,7 @@ class AnnotationPatchHighlight extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchHighlightRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchInk.php b/src/Types/AnnotationPatchInk.php index a80e0b6b..82a12497 100644 --- a/src/Types/AnnotationPatchInk.php +++ b/src/Types/AnnotationPatchInk.php @@ -33,6 +33,12 @@ class AnnotationPatchInk extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -249,6 +255,7 @@ class AnnotationPatchInk extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchInkRect, * contents?: ?string, @@ -298,6 +305,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchLine.php b/src/Types/AnnotationPatchLine.php index 6924579e..2264f218 100644 --- a/src/Types/AnnotationPatchLine.php +++ b/src/Types/AnnotationPatchLine.php @@ -33,6 +33,12 @@ class AnnotationPatchLine extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -288,6 +294,7 @@ class AnnotationPatchLine extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchLineRect, * contents?: ?string, @@ -341,6 +348,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchLink.php b/src/Types/AnnotationPatchLink.php index be4410bf..eda193ca 100644 --- a/src/Types/AnnotationPatchLink.php +++ b/src/Types/AnnotationPatchLink.php @@ -32,6 +32,12 @@ class AnnotationPatchLink extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -204,6 +210,7 @@ class AnnotationPatchLink extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchLinkRect, * contents?: ?string, @@ -244,6 +251,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchPolygon.php b/src/Types/AnnotationPatchPolygon.php index 440a1fee..62c91b14 100644 --- a/src/Types/AnnotationPatchPolygon.php +++ b/src/Types/AnnotationPatchPolygon.php @@ -33,6 +33,12 @@ class AnnotationPatchPolygon extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -279,6 +285,7 @@ class AnnotationPatchPolygon extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchPolygonRect, * contents?: ?string, @@ -333,6 +340,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchPolyline.php b/src/Types/AnnotationPatchPolyline.php index 62fa2fde..d4f8d2d4 100644 --- a/src/Types/AnnotationPatchPolyline.php +++ b/src/Types/AnnotationPatchPolyline.php @@ -33,6 +33,12 @@ class AnnotationPatchPolyline extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -279,6 +285,7 @@ class AnnotationPatchPolyline extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchPolylineRect, * contents?: ?string, @@ -333,6 +340,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchPopup.php b/src/Types/AnnotationPatchPopup.php index 4ebfe0d1..ab392765 100644 --- a/src/Types/AnnotationPatchPopup.php +++ b/src/Types/AnnotationPatchPopup.php @@ -31,6 +31,12 @@ class AnnotationPatchPopup extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -205,6 +211,7 @@ class AnnotationPatchPopup extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchPopupRect, * contents?: ?string, @@ -242,6 +249,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchRedact.php b/src/Types/AnnotationPatchRedact.php index 2f1e148b..85c20605 100644 --- a/src/Types/AnnotationPatchRedact.php +++ b/src/Types/AnnotationPatchRedact.php @@ -32,6 +32,12 @@ class AnnotationPatchRedact extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -254,6 +260,7 @@ class AnnotationPatchRedact extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchRedactRect, * contents?: ?string, @@ -299,6 +306,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchSquare.php b/src/Types/AnnotationPatchSquare.php index 52b97c63..dbb9e316 100644 --- a/src/Types/AnnotationPatchSquare.php +++ b/src/Types/AnnotationPatchSquare.php @@ -33,6 +33,12 @@ class AnnotationPatchSquare extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -252,6 +258,7 @@ class AnnotationPatchSquare extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchSquareRect, * contents?: ?string, @@ -299,6 +306,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchSquiggly.php b/src/Types/AnnotationPatchSquiggly.php index 1e75ea70..6cdb82bd 100644 --- a/src/Types/AnnotationPatchSquiggly.php +++ b/src/Types/AnnotationPatchSquiggly.php @@ -32,6 +32,12 @@ class AnnotationPatchSquiggly extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -212,6 +218,7 @@ class AnnotationPatchSquiggly extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchSquigglyRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchStamp.php b/src/Types/AnnotationPatchStamp.php index 90705ca8..519e85d4 100644 --- a/src/Types/AnnotationPatchStamp.php +++ b/src/Types/AnnotationPatchStamp.php @@ -31,6 +31,12 @@ class AnnotationPatchStamp extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -223,6 +229,7 @@ class AnnotationPatchStamp extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchStampRect, * contents?: ?string, @@ -263,6 +270,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchStrikeout.php b/src/Types/AnnotationPatchStrikeout.php index d69608fe..de08a5ee 100644 --- a/src/Types/AnnotationPatchStrikeout.php +++ b/src/Types/AnnotationPatchStrikeout.php @@ -32,6 +32,12 @@ class AnnotationPatchStrikeout extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -218,6 +224,7 @@ class AnnotationPatchStrikeout extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchStrikeoutRect, * contents?: ?string, @@ -257,6 +264,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchText.php b/src/Types/AnnotationPatchText.php index 553cc7f5..9153ff8f 100644 --- a/src/Types/AnnotationPatchText.php +++ b/src/Types/AnnotationPatchText.php @@ -31,6 +31,12 @@ class AnnotationPatchText extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -229,6 +235,7 @@ class AnnotationPatchText extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchTextRect, * contents?: ?string, @@ -270,6 +277,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPatchUnderline.php b/src/Types/AnnotationPatchUnderline.php index 154c0d53..348a812b 100644 --- a/src/Types/AnnotationPatchUnderline.php +++ b/src/Types/AnnotationPatchUnderline.php @@ -32,6 +32,12 @@ class AnnotationPatchUnderline extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -212,6 +218,7 @@ class AnnotationPatchUnderline extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?AnnotationPatchUnderlineRect, * contents?: ?string, @@ -250,6 +257,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPolygon.php b/src/Types/AnnotationPolygon.php index 575d9e28..3e6c6b5f 100644 --- a/src/Types/AnnotationPolygon.php +++ b/src/Types/AnnotationPolygon.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationPolygon extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationPolygon extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -291,6 +297,7 @@ class AnnotationPolygon extends JsonSerializableType * borderStyle: value-of, * vertices: array, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -322,6 +329,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPolyline.php b/src/Types/AnnotationPolyline.php index 3360692f..969c7092 100644 --- a/src/Types/AnnotationPolyline.php +++ b/src/Types/AnnotationPolyline.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationPolyline extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationPolyline extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -292,6 +298,7 @@ class AnnotationPolyline extends JsonSerializableType * vertices: array, * lineEndings: AnnotationPolylineLineEndings, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -322,6 +329,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationPopup.php b/src/Types/AnnotationPopup.php index 18823cee..b0201b73 100644 --- a/src/Types/AnnotationPopup.php +++ b/src/Types/AnnotationPopup.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationPopup extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -220,6 +227,7 @@ class AnnotationPopup extends JsonSerializableType * lockedContents: bool, * open: bool, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -244,6 +252,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationRedact.php b/src/Types/AnnotationRedact.php index 9e44ec35..56cfb19b 100644 --- a/src/Types/AnnotationRedact.php +++ b/src/Types/AnnotationRedact.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationRedact extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationRedact extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -276,6 +282,7 @@ class AnnotationRedact extends JsonSerializableType * fontColor: string, * textAlign: value-of, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -301,6 +308,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationSquare.php b/src/Types/AnnotationSquare.php index ae8258ff..7af6572c 100644 --- a/src/Types/AnnotationSquare.php +++ b/src/Types/AnnotationSquare.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationSquare extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationSquare extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -267,6 +273,7 @@ class AnnotationSquare extends JsonSerializableType * borderStyle: value-of, * box: AnnotationSquareBox, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -294,6 +301,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationSquiggly.php b/src/Types/AnnotationSquiggly.php index 5d312cca..797758f5 100644 --- a/src/Types/AnnotationSquiggly.php +++ b/src/Types/AnnotationSquiggly.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationSquiggly extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationSquiggly extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -229,6 +235,7 @@ class AnnotationSquiggly extends JsonSerializableType * opacity: float, * quadPoints: array, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -252,6 +259,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationStamp.php b/src/Types/AnnotationStamp.php index 4ebc1b33..ae9cf9c0 100644 --- a/src/Types/AnnotationStamp.php +++ b/src/Types/AnnotationStamp.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationStamp extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -239,6 +246,7 @@ class AnnotationStamp extends JsonSerializableType * box: AnnotationStampBox, * opacity: float, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -265,6 +273,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationStrikeout.php b/src/Types/AnnotationStrikeout.php index 62650d2c..0352198d 100644 --- a/src/Types/AnnotationStrikeout.php +++ b/src/Types/AnnotationStrikeout.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationStrikeout extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationStrikeout extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -235,6 +241,7 @@ class AnnotationStrikeout extends JsonSerializableType * opacity: float, * quadPoints: array, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -259,6 +266,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationText.php b/src/Types/AnnotationText.php index 9078326d..ecb41455 100644 --- a/src/Types/AnnotationText.php +++ b/src/Types/AnnotationText.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationText extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -247,6 +254,7 @@ class AnnotationText extends JsonSerializableType * icon: value-of, * open: bool, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -272,6 +280,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationUnderline.php b/src/Types/AnnotationUnderline.php index 94624232..99f70a50 100644 --- a/src/Types/AnnotationUnderline.php +++ b/src/Types/AnnotationUnderline.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class AnnotationUnderline extends JsonSerializableType { @@ -34,6 +34,12 @@ class AnnotationUnderline extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -229,6 +235,7 @@ class AnnotationUnderline extends JsonSerializableType * opacity: float, * quadPoints: array, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -252,6 +259,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AnnotationUnsupported.php b/src/Types/AnnotationUnsupported.php index ea6c1712..7a7ad341 100644 --- a/src/Types/AnnotationUnsupported.php +++ b/src/Types/AnnotationUnsupported.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; @@ -33,6 +34,12 @@ class AnnotationUnsupported extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -220,6 +227,7 @@ class AnnotationUnsupported extends JsonSerializableType * lockedContents: bool, * rawSubtypeCode: int, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -244,6 +252,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/AttachmentMutationMeta.php b/src/Types/AttachmentMutationMeta.php index 113aa093..e08231f8 100644 --- a/src/Types/AttachmentMutationMeta.php +++ b/src/Types/AttachmentMutationMeta.php @@ -32,6 +32,12 @@ class AttachmentMutationMeta extends JsonSerializableType #[JsonProperty('undoable')] public bool $undoable; + /** + * @var ?array $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public ?array $missingCharacters; + /** * @var array $changed */ @@ -45,6 +51,7 @@ class AttachmentMutationMeta extends JsonSerializableType * undoable: bool, * changed: array, * cacheDelta?: ?CacheDelta, + * missingCharacters?: ?array, * } $values */ public function __construct( @@ -54,6 +61,7 @@ public function __construct( $this->cacheDelta = $values['cacheDelta'] ?? null; $this->opId = $values['opId']; $this->undoable = $values['undoable']; + $this->missingCharacters = $values['missingCharacters'] ?? null; $this->changed = $values['changed']; } diff --git a/src/Types/CacheDelta.php b/src/Types/CacheDelta.php index b90dced6..1ee21b44 100644 --- a/src/Types/CacheDelta.php +++ b/src/Types/CacheDelta.php @@ -56,6 +56,12 @@ class CacheDelta extends JsonSerializableType #[JsonProperty('outlineVersion')] public ?int $outlineVersion; + /** + * @var ?int $fontsVersion + */ + #[JsonProperty('fontsVersion')] + public ?int $fontsVersion; + /** * @var ?int $layerVersion */ @@ -85,6 +91,7 @@ class CacheDelta extends JsonSerializableType * metadataVersion?: ?int, * attachmentsVersion?: ?int, * outlineVersion?: ?int, + * fontsVersion?: ?int, * layerVersion?: ?int, * working?: ?bool, * } $values @@ -100,6 +107,7 @@ public function __construct( $this->metadataVersion = $values['metadataVersion'] ?? null; $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; $this->outlineVersion = $values['outlineVersion'] ?? null; + $this->fontsVersion = $values['fontsVersion'] ?? null; $this->layerVersion = $values['layerVersion'] ?? null; $this->working = $values['working'] ?? null; $this->pages = $values['pages']; diff --git a/src/Types/ChangeItem.php b/src/Types/ChangeItem.php index 44c9d812..14fe0ba0 100644 --- a/src/Types/ChangeItem.php +++ b/src/Types/ChangeItem.php @@ -43,6 +43,7 @@ class ChangeItem extends JsonSerializableType * |'pages.delete' * |'pages.insertBlank' * |'pages.insert' + * |'pages.copy' * |'pages.restore' * |'attachments.create' * |'attachments.delete' @@ -88,6 +89,7 @@ class ChangeItem extends JsonSerializableType * |ChangeItemPagesDelete * |ChangeItemPagesInsertBlank * |ChangeItemPagesInsert + * |ChangeItemPagesCopy * |ChangeItemPagesRestore * |ChangeItemAttachmentsCreate * |ChangeItemAttachmentsDelete @@ -134,6 +136,7 @@ class ChangeItem extends JsonSerializableType * |'pages.delete' * |'pages.insertBlank' * |'pages.insert' + * |'pages.copy' * |'pages.restore' * |'attachments.create' * |'attachments.delete' @@ -175,6 +178,7 @@ class ChangeItem extends JsonSerializableType * |ChangeItemPagesDelete * |ChangeItemPagesInsertBlank * |ChangeItemPagesInsert + * |ChangeItemPagesCopy * |ChangeItemPagesRestore * |ChangeItemAttachmentsCreate * |ChangeItemAttachmentsDelete @@ -598,6 +602,18 @@ public static function pagesInsert(ChangeItemPagesInsert $pagesInsert): ChangeIt ]); } + /** + * @param ChangeItemPagesCopy $pagesCopy + * @return ChangeItem + */ + public static function pagesCopy(ChangeItemPagesCopy $pagesCopy): ChangeItem + { + return new ChangeItem([ + 'type' => 'pages.copy', + 'value' => $pagesCopy, + ]); + } + /** * @param ChangeItemPagesRestore $pagesRestore * @return ChangeItem @@ -1394,6 +1410,28 @@ public function asPagesInsert(): ChangeItemPagesInsert return $this->value; } + /** + * @return bool + */ + public function isPagesCopy(): bool + { + return $this->value instanceof ChangeItemPagesCopy && $this->type === 'pages.copy'; + } + + /** + * @return ChangeItemPagesCopy + */ + public function asPagesCopy(): ChangeItemPagesCopy + { + if (!($this->value instanceof ChangeItemPagesCopy && $this->type === 'pages.copy')) { + throw new Exception( + "Expected pages.copy; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1638,6 +1676,10 @@ public function jsonSerialize(): array $value = $this->asPagesInsert()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'pages.copy': + $value = $this->asPagesCopy()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'pages.restore': $value = $this->asPagesRestore()->jsonSerialize(); $result = array_merge($value, $result); @@ -1792,6 +1834,9 @@ public static function jsonDeserialize(array $data): static case 'pages.insert': $args['value'] = ChangeItemPagesInsert::jsonDeserialize($data); break; + case 'pages.copy': + $args['value'] = ChangeItemPagesCopy::jsonDeserialize($data); + break; case 'pages.restore': $args['value'] = ChangeItemPagesRestore::jsonDeserialize($data); break; diff --git a/src/Types/ChangeItemPagesCopy.php b/src/Types/ChangeItemPagesCopy.php new file mode 100644 index 00000000..7269f8df --- /dev/null +++ b/src/Types/ChangeItemPagesCopy.php @@ -0,0 +1,51 @@ + $insertedPages + */ + #[JsonProperty('insertedPages'), ArrayType([PageRef::class])] + public array $insertedPages; + + /** + * @var ChangeItemPagesCopyLayout $layout + */ + #[JsonProperty('layout')] + public ChangeItemPagesCopyLayout $layout; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * insertedPages: array, + * layout: ChangeItemPagesCopyLayout, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->insertedPages = $values['insertedPages']; + $this->layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayout.php b/src/Types/ChangeItemPagesCopyLayout.php new file mode 100644 index 00000000..80f33aa0 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayout.php @@ -0,0 +1,59 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([ChangeItemPagesCopyLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesCopyLayoutLabelsItem::class])] + public array $labels; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([ChangeItemPagesCopyLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * labels: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->labels = $values['labels']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutLabelsItem.php b/src/Types/ChangeItemPagesCopyLayoutLabelsItem.php new file mode 100644 index 00000000..4362c73c --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php new file mode 100644 index 00000000..e45c8801 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ +name = $values['name']; + $this->target = $values['target']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php new file mode 100644 index 00000000..e224cf4e --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetPage $page + * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + */ + public static function page(ChangeItemPagesCopyLayoutNamedPagesItemTargetPage $page): ChangeItemPagesCopyLayoutNamedPagesItemTarget + { + return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate $template + * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + */ + public static function template(ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate $template): ChangeItemPagesCopyLayoutNamedPagesItemTarget + { + return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling $dangling + * @return ChangeItemPagesCopyLayoutNamedPagesItemTarget + */ + public static function dangling(ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling $dangling): ChangeItemPagesCopyLayoutNamedPagesItemTarget + { + return new ChangeItemPagesCopyLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetPage + */ + public function asPage(): ChangeItemPagesCopyLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling::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/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 00000000..71814f2f --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php new file mode 100644 index 00000000..732b9281 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 00000000..0539be67 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItem.php b/src/Types/ChangeItemPagesCopyLayoutPagesItem.php new file mode 100644 index 00000000..be7632a7 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var ChangeItemPagesCopyLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public ChangeItemPagesCopyLayoutPagesItemBoxes $boxes; + + /** + * @var ChangeItemPagesCopyLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public ChangeItemPagesCopyLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: ChangeItemPagesCopyLayoutPagesItemSize, + * rotation: float, + * userUnit: float, + * boxes: ChangeItemPagesCopyLayoutPagesItemBoxes, + * pdfCropBox: ChangeItemPagesCopyLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxes.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxes.php new file mode 100644 index 00000000..8349621a --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxes.php @@ -0,0 +1,66 @@ +media = $values['media']; + $this->crop = $values['crop']; + $this->bleed = $values['bleed']; + $this->trim = $values['trim']; + $this->art = $values['art']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..59093f8d --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesArt.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..c50b4c91 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesBleed.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..9d3465d7 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesCrop.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..54168baf --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesMedia.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..ab7537e6 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemBoxesTrim.php @@ -0,0 +1,58 @@ +x = $values['x']; + $this->y = $values['y']; + $this->width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.php new file mode 100644 index 00000000..f81bb4c8 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemPdfCropBox.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/ChangeItemPagesCopyLayoutPagesItemSize.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemSize.php new file mode 100644 index 00000000..092acb20 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemSize.php @@ -0,0 +1,42 @@ +width = $values['width']; + $this->height = $values['height']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php b/src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php new file mode 100644 index 00000000..39f60344 --- /dev/null +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesDeleteLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesDeleteLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php b/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php new file mode 100644 index 00000000..a4a05743 --- /dev/null +++ b/src/Types/ChangeItemPagesDeleteLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php new file mode 100644 index 00000000..7b79e191 --- /dev/null +++ b/src/Types/ChangeItemPagesDeleteLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesInsertBlankLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesInsertBlankLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php new file mode 100644 index 00000000..1dafaec4 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php new file mode 100644 index 00000000..b0ee7983 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertBlankLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesInsertLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesInsertLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php b/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php new file mode 100644 index 00000000..a1a9d9f3 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php new file mode 100644 index 00000000..bc85beb2 --- /dev/null +++ b/src/Types/ChangeItemPagesInsertLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesReorderLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesReorderLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php b/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php new file mode 100644 index 00000000..27561055 --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php new file mode 100644 index 00000000..de917a56 --- /dev/null +++ b/src/Types/ChangeItemPagesReorderLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesRestoreLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesRestoreLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php b/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php new file mode 100644 index 00000000..d6ce7b4a --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php new file mode 100644 index 00000000..54c0fe3d --- /dev/null +++ b/src/Types/ChangeItemPagesRestoreLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([ChangeItemPagesRotateLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class ChangeItemPagesRotateLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php b/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php new file mode 100644 index 00000000..d356a65b --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php b/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php new file mode 100644 index 00000000..8adcf49a --- /dev/null +++ b/src/Types/ChangeItemPagesRotateLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + 'pages.copy', + 'value' => $pagesCopy, + ]); + } + /** * @param ChangeOpAttachmentsCreate $attachmentsCreate * @return ChangeOp @@ -1172,6 +1188,28 @@ public function asPagesInsert(): ChangeOpPagesInsert return $this->value; } + /** + * @return bool + */ + public function isPagesCopy(): bool + { + return $this->value instanceof ChangeOpPagesCopy && $this->type === 'pages.copy'; + } + + /** + * @return ChangeOpPagesCopy + */ + public function asPagesCopy(): ChangeOpPagesCopy + { + if (!($this->value instanceof ChangeOpPagesCopy && $this->type === 'pages.copy')) { + throw new Exception( + "Expected pages.copy; got " . $this->type . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return bool */ @@ -1352,6 +1390,10 @@ public function jsonSerialize(): array $value = $this->asPagesInsert()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'pages.copy': + $value = $this->asPagesCopy()->jsonSerialize(); + $result = array_merge($value, $result); + break; case 'attachments.create': $value = $this->asAttachmentsCreate()->jsonSerialize(); $result = array_merge($value, $result); @@ -1483,6 +1525,9 @@ public static function jsonDeserialize(array $data): static case 'pages.insert': $args['value'] = ChangeOpPagesInsert::jsonDeserialize($data); break; + case 'pages.copy': + $args['value'] = ChangeOpPagesCopy::jsonDeserialize($data); + break; case 'attachments.create': $args['value'] = ChangeOpAttachmentsCreate::jsonDeserialize($data); break; diff --git a/src/Types/ChangeOpPagesCopy.php b/src/Types/ChangeOpPagesCopy.php new file mode 100644 index 00000000..a9665e02 --- /dev/null +++ b/src/Types/ChangeOpPagesCopy.php @@ -0,0 +1,58 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var ( + * value-of + * |PagePositionAfter + * )|null $position + */ + #[JsonProperty('position'), Union('string', PagePositionAfter::class, 'null')] + public string|PagePositionAfter|null $position; + + /** + * @var ?array $objectNumbers + */ + #[JsonProperty('objectNumbers'), ArrayType(['integer'])] + public ?array $objectNumbers; + + /** + * @param array{ + * pages: array, + * position?: ( + * value-of + * |PagePositionAfter + * )|null, + * objectNumbers?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->position = $values['position'] ?? null; + $this->objectNumbers = $values['objectNumbers'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/ChangeOpPagesInsert.php b/src/Types/ChangeOpPagesInsert.php index e0b347b3..dfef2f11 100644 --- a/src/Types/ChangeOpPagesInsert.php +++ b/src/Types/ChangeOpPagesInsert.php @@ -5,6 +5,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\Union; +use CloudPDF\Core\Types\ArrayType; class ChangeOpPagesInsert extends JsonSerializableType { @@ -23,6 +24,12 @@ class ChangeOpPagesInsert extends JsonSerializableType #[JsonProperty('position'), Union('string', PagePositionAfter::class, 'null')] public string|PagePositionAfter|null $position; + /** + * @var ?array $objectNumbers + */ + #[JsonProperty('objectNumbers'), ArrayType(['integer'])] + public ?array $objectNumbers; + /** * @param array{ * resources: ChangeOpPagesInsertResources, @@ -30,6 +37,7 @@ class ChangeOpPagesInsert extends JsonSerializableType * value-of * |PagePositionAfter * )|null, + * objectNumbers?: ?array, * } $values */ public function __construct( @@ -37,6 +45,7 @@ public function __construct( ) { $this->resources = $values['resources']; $this->position = $values['position'] ?? null; + $this->objectNumbers = $values['objectNumbers'] ?? null; } /** diff --git a/src/Types/DocManifest200Response.php b/src/Types/DocManifest200Response.php index 1cc8b916..d32a1632 100644 --- a/src/Types/DocManifest200Response.php +++ b/src/Types/DocManifest200Response.php @@ -56,6 +56,18 @@ class DocManifest200Response extends JsonSerializableType #[JsonProperty('outlineVersion')] public ?int $outlineVersion; + /** + * @var ?int $fontsVersion + */ + #[JsonProperty('fontsVersion')] + public ?int $fontsVersion; + + /** + * @var string $serverFonts + */ + #[JsonProperty('serverFonts')] + public string $serverFonts; + /** * @var int $auditHead */ @@ -109,6 +121,7 @@ class DocManifest200Response extends JsonSerializableType * docVersion: int, * layoutVersion: int, * metadataVersion: int, + * serverFonts: string, * auditHead: int, * baseSha: string, * pages: array, @@ -117,6 +130,7 @@ class DocManifest200Response extends JsonSerializableType * annotationsVersion?: ?int, * formsVersion?: ?int, * outlineVersion?: ?int, + * fontsVersion?: ?int, * layerVersion?: ?int, * working?: ?bool, * baseByteLength?: ?int, @@ -135,6 +149,8 @@ public function __construct( $this->annotationsVersion = $values['annotationsVersion'] ?? null; $this->formsVersion = $values['formsVersion'] ?? null; $this->outlineVersion = $values['outlineVersion'] ?? null; + $this->fontsVersion = $values['fontsVersion'] ?? null; + $this->serverFonts = $values['serverFonts']; $this->auditHead = $values['auditHead']; $this->baseSha = $values['baseSha']; $this->layerVersion = $values['layerVersion'] ?? null; diff --git a/src/Types/DocPagesRemoveName200ResponseLayout.php b/src/Types/DocPagesRemoveName200ResponseLayout.php index 4d6e80d7..14cbca57 100644 --- a/src/Types/DocPagesRemoveName200ResponseLayout.php +++ b/src/Types/DocPagesRemoveName200ResponseLayout.php @@ -20,6 +20,12 @@ class DocPagesRemoveName200ResponseLayout extends JsonSerializableType #[JsonProperty('pages'), ArrayType([DocPagesRemoveName200ResponseLayoutPagesItem::class])] public array $pages; + /** + * @var array $labels + */ + #[JsonProperty('labels'), ArrayType([DocPagesRemoveName200ResponseLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class DocPagesRemoveName200ResponseLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItem.php b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItem.php new file mode 100644 index 00000000..7e633235 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php new file mode 100644 index 00000000..f6d2ec66 --- /dev/null +++ b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $labels + */ + #[JsonProperty('labels'), ArrayType([DocPagesSetName200ResponseLayoutLabelsItem::class])] + public array $labels; + /** * @var array $namedPages */ @@ -30,6 +36,7 @@ class DocPagesSetName200ResponseLayout extends JsonSerializableType * @param array{ * pageCount: int, * pages: array, + * labels: array, * namedPages: array, * } $values */ @@ -38,6 +45,7 @@ public function __construct( ) { $this->pageCount = $values['pageCount']; $this->pages = $values['pages']; + $this->labels = $values['labels']; $this->namedPages = $values['namedPages']; } diff --git a/src/Types/DocPagesSetName200ResponseLayoutLabelsItem.php b/src/Types/DocPagesSetName200ResponseLayoutLabelsItem.php new file mode 100644 index 00000000..06d03ae1 --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutLabelsItem.php @@ -0,0 +1,58 @@ + $style + */ + #[JsonProperty('style')] + public ?string $style; + + /** + * @var int $firstNumber + */ + #[JsonProperty('firstNumber')] + public int $firstNumber; + + /** + * @var string $prefix + */ + #[JsonProperty('prefix')] + public string $prefix; + + /** + * @param array{ + * firstPage: int, + * firstNumber: int, + * prefix: string, + * style?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->firstPage = $values['firstPage']; + $this->style = $values['style'] ?? null; + $this->firstNumber = $values['firstNumber']; + $this->prefix = $values['prefix']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php new file mode 100644 index 00000000..73bb0ece --- /dev/null +++ b/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php @@ -0,0 +1,12 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var string $familyName + */ + #[JsonProperty('familyName')] + public string $familyName; + + /** + * @var int $weight + */ + #[JsonProperty('weight')] + public int $weight; + + /** + * @var bool $italic + */ + #[JsonProperty('italic')] + public bool $italic; + + /** + * @var ?string $postScriptName + */ + #[JsonProperty('postScriptName')] + public ?string $postScriptName; + + /** + * @var bool $canChoose + */ + #[JsonProperty('canChoose')] + public bool $canChoose; + + /** + * @var array> $restrictions + */ + #[JsonProperty('restrictions'), ArrayType(['string'])] + public array $restrictions; + + /** + * @var array $programs + */ + #[JsonProperty('programs'), ArrayType([FontProgram::class])] + public array $programs; + + /** + * @param array{ + * name: string, + * source: value-of, + * familyName: string, + * weight: int, + * italic: bool, + * canChoose: bool, + * restrictions: array>, + * programs: array, + * postScriptName?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->source = $values['source']; + $this->familyName = $values['familyName']; + $this->weight = $values['weight']; + $this->italic = $values['italic']; + $this->postScriptName = $values['postScriptName'] ?? null; + $this->canChoose = $values['canChoose']; + $this->restrictions = $values['restrictions']; + $this->programs = $values['programs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontList.php b/src/Types/FontList.php new file mode 100644 index 00000000..b2aad7ca --- /dev/null +++ b/src/Types/FontList.php @@ -0,0 +1,51 @@ + $fonts + */ + #[JsonProperty('fonts'), ArrayType([Font::class])] + public array $fonts; + + /** + * @var array $fallbacks + */ + #[JsonProperty('fallbacks'), ArrayType(['string'])] + public array $fallbacks; + + /** + * @var FontProgram $lastResort + */ + #[JsonProperty('lastResort')] + public FontProgram $lastResort; + + /** + * @param array{ + * fonts: array, + * fallbacks: array, + * lastResort: FontProgram, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fonts = $values['fonts']; + $this->fallbacks = $values['fallbacks']; + $this->lastResort = $values['lastResort']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontProgram.php b/src/Types/FontProgram.php new file mode 100644 index 00000000..93a3dc0a --- /dev/null +++ b/src/Types/FontProgram.php @@ -0,0 +1,74 @@ + $embedded + */ + #[JsonProperty('embedded')] + public string $embedded; + + /** + * @var ?value-of $format + */ + #[JsonProperty('format')] + public ?string $format; + + /** + * @var ?value-of $embeddingPermission + */ + #[JsonProperty('embeddingPermission')] + public ?string $embeddingPermission; + + /** + * @var bool $canDownload + */ + #[JsonProperty('canDownload')] + public bool $canDownload; + + /** + * @param array{ + * embedded: value-of, + * canDownload: bool, + * displayHash?: ?string, + * sourceHash?: ?string, + * format?: ?value-of, + * embeddingPermission?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->displayHash = $values['displayHash'] ?? null; + $this->sourceHash = $values['sourceHash'] ?? null; + $this->embedded = $values['embedded']; + $this->format = $values['format'] ?? null; + $this->embeddingPermission = $values['embeddingPermission'] ?? null; + $this->canDownload = $values['canDownload']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontProgramEmbedded.php b/src/Types/FontProgramEmbedded.php new file mode 100644 index 00000000..2fd394a8 --- /dev/null +++ b/src/Types/FontProgramEmbedded.php @@ -0,0 +1,10 @@ + $embedded + */ + #[JsonProperty('embedded')] + public string $embedded; + + /** + * @var ?value-of $format + */ + #[JsonProperty('format')] + public ?string $format; + + /** + * @var ?value-of $embeddingPermission + */ + #[JsonProperty('embeddingPermission')] + public ?string $embeddingPermission; + + /** + * @var bool $canDownload + */ + #[JsonProperty('canDownload')] + public bool $canDownload; + + /** + * @var array $covers + */ + #[JsonProperty('covers'), ArrayType([FontProgramInfoCoversItem::class])] + public array $covers; + + /** + * @var float $ascent + */ + #[JsonProperty('ascent')] + public float $ascent; + + /** + * @var float $descent + */ + #[JsonProperty('descent')] + public float $descent; + + /** + * @param array{ + * embedded: value-of, + * canDownload: bool, + * covers: array, + * ascent: float, + * descent: float, + * displayHash?: ?string, + * sourceHash?: ?string, + * format?: ?value-of, + * embeddingPermission?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->displayHash = $values['displayHash'] ?? null; + $this->sourceHash = $values['sourceHash'] ?? null; + $this->embedded = $values['embedded']; + $this->format = $values['format'] ?? null; + $this->embeddingPermission = $values['embeddingPermission'] ?? null; + $this->canDownload = $values['canDownload']; + $this->covers = $values['covers']; + $this->ascent = $values['ascent']; + $this->descent = $values['descent']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontProgramInfoCoversItem.php b/src/Types/FontProgramInfoCoversItem.php new file mode 100644 index 00000000..019d2520 --- /dev/null +++ b/src/Types/FontProgramInfoCoversItem.php @@ -0,0 +1,42 @@ +start = $values['start']; + $this->count = $values['count']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontProgramInfoEmbedded.php b/src/Types/FontProgramInfoEmbedded.php new file mode 100644 index 00000000..4ef2f021 --- /dev/null +++ b/src/Types/FontProgramInfoEmbedded.php @@ -0,0 +1,10 @@ + $runs + */ + #[JsonProperty('runs'), ArrayType([ResolvedFontRun::class])] + public array $runs; + + /** + * @var array $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public array $missingCharacters; + + /** + * @param array{ + * runs: array, + * missingCharacters: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->runs = $values['runs']; + $this->missingCharacters = $values['missingCharacters']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontResolveRequest.php b/src/Types/FontResolveRequest.php new file mode 100644 index 00000000..195df98f --- /dev/null +++ b/src/Types/FontResolveRequest.php @@ -0,0 +1,43 @@ + $runs + */ + #[JsonProperty('runs'), ArrayType([FontResolveRun::class])] + public array $runs; + + /** + * @param array{ + * runs: array, + * annotation?: ?AnnotationRef, + * } $values + */ + public function __construct( + array $values, + ) { + $this->annotation = $values['annotation'] ?? null; + $this->runs = $values['runs']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontResolveRun.php b/src/Types/FontResolveRun.php new file mode 100644 index 00000000..e66c5690 --- /dev/null +++ b/src/Types/FontResolveRun.php @@ -0,0 +1,66 @@ +text = $values['text']; + $this->fontFamily = $values['fontFamily'] ?? null; + $this->family = $values['family'] ?? null; + $this->weight = $values['weight'] ?? null; + $this->italic = $values['italic'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontRestrictionsItem.php b/src/Types/FontRestrictionsItem.php new file mode 100644 index 00000000..a2eec3bb --- /dev/null +++ b/src/Types/FontRestrictionsItem.php @@ -0,0 +1,13 @@ + $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public ?array $missingCharacters; + /** * @var array $changedFields */ @@ -59,6 +65,7 @@ class FormMutationMeta extends JsonSerializableType * changedWidgets: array, * redrawnWidgets: array, * cacheDelta?: ?CacheDelta, + * missingCharacters?: ?array, * } $values */ public function __construct( @@ -68,6 +75,7 @@ public function __construct( $this->cacheDelta = $values['cacheDelta'] ?? null; $this->opId = $values['opId']; $this->undoable = $values['undoable']; + $this->missingCharacters = $values['missingCharacters'] ?? null; $this->changedFields = $values['changedFields']; $this->changedWidgets = $values['changedWidgets']; $this->redrawnWidgets = $values['redrawnWidgets']; diff --git a/src/Types/MutationMeta.php b/src/Types/MutationMeta.php index f732d2fa..52d375ed 100644 --- a/src/Types/MutationMeta.php +++ b/src/Types/MutationMeta.php @@ -32,12 +32,19 @@ class MutationMeta extends JsonSerializableType #[JsonProperty('undoable')] public bool $undoable; + /** + * @var ?array $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public ?array $missingCharacters; + /** * @param array{ * affectedPages: array, * opId: string, * undoable: bool, * cacheDelta?: ?CacheDelta, + * missingCharacters?: ?array, * } $values */ public function __construct( @@ -47,6 +54,7 @@ public function __construct( $this->cacheDelta = $values['cacheDelta'] ?? null; $this->opId = $values['opId']; $this->undoable = $values['undoable']; + $this->missingCharacters = $values['missingCharacters'] ?? null; } /** diff --git a/src/Types/OutlineMutationMeta.php b/src/Types/OutlineMutationMeta.php index 6ee6adfd..d2c13958 100644 --- a/src/Types/OutlineMutationMeta.php +++ b/src/Types/OutlineMutationMeta.php @@ -32,6 +32,12 @@ class OutlineMutationMeta extends JsonSerializableType #[JsonProperty('undoable')] public bool $undoable; + /** + * @var ?array $missingCharacters + */ + #[JsonProperty('missingCharacters'), ArrayType(['string'])] + public ?array $missingCharacters; + /** * @var array $changed */ @@ -45,6 +51,7 @@ class OutlineMutationMeta extends JsonSerializableType * undoable: bool, * changed: array, * cacheDelta?: ?CacheDelta, + * missingCharacters?: ?array, * } $values */ public function __construct( @@ -54,6 +61,7 @@ public function __construct( $this->cacheDelta = $values['cacheDelta'] ?? null; $this->opId = $values['opId']; $this->undoable = $values['undoable']; + $this->missingCharacters = $values['missingCharacters'] ?? null; $this->changed = $values['changed']; } diff --git a/src/Types/ResolvedFontRun.php b/src/Types/ResolvedFontRun.php new file mode 100644 index 00000000..d05d5508 --- /dev/null +++ b/src/Types/ResolvedFontRun.php @@ -0,0 +1,75 @@ + $fallbacks + */ + #[JsonProperty('fallbacks'), ArrayType(['string'])] + public array $fallbacks; + + /** + * @param array{ + * font: string, + * weight: float, + * italic: bool, + * substituted: bool, + * fallbacks: array, + * program?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->font = $values['font']; + $this->weight = $values['weight']; + $this->italic = $values['italic']; + $this->substituted = $values['substituted']; + $this->program = $values['program'] ?? null; + $this->fallbacks = $values['fallbacks']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssueRequest.php b/src/Types/TokensIssueRequest.php index a93af78e..04e74e9b 100644 --- a/src/Types/TokensIssueRequest.php +++ b/src/Types/TokensIssueRequest.php @@ -11,6 +11,7 @@ class TokensIssueRequest extends JsonSerializableType * @var ( * 'doc' * |'tenant' + * |'upload' * |'_unknown' * ) $kind */ @@ -20,6 +21,7 @@ class TokensIssueRequest extends JsonSerializableType * @var ( * TokensIssueRequestDoc * |TokensIssueRequestTenant + * |TokensIssueRequestUpload * |mixed * ) $value */ @@ -30,11 +32,13 @@ class TokensIssueRequest extends JsonSerializableType * kind: ( * 'doc' * |'tenant' + * |'upload' * |'_unknown' * ), * value: ( * TokensIssueRequestDoc * |TokensIssueRequestTenant + * |TokensIssueRequestUpload * |mixed * ), * } $values @@ -70,6 +74,18 @@ public static function tenant(TokensIssueRequestTenant $tenant): TokensIssueRequ ]); } + /** + * @param TokensIssueRequestUpload $upload + * @return TokensIssueRequest + */ + public static function upload(TokensIssueRequestUpload $upload): TokensIssueRequest + { + return new TokensIssueRequest([ + 'kind' => 'upload', + 'value' => $upload, + ]); + } + /** * @return bool */ @@ -114,6 +130,28 @@ public function asTenant(): TokensIssueRequestTenant return $this->value; } + /** + * @return bool + */ + public function isUpload(): bool + { + return $this->value instanceof TokensIssueRequestUpload && $this->kind === 'upload'; + } + + /** + * @return TokensIssueRequestUpload + */ + public function asUpload(): TokensIssueRequestUpload + { + if (!($this->value instanceof TokensIssueRequestUpload && $this->kind === 'upload')) { + throw new Exception( + "Expected upload; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + /** * @return string */ @@ -142,6 +180,10 @@ public function jsonSerialize(): array $value = $this->asTenant()->jsonSerialize(); $result = array_merge($value, $result); break; + case 'upload': + $value = $this->asUpload()->jsonSerialize(); + $result = array_merge($value, $result); + break; case '_unknown': default: if (is_null($this->value)) { @@ -184,6 +226,9 @@ public static function jsonDeserialize(array $data): static case 'tenant': $args['value'] = TokensIssueRequestTenant::jsonDeserialize($data); break; + case 'upload': + $args['value'] = TokensIssueRequestUpload::jsonDeserialize($data); + break; case '_unknown': default: $args['kind'] = '_unknown'; diff --git a/src/Types/TokensIssueRequestUpload.php b/src/Types/TokensIssueRequestUpload.php new file mode 100644 index 00000000..73bb311c --- /dev/null +++ b/src/Types/TokensIssueRequestUpload.php @@ -0,0 +1,83 @@ + $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?int $maxFiles + */ + #[JsonProperty('maxFiles')] + public ?int $maxFiles; + + /** + * @var ?int $maxBytes + */ + #[JsonProperty('maxBytes')] + public ?int $maxBytes; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var int $expiresIn + */ + #[JsonProperty('expiresIn')] + public int $expiresIn; + + /** + * @param array{ + * sub: string, + * expiresIn: int, + * folderId?: ?string, + * metadata?: ?array, + * maxFiles?: ?int, + * maxBytes?: ?int, + * origins?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->sub = $values['sub']; + $this->folderId = $values['folderId'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->maxFiles = $values['maxFiles'] ?? null; + $this->maxBytes = $values['maxBytes'] ?? null; + $this->origins = $values['origins'] ?? null; + $this->expiresIn = $values['expiresIn']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetAnnotation.php b/src/Types/WidgetAnnotation.php index 2e0a26c9..33558ae7 100644 --- a/src/Types/WidgetAnnotation.php +++ b/src/Types/WidgetAnnotation.php @@ -4,9 +4,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; use DateTime; use CloudPDF\Core\Types\Date; -use CloudPDF\Core\Types\ArrayType; class WidgetAnnotation extends JsonSerializableType { @@ -40,6 +40,12 @@ class WidgetAnnotation extends JsonSerializableType #[JsonProperty('appearanceState')] public ?string $appearanceState; + /** + * @var ?array $structurePosition + */ + #[JsonProperty('structurePosition'), ArrayType(['integer'])] + public ?array $structurePosition; + /** * @var ?string $nm */ @@ -310,6 +316,7 @@ class WidgetAnnotation extends JsonSerializableType * textAlign: value-of, * fieldFamily: value-of, * appearanceState?: ?string, + * structurePosition?: ?array, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -344,6 +351,7 @@ public function __construct( $this->page = $values['page']; $this->hasAppearance = $values['hasAppearance']; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect']; $this->contents = $values['contents'] ?? null; diff --git a/src/Types/WidgetPatch.php b/src/Types/WidgetPatch.php index 203f4b26..2cf48054 100644 --- a/src/Types/WidgetPatch.php +++ b/src/Types/WidgetPatch.php @@ -39,6 +39,12 @@ class WidgetPatch extends JsonSerializableType #[JsonProperty('appearanceState')] public mixed $appearanceState; + /** + * @var mixed $structurePosition + */ + #[JsonProperty('structurePosition')] + public mixed $structurePosition; + /** * @var ?string $nm */ @@ -296,6 +302,7 @@ class WidgetPatch extends JsonSerializableType * page?: mixed, * hasAppearance?: mixed, * appearanceState?: mixed, + * structurePosition?: mixed, * nm?: ?string, * rect?: ?WidgetPatchRect, * contents?: ?string, @@ -351,6 +358,7 @@ public function __construct( $this->page = $values['page'] ?? null; $this->hasAppearance = $values['hasAppearance'] ?? null; $this->appearanceState = $values['appearanceState'] ?? null; + $this->structurePosition = $values['structurePosition'] ?? null; $this->nm = $values['nm'] ?? null; $this->rect = $values['rect'] ?? null; $this->contents = $values['contents'] ?? null;