diff --git a/.fern/metadata.json b/.fern/metadata.json index 1a94ba9f..fb527ba1 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { "cliVersion": "5.91.0", "generatorName": "fernapi/fern-php-sdk", - "generatorVersion": "2.18.1", + "generatorVersion": "2.30.14", "generatorConfig": { "namespace": "CloudPDF", "clientName": "CloudPDFClient", @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07", + "originGitCommit": "3f7f3c650bb91d9c5a4277c920bbd6fab7142f98", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.22", + "requestedVersion": "3.0.0-alpha.23", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.22" + "sdkVersion": "3.0.0-alpha.23" } \ No newline at end of file diff --git a/README.md b/README.md index 52df4155..2d351b97 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ use CloudPDF\Doc\Requests\DocChangesRequest; use CloudPDF\Doc\Types\DocChangesRequestChangesItem; $client = new CloudPDFClient( + embedPdfVersion: '3.0', token: '', ); $client->doc->changes( diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 58a91e24..8a7d1e0a 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,17 +1,17 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.22", - "sdkVersion": "3.0.0-alpha.22", + "canonicalVersion": "3.0.0-next.23", + "sdkVersion": "3.0.0-alpha.23", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "1f5aa976eec4d5fc4e2b22efe725df58a01389896733ec1870f96a6441b62859", - "gitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07", + "openapiSha256": "82488f8cc7c2cd27aee3dc6000d59164467f7dd3899074e309f0574a027e4524", + "gitCommit": "3f7f3c650bb91d9c5a4277c920bbd6fab7142f98", "gitCommitIsDirty": false }, "fern": { "cliVersion": "5.91.0", "generatorName": "fernapi/fern-php-sdk", - "generatorVersion": "2.18.1" + "generatorVersion": "2.30.14" } } diff --git a/reference.md b/reference.md index 007ebe47..172c53a8 100644 --- a/reference.md +++ b/reference.md @@ -65,7 +65,7 @@ $client->deployment->modules(); ## Doc -
$client->doc->head($docId, $request) -> ?DocHead200Response +
$client->doc->head($docId, $request) -> ?DocHeadResponse
@@ -116,7 +116,7 @@ $client->doc->head(
-
$client->doc->changes($docId, $layerName, $request) -> ?DocChanges200Response +
$client->doc->changes($docId, $layerName, $request) -> ?DocChangesResponse
@@ -264,7 +264,7 @@ $client->doc->download(
-
$client->doc->downloadLink($docId, $layerName, $request) -> ?DocDownloadLink200Response +
$client->doc->downloadLink($docId, $layerName, $request) -> ?DocDownloadLinkResponse
@@ -334,7 +334,7 @@ $client->doc->downloadLink(
-**$expiresIn:** `?int` +**$expiresInSeconds:** `?int`
@@ -346,7 +346,7 @@ $client->doc->downloadLink(
-
$client->doc->manifest($docId, $layerName, $request) -> ?DocManifest200Response +
$client->doc->manifest($docId, $layerName, $request) -> ?DocManifestResponse
@@ -469,7 +469,7 @@ $client->doc->render(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -489,7 +489,7 @@ $client->doc->render(
-
$client->doc->text($docId, $layerName, $pageKey, $request) -> ?DocText200Response +
$client->doc->text($docId, $layerName, $pageKey, $request) -> ?DocTextResponse
@@ -538,7 +538,7 @@ $client->doc->text(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -559,7 +559,7 @@ $client->doc->text(
## Grants -
$client->grants->exchange($request) -> ?GrantsExchange200Response +
$client->grants->exchange($request) -> ?GrantsExchangeResponse
@@ -649,7 +649,7 @@ $client->grants->exchange(
-
$client->grants->list($tenantId, $request) -> ?GrantsList200Response +
$client->grants->list($tenantId, $request) -> ?GrantsListResponse
@@ -724,7 +724,7 @@ $client->grants->list(
-
$client->grants->create($tenantId, $request) -> ?GrantsCreate200Response +
$client->grants->create($tenantId, $request) -> ?GrantsCreateResponse
@@ -878,7 +878,7 @@ $client->grants->create(
-**$expiresAt:** `?int` +**$expiresAt:** `?DateTime`
@@ -890,7 +890,7 @@ $client->grants->create(
-
$client->grants->get($tenantId, $grantId) -> ?GrantsGet200Response +
$client->grants->get($tenantId, $grantId) -> ?GrantsGetResponse
@@ -992,7 +992,7 @@ $client->grants->delete(
-
$client->grants->update($tenantId, $grantId, $request) -> ?GrantsUpdate200Response +
$client->grants->update($tenantId, $grantId, $request) -> ?GrantsUpdateResponse
@@ -1136,7 +1136,7 @@ $client->grants->update(
-**$expiresAt:** `?int` +**$expiresAt:** `?DateTime`
@@ -1148,7 +1148,7 @@ $client->grants->update(
-
$client->grants->archive($tenantId, $grantId) -> ?GrantsArchive200Response +
$client->grants->archive($tenantId, $grantId) -> ?GrantsArchiveResponse
@@ -1214,7 +1214,7 @@ $client->grants->archive(
## Tenants -
$client->tenants->list($request) -> ?TenantsList200Response +
$client->tenants->list($request) -> ?TenantsListResponse
@@ -1264,7 +1264,7 @@ $client->tenants->list(
-
$client->tenants->create($request) -> ?TenantsCreate200Response +
$client->tenants->create($request) -> ?TenantsCreateResponse
@@ -1316,7 +1316,7 @@ $client->tenants->create(
-
$client->tenants->get($tenantId) -> ?TenantsGet200Response +
$client->tenants->get($tenantId) -> ?TenantsGetResponse
@@ -1414,7 +1414,7 @@ $client->tenants->delete(
-
$client->tenants->update($tenantId, $request) -> ?TenantsUpdate200Response +
$client->tenants->update($tenantId, $request) -> ?TenantsUpdateResponse
@@ -1592,7 +1592,7 @@ $client->tenants->suspend(
-
$client->tenants->usage($tenantId, $request) -> ?TenantsUsage200Response +
$client->tenants->usage($tenantId, $request) -> ?TenantsUsageResponse
@@ -1674,7 +1674,7 @@ $client->tenants->usage(
## Documents -
$client->documents->list($tenantId, $request) -> ?DocumentsList200Response +
$client->documents->list($tenantId, $request) -> ?DocumentsListResponse
@@ -1773,7 +1773,7 @@ $client->documents->list(
-
$client->documents->get($tenantId, $id) -> ?DocumentsGet200Response +
$client->documents->get($tenantId, $docId) -> ?DocumentsGetResponse
@@ -1788,7 +1788,7 @@ $client->documents->list( ```php $client->documents->get( 'tenantId', - 'id', + 'docId', ); ```
@@ -1812,7 +1812,7 @@ $client->documents->get(
-**$id:** `string` +**$docId:** `string`
@@ -1824,7 +1824,7 @@ $client->documents->get(
-
$client->documents->delete($tenantId, $id) +
$client->documents->delete($tenantId, $docId)
@@ -1839,7 +1839,7 @@ $client->documents->get( ```php $client->documents->delete( 'tenantId', - 'id', + 'docId', ); ```
@@ -1863,7 +1863,7 @@ $client->documents->delete(
-**$id:** `string` +**$docId:** `string`
@@ -1875,7 +1875,7 @@ $client->documents->delete(
-
$client->documents->update($tenantId, $id, $request) -> ?DocumentsUpdate200Response +
$client->documents->update($tenantId, $docId, $request) -> ?DocumentsUpdateResponse
@@ -1904,7 +1904,7 @@ A document that is being deleted answers 404. ```php $client->documents->update( 'tenantId', - 'id', + 'docId', new DocumentsUpdateRequest([ 'name' => 'name', ]), @@ -1931,7 +1931,7 @@ $client->documents->update(
-**$id:** `string` +**$docId:** `string`
@@ -1951,7 +1951,7 @@ $client->documents->update(
-
$client->documents->commit($tenantId, $id, $request) -> ?DocumentsCommit200Response +
$client->documents->commit($tenantId, $docId, $request) -> ?DocumentsCommitResponse
@@ -1980,7 +1980,7 @@ An upload token commits only the documents it started; any other document answer ```php $client->documents->commit( 'tenantId', - 'id', + 'docId', new DocumentsCommitRequest([ 'sha256' => 'sha256', ]), @@ -2007,7 +2007,7 @@ $client->documents->commit(
-**$id:** `string` +**$docId:** `string`
@@ -2027,7 +2027,7 @@ $client->documents->commit(
-
$client->documents->download($tenantId, $id) -> string +
$client->documents->download($tenantId, $docId) -> string
@@ -2042,7 +2042,7 @@ $client->documents->commit( ```php $client->documents->download( 'tenantId', - 'id', + 'docId', ); ```
@@ -2066,7 +2066,7 @@ $client->documents->download(
-**$id:** `string` +**$docId:** `string`
@@ -2078,7 +2078,7 @@ $client->documents->download(
-
$client->documents->thumbnail($tenantId, $id) -> string +
$client->documents->thumbnail($tenantId, $docId) -> string
@@ -2093,7 +2093,7 @@ $client->documents->download( ```php $client->documents->thumbnail( 'tenantId', - 'id', + 'docId', ); ```
@@ -2117,7 +2117,7 @@ $client->documents->thumbnail(
-**$id:** `string` +**$docId:** `string`
@@ -2129,7 +2129,7 @@ $client->documents->thumbnail(
-
$client->documents->uploadProxy($tenantId, $id, $request) -> ?DocumentsUploadProxy200Response +
$client->documents->uploadProxy($tenantId, $docId, $request) -> ?DocumentsUploadProxyResponse
@@ -2158,7 +2158,7 @@ This bounded origin-mediated fallback must only be used after documents.init ret ```php $client->documents->uploadProxy( 'tenantId', - 'id', + 'docId', new UploadProxyDocumentsRequest([ 'file' => File::createFromString("example_file", "example_file"), ]), @@ -2185,7 +2185,7 @@ $client->documents->uploadProxy(
-**$id:** `string` +**$docId:** `string`
@@ -2330,7 +2330,7 @@ $client->documents->importFrom(
-
$client->documents->init($tenantId, $request) -> ?DocumentsInit200Response +
$client->documents->init($tenantId, $request) -> ?DocumentsInitResponse
@@ -2342,7 +2342,7 @@ $client->documents->importFrom(
-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. +With an upload token, the document goes into the token's folder with the token's metadata, whatever the request says; sizeBytes 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.
@@ -2360,7 +2360,7 @@ With an upload token, the document goes into the token's folder with the token's $client->documents->init( 'tenantId', new DocumentsInitRequest([ - 'contentLength' => 1.1, + 'sizeBytes' => 1, 'contentSha256' => 'contentSha256', ]), ); @@ -2386,7 +2386,7 @@ $client->documents->init(
-**$contentLength:** `float` +**$sizeBytes:** `int`
@@ -2450,7 +2450,7 @@ $client->documents->init(
-**$uploadTtlSec:** `?float` +**$uploadTtlSeconds:** `?int`
@@ -2471,7 +2471,7 @@ $client->documents->init(
## Folders -
$client->folders->list($tenantId, $request) -> ?FoldersList200Response +
$client->folders->list($tenantId, $request) -> ?FoldersListResponse
@@ -2538,7 +2538,7 @@ $client->folders->list(
-
$client->folders->create($tenantId, $request) -> ?FoldersCreate200Response +
$client->folders->create($tenantId, $request) -> ?FoldersCreateResponse
@@ -2613,7 +2613,7 @@ $client->folders->create(
-
$client->folders->get($tenantId, $folderId) -> ?FoldersGet200Response +
$client->folders->get($tenantId, $folderId) -> ?FoldersGetResponse
@@ -2738,7 +2738,7 @@ $client->folders->delete(
-
$client->folders->update($tenantId, $folderId, $request) -> ?FoldersUpdate200Response +
$client->folders->update($tenantId, $folderId, $request) -> ?FoldersUpdateResponse
@@ -2826,7 +2826,7 @@ $client->folders->update(
-Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in `details.documentIds` and `details.folderIds`. 409 Conflict carries `details.reason`: `cycle` (the destination is a moved folder or inside one; `details.folderId`), `too-deep` (the move would nest folders deeper than 100 levels; `details.maxDepth`) or `name-taken` (a moved folder's name is taken in the destination, ignoring case; `details.name`). +Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in `details.docIds` and `details.folderIds`. 409 Conflict carries `details.reason`: `cycle` (the destination is a moved folder or inside one; `details.folderId`), `too-deep` (the move would nest folders deeper than 100 levels; `details.maxDepth`) or `name-taken` (a moved folder's name is taken in the destination, ignoring case; `details.name`).
@@ -2876,7 +2876,7 @@ $client->folders->moveInto(
-**$documentIds:** `?array` +**$docIds:** `?array`
@@ -2897,7 +2897,7 @@ $client->folders->moveInto(
## Tokens -
$client->tokens->issue($tenantId, $request) -> ?TokensIssue200Response +
$client->tokens->issue($tenantId, $request) -> ?TokensIssueResponse
@@ -2933,7 +2933,7 @@ $client->tokens->issue( 'scope' => [ 'scope', ], - 'expiresIn' => 1, + 'expiresInSeconds' => 1, ])), ]), ); @@ -3041,7 +3041,7 @@ $client->tokens->revoke(
-**$expiresAtSeconds:** `?int` +**$expiresAt:** `?DateTime`
@@ -3177,7 +3177,7 @@ $client->doc->annotations->list(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3197,7 +3197,7 @@ $client->doc->annotations->list(
-
$client->doc->annotations->create($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsCreate200Response +
$client->doc->annotations->create($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsCreateResponse
@@ -3264,7 +3264,7 @@ $client->doc->annotations->create(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3300,7 +3300,7 @@ $client->doc->annotations->create(
-
$client->doc->annotations->delete($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocAnnotationsDelete200Response +
$client->doc->annotations->delete($docId, $layerName, $pageKey, $annotationKey, $request) -> ?DocAnnotationsDeleteResponse
@@ -3317,7 +3317,7 @@ $client->doc->annotations->delete( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new DeleteAnnotationsRequest([]), ); ``` @@ -3350,7 +3350,7 @@ $client->doc->annotations->delete(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3358,7 +3358,7 @@ $client->doc->annotations->delete(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -3386,7 +3386,7 @@ $client->doc->annotations->delete(
-
$client->doc->annotations->update($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocAnnotationsUpdate200Response +
$client->doc->annotations->update($docId, $layerName, $pageKey, $annotationKey, $request) -> ?DocAnnotationsUpdateResponse
@@ -3403,7 +3403,7 @@ $client->doc->annotations->update( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new UpdateAnnotationsRequest([ 'body' => [ 'key' => "value", @@ -3440,7 +3440,7 @@ $client->doc->annotations->update(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3448,7 +3448,7 @@ $client->doc->annotations->update(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -3484,7 +3484,7 @@ $client->doc->annotations->update(
-
$client->doc->annotations->readAppearance($docId, $layerName, $pageKey, $annotKey, $request) -> string +
$client->doc->annotations->readAppearance($docId, $layerName, $pageKey, $annotationKey, $request) -> string
@@ -3501,7 +3501,7 @@ $client->doc->annotations->readAppearance( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new ReadAppearanceAnnotationsRequest([]), ); ``` @@ -3534,7 +3534,7 @@ $client->doc->annotations->readAppearance(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3542,7 +3542,7 @@ $client->doc->annotations->readAppearance(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -3562,7 +3562,7 @@ $client->doc->annotations->readAppearance(
-
$client->doc->annotations->readFile($docId, $layerName, $pageKey, $annotKey, $request) -> string +
$client->doc->annotations->readFile($docId, $layerName, $pageKey, $annotationKey, $request) -> string
@@ -3593,7 +3593,7 @@ $client->doc->annotations->readFile( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new ReadFileAnnotationsRequest([]), ); ``` @@ -3626,7 +3626,7 @@ $client->doc->annotations->readFile(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3634,7 +3634,7 @@ $client->doc->annotations->readFile(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -3709,7 +3709,7 @@ $client->doc->annotations->exportAppearance(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3737,7 +3737,7 @@ $client->doc->annotations->exportAppearance(
-
$client->doc->annotations->flatten($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsFlatten200Response +
$client->doc->annotations->flatten($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsFlattenResponse
@@ -3790,7 +3790,7 @@ $client->doc->annotations->flatten(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -3826,7 +3826,7 @@ $client->doc->annotations->flatten(
-
$client->doc->annotations->reorder($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsReorder200Response +
$client->doc->annotations->reorder($docId, $layerName, $pageKey, $request) -> ?DocAnnotationsReorderResponse
@@ -3886,7 +3886,7 @@ $client->doc->annotations->reorder(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -4226,7 +4226,7 @@ $client->doc->fonts->resolve(
## Doc Forms -
$client->doc->forms->list($docId, $layerName, $request) -> ?DocFormsList200Response +
$client->doc->forms->list($docId, $layerName, $request) -> ?DocFormsListResponse
@@ -4286,7 +4286,7 @@ $client->doc->forms->list(
-
$client->doc->forms->reorderCalculations($docId, $layerName, $request) -> ?DocFormsReorderCalculations200Response +
$client->doc->forms->reorderCalculations($docId, $layerName, $request) -> ?DocFormsReorderCalculationsResponse
@@ -4377,7 +4377,7 @@ $client->doc->forms->reorderCalculations(
-
$client->doc->forms->setValue($docId, $layerName, $fieldKey, $request) -> ?DocFormsSetValue200Response +
$client->doc->forms->setValue($docId, $layerName, $fieldKey, $request) -> ?DocFormsSetValueResponse
@@ -4466,7 +4466,7 @@ $client->doc->forms->setValue(
-
$client->doc->forms->reset($docId, $layerName, $request) -> ?DocFormsReset200Response +
$client->doc->forms->reset($docId, $layerName, $request) -> ?DocFormsResetResponse
@@ -4542,7 +4542,7 @@ $client->doc->forms->reset(
-
$client->doc->forms->deleteWidget($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocFormsDeleteWidget200Response +
$client->doc->forms->deleteWidget($docId, $layerName, $pageKey, $annotationKey, $request) -> ?DocFormsDeleteWidgetResponse
@@ -4559,7 +4559,7 @@ $client->doc->forms->deleteWidget( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new DeleteWidgetFormsRequest([]), ); ``` @@ -4592,7 +4592,7 @@ $client->doc->forms->deleteWidget(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -4600,7 +4600,7 @@ $client->doc->forms->deleteWidget(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -4628,7 +4628,7 @@ $client->doc->forms->deleteWidget(
-
$client->doc->forms->updateWidget($docId, $layerName, $pageKey, $annotKey, $request) -> ?DocFormsUpdateWidget200Response +
$client->doc->forms->updateWidget($docId, $layerName, $pageKey, $annotationKey, $request) -> ?DocFormsUpdateWidgetResponse
@@ -4645,7 +4645,7 @@ $client->doc->forms->updateWidget( 'docId', 'layerName', 'pageKey', - 'annotKey', + 'annotationKey', new DocFormsUpdateWidgetRequest([ 'patch' => new WidgetPatch([]), ]), @@ -4680,7 +4680,7 @@ $client->doc->forms->updateWidget(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -4688,7 +4688,7 @@ $client->doc->forms->updateWidget(
-**$annotKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. +**$annotationKey:** `string` — The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life.
@@ -4724,7 +4724,7 @@ $client->doc->forms->updateWidget(
-
$client->doc->forms->reorderWidgets($docId, $layerName, $pageKey, $request) -> ?DocFormsReorderWidgets200Response +
$client->doc->forms->reorderWidgets($docId, $layerName, $pageKey, $request) -> ?DocFormsReorderWidgetsResponse
@@ -4784,7 +4784,7 @@ $client->doc->forms->reorderWidgets(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -4951,7 +4951,7 @@ $client->doc->outline->get(
## Doc Pages -
$client->doc->pages->setScale($docId, $layerName, $pageKey, $request) -> ?DocPagesSetScale200Response +
$client->doc->pages->setScale($docId, $layerName, $pageKey, $request) -> ?DocPagesSetScaleResponse
@@ -5000,7 +5000,7 @@ $client->doc->pages->setScale(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -5036,7 +5036,7 @@ $client->doc->pages->setScale(
-
$client->doc->pages->viewports($docId, $layerName, $pageKey, $request) -> ?DocPagesViewports200Response +
$client->doc->pages->viewports($docId, $layerName, $pageKey, $request) -> ?DocPagesViewportsResponse
@@ -5085,7 +5085,7 @@ $client->doc->pages->viewports(
-**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. +**$pageKey:** `string` — The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`.
@@ -5193,7 +5193,7 @@ $client->doc->pages->extract(
-
$client->doc->pages->flatten($docId, $layerName, $request) -> ?DocPagesFlatten200Response +
$client->doc->pages->flatten($docId, $layerName, $request) -> ?DocPagesFlattenResponse
@@ -5273,7 +5273,7 @@ $client->doc->pages->flatten(
-
$client->doc->pages->setName($docId, $layerName, $request) -> ?DocPagesSetName200Response +
$client->doc->pages->setName($docId, $layerName, $request) -> ?DocPagesSetNameResponse
@@ -5353,7 +5353,7 @@ $client->doc->pages->setName(
-
$client->doc->pages->removeName($docId, $layerName, $request) -> ?DocPagesRemoveName200Response +
$client->doc->pages->removeName($docId, $layerName, $request) -> ?DocPagesRemoveNameResponse
@@ -5434,7 +5434,7 @@ $client->doc->pages->removeName(
## Doc Redactions -
$client->doc->redactions->apply($docId, $layerName, $request) -> ?DocRedactionsApply200Response +
$client->doc->redactions->apply($docId, $layerName, $request) -> ?DocRedactionsApplyResponse
@@ -5519,7 +5519,7 @@ $client->doc->redactions->apply(
## Doc Signatures -
$client->doc->signatures->list($docId, $layerName, $request) -> ?DocSignaturesList200Response +
$client->doc->signatures->list($docId, $layerName, $request) -> ?DocSignaturesListResponse
@@ -5593,7 +5593,7 @@ $client->doc->signatures->list(
-
$client->doc->signatures->cancel($docId, $layerName, $signingId, $request) -> ?DocSignaturesCancel200Response +
$client->doc->signatures->cancel($docId, $layerName, $signingId, $request) -> ?DocSignaturesCancelResponse
@@ -5662,7 +5662,7 @@ $client->doc->signatures->cancel(
-
$client->doc->signatures->complete($docId, $layerName, $signingId, $request) -> ?DocSignaturesComplete200Response +
$client->doc->signatures->complete($docId, $layerName, $signingId, $request) -> ?DocSignaturesCompleteResponse
@@ -5767,7 +5767,7 @@ $client->doc->signatures->complete(
-
$client->doc->signatures->analysis($docId, $layerName, $request) -> ?DocSignaturesAnalysis200Response +
$client->doc->signatures->analysis($docId, $layerName, $request) -> ?DocSignaturesAnalysisResponse
@@ -5865,7 +5865,7 @@ $client->doc->signatures->analysis(
-
$client->doc->signatures->prepare($docId, $layerName, $request) -> ?DocSignaturesPrepare200Response +
$client->doc->signatures->prepare($docId, $layerName, $request) -> ?DocSignaturesPrepareResponse
@@ -5942,7 +5942,7 @@ $client->doc->signatures->prepare(
## Doc Versions -
$client->doc->versions->list($docId, $layerName, $request) -> ?DocVersionsList200Response +
$client->doc->versions->list($docId, $layerName, $request) -> ?DocVersionsListResponse
@@ -6016,7 +6016,7 @@ $client->doc->versions->list(
-
$client->doc->versions->analysis($docId, $layerName, $sha, $request) -> ?DocVersionsAnalysis200Response +
$client->doc->versions->analysis($docId, $layerName, $sha256, $request) -> ?DocVersionsAnalysisResponse
@@ -6046,7 +6046,7 @@ Exactly one of `since.signature` / `since.revision`; `until=` defaults $client->doc->versions->analysis( 'docId', 'layerName', - 'sha', + 'sha256', new AnalysisVersionsRequest([]), ); ``` @@ -6079,7 +6079,7 @@ $client->doc->versions->analysis(
-**$sha:** `string` +**$sha256:** `string`
@@ -6139,7 +6139,7 @@ $client->doc->versions->analysis(
-
$client->doc->versions->download($docId, $layerName, $sha, $request) -> string +
$client->doc->versions->download($docId, $layerName, $sha256, $request) -> string
@@ -6155,7 +6155,7 @@ $client->doc->versions->analysis( $client->doc->versions->download( 'docId', 'layerName', - 'sha', + 'sha256', new DownloadVersionsRequest([]), ); ``` @@ -6188,7 +6188,7 @@ $client->doc->versions->download(
-**$sha:** `string` +**$sha256:** `string`
@@ -6208,7 +6208,7 @@ $client->doc->versions->download(
-
$client->doc->versions->revision($docId, $layerName, $sha, $index, $request) -> string +
$client->doc->versions->revision($docId, $layerName, $sha256, $index, $request) -> string
@@ -6224,7 +6224,7 @@ $client->doc->versions->download( $client->doc->versions->revision( 'docId', 'layerName', - 'sha', + 'sha256', 1, new RevisionVersionsRequest([]), ); @@ -6258,7 +6258,7 @@ $client->doc->versions->revision(
-**$sha:** `string` +**$sha256:** `string`
@@ -6286,7 +6286,7 @@ $client->doc->versions->revision(
-
$client->doc->versions->signatures($docId, $layerName, $sha, $request) -> ?DocVersionsSignatures200Response +
$client->doc->versions->signatures($docId, $layerName, $sha256, $request) -> ?DocVersionsSignaturesResponse
@@ -6302,7 +6302,7 @@ $client->doc->versions->revision( $client->doc->versions->signatures( 'docId', 'layerName', - 'sha', + 'sha256', new SignaturesVersionsRequest([]), ); ``` @@ -6335,7 +6335,7 @@ $client->doc->versions->signatures(
-**$sha:** `string` +**$sha256:** `string`
@@ -6355,7 +6355,7 @@ $client->doc->versions->signatures(
-
$client->doc->versions->signatureContents($docId, $layerName, $sha, $fieldKey, $request) -> string +
$client->doc->versions->signatureContents($docId, $layerName, $sha256, $fieldKey, $request) -> string
@@ -6385,7 +6385,7 @@ $client->doc->versions->signatures( $client->doc->versions->signatureContents( 'docId', 'layerName', - 'sha', + 'sha256', 'fieldKey', new SignatureContentsVersionsRequest([]), ); @@ -6419,7 +6419,7 @@ $client->doc->versions->signatureContents(
-**$sha:** `string` +**$sha256:** `string`
@@ -6447,7 +6447,7 @@ $client->doc->versions->signatureContents(
-
$client->doc->versions->signatureDigest($docId, $layerName, $sha, $fieldKey, $algorithm, $request) -> string +
$client->doc->versions->signatureDigest($docId, $layerName, $sha256, $fieldKey, $algorithm, $request) -> string
@@ -6477,7 +6477,7 @@ What a CMS verifier compares its message digest to. $client->doc->versions->signatureDigest( 'docId', 'layerName', - 'sha', + 'sha256', 'fieldKey', SignatureDigestVersionsRequestAlgorithm::Sha1->value, new SignatureDigestVersionsRequest([]), @@ -6512,7 +6512,7 @@ $client->doc->versions->signatureDigest(
-**$sha:** `string` +**$sha256:** `string`
@@ -6549,7 +6549,7 @@ $client->doc->versions->signatureDigest(
## Doc Fonts Programs -
$client->doc->fonts->programs->download($docId, $layerName, $displayHash, $request) -> string +
$client->doc->fonts->programs->download($docId, $layerName, $displaySha256, $request) -> string
@@ -6579,7 +6579,7 @@ A document token needs any one of the listed capabilities: one that may write te $client->doc->fonts->programs->download( 'docId', 'layerName', - 'displayHash', + 'displaySha256', new DownloadProgramsRequest([]), ); ``` @@ -6612,7 +6612,7 @@ $client->doc->fonts->programs->download(
-**$displayHash:** `string` +**$displaySha256:** `string`
@@ -6632,7 +6632,7 @@ $client->doc->fonts->programs->download(
-
$client->doc->fonts->programs->get($docId, $layerName, $displayHash, $request) -> ?FontProgramInfo +
$client->doc->fonts->programs->get($docId, $layerName, $displaySha256, $request) -> ?FontProgramInfo
@@ -6648,7 +6648,7 @@ $client->doc->fonts->programs->download( $client->doc->fonts->programs->get( 'docId', 'layerName', - 'displayHash', + 'displaySha256', new GetProgramsRequest([]), ); ``` @@ -6681,7 +6681,7 @@ $client->doc->fonts->programs->get(
-**$displayHash:** `string` +**$displaySha256:** `string`
@@ -6763,7 +6763,7 @@ $client->doc->metadata->custom->get(
## Documents Layers -
$client->documents->layers->list($tenantId, $id, $request) -> ?DocumentsLayersList200Response +
$client->documents->layers->list($tenantId, $docId, $request) -> ?DocumentsLayersListResponse
@@ -6778,7 +6778,7 @@ $client->doc->metadata->custom->get( ```php $client->documents->layers->list( 'tenantId', - 'id', + 'docId', new ListLayersRequest([]), ); ``` @@ -6803,7 +6803,7 @@ $client->documents->layers->list(
-**$id:** `string` +**$docId:** `string`
@@ -6839,7 +6839,7 @@ $client->documents->layers->list(
-
$client->documents->layers->delete($tenantId, $id, $layerName) +
$client->documents->layers->delete($tenantId, $docId, $layerName)
@@ -6854,7 +6854,7 @@ $client->documents->layers->list( ```php $client->documents->layers->delete( 'tenantId', - 'id', + 'docId', 'layerName', ); ``` @@ -6879,7 +6879,7 @@ $client->documents->layers->delete(
-**$id:** `string` +**$docId:** `string`
@@ -6900,7 +6900,7 @@ $client->documents->layers->delete(
## Grants Visitors -
$client->grants->visitors->list($tenantId, $grantId, $request) -> ?GrantsVisitorsList200Response +
$client->grants->visitors->list($tenantId, $grantId, $request) -> ?GrantsVisitorsListResponse
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 036fe865..b0d55475 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -67,6 +67,7 @@ class CloudPDFClient /** * @param ?string $token The token to use for authentication. + * @param ?string $embedPdfVersion * @param ?array{ * baseUrl?: string, * client?: ClientInterface, @@ -77,17 +78,22 @@ class CloudPDFClient */ public function __construct( ?string $token = null, + ?string $embedPdfVersion = null, ?array $options = null, ) { $defaultHeaders = [ + 'EmbedPDF-Version' => '3.0', 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0-alpha.22', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.22', + 'X-Fern-SDK-Version' => '3.0.0-alpha.23', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.23', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; } + if ($embedPdfVersion !== null) { + $defaultHeaders['EmbedPDF-Version'] = $embedPdfVersion; + } $this->options = $options ?? []; diff --git a/src/Core/Client/RawClient.php b/src/Core/Client/RawClient.php index 42831479..01293f02 100644 --- a/src/Core/Client/RawClient.php +++ b/src/Core/Client/RawClient.php @@ -289,6 +289,7 @@ private function buildUrl( $baseUrl = $request->baseUrl; $trimmedBaseUrl = rtrim($baseUrl, '/'); $trimmedBasePath = ltrim($request->path, '/'); + self::assertNoDotSegments($trimmedBasePath); $url = "{$trimmedBaseUrl}/{$trimmedBasePath}"; $query = array_merge( $request->query, @@ -300,6 +301,25 @@ private function buildUrl( return $url; } + /** + * Rejects "." and ".." path segments, which HTTP clients and servers resolve + * and which would otherwise change the endpoint a request is sent to. + * + * @param string $path + * @throws InvalidArgumentException + */ + private static function assertNoDotSegments(string $path): void + { + foreach (explode('/', $path) as $segment) { + $decoded = rawurldecode($segment); + if ($decoded === '.' || $decoded === '..') { + throw new InvalidArgumentException( + "Invalid request path \"/{$path}\": \".\" and \"..\" path segments are not allowed." + ); + } + } + } + /** * @param array $query * @return string diff --git a/src/Core/Json/JsonSerializableType.php b/src/Core/Json/JsonSerializableType.php index 4bf324d2..672d2cc6 100644 --- a/src/Core/Json/JsonSerializableType.php +++ b/src/Core/Json/JsonSerializableType.php @@ -146,12 +146,14 @@ public static function jsonDeserialize(array $data): static $dateTypeAttr = $property->getAttributes(Date::class)[0] ?? null; if ($dateTypeAttr) { $dateType = $dateTypeAttr->newInstance()->type; - if (!is_string($value)) { - throw new JsonException("Unexpected non-string type for date."); + if ($value !== null) { + if (!is_string($value)) { + throw new JsonException("Unexpected non-string type for date."); + } + $value = ($dateType === Date::TYPE_DATE) + ? JsonDeserializer::deserializeDate($value) + : JsonDeserializer::deserializeDateTime($value); } - $value = ($dateType === Date::TYPE_DATE) - ? JsonDeserializer::deserializeDate($value) - : JsonDeserializer::deserializeDateTime($value); } // Handle Array annotation diff --git a/src/Doc/Annotations/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php index 40b825dd..53aca406 100644 --- a/src/Doc/Annotations/AnnotationsClient.php +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -15,18 +15,18 @@ use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Annotations\Requests\ListAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\CreateAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsCreate200Response; +use CloudPDF\Types\DocAnnotationsCreateResponse; use CloudPDF\Doc\Annotations\Requests\DeleteAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsDelete200Response; +use CloudPDF\Types\DocAnnotationsDeleteResponse; use CloudPDF\Doc\Annotations\Requests\UpdateAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsUpdate200Response; +use CloudPDF\Types\DocAnnotationsUpdateResponse; use CloudPDF\Doc\Annotations\Requests\ReadAppearanceAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\ReadFileAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\ExportAppearanceAnnotationsRequest; use CloudPDF\Doc\Annotations\Requests\FlattenAnnotationsRequest; -use CloudPDF\Types\DocAnnotationsFlatten200Response; +use CloudPDF\Types\DocAnnotationsFlattenResponse; use CloudPDF\Doc\Annotations\Requests\DocAnnotationsReorderRequest; -use CloudPDF\Types\DocAnnotationsReorder200Response; +use CloudPDF\Types\DocAnnotationsReorderResponse; class AnnotationsClient { @@ -141,7 +141,7 @@ public function listAll(string $docId, string $layerName, ListAllAnnotationsRequ * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param ListAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -211,7 +211,7 @@ public function list(string $docId, string $layerName, string $pageKey, ListAnno * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param CreateAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -221,11 +221,11 @@ public function list(string $docId, string $layerName, string $pageKey, ListAnno * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsCreate200Response + * @return ?DocAnnotationsCreateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function create(string $docId, string $layerName, string $pageKey, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreate200Response + public function create(string $docId, string $layerName, string $pageKey, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreateResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -252,7 +252,7 @@ public function create(string $docId, string $layerName, string $pageKey, Create if (empty($json)) { return null; } - return DocAnnotationsCreate200Response::fromJson($json); + return DocAnnotationsCreateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -273,15 +273,15 @@ public function create(string $docId, string $layerName, string $pageKey, Create * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new DeleteAnnotationsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param DeleteAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -291,11 +291,11 @@ public function create(string $docId, string $layerName, string $pageKey, Create * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsDelete200Response + * @return ?DocAnnotationsDeleteResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function delete(string $docId, string $layerName, string $pageKey, string $annotKey, DeleteAnnotationsRequest $request = new DeleteAnnotationsRequest(), ?array $options = null): ?DocAnnotationsDelete200Response + public function delete(string $docId, string $layerName, string $pageKey, string $annotationKey, DeleteAnnotationsRequest $request = new DeleteAnnotationsRequest(), ?array $options = null): ?DocAnnotationsDeleteResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -309,7 +309,7 @@ public function delete(string $docId, string $layerName, string $pageKey, string $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotationKey}", method: HttpMethod::DELETE, headers: $headers, ), @@ -321,7 +321,7 @@ public function delete(string $docId, string $layerName, string $pageKey, string if (empty($json)) { return null; } - return DocAnnotationsDelete200Response::fromJson($json); + return DocAnnotationsDeleteResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -342,7 +342,7 @@ public function delete(string $docId, string $layerName, string $pageKey, string * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new UpdateAnnotationsRequest([ * 'body' => [ * 'key' => "value", @@ -353,8 +353,8 @@ public function delete(string $docId, string $layerName, string $pageKey, string * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param UpdateAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -364,11 +364,11 @@ public function delete(string $docId, string $layerName, string $pageKey, string * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsUpdate200Response + * @return ?DocAnnotationsUpdateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $docId, string $layerName, string $pageKey, string $annotKey, UpdateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsUpdate200Response + public function update(string $docId, string $layerName, string $pageKey, string $annotationKey, UpdateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsUpdateResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -382,7 +382,7 @@ public function update(string $docId, string $layerName, string $pageKey, string $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotationKey}", method: HttpMethod::PATCH, headers: $headers, body: $request->body, @@ -395,7 +395,7 @@ public function update(string $docId, string $layerName, string $pageKey, string if (empty($json)) { return null; } - return DocAnnotationsUpdate200Response::fromJson($json); + return DocAnnotationsUpdateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -416,15 +416,15 @@ public function update(string $docId, string $layerName, string $pageKey, string * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new ReadAppearanceAnnotationsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param ReadAppearanceAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -438,7 +438,7 @@ public function update(string $docId, string $layerName, string $pageKey, string * @throws CloudPDFException * @throws CloudPDFApiException */ - public function readAppearance(string $docId, string $layerName, string $pageKey, string $annotKey, ReadAppearanceAnnotationsRequest $request = new ReadAppearanceAnnotationsRequest(), ?array $options = null): string + public function readAppearance(string $docId, string $layerName, string $pageKey, string $annotationKey, ReadAppearanceAnnotationsRequest $request = new ReadAppearanceAnnotationsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -449,7 +449,7 @@ public function readAppearance(string $docId, string $layerName, string $pageKey $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/appearance", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotationKey}/resources/appearance", method: HttpMethod::GET, headers: $headers, ), @@ -478,15 +478,15 @@ public function readAppearance(string $docId, string $layerName, string $pageKey * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new ReadFileAnnotationsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param ReadFileAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -500,7 +500,7 @@ public function readAppearance(string $docId, string $layerName, string $pageKey * @throws CloudPDFException * @throws CloudPDFApiException */ - public function readFile(string $docId, string $layerName, string $pageKey, string $annotKey, ReadFileAnnotationsRequest $request = new ReadFileAnnotationsRequest(), ?array $options = null): string + public function readFile(string $docId, string $layerName, string $pageKey, string $annotationKey, ReadFileAnnotationsRequest $request = new ReadFileAnnotationsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -511,7 +511,7 @@ public function readFile(string $docId, string $layerName, string $pageKey, stri $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotKey}/resources/file", + path: "v1/docs/{$docId}/layers/{$layerName}/annotations/pages/{$pageKey}/items/{$annotationKey}/resources/file", method: HttpMethod::GET, headers: $headers, ), @@ -550,7 +550,7 @@ public function readFile(string $docId, string $layerName, string $pageKey, stri * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param ExportAppearanceAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -613,7 +613,7 @@ public function exportAppearance(string $docId, string $layerName, string $pageK * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param FlattenAnnotationsRequest $request * @param ?array{ * baseUrl?: string, @@ -623,11 +623,11 @@ public function exportAppearance(string $docId, string $layerName, string $pageK * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsFlatten200Response + * @return ?DocAnnotationsFlattenResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function flatten(string $docId, string $layerName, string $pageKey, FlattenAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsFlatten200Response + public function flatten(string $docId, string $layerName, string $pageKey, FlattenAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsFlattenResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -654,7 +654,7 @@ public function flatten(string $docId, string $layerName, string $pageKey, Flatt if (empty($json)) { return null; } - return DocAnnotationsFlatten200Response::fromJson($json); + return DocAnnotationsFlattenResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -692,7 +692,7 @@ public function flatten(string $docId, string $layerName, string $pageKey, Flatt * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param DocAnnotationsReorderRequest $request * @param ?array{ * baseUrl?: string, @@ -702,11 +702,11 @@ public function flatten(string $docId, string $layerName, string $pageKey, Flatt * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocAnnotationsReorder200Response + * @return ?DocAnnotationsReorderResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function reorder(string $docId, string $layerName, string $pageKey, DocAnnotationsReorderRequest $request, ?array $options = null): ?DocAnnotationsReorder200Response + public function reorder(string $docId, string $layerName, string $pageKey, DocAnnotationsReorderRequest $request, ?array $options = null): ?DocAnnotationsReorderResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -733,7 +733,7 @@ public function reorder(string $docId, string $layerName, string $pageKey, DocAn if (empty($json)) { return null; } - return DocAnnotationsReorder200Response::fromJson($json); + return DocAnnotationsReorderResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/DocClient.php b/src/Doc/DocClient.php index fe95f95f..a66dc48e 100644 --- a/src/Doc/DocClient.php +++ b/src/Doc/DocClient.php @@ -15,7 +15,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Requests\HeadDocRequest; -use CloudPDF\Types\DocHead200Response; +use CloudPDF\Types\DocHeadResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -24,15 +24,15 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Requests\DocChangesRequest; -use CloudPDF\Types\DocChanges200Response; +use CloudPDF\Types\DocChangesResponse; use CloudPDF\Doc\Requests\DownloadDocRequest; use CloudPDF\Doc\Requests\DocDownloadLinkRequest; -use CloudPDF\Types\DocDownloadLink200Response; +use CloudPDF\Types\DocDownloadLinkResponse; use CloudPDF\Doc\Requests\ManifestDocRequest; -use CloudPDF\Types\DocManifest200Response; +use CloudPDF\Types\DocManifestResponse; use CloudPDF\Doc\Requests\RenderDocRequest; use CloudPDF\Doc\Requests\TextDocRequest; -use CloudPDF\Types\DocText200Response; +use CloudPDF\Types\DocTextResponse; class DocClient { @@ -149,11 +149,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocHead200Response + * @return ?DocHeadResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function head(string $docId, HeadDocRequest $request = new HeadDocRequest(), ?array $options = null): ?DocHead200Response + public function head(string $docId, HeadDocRequest $request = new HeadDocRequest(), ?array $options = null): ?DocHeadResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -176,7 +176,7 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest if (empty($json)) { return null; } - return DocHead200Response::fromJson($json); + return DocHeadResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -219,11 +219,11 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocChanges200Response + * @return ?DocChangesResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function changes(string $docId, string $layerName, DocChangesRequest $request, ?array $options = null): ?DocChanges200Response + public function changes(string $docId, string $layerName, DocChangesRequest $request, ?array $options = null): ?DocChangesResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -247,7 +247,7 @@ public function changes(string $docId, string $layerName, DocChangesRequest $req if (empty($json)) { return null; } - return DocChanges200Response::fromJson($json); + return DocChangesResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -340,11 +340,11 @@ public function download(string $docId, string $layerName, DownloadDocRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocDownloadLink200Response + * @return ?DocDownloadLinkResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function downloadLink(string $docId, string $layerName, DocDownloadLinkRequest $request = new DocDownloadLinkRequest(), ?array $options = null): ?DocDownloadLink200Response + public function downloadLink(string $docId, string $layerName, DocDownloadLinkRequest $request = new DocDownloadLinkRequest(), ?array $options = null): ?DocDownloadLinkResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -368,7 +368,7 @@ public function downloadLink(string $docId, string $layerName, DocDownloadLinkRe if (empty($json)) { return null; } - return DocDownloadLink200Response::fromJson($json); + return DocDownloadLinkResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -403,11 +403,11 @@ public function downloadLink(string $docId, string $layerName, DocDownloadLinkRe * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocManifest200Response + * @return ?DocManifestResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function manifest(string $docId, string $layerName, ManifestDocRequest $request = new ManifestDocRequest(), ?array $options = null): ?DocManifest200Response + public function manifest(string $docId, string $layerName, ManifestDocRequest $request = new ManifestDocRequest(), ?array $options = null): ?DocManifestResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -430,7 +430,7 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r if (empty($json)) { return null; } - return DocManifest200Response::fromJson($json); + return DocManifestResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -459,7 +459,7 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param RenderDocRequest $request * @param ?array{ * baseUrl?: string, @@ -517,7 +517,7 @@ public function render(string $docId, string $layerName, string $pageKey, Render * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param TextDocRequest $request * @param ?array{ * baseUrl?: string, @@ -527,11 +527,11 @@ public function render(string $docId, string $layerName, string $pageKey, Render * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocText200Response + * @return ?DocTextResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function text(string $docId, string $layerName, string $pageKey, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocText200Response + public function text(string $docId, string $layerName, string $pageKey, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocTextResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -554,7 +554,7 @@ public function text(string $docId, string $layerName, string $pageKey, TextDocR if (empty($json)) { return null; } - return DocText200Response::fromJson($json); + return DocTextResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Fonts/Programs/ProgramsClient.php b/src/Doc/Fonts/Programs/ProgramsClient.php index d9be1432..d6474582 100644 --- a/src/Doc/Fonts/Programs/ProgramsClient.php +++ b/src/Doc/Fonts/Programs/ProgramsClient.php @@ -59,14 +59,14 @@ public function __construct( * $client->doc->fonts->programs->download( * 'docId', * 'layerName', - * 'displayHash', + * 'displaySha256', * new DownloadProgramsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $displayHash + * @param string $displaySha256 * @param DownloadProgramsRequest $request * @param ?array{ * baseUrl?: string, @@ -80,7 +80,7 @@ public function __construct( * @throws CloudPDFException * @throws CloudPDFApiException */ - public function download(string $docId, string $layerName, string $displayHash, DownloadProgramsRequest $request = new DownloadProgramsRequest(), ?array $options = null): string + public function download(string $docId, string $layerName, string $displaySha256, DownloadProgramsRequest $request = new DownloadProgramsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -91,7 +91,7 @@ public function download(string $docId, string $layerName, string $displayHash, $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}", + path: "v1/docs/{$docId}/layers/{$layerName}/font-program-files/{$displaySha256}", method: HttpMethod::GET, headers: $headers, ), @@ -117,14 +117,14 @@ public function download(string $docId, string $layerName, string $displayHash, * $client->doc->fonts->programs->get( * 'docId', * 'layerName', - * 'displayHash', + * 'displaySha256', * new GetProgramsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $displayHash + * @param string $displaySha256 * @param GetProgramsRequest $request * @param ?array{ * baseUrl?: string, @@ -138,7 +138,7 @@ public function download(string $docId, string $layerName, string $displayHash, * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $docId, string $layerName, string $displayHash, GetProgramsRequest $request = new GetProgramsRequest(), ?array $options = null): ?FontProgramInfo + public function get(string $docId, string $layerName, string $displaySha256, GetProgramsRequest $request = new GetProgramsRequest(), ?array $options = null): ?FontProgramInfo { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -149,7 +149,7 @@ public function get(string $docId, string $layerName, string $displayHash, GetPr $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}", + path: "v1/docs/{$docId}/layers/{$layerName}/font-programs/{$displaySha256}", method: HttpMethod::GET, headers: $headers, ), diff --git a/src/Doc/Forms/FormsClient.php b/src/Doc/Forms/FormsClient.php index d1321a5b..d43652f6 100644 --- a/src/Doc/Forms/FormsClient.php +++ b/src/Doc/Forms/FormsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Forms\Requests\ListFormsRequest; -use CloudPDF\Types\DocFormsList200Response; +use CloudPDF\Types\DocFormsListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,17 +14,17 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Forms\Requests\DocFormsReorderCalculationsRequest; -use CloudPDF\Types\DocFormsReorderCalculations200Response; +use CloudPDF\Types\DocFormsReorderCalculationsResponse; use CloudPDF\Doc\Forms\Requests\SetValueFormsRequest; -use CloudPDF\Types\DocFormsSetValue200Response; +use CloudPDF\Types\DocFormsSetValueResponse; use CloudPDF\Doc\Forms\Requests\DocFormsResetRequest; -use CloudPDF\Types\DocFormsReset200Response; +use CloudPDF\Types\DocFormsResetResponse; use CloudPDF\Doc\Forms\Requests\DeleteWidgetFormsRequest; -use CloudPDF\Types\DocFormsDeleteWidget200Response; +use CloudPDF\Types\DocFormsDeleteWidgetResponse; use CloudPDF\Doc\Forms\Requests\DocFormsUpdateWidgetRequest; -use CloudPDF\Types\DocFormsUpdateWidget200Response; +use CloudPDF\Types\DocFormsUpdateWidgetResponse; use CloudPDF\Doc\Forms\Requests\DocFormsReorderWidgetsRequest; -use CloudPDF\Types\DocFormsReorderWidgets200Response; +use CloudPDF\Types\DocFormsReorderWidgetsResponse; class FormsClient { @@ -83,11 +83,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsList200Response + * @return ?DocFormsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $docId, string $layerName, ListFormsRequest $request = new ListFormsRequest(), ?array $options = null): ?DocFormsList200Response + public function list(string $docId, string $layerName, ListFormsRequest $request = new ListFormsRequest(), ?array $options = null): ?DocFormsListResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -110,7 +110,7 @@ public function list(string $docId, string $layerName, ListFormsRequest $request if (empty($json)) { return null; } - return DocFormsList200Response::fromJson($json); + return DocFormsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -152,11 +152,11 @@ public function list(string $docId, string $layerName, ListFormsRequest $request * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsReorderCalculations200Response + * @return ?DocFormsReorderCalculationsResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function reorderCalculations(string $docId, string $layerName, DocFormsReorderCalculationsRequest $request, ?array $options = null): ?DocFormsReorderCalculations200Response + public function reorderCalculations(string $docId, string $layerName, DocFormsReorderCalculationsRequest $request, ?array $options = null): ?DocFormsReorderCalculationsResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -183,7 +183,7 @@ public function reorderCalculations(string $docId, string $layerName, DocFormsRe if (empty($json)) { return null; } - return DocFormsReorderCalculations200Response::fromJson($json); + return DocFormsReorderCalculationsResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -224,11 +224,11 @@ public function reorderCalculations(string $docId, string $layerName, DocFormsRe * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsSetValue200Response + * @return ?DocFormsSetValueResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setValue(string $docId, string $layerName, string $fieldKey, SetValueFormsRequest $request, ?array $options = null): ?DocFormsSetValue200Response + public function setValue(string $docId, string $layerName, string $fieldKey, SetValueFormsRequest $request, ?array $options = null): ?DocFormsSetValueResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -255,7 +255,7 @@ public function setValue(string $docId, string $layerName, string $fieldKey, Set if (empty($json)) { return null; } - return DocFormsSetValue200Response::fromJson($json); + return DocFormsSetValueResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -290,11 +290,11 @@ public function setValue(string $docId, string $layerName, string $fieldKey, Set * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsReset200Response + * @return ?DocFormsResetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function reset(string $docId, string $layerName, DocFormsResetRequest $request = new DocFormsResetRequest(), ?array $options = null): ?DocFormsReset200Response + public function reset(string $docId, string $layerName, DocFormsResetRequest $request = new DocFormsResetRequest(), ?array $options = null): ?DocFormsResetResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -321,7 +321,7 @@ public function reset(string $docId, string $layerName, DocFormsResetRequest $re if (empty($json)) { return null; } - return DocFormsReset200Response::fromJson($json); + return DocFormsResetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -342,15 +342,15 @@ public function reset(string $docId, string $layerName, DocFormsResetRequest $re * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new DeleteWidgetFormsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param DeleteWidgetFormsRequest $request * @param ?array{ * baseUrl?: string, @@ -360,11 +360,11 @@ public function reset(string $docId, string $layerName, DocFormsResetRequest $re * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsDeleteWidget200Response + * @return ?DocFormsDeleteWidgetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function deleteWidget(string $docId, string $layerName, string $pageKey, string $annotKey, DeleteWidgetFormsRequest $request = new DeleteWidgetFormsRequest(), ?array $options = null): ?DocFormsDeleteWidget200Response + public function deleteWidget(string $docId, string $layerName, string $pageKey, string $annotationKey, DeleteWidgetFormsRequest $request = new DeleteWidgetFormsRequest(), ?array $options = null): ?DocFormsDeleteWidgetResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -378,7 +378,7 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotationKey}", method: HttpMethod::DELETE, headers: $headers, ), @@ -390,7 +390,7 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, if (empty($json)) { return null; } - return DocFormsDeleteWidget200Response::fromJson($json); + return DocFormsDeleteWidgetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -411,7 +411,7 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, * 'docId', * 'layerName', * 'pageKey', - * 'annotKey', + * 'annotationKey', * new DocFormsUpdateWidgetRequest([ * 'patch' => new WidgetPatch([]), * ]), @@ -420,8 +420,8 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. - * @param string $annotKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. + * @param string $annotationKey The annotation's address on the page: `obj:N`, its indirect object number, or `base:N` for an annotation the uploaded file stored inline (without an object number of its own), the position it was born at in the page's /Annots. The name the annotation's `ref` carries for life. * @param DocFormsUpdateWidgetRequest $request * @param ?array{ * baseUrl?: string, @@ -431,11 +431,11 @@ public function deleteWidget(string $docId, string $layerName, string $pageKey, * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsUpdateWidget200Response + * @return ?DocFormsUpdateWidgetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function updateWidget(string $docId, string $layerName, string $pageKey, string $annotKey, DocFormsUpdateWidgetRequest $request, ?array $options = null): ?DocFormsUpdateWidget200Response + public function updateWidget(string $docId, string $layerName, string $pageKey, string $annotationKey, DocFormsUpdateWidgetRequest $request, ?array $options = null): ?DocFormsUpdateWidgetResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -449,7 +449,7 @@ public function updateWidget(string $docId, string $layerName, string $pageKey, $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotKey}", + path: "v1/docs/{$docId}/layers/{$layerName}/form/widgets/{$pageKey}/{$annotationKey}", method: HttpMethod::PATCH, headers: $headers, body: $request, @@ -462,7 +462,7 @@ public function updateWidget(string $docId, string $layerName, string $pageKey, if (empty($json)) { return null; } - return DocFormsUpdateWidget200Response::fromJson($json); + return DocFormsUpdateWidgetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -500,7 +500,7 @@ public function updateWidget(string $docId, string $layerName, string $pageKey, * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param DocFormsReorderWidgetsRequest $request * @param ?array{ * baseUrl?: string, @@ -510,11 +510,11 @@ public function updateWidget(string $docId, string $layerName, string $pageKey, * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocFormsReorderWidgets200Response + * @return ?DocFormsReorderWidgetsResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function reorderWidgets(string $docId, string $layerName, string $pageKey, DocFormsReorderWidgetsRequest $request, ?array $options = null): ?DocFormsReorderWidgets200Response + public function reorderWidgets(string $docId, string $layerName, string $pageKey, DocFormsReorderWidgetsRequest $request, ?array $options = null): ?DocFormsReorderWidgetsResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -541,7 +541,7 @@ public function reorderWidgets(string $docId, string $layerName, string $pageKey if (empty($json)) { return null; } - return DocFormsReorderWidgets200Response::fromJson($json); + return DocFormsReorderWidgetsResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php index 74cf4e36..a4a220d1 100644 --- a/src/Doc/Pages/PagesClient.php +++ b/src/Doc/Pages/PagesClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Pages\Requests\DocPagesSetScaleRequest; -use CloudPDF\Types\DocPagesSetScale200Response; +use CloudPDF\Types\DocPagesSetScaleResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,14 +14,14 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Pages\Requests\ViewportsPagesRequest; -use CloudPDF\Types\DocPagesViewports200Response; +use CloudPDF\Types\DocPagesViewportsResponse; use CloudPDF\Doc\Pages\Requests\ExtractPagesRequest; use CloudPDF\Doc\Pages\Requests\FlattenPagesRequest; -use CloudPDF\Types\DocPagesFlatten200Response; +use CloudPDF\Types\DocPagesFlattenResponse; use CloudPDF\Doc\Pages\Requests\SetNamePagesRequest; -use CloudPDF\Types\DocPagesSetName200Response; +use CloudPDF\Types\DocPagesSetNameResponse; use CloudPDF\Doc\Pages\Requests\RemoveNamePagesRequest; -use CloudPDF\Types\DocPagesRemoveName200Response; +use CloudPDF\Types\DocPagesRemoveNameResponse; class PagesClient { @@ -72,7 +72,7 @@ public function __construct( * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param DocPagesSetScaleRequest $request * @param ?array{ * baseUrl?: string, @@ -82,11 +82,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesSetScale200Response + * @return ?DocPagesSetScaleResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setScale(string $docId, string $layerName, string $pageKey, DocPagesSetScaleRequest $request, ?array $options = null): ?DocPagesSetScale200Response + public function setScale(string $docId, string $layerName, string $pageKey, DocPagesSetScaleRequest $request, ?array $options = null): ?DocPagesSetScaleResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -113,7 +113,7 @@ public function setScale(string $docId, string $layerName, string $pageKey, DocP if (empty($json)) { return null; } - return DocPagesSetScale200Response::fromJson($json); + return DocPagesSetScaleResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -140,7 +140,7 @@ public function setScale(string $docId, string $layerName, string $pageKey, DocP * * @param string $docId * @param string $layerName - * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotKey` and `fieldKey`. + * @param string $pageKey The page's address, `obj:N`: the page's indirect object number, the durable identity every `PageLayout.ref` carries. Mirrors `annotationKey` and `fieldKey`. * @param ViewportsPagesRequest $request * @param ?array{ * baseUrl?: string, @@ -150,11 +150,11 @@ public function setScale(string $docId, string $layerName, string $pageKey, DocP * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesViewports200Response + * @return ?DocPagesViewportsResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function viewports(string $docId, string $layerName, string $pageKey, ViewportsPagesRequest $request = new ViewportsPagesRequest(), ?array $options = null): ?DocPagesViewports200Response + public function viewports(string $docId, string $layerName, string $pageKey, ViewportsPagesRequest $request = new ViewportsPagesRequest(), ?array $options = null): ?DocPagesViewportsResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -177,7 +177,7 @@ public function viewports(string $docId, string $layerName, string $pageKey, Vie if (empty($json)) { return null; } - return DocPagesViewports200Response::fromJson($json); + return DocPagesViewportsResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -281,11 +281,11 @@ public function extract(string $docId, string $layerName, ExtractPagesRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesFlatten200Response + * @return ?DocPagesFlattenResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function flatten(string $docId, string $layerName, FlattenPagesRequest $request, ?array $options = null): ?DocPagesFlatten200Response + public function flatten(string $docId, string $layerName, FlattenPagesRequest $request, ?array $options = null): ?DocPagesFlattenResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -312,7 +312,7 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r if (empty($json)) { return null; } - return DocPagesFlatten200Response::fromJson($json); + return DocPagesFlattenResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -351,11 +351,11 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesSetName200Response + * @return ?DocPagesSetNameResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function setName(string $docId, string $layerName, SetNamePagesRequest $request, ?array $options = null): ?DocPagesSetName200Response + public function setName(string $docId, string $layerName, SetNamePagesRequest $request, ?array $options = null): ?DocPagesSetNameResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -382,7 +382,7 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r if (empty($json)) { return null; } - return DocPagesSetName200Response::fromJson($json); + return DocPagesSetNameResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -421,11 +421,11 @@ public function setName(string $docId, string $layerName, SetNamePagesRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocPagesRemoveName200Response + * @return ?DocPagesRemoveNameResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function removeName(string $docId, string $layerName, RemoveNamePagesRequest $request, ?array $options = null): ?DocPagesRemoveName200Response + public function removeName(string $docId, string $layerName, RemoveNamePagesRequest $request, ?array $options = null): ?DocPagesRemoveNameResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -452,7 +452,7 @@ public function removeName(string $docId, string $layerName, RemoveNamePagesRequ if (empty($json)) { return null; } - return DocPagesRemoveName200Response::fromJson($json); + return DocPagesRemoveNameResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Redactions/RedactionsClient.php b/src/Doc/Redactions/RedactionsClient.php index 7400c511..a1477926 100644 --- a/src/Doc/Redactions/RedactionsClient.php +++ b/src/Doc/Redactions/RedactionsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Redactions\Requests\DocRedactionsApplyRequest; -use CloudPDF\Types\DocRedactionsApply200Response; +use CloudPDF\Types\DocRedactionsApplyResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -71,11 +71,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocRedactionsApply200Response + * @return ?DocRedactionsApplyResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function apply(string $docId, string $layerName, DocRedactionsApplyRequest $request = new DocRedactionsApplyRequest(), ?array $options = null): ?DocRedactionsApply200Response + public function apply(string $docId, string $layerName, DocRedactionsApplyRequest $request = new DocRedactionsApplyRequest(), ?array $options = null): ?DocRedactionsApplyResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -102,7 +102,7 @@ public function apply(string $docId, string $layerName, DocRedactionsApplyReques if (empty($json)) { return null; } - return DocRedactionsApply200Response::fromJson($json); + return DocRedactionsApplyResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Requests/DocDownloadLinkRequest.php b/src/Doc/Requests/DocDownloadLinkRequest.php index d49b179b..3329041e 100644 --- a/src/Doc/Requests/DocDownloadLinkRequest.php +++ b/src/Doc/Requests/DocDownloadLinkRequest.php @@ -13,21 +13,21 @@ class DocDownloadLinkRequest extends JsonSerializableType public ?string $documentPassword; /** - * @var ?int $expiresIn + * @var ?int $expiresInSeconds */ - #[JsonProperty('expiresIn')] - public ?int $expiresIn; + #[JsonProperty('expiresInSeconds')] + public ?int $expiresInSeconds; /** * @param array{ * documentPassword?: ?string, - * expiresIn?: ?int, + * expiresInSeconds?: ?int, * } $values */ public function __construct( array $values = [], ) { $this->documentPassword = $values['documentPassword'] ?? null; - $this->expiresIn = $values['expiresIn'] ?? null; + $this->expiresInSeconds = $values['expiresInSeconds'] ?? null; } } diff --git a/src/Doc/Signatures/SignaturesClient.php b/src/Doc/Signatures/SignaturesClient.php index 98a841b0..3eeb39fb 100644 --- a/src/Doc/Signatures/SignaturesClient.php +++ b/src/Doc/Signatures/SignaturesClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Signatures\Requests\ListSignaturesRequest; -use CloudPDF\Types\DocSignaturesList200Response; +use CloudPDF\Types\DocSignaturesListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,13 +14,13 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Signatures\Requests\CancelSignaturesRequest; -use CloudPDF\Types\DocSignaturesCancel200Response; +use CloudPDF\Types\DocSignaturesCancelResponse; use CloudPDF\Doc\Signatures\Requests\DocSignaturesCompleteRequest; -use CloudPDF\Types\DocSignaturesComplete200Response; +use CloudPDF\Types\DocSignaturesCompleteResponse; use CloudPDF\Doc\Signatures\Requests\AnalysisSignaturesRequest; -use CloudPDF\Types\DocSignaturesAnalysis200Response; +use CloudPDF\Types\DocSignaturesAnalysisResponse; use CloudPDF\Doc\Signatures\Requests\PrepareSignaturesRequest; -use CloudPDF\Types\DocSignaturesPrepare200Response; +use CloudPDF\Types\DocSignaturesPrepareResponse; use CloudPDF\Core\Multipart\MultipartFormData; use CloudPDF\Core\Multipart\MultipartApiRequest; @@ -83,11 +83,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocSignaturesList200Response + * @return ?DocSignaturesListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $docId, string $layerName, ListSignaturesRequest $request = new ListSignaturesRequest(), ?array $options = null): ?DocSignaturesList200Response + public function list(string $docId, string $layerName, ListSignaturesRequest $request = new ListSignaturesRequest(), ?array $options = null): ?DocSignaturesListResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -110,7 +110,7 @@ public function list(string $docId, string $layerName, ListSignaturesRequest $re if (empty($json)) { return null; } - return DocSignaturesList200Response::fromJson($json); + return DocSignaturesListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -147,11 +147,11 @@ public function list(string $docId, string $layerName, ListSignaturesRequest $re * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocSignaturesCancel200Response + * @return ?DocSignaturesCancelResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function cancel(string $docId, string $layerName, string $signingId, CancelSignaturesRequest $request = new CancelSignaturesRequest(), ?array $options = null): ?DocSignaturesCancel200Response + public function cancel(string $docId, string $layerName, string $signingId, CancelSignaturesRequest $request = new CancelSignaturesRequest(), ?array $options = null): ?DocSignaturesCancelResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -174,7 +174,7 @@ public function cancel(string $docId, string $layerName, string $signingId, Canc if (empty($json)) { return null; } - return DocSignaturesCancel200Response::fromJson($json); + return DocSignaturesCancelResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -219,11 +219,11 @@ public function cancel(string $docId, string $layerName, string $signingId, Canc * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocSignaturesComplete200Response + * @return ?DocSignaturesCompleteResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function complete(string $docId, string $layerName, string $signingId, DocSignaturesCompleteRequest $request, ?array $options = null): ?DocSignaturesComplete200Response + public function complete(string $docId, string $layerName, string $signingId, DocSignaturesCompleteRequest $request, ?array $options = null): ?DocSignaturesCompleteResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -247,7 +247,7 @@ public function complete(string $docId, string $layerName, string $signingId, Do if (empty($json)) { return null; } - return DocSignaturesComplete200Response::fromJson($json); + return DocSignaturesCompleteResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -284,11 +284,11 @@ public function complete(string $docId, string $layerName, string $signingId, Do * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocSignaturesAnalysis200Response + * @return ?DocSignaturesAnalysisResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function analysis(string $docId, string $layerName, AnalysisSignaturesRequest $request = new AnalysisSignaturesRequest(), ?array $options = null): ?DocSignaturesAnalysis200Response + public function analysis(string $docId, string $layerName, AnalysisSignaturesRequest $request = new AnalysisSignaturesRequest(), ?array $options = null): ?DocSignaturesAnalysisResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -322,7 +322,7 @@ public function analysis(string $docId, string $layerName, AnalysisSignaturesReq if (empty($json)) { return null; } - return DocSignaturesAnalysis200Response::fromJson($json); + return DocSignaturesAnalysisResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -360,11 +360,11 @@ public function analysis(string $docId, string $layerName, AnalysisSignaturesReq * headers?: array, * queryParameters?: array, * } $options - * @return ?DocSignaturesPrepare200Response + * @return ?DocSignaturesPrepareResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function prepare(string $docId, string $layerName, PrepareSignaturesRequest $request, ?array $options = null): ?DocSignaturesPrepare200Response + public function prepare(string $docId, string $layerName, PrepareSignaturesRequest $request, ?array $options = null): ?DocSignaturesPrepareResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -390,7 +390,7 @@ public function prepare(string $docId, string $layerName, PrepareSignaturesReque if (empty($json)) { return null; } - return DocSignaturesPrepare200Response::fromJson($json); + return DocSignaturesPrepareResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Doc/Versions/VersionsClient.php b/src/Doc/Versions/VersionsClient.php index 7fcee37e..db46311f 100644 --- a/src/Doc/Versions/VersionsClient.php +++ b/src/Doc/Versions/VersionsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Doc\Versions\Requests\ListVersionsRequest; -use CloudPDF\Types\DocVersionsList200Response; +use CloudPDF\Types\DocVersionsListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,11 +14,11 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Doc\Versions\Requests\AnalysisVersionsRequest; -use CloudPDF\Types\DocVersionsAnalysis200Response; +use CloudPDF\Types\DocVersionsAnalysisResponse; use CloudPDF\Doc\Versions\Requests\DownloadVersionsRequest; use CloudPDF\Doc\Versions\Requests\RevisionVersionsRequest; use CloudPDF\Doc\Versions\Requests\SignaturesVersionsRequest; -use CloudPDF\Types\DocVersionsSignatures200Response; +use CloudPDF\Types\DocVersionsSignaturesResponse; use CloudPDF\Doc\Versions\Requests\SignatureContentsVersionsRequest; use CloudPDF\Doc\Versions\Types\SignatureDigestVersionsRequestAlgorithm; use CloudPDF\Doc\Versions\Requests\SignatureDigestVersionsRequest; @@ -82,11 +82,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocVersionsList200Response + * @return ?DocVersionsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $docId, string $layerName, ListVersionsRequest $request = new ListVersionsRequest(), ?array $options = null): ?DocVersionsList200Response + public function list(string $docId, string $layerName, ListVersionsRequest $request = new ListVersionsRequest(), ?array $options = null): ?DocVersionsListResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -109,7 +109,7 @@ public function list(string $docId, string $layerName, ListVersionsRequest $requ if (empty($json)) { return null; } - return DocVersionsList200Response::fromJson($json); + return DocVersionsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -131,14 +131,14 @@ public function list(string $docId, string $layerName, ListVersionsRequest $requ * $client->doc->versions->analysis( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * new AnalysisVersionsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param AnalysisVersionsRequest $request * @param ?array{ * baseUrl?: string, @@ -148,11 +148,11 @@ public function list(string $docId, string $layerName, ListVersionsRequest $requ * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocVersionsAnalysis200Response + * @return ?DocVersionsAnalysisResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function analysis(string $docId, string $layerName, string $sha, AnalysisVersionsRequest $request = new AnalysisVersionsRequest(), ?array $options = null): ?DocVersionsAnalysis200Response + public function analysis(string $docId, string $layerName, string $sha256, AnalysisVersionsRequest $request = new AnalysisVersionsRequest(), ?array $options = null): ?DocVersionsAnalysisResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -179,7 +179,7 @@ public function analysis(string $docId, string $layerName, string $sha, Analysis $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/analysis/{$sha}", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/analysis/{$sha256}", method: HttpMethod::GET, headers: $headers, query: $query, @@ -192,7 +192,7 @@ public function analysis(string $docId, string $layerName, string $sha, Analysis if (empty($json)) { return null; } - return DocVersionsAnalysis200Response::fromJson($json); + return DocVersionsAnalysisResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -212,14 +212,14 @@ public function analysis(string $docId, string $layerName, string $sha, Analysis * $client->doc->versions->download( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * new DownloadVersionsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param DownloadVersionsRequest $request * @param ?array{ * baseUrl?: string, @@ -233,7 +233,7 @@ public function analysis(string $docId, string $layerName, string $sha, Analysis * @throws CloudPDFException * @throws CloudPDFApiException */ - public function download(string $docId, string $layerName, string $sha, DownloadVersionsRequest $request = new DownloadVersionsRequest(), ?array $options = null): string + public function download(string $docId, string $layerName, string $sha256, DownloadVersionsRequest $request = new DownloadVersionsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -244,7 +244,7 @@ public function download(string $docId, string $layerName, string $sha, Download $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/download/{$sha}", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/download/{$sha256}", method: HttpMethod::GET, headers: $headers, ), @@ -270,7 +270,7 @@ public function download(string $docId, string $layerName, string $sha, Download * $client->doc->versions->revision( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * 1, * new RevisionVersionsRequest([]), * ); @@ -278,7 +278,7 @@ public function download(string $docId, string $layerName, string $sha, Download * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param int $index * @param RevisionVersionsRequest $request * @param ?array{ @@ -293,7 +293,7 @@ public function download(string $docId, string $layerName, string $sha, Download * @throws CloudPDFException * @throws CloudPDFApiException */ - public function revision(string $docId, string $layerName, string $sha, int $index, RevisionVersionsRequest $request = new RevisionVersionsRequest(), ?array $options = null): string + public function revision(string $docId, string $layerName, string $sha256, int $index, RevisionVersionsRequest $request = new RevisionVersionsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -304,7 +304,7 @@ public function revision(string $docId, string $layerName, string $sha, int $ind $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/revisions/{$sha}/{$index}", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/revisions/{$sha256}/{$index}", method: HttpMethod::GET, headers: $headers, ), @@ -330,14 +330,14 @@ public function revision(string $docId, string $layerName, string $sha, int $ind * $client->doc->versions->signatures( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * new SignaturesVersionsRequest([]), * ); * ``` * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param SignaturesVersionsRequest $request * @param ?array{ * baseUrl?: string, @@ -347,11 +347,11 @@ public function revision(string $docId, string $layerName, string $sha, int $ind * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocVersionsSignatures200Response + * @return ?DocVersionsSignaturesResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function signatures(string $docId, string $layerName, string $sha, SignaturesVersionsRequest $request = new SignaturesVersionsRequest(), ?array $options = null): ?DocVersionsSignatures200Response + public function signatures(string $docId, string $layerName, string $sha256, SignaturesVersionsRequest $request = new SignaturesVersionsRequest(), ?array $options = null): ?DocVersionsSignaturesResponse { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -362,7 +362,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha256}", method: HttpMethod::GET, headers: $headers, ), @@ -374,7 +374,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat if (empty($json)) { return null; } - return DocVersionsSignatures200Response::fromJson($json); + return DocVersionsSignaturesResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -396,7 +396,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat * $client->doc->versions->signatureContents( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * 'fieldKey', * new SignatureContentsVersionsRequest([]), * ); @@ -404,7 +404,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param string $fieldKey * @param SignatureContentsVersionsRequest $request * @param ?array{ @@ -419,7 +419,7 @@ public function signatures(string $docId, string $layerName, string $sha, Signat * @throws CloudPDFException * @throws CloudPDFApiException */ - public function signatureContents(string $docId, string $layerName, string $sha, string $fieldKey, SignatureContentsVersionsRequest $request = new SignatureContentsVersionsRequest(), ?array $options = null): string + public function signatureContents(string $docId, string $layerName, string $sha256, string $fieldKey, SignatureContentsVersionsRequest $request = new SignatureContentsVersionsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -430,7 +430,7 @@ public function signatureContents(string $docId, string $layerName, string $sha, $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}/{$fieldKey}/contents", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha256}/{$fieldKey}/contents", method: HttpMethod::GET, headers: $headers, ), @@ -458,7 +458,7 @@ public function signatureContents(string $docId, string $layerName, string $sha, * $client->doc->versions->signatureDigest( * 'docId', * 'layerName', - * 'sha', + * 'sha256', * 'fieldKey', * SignatureDigestVersionsRequestAlgorithm::Sha1->value, * new SignatureDigestVersionsRequest([]), @@ -467,7 +467,7 @@ public function signatureContents(string $docId, string $layerName, string $sha, * * @param string $docId * @param string $layerName - * @param string $sha + * @param string $sha256 * @param string $fieldKey * @param value-of $algorithm * @param SignatureDigestVersionsRequest $request @@ -483,7 +483,7 @@ public function signatureContents(string $docId, string $layerName, string $sha, * @throws CloudPDFException * @throws CloudPDFApiException */ - public function signatureDigest(string $docId, string $layerName, string $sha, string $fieldKey, string $algorithm, SignatureDigestVersionsRequest $request = new SignatureDigestVersionsRequest(), ?array $options = null): string + public function signatureDigest(string $docId, string $layerName, string $sha256, string $fieldKey, string $algorithm, SignatureDigestVersionsRequest $request = new SignatureDigestVersionsRequest(), ?array $options = null): string { $options = array_merge($this->options, $options ?? []); $headers = []; @@ -494,7 +494,7 @@ public function signatureDigest(string $docId, string $layerName, string $sha, s $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha}/{$fieldKey}/digest/{$algorithm}", + path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha256}/{$fieldKey}/digest/{$algorithm}", method: HttpMethod::GET, headers: $headers, ), diff --git a/src/Documents/DocumentsClient.php b/src/Documents/DocumentsClient.php index 02bd6daa..30a7b75e 100644 --- a/src/Documents/DocumentsClient.php +++ b/src/Documents/DocumentsClient.php @@ -6,7 +6,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Documents\Requests\ListDocumentsRequest; -use CloudPDF\Types\DocumentsList200Response; +use CloudPDF\Types\DocumentsListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,19 +14,19 @@ use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; -use CloudPDF\Types\DocumentsGet200Response; +use CloudPDF\Types\DocumentsGetResponse; use CloudPDF\Documents\Requests\DocumentsUpdateRequest; -use CloudPDF\Types\DocumentsUpdate200Response; +use CloudPDF\Types\DocumentsUpdateResponse; use CloudPDF\Documents\Requests\DocumentsCommitRequest; -use CloudPDF\Types\DocumentsCommit200Response; +use CloudPDF\Types\DocumentsCommitResponse; use CloudPDF\Documents\Requests\UploadProxyDocumentsRequest; -use CloudPDF\Types\DocumentsUploadProxy200Response; +use CloudPDF\Types\DocumentsUploadProxyResponse; use CloudPDF\Core\Multipart\MultipartFormData; use CloudPDF\Core\Multipart\MultipartApiRequest; use CloudPDF\Documents\Requests\DocumentsImportFromRequest; use CloudPDF\Types\DocumentsImportFrom200Response; use CloudPDF\Documents\Requests\DocumentsInitRequest; -use CloudPDF\Types\DocumentsInit200Response; +use CloudPDF\Types\DocumentsInitResponse; class DocumentsClient { @@ -89,11 +89,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsList200Response + * @return ?DocumentsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $tenantId, ListDocumentsRequest $request = new ListDocumentsRequest(), ?array $options = null): ?DocumentsList200Response + public function list(string $tenantId, ListDocumentsRequest $request = new ListDocumentsRequest(), ?array $options = null): ?DocumentsListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -134,7 +134,7 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD if (empty($json)) { return null; } - return DocumentsList200Response::fromJson($json); + return DocumentsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -153,12 +153,12 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD * ```php * $client->documents->get( * 'tenantId', - * 'id', + * 'docId', * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -167,18 +167,18 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsGet200Response + * @return ?DocumentsGetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $tenantId, string $id, ?array $options = null): ?DocumentsGet200Response + public function get(string $tenantId, string $docId, ?array $options = null): ?DocumentsGetResponse { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}", + path: "v1/tenants/{$tenantId}/documents/{$docId}", method: HttpMethod::GET, ), $options, @@ -189,7 +189,7 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu if (empty($json)) { return null; } - return DocumentsGet200Response::fromJson($json); + return DocumentsGetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -208,12 +208,12 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu * ```php * $client->documents->delete( * 'tenantId', - * 'id', + * 'docId', * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -225,14 +225,14 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu * @throws CloudPDFException * @throws CloudPDFApiException */ - public function delete(string $tenantId, string $id, ?array $options = null): void + public function delete(string $tenantId, string $docId, ?array $options = null): void { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}", + path: "v1/tenants/{$tenantId}/documents/{$docId}", method: HttpMethod::DELETE, ), $options, @@ -258,7 +258,7 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo * ```php * $client->documents->update( * 'tenantId', - * 'id', + * 'docId', * new DocumentsUpdateRequest([ * 'name' => 'name', * ]), @@ -266,7 +266,7 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param DocumentsUpdateRequest $request * @param ?array{ * baseUrl?: string, @@ -276,18 +276,18 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsUpdate200Response + * @return ?DocumentsUpdateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $tenantId, string $id, DocumentsUpdateRequest $request, ?array $options = null): ?DocumentsUpdate200Response + public function update(string $tenantId, string $docId, DocumentsUpdateRequest $request, ?array $options = null): ?DocumentsUpdateResponse { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}", + path: "v1/tenants/{$tenantId}/documents/{$docId}", method: HttpMethod::PATCH, body: $request, ), @@ -299,7 +299,7 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req if (empty($json)) { return null; } - return DocumentsUpdate200Response::fromJson($json); + return DocumentsUpdateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -320,7 +320,7 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req * ```php * $client->documents->commit( * 'tenantId', - * 'id', + * 'docId', * new DocumentsCommitRequest([ * 'sha256' => 'sha256', * ]), @@ -328,7 +328,7 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param DocumentsCommitRequest $request * @param ?array{ * baseUrl?: string, @@ -338,18 +338,18 @@ public function update(string $tenantId, string $id, DocumentsUpdateRequest $req * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsCommit200Response + * @return ?DocumentsCommitResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function commit(string $tenantId, string $id, DocumentsCommitRequest $request, ?array $options = null): ?DocumentsCommit200Response + public function commit(string $tenantId, string $docId, DocumentsCommitRequest $request, ?array $options = null): ?DocumentsCommitResponse { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/commit", + path: "v1/tenants/{$tenantId}/documents/{$docId}/commit", method: HttpMethod::POST, body: $request, ), @@ -361,7 +361,7 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req if (empty($json)) { return null; } - return DocumentsCommit200Response::fromJson($json); + return DocumentsCommitResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -380,12 +380,12 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req * ```php * $client->documents->download( * 'tenantId', - * 'id', + * 'docId', * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -398,14 +398,14 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req * @throws CloudPDFException * @throws CloudPDFApiException */ - public function download(string $tenantId, string $id, ?array $options = null): string + public function download(string $tenantId, string $docId, ?array $options = null): string { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/download", + path: "v1/tenants/{$tenantId}/documents/{$docId}/download", method: HttpMethod::GET, ), $options, @@ -429,12 +429,12 @@ public function download(string $tenantId, string $id, ?array $options = null): * ```php * $client->documents->thumbnail( * 'tenantId', - * 'id', + * 'docId', * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param ?array{ * baseUrl?: string, * maxRetries?: int, @@ -447,14 +447,14 @@ public function download(string $tenantId, string $id, ?array $options = null): * @throws CloudPDFException * @throws CloudPDFApiException */ - public function thumbnail(string $tenantId, string $id, ?array $options = null): string + public function thumbnail(string $tenantId, string $docId, ?array $options = null): string { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/thumbnail", + path: "v1/tenants/{$tenantId}/documents/{$docId}/thumbnail", method: HttpMethod::GET, ), $options, @@ -480,7 +480,7 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): * ```php * $client->documents->uploadProxy( * 'tenantId', - * 'id', + * 'docId', * new UploadProxyDocumentsRequest([ * 'file' => File::createFromString("example_file", "example_file"), * ]), @@ -488,7 +488,7 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param UploadProxyDocumentsRequest $request * @param ?array{ * baseUrl?: string, @@ -497,11 +497,11 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): * headers?: array, * queryParameters?: array, * } $options - * @return ?DocumentsUploadProxy200Response + * @return ?DocumentsUploadProxyResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function uploadProxy(string $tenantId, string $id, UploadProxyDocumentsRequest $request, ?array $options = null): ?DocumentsUploadProxy200Response + public function uploadProxy(string $tenantId, string $docId, UploadProxyDocumentsRequest $request, ?array $options = null): ?DocumentsUploadProxyResponse { $options = array_merge($this->options, $options ?? []); $body = new MultipartFormData(); @@ -510,7 +510,7 @@ public function uploadProxy(string $tenantId, string $id, UploadProxyDocumentsRe $response = $this->client->sendRequest( new MultipartApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/upload-proxy", + path: "v1/tenants/{$tenantId}/documents/{$docId}/upload-proxy", method: HttpMethod::POST, body: $body, ), @@ -522,7 +522,7 @@ public function uploadProxy(string $tenantId, string $id, UploadProxyDocumentsRe if (empty($json)) { return null; } - return DocumentsUploadProxy200Response::fromJson($json); + return DocumentsUploadProxyResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -599,14 +599,14 @@ 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. + * With an upload token, the document goes into the token's folder with the token's metadata, whatever the request says; sizeBytes 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( * 'tenantId', * new DocumentsInitRequest([ - * 'contentLength' => 1.1, + * 'sizeBytes' => 1, * 'contentSha256' => 'contentSha256', * ]), * ); @@ -622,11 +622,11 @@ public function importFrom(string $tenantId, DocumentsImportFromRequest $request * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsInit200Response + * @return ?DocumentsInitResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function init(string $tenantId, DocumentsInitRequest $request, ?array $options = null): ?DocumentsInit200Response + public function init(string $tenantId, DocumentsInitRequest $request, ?array $options = null): ?DocumentsInitResponse { $options = array_merge($this->options, $options ?? []); try { @@ -645,7 +645,7 @@ public function init(string $tenantId, DocumentsInitRequest $request, ?array $op if (empty($json)) { return null; } - return DocumentsInit200Response::fromJson($json); + return DocumentsInitResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Documents/Layers/LayersClient.php b/src/Documents/Layers/LayersClient.php index 477a1308..c9ced468 100644 --- a/src/Documents/Layers/LayersClient.php +++ b/src/Documents/Layers/LayersClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Documents\Layers\Requests\ListLayersRequest; -use CloudPDF\Types\DocumentsLayersList200Response; +use CloudPDF\Types\DocumentsLayersListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -55,13 +55,13 @@ public function __construct( * ```php * $client->documents->layers->list( * 'tenantId', - * 'id', + * 'docId', * new ListLayersRequest([]), * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param ListLayersRequest $request * @param ?array{ * baseUrl?: string, @@ -71,11 +71,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?DocumentsLayersList200Response + * @return ?DocumentsLayersListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $tenantId, string $id, ListLayersRequest $request = new ListLayersRequest(), ?array $options = null): ?DocumentsLayersList200Response + public function list(string $tenantId, string $docId, ListLayersRequest $request = new ListLayersRequest(), ?array $options = null): ?DocumentsLayersListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -92,7 +92,7 @@ public function list(string $tenantId, string $id, ListLayersRequest $request = $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/layers", + path: "v1/tenants/{$tenantId}/documents/{$docId}/layers", method: HttpMethod::GET, query: $query, ), @@ -104,7 +104,7 @@ public function list(string $tenantId, string $id, ListLayersRequest $request = if (empty($json)) { return null; } - return DocumentsLayersList200Response::fromJson($json); + return DocumentsLayersListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -123,13 +123,13 @@ public function list(string $tenantId, string $id, ListLayersRequest $request = * ```php * $client->documents->layers->delete( * 'tenantId', - * 'id', + * 'docId', * 'layerName', * ); * ``` * * @param string $tenantId - * @param string $id + * @param string $docId * @param string $layerName * @param ?array{ * baseUrl?: string, @@ -142,14 +142,14 @@ public function list(string $tenantId, string $id, ListLayersRequest $request = * @throws CloudPDFException * @throws CloudPDFApiException */ - public function delete(string $tenantId, string $id, string $layerName, ?array $options = null): void + public function delete(string $tenantId, string $docId, string $layerName, ?array $options = null): void { $options = array_merge($this->options, $options ?? []); try { $response = $this->client->sendRequest( new JsonApiRequest( baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, - path: "v1/tenants/{$tenantId}/documents/{$id}/layers/{$layerName}", + path: "v1/tenants/{$tenantId}/documents/{$docId}/layers/{$layerName}", method: HttpMethod::DELETE, ), $options, diff --git a/src/Documents/Requests/DocumentsInitRequest.php b/src/Documents/Requests/DocumentsInitRequest.php index ac961531..a4f6fbbd 100644 --- a/src/Documents/Requests/DocumentsInitRequest.php +++ b/src/Documents/Requests/DocumentsInitRequest.php @@ -11,10 +11,10 @@ class DocumentsInitRequest extends JsonSerializableType { /** - * @var float $contentLength + * @var int $sizeBytes */ - #[JsonProperty('contentLength')] - public float $contentLength; + #[JsonProperty('sizeBytes')] + public int $sizeBytes; /** * @var string $contentSha256 @@ -59,10 +59,10 @@ class DocumentsInitRequest extends JsonSerializableType public ?string $docId; /** - * @var ?float $uploadTtlSec + * @var ?int $uploadTtlSeconds */ - #[JsonProperty('uploadTtlSec')] - public ?float $uploadTtlSec; + #[JsonProperty('uploadTtlSeconds')] + public ?int $uploadTtlSeconds; /** * @var ?value-of $uploadPreference @@ -72,7 +72,7 @@ class DocumentsInitRequest extends JsonSerializableType /** * @param array{ - * contentLength: float, + * sizeBytes: int, * contentSha256: string, * name?: ?string, * folderId?: ?string, @@ -80,14 +80,14 @@ class DocumentsInitRequest extends JsonSerializableType * idempotencyKey?: ?string, * dedupMode?: ?value-of, * docId?: ?string, - * uploadTtlSec?: ?float, + * uploadTtlSeconds?: ?int, * uploadPreference?: ?value-of, * } $values */ public function __construct( array $values, ) { - $this->contentLength = $values['contentLength']; + $this->sizeBytes = $values['sizeBytes']; $this->contentSha256 = $values['contentSha256']; $this->name = $values['name'] ?? null; $this->folderId = $values['folderId'] ?? null; @@ -95,7 +95,7 @@ public function __construct( $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->dedupMode = $values['dedupMode'] ?? null; $this->docId = $values['docId'] ?? null; - $this->uploadTtlSec = $values['uploadTtlSec'] ?? null; + $this->uploadTtlSeconds = $values['uploadTtlSeconds'] ?? null; $this->uploadPreference = $values['uploadPreference'] ?? null; } } diff --git a/src/Folders/FoldersClient.php b/src/Folders/FoldersClient.php index ae707c2c..545d74fa 100644 --- a/src/Folders/FoldersClient.php +++ b/src/Folders/FoldersClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Folders\Requests\ListFoldersRequest; -use CloudPDF\Types\FoldersList200Response; +use CloudPDF\Types\FoldersListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,11 +14,11 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Folders\Requests\FoldersCreateRequest; -use CloudPDF\Types\FoldersCreate200Response; -use CloudPDF\Types\FoldersGet200Response; +use CloudPDF\Types\FoldersCreateResponse; +use CloudPDF\Types\FoldersGetResponse; use CloudPDF\Folders\Requests\DeleteFoldersRequest; use CloudPDF\Folders\Requests\FoldersUpdateRequest; -use CloudPDF\Types\FoldersUpdate200Response; +use CloudPDF\Types\FoldersUpdateResponse; use CloudPDF\Folders\Requests\FoldersMoveIntoRequest; class FoldersClient @@ -76,11 +76,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?FoldersList200Response + * @return ?FoldersListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $tenantId, ListFoldersRequest $request = new ListFoldersRequest(), ?array $options = null): ?FoldersList200Response + public function list(string $tenantId, ListFoldersRequest $request = new ListFoldersRequest(), ?array $options = null): ?FoldersListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -109,7 +109,7 @@ public function list(string $tenantId, ListFoldersRequest $request = new ListFol if (empty($json)) { return null; } - return FoldersList200Response::fromJson($json); + return FoldersListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -146,11 +146,11 @@ public function list(string $tenantId, ListFoldersRequest $request = new ListFol * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?FoldersCreate200Response + * @return ?FoldersCreateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function create(string $tenantId, FoldersCreateRequest $request, ?array $options = null): ?FoldersCreate200Response + public function create(string $tenantId, FoldersCreateRequest $request, ?array $options = null): ?FoldersCreateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -169,7 +169,7 @@ public function create(string $tenantId, FoldersCreateRequest $request, ?array $ if (empty($json)) { return null; } - return FoldersCreate200Response::fromJson($json); + return FoldersCreateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -202,11 +202,11 @@ public function create(string $tenantId, FoldersCreateRequest $request, ?array $ * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?FoldersGet200Response + * @return ?FoldersGetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $tenantId, string $folderId, ?array $options = null): ?FoldersGet200Response + public function get(string $tenantId, string $folderId, ?array $options = null): ?FoldersGetResponse { $options = array_merge($this->options, $options ?? []); try { @@ -224,7 +224,7 @@ public function get(string $tenantId, string $folderId, ?array $options = null): if (empty($json)) { return null; } - return FoldersGet200Response::fromJson($json); + return FoldersGetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -320,11 +320,11 @@ public function delete(string $tenantId, string $folderId, DeleteFoldersRequest * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?FoldersUpdate200Response + * @return ?FoldersUpdateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $tenantId, string $folderId, FoldersUpdateRequest $request, ?array $options = null): ?FoldersUpdate200Response + public function update(string $tenantId, string $folderId, FoldersUpdateRequest $request, ?array $options = null): ?FoldersUpdateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -343,7 +343,7 @@ public function update(string $tenantId, string $folderId, FoldersUpdateRequest if (empty($json)) { return null; } - return FoldersUpdate200Response::fromJson($json); + return FoldersUpdateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -358,7 +358,7 @@ public function update(string $tenantId, string $folderId, FoldersUpdateRequest } /** - * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in `details.documentIds` and `details.folderIds`. 409 Conflict carries `details.reason`: `cycle` (the destination is a moved folder or inside one; `details.folderId`), `too-deep` (the move would nest folders deeper than 100 levels; `details.maxDepth`) or `name-taken` (a moved folder's name is taken in the destination, ignoring case; `details.name`). + * Up to 1,000 ids in total. A folder moves with everything in it. 404 NotFound names the ids that do not exist or are being deleted in `details.docIds` and `details.folderIds`. 409 Conflict carries `details.reason`: `cycle` (the destination is a moved folder or inside one; `details.folderId`), `too-deep` (the move would nest folders deeper than 100 levels; `details.maxDepth`) or `name-taken` (a moved folder's name is taken in the destination, ignoring case; `details.name`). * * Example: * ```php diff --git a/src/Folders/Requests/FoldersMoveIntoRequest.php b/src/Folders/Requests/FoldersMoveIntoRequest.php index 2aaec060..ac8b6c21 100644 --- a/src/Folders/Requests/FoldersMoveIntoRequest.php +++ b/src/Folders/Requests/FoldersMoveIntoRequest.php @@ -9,10 +9,10 @@ class FoldersMoveIntoRequest extends JsonSerializableType { /** - * @var ?array $documentIds + * @var ?array $docIds */ - #[JsonProperty('documentIds'), ArrayType(['string'])] - public ?array $documentIds; + #[JsonProperty('docIds'), ArrayType(['string'])] + public ?array $docIds; /** * @var ?array $folderIds @@ -22,14 +22,14 @@ class FoldersMoveIntoRequest extends JsonSerializableType /** * @param array{ - * documentIds?: ?array, + * docIds?: ?array, * folderIds?: ?array, * } $values */ public function __construct( array $values = [], ) { - $this->documentIds = $values['documentIds'] ?? null; + $this->docIds = $values['docIds'] ?? null; $this->folderIds = $values['folderIds'] ?? null; } } diff --git a/src/Grants/GrantsClient.php b/src/Grants/GrantsClient.php index c5174cae..68c8d16d 100644 --- a/src/Grants/GrantsClient.php +++ b/src/Grants/GrantsClient.php @@ -6,7 +6,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Grants\Requests\GrantsExchangeRequest; -use CloudPDF\Types\GrantsExchange200Response; +use CloudPDF\Types\GrantsExchangeResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -15,13 +15,13 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Grants\Requests\ListGrantsRequest; -use CloudPDF\Types\GrantsList200Response; +use CloudPDF\Types\GrantsListResponse; use CloudPDF\Grants\Requests\GrantsCreateRequest; -use CloudPDF\Types\GrantsCreate200Response; -use CloudPDF\Types\GrantsGet200Response; +use CloudPDF\Types\GrantsCreateResponse; +use CloudPDF\Types\GrantsGetResponse; use CloudPDF\Grants\Requests\GrantsUpdateRequest; -use CloudPDF\Types\GrantsUpdate200Response; -use CloudPDF\Types\GrantsArchive200Response; +use CloudPDF\Types\GrantsUpdateResponse; +use CloudPDF\Types\GrantsArchiveResponse; class GrantsClient { @@ -86,11 +86,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsExchange200Response + * @return ?GrantsExchangeResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function exchange(GrantsExchangeRequest $request, ?array $options = null): ?GrantsExchange200Response + public function exchange(GrantsExchangeRequest $request, ?array $options = null): ?GrantsExchangeResponse { $options = array_merge($this->options, $options ?? []); try { @@ -109,7 +109,7 @@ public function exchange(GrantsExchangeRequest $request, ?array $options = null) if (empty($json)) { return null; } - return GrantsExchange200Response::fromJson($json); + return GrantsExchangeResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -142,11 +142,11 @@ public function exchange(GrantsExchangeRequest $request, ?array $options = null) * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsList200Response + * @return ?GrantsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $tenantId, ListGrantsRequest $request = new ListGrantsRequest(), ?array $options = null): ?GrantsList200Response + public function list(string $tenantId, ListGrantsRequest $request = new ListGrantsRequest(), ?array $options = null): ?GrantsListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -178,7 +178,7 @@ public function list(string $tenantId, ListGrantsRequest $request = new ListGran if (empty($json)) { return null; } - return GrantsList200Response::fromJson($json); + return GrantsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -218,11 +218,11 @@ public function list(string $tenantId, ListGrantsRequest $request = new ListGran * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsCreate200Response + * @return ?GrantsCreateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function create(string $tenantId, GrantsCreateRequest $request, ?array $options = null): ?GrantsCreate200Response + public function create(string $tenantId, GrantsCreateRequest $request, ?array $options = null): ?GrantsCreateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -241,7 +241,7 @@ public function create(string $tenantId, GrantsCreateRequest $request, ?array $o if (empty($json)) { return null; } - return GrantsCreate200Response::fromJson($json); + return GrantsCreateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -274,11 +274,11 @@ public function create(string $tenantId, GrantsCreateRequest $request, ?array $o * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsGet200Response + * @return ?GrantsGetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $tenantId, string $grantId, ?array $options = null): ?GrantsGet200Response + public function get(string $tenantId, string $grantId, ?array $options = null): ?GrantsGetResponse { $options = array_merge($this->options, $options ?? []); try { @@ -296,7 +296,7 @@ public function get(string $tenantId, string $grantId, ?array $options = null): if (empty($json)) { return null; } - return GrantsGet200Response::fromJson($json); + return GrantsGetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -379,11 +379,11 @@ public function delete(string $tenantId, string $grantId, ?array $options = null * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsUpdate200Response + * @return ?GrantsUpdateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $tenantId, string $grantId, GrantsUpdateRequest $request = new GrantsUpdateRequest(), ?array $options = null): ?GrantsUpdate200Response + public function update(string $tenantId, string $grantId, GrantsUpdateRequest $request = new GrantsUpdateRequest(), ?array $options = null): ?GrantsUpdateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -402,7 +402,7 @@ public function update(string $tenantId, string $grantId, GrantsUpdateRequest $r if (empty($json)) { return null; } - return GrantsUpdate200Response::fromJson($json); + return GrantsUpdateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -437,11 +437,11 @@ public function update(string $tenantId, string $grantId, GrantsUpdateRequest $r * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsArchive200Response + * @return ?GrantsArchiveResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function archive(string $tenantId, string $grantId, ?array $options = null): ?GrantsArchive200Response + public function archive(string $tenantId, string $grantId, ?array $options = null): ?GrantsArchiveResponse { $options = array_merge($this->options, $options ?? []); try { @@ -459,7 +459,7 @@ public function archive(string $tenantId, string $grantId, ?array $options = nul if (empty($json)) { return null; } - return GrantsArchive200Response::fromJson($json); + return GrantsArchiveResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Grants/Requests/GrantsCreateRequest.php b/src/Grants/Requests/GrantsCreateRequest.php index fe7f2ca7..54e60e75 100644 --- a/src/Grants/Requests/GrantsCreateRequest.php +++ b/src/Grants/Requests/GrantsCreateRequest.php @@ -8,6 +8,8 @@ use CloudPDF\Grants\Types\GrantsCreateRequestVisitorIdentity; use CloudPDF\Types\Identity; use CloudPDF\Core\Types\ArrayType; +use DateTime; +use CloudPDF\Core\Types\Date; class GrantsCreateRequest extends JsonSerializableType { @@ -84,10 +86,10 @@ class GrantsCreateRequest extends JsonSerializableType public ?int $sessionTtlSeconds; /** - * @var ?int $expiresAt + * @var ?DateTime $expiresAt */ - #[JsonProperty('expiresAt')] - public ?int $expiresAt; + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; /** * @param array{ @@ -103,7 +105,7 @@ class GrantsCreateRequest extends JsonSerializableType * origins?: ?array, * passphrase?: ?string, * sessionTtlSeconds?: ?int, - * expiresAt?: ?int, + * expiresAt?: ?DateTime, * } $values */ public function __construct( diff --git a/src/Grants/Requests/GrantsUpdateRequest.php b/src/Grants/Requests/GrantsUpdateRequest.php index f2d170c6..61f29b50 100644 --- a/src/Grants/Requests/GrantsUpdateRequest.php +++ b/src/Grants/Requests/GrantsUpdateRequest.php @@ -8,6 +8,8 @@ use CloudPDF\Grants\Types\GrantsUpdateRequestVisitorIdentity; use CloudPDF\Types\Identity; use CloudPDF\Core\Types\ArrayType; +use DateTime; +use CloudPDF\Core\Types\Date; class GrantsUpdateRequest extends JsonSerializableType { @@ -84,10 +86,10 @@ class GrantsUpdateRequest extends JsonSerializableType public ?bool $disabled; /** - * @var ?int $expiresAt + * @var ?DateTime $expiresAt */ - #[JsonProperty('expiresAt')] - public ?int $expiresAt; + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; /** * @param array{ @@ -103,7 +105,7 @@ class GrantsUpdateRequest extends JsonSerializableType * passphrase?: ?string, * sessionTtlSeconds?: ?int, * disabled?: ?bool, - * expiresAt?: ?int, + * expiresAt?: ?DateTime, * } $values */ public function __construct( diff --git a/src/Grants/Visitors/VisitorsClient.php b/src/Grants/Visitors/VisitorsClient.php index 7a6b3586..580213e6 100644 --- a/src/Grants/Visitors/VisitorsClient.php +++ b/src/Grants/Visitors/VisitorsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Grants\Visitors\Requests\ListVisitorsRequest; -use CloudPDF\Types\GrantsVisitorsList200Response; +use CloudPDF\Types\GrantsVisitorsListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -73,11 +73,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?GrantsVisitorsList200Response + * @return ?GrantsVisitorsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(string $tenantId, string $grantId, ListVisitorsRequest $request = new ListVisitorsRequest(), ?array $options = null): ?GrantsVisitorsList200Response + public function list(string $tenantId, string $grantId, ListVisitorsRequest $request = new ListVisitorsRequest(), ?array $options = null): ?GrantsVisitorsListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -103,7 +103,7 @@ public function list(string $tenantId, string $grantId, ListVisitorsRequest $req if (empty($json)) { return null; } - return GrantsVisitorsList200Response::fromJson($json); + return GrantsVisitorsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Tenants/TenantsClient.php b/src/Tenants/TenantsClient.php index c38343a4..4b52f40b 100644 --- a/src/Tenants/TenantsClient.php +++ b/src/Tenants/TenantsClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Tenants\Requests\ListTenantsRequest; -use CloudPDF\Types\TenantsList200Response; +use CloudPDF\Types\TenantsListResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -14,13 +14,13 @@ use JsonException; use Psr\Http\Client\ClientExceptionInterface; use CloudPDF\Tenants\Requests\TenantsCreateRequest; -use CloudPDF\Types\TenantsCreate200Response; -use CloudPDF\Types\TenantsGet200Response; +use CloudPDF\Types\TenantsCreateResponse; +use CloudPDF\Types\TenantsGetResponse; use CloudPDF\Tenants\Requests\TenantsUpdateRequest; -use CloudPDF\Types\TenantsUpdate200Response; +use CloudPDF\Types\TenantsUpdateResponse; use CloudPDF\Tenants\Requests\TenantsSuspendRequest; use CloudPDF\Tenants\Requests\UsageTenantsRequest; -use CloudPDF\Types\TenantsUsage200Response; +use CloudPDF\Types\TenantsUsageResponse; class TenantsClient { @@ -75,11 +75,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TenantsList200Response + * @return ?TenantsListResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?array $options = null): ?TenantsList200Response + public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?array $options = null): ?TenantsListResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -105,7 +105,7 @@ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?ar if (empty($json)) { return null; } - return TenantsList200Response::fromJson($json); + return TenantsListResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -138,11 +138,11 @@ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?ar * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TenantsCreate200Response + * @return ?TenantsCreateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function create(TenantsCreateRequest $request, ?array $options = null): ?TenantsCreate200Response + public function create(TenantsCreateRequest $request, ?array $options = null): ?TenantsCreateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -161,7 +161,7 @@ public function create(TenantsCreateRequest $request, ?array $options = null): ? if (empty($json)) { return null; } - return TenantsCreate200Response::fromJson($json); + return TenantsCreateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -192,11 +192,11 @@ public function create(TenantsCreateRequest $request, ?array $options = null): ? * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TenantsGet200Response + * @return ?TenantsGetResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function get(string $tenantId, ?array $options = null): ?TenantsGet200Response + public function get(string $tenantId, ?array $options = null): ?TenantsGetResponse { $options = array_merge($this->options, $options ?? []); try { @@ -214,7 +214,7 @@ public function get(string $tenantId, ?array $options = null): ?TenantsGet200Res if (empty($json)) { return null; } - return TenantsGet200Response::fromJson($json); + return TenantsGetResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -303,11 +303,11 @@ public function delete(string $tenantId, ?array $options = null): void * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TenantsUpdate200Response + * @return ?TenantsUpdateResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function update(string $tenantId, TenantsUpdateRequest $request, ?array $options = null): ?TenantsUpdate200Response + public function update(string $tenantId, TenantsUpdateRequest $request, ?array $options = null): ?TenantsUpdateResponse { $options = array_merge($this->options, $options ?? []); try { @@ -326,7 +326,7 @@ public function update(string $tenantId, TenantsUpdateRequest $request, ?array $ if (empty($json)) { return null; } - return TenantsUpdate200Response::fromJson($json); + return TenantsUpdateResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); @@ -458,11 +458,11 @@ public function suspend(string $tenantId, TenantsSuspendRequest $request = new T * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TenantsUsage200Response + * @return ?TenantsUsageResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function usage(string $tenantId, UsageTenantsRequest $request = new UsageTenantsRequest(), ?array $options = null): ?TenantsUsage200Response + public function usage(string $tenantId, UsageTenantsRequest $request = new UsageTenantsRequest(), ?array $options = null): ?TenantsUsageResponse { $options = array_merge($this->options, $options ?? []); $query = []; @@ -491,7 +491,7 @@ public function usage(string $tenantId, UsageTenantsRequest $request = new Usage if (empty($json)) { return null; } - return TenantsUsage200Response::fromJson($json); + return TenantsUsageResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Tokens/Requests/TokensRevokeRequest.php b/src/Tokens/Requests/TokensRevokeRequest.php index 9a54380c..de91509d 100644 --- a/src/Tokens/Requests/TokensRevokeRequest.php +++ b/src/Tokens/Requests/TokensRevokeRequest.php @@ -4,6 +4,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use DateTime; +use CloudPDF\Core\Types\Date; class TokensRevokeRequest extends JsonSerializableType { @@ -14,21 +16,21 @@ class TokensRevokeRequest extends JsonSerializableType public ?string $reason; /** - * @var ?int $expiresAtSeconds + * @var ?DateTime $expiresAt */ - #[JsonProperty('expiresAtSeconds')] - public ?int $expiresAtSeconds; + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; /** * @param array{ * reason?: ?string, - * expiresAtSeconds?: ?int, + * expiresAt?: ?DateTime, * } $values */ public function __construct( array $values = [], ) { $this->reason = $values['reason'] ?? null; - $this->expiresAtSeconds = $values['expiresAtSeconds'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; } } diff --git a/src/Tokens/TokensClient.php b/src/Tokens/TokensClient.php index 4e77da16..5c8d9cde 100644 --- a/src/Tokens/TokensClient.php +++ b/src/Tokens/TokensClient.php @@ -5,7 +5,7 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Tokens\Requests\IssueTokensRequest; -use CloudPDF\Types\TokensIssue200Response; +use CloudPDF\Types\TokensIssueResponse; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; @@ -65,7 +65,7 @@ public function __construct( * 'scope' => [ * 'scope', * ], - * 'expiresIn' => 1, + * 'expiresInSeconds' => 1, * ])), * ]), * ); @@ -81,11 +81,11 @@ public function __construct( * queryParameters?: array, * bodyProperties?: array, * } $options - * @return ?TokensIssue200Response + * @return ?TokensIssueResponse * @throws CloudPDFException * @throws CloudPDFApiException */ - public function issue(string $tenantId, IssueTokensRequest $request, ?array $options = null): ?TokensIssue200Response + public function issue(string $tenantId, IssueTokensRequest $request, ?array $options = null): ?TokensIssueResponse { $options = array_merge($this->options, $options ?? []); try { @@ -104,7 +104,7 @@ public function issue(string $tenantId, IssueTokensRequest $request, ?array $opt if (empty($json)) { return null; } - return TokensIssue200Response::fromJson($json); + return TokensIssueResponse::fromJson($json); } } catch (JsonException $e) { throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); diff --git a/src/Types/AdminErrorPayload.php b/src/Types/AdminErrorPayload.php deleted file mode 100644 index e6432257..00000000 --- a/src/Types/AdminErrorPayload.php +++ /dev/null @@ -1,34 +0,0 @@ -error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AdminErrorPayloadError.php b/src/Types/AdminErrorPayloadError.php deleted file mode 100644 index 174e5beb..00000000 --- a/src/Types/AdminErrorPayloadError.php +++ /dev/null @@ -1,51 +0,0 @@ - $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * code: string, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/Annotation.php b/src/Types/Annotation.php index 870a1540..bde7e820 100644 --- a/src/Types/Annotation.php +++ b/src/Types/Annotation.php @@ -5,6 +5,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; +/** + * An annotation, by its `subtype`. A newer server can add subtypes: read one your client doesn't know as `unsupported`, keeping the fields every annotation has, with `rawSubtypeCode` 0 and `rawSubtypeName` null when the body has neither. + */ class Annotation extends JsonSerializableType { /** diff --git a/src/Types/AnnotationDraftWidget.php b/src/Types/AnnotationDraftWidget.php index c5fdfb06..b02deec3 100644 --- a/src/Types/AnnotationDraftWidget.php +++ b/src/Types/AnnotationDraftWidget.php @@ -201,10 +201,10 @@ class AnnotationDraftWidget extends JsonSerializableType public ?AnnotationDraftWidgetBox $box; /** - * @var ?float $rotation + * @var ?int $rotation */ #[JsonProperty('rotation')] - public ?float $rotation; + public ?int $rotation; /** * @var ?string $color @@ -279,10 +279,16 @@ class AnnotationDraftWidget extends JsonSerializableType public mixed $field; /** - * @var mixed $fieldFamily + * @var mixed $fieldKind */ - #[JsonProperty('fieldFamily')] - public mixed $fieldFamily; + #[JsonProperty('fieldKind')] + public mixed $fieldKind; + + /** + * @var mixed $hasMark + */ + #[JsonProperty('hasMark')] + public mixed $hasMark; /** * @param array{ @@ -318,7 +324,7 @@ class AnnotationDraftWidget extends JsonSerializableType * importedBy?: mixed, * actions?: ?WidgetActionsPatch, * box?: ?AnnotationDraftWidgetBox, - * rotation?: ?float, + * rotation?: ?int, * color?: ?string, * interiorColor?: ?string, * strokeWidth?: ?float, @@ -331,7 +337,8 @@ class AnnotationDraftWidget extends JsonSerializableType * caption?: ?string, * checkStyle?: ?value-of, * field?: mixed, - * fieldFamily?: mixed, + * fieldKind?: mixed, + * hasMark?: mixed, * } $values */ public function __construct( @@ -382,7 +389,8 @@ public function __construct( $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; $this->field = $values['field'] ?? null; - $this->fieldFamily = $values['fieldFamily'] ?? null; + $this->fieldKind = $values['fieldKind'] ?? null; + $this->hasMark = $values['hasMark'] ?? null; } /** diff --git a/src/Types/AnnotationLine.php b/src/Types/AnnotationLine.php index 026cf4b2..f6bb026e 100644 --- a/src/Types/AnnotationLine.php +++ b/src/Types/AnnotationLine.php @@ -263,16 +263,16 @@ class AnnotationLine extends JsonSerializableType public ?string $intent; /** - * @var ?AnnotationLineMeasure $measure + * @var ?PdfMeasurement $measure A measure, by its `subtype`. A newer server can add subtypes: read one your client doesn't know as `unknown`. */ #[JsonProperty('measure')] - public ?AnnotationLineMeasure $measure; + public ?PdfMeasurement $measure; /** - * @var ?bool $captionEnabled + * @var bool $captionEnabled */ #[JsonProperty('captionEnabled')] - public ?bool $captionEnabled; + public bool $captionEnabled; /** * @var value-of $captionPosition @@ -314,6 +314,7 @@ class AnnotationLine extends JsonSerializableType * borderStyle: value-of, * linePoints: AnnotationLineLinePoints, * lineEndings: AnnotationLineLineEndings, + * captionEnabled: bool, * captionPosition: value-of, * appearanceState?: ?string, * structurePosition?: ?array, @@ -337,8 +338,7 @@ class AnnotationLine extends JsonSerializableType * interiorColor?: ?string, * rotation?: ?float, * intent?: ?value-of, - * measure?: ?AnnotationLineMeasure, - * captionEnabled?: ?bool, + * measure?: ?PdfMeasurement, * captionOffset?: ?AnnotationLineCaptionOffset, * leader?: ?AnnotationLineLeader, * } $values @@ -389,7 +389,7 @@ public function __construct( $this->rotation = $values['rotation'] ?? null; $this->intent = $values['intent'] ?? null; $this->measure = $values['measure'] ?? null; - $this->captionEnabled = $values['captionEnabled'] ?? null; + $this->captionEnabled = $values['captionEnabled']; $this->captionPosition = $values['captionPosition']; $this->captionOffset = $values['captionOffset'] ?? null; $this->leader = $values['leader'] ?? null; diff --git a/src/Types/AnnotationLineMeasure.php b/src/Types/AnnotationLineMeasure.php deleted file mode 100644 index 68d99ff4..00000000 --- a/src/Types/AnnotationLineMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param AnnotationLineMeasureRectilinear $rectilinear - * @return AnnotationLineMeasure - */ - public static function rectilinear(AnnotationLineMeasureRectilinear $rectilinear): AnnotationLineMeasure - { - return new AnnotationLineMeasure([ - 'subtype' => 'rectilinear', - 'value' => $rectilinear, - ]); - } - - /** - * @param AnnotationLineMeasureGeospatial $geospatial - * @return AnnotationLineMeasure - */ - public static function geospatial(AnnotationLineMeasureGeospatial $geospatial): AnnotationLineMeasure - { - return new AnnotationLineMeasure([ - 'subtype' => 'geospatial', - 'value' => $geospatial, - ]); - } - - /** - * @param AnnotationLineMeasureUnknown $unknown - * @return AnnotationLineMeasure - */ - public static function unknown(AnnotationLineMeasureUnknown $unknown): AnnotationLineMeasure - { - return new AnnotationLineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRectilinear(): bool - { - return $this->value instanceof AnnotationLineMeasureRectilinear && $this->subtype === 'rectilinear'; - } - - /** - * @return AnnotationLineMeasureRectilinear - */ - public function asRectilinear(): AnnotationLineMeasureRectilinear - { - if (!($this->value instanceof AnnotationLineMeasureRectilinear && $this->subtype === 'rectilinear')) { - throw new Exception( - "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeospatial(): bool - { - return $this->value instanceof AnnotationLineMeasureGeospatial && $this->subtype === 'geospatial'; - } - - /** - * @return AnnotationLineMeasureGeospatial - */ - public function asGeospatial(): AnnotationLineMeasureGeospatial - { - if (!($this->value instanceof AnnotationLineMeasureGeospatial && $this->subtype === 'geospatial')) { - throw new Exception( - "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof AnnotationLineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return AnnotationLineMeasureUnknown - */ - public function asUnknown(): AnnotationLineMeasureUnknown - { - if (!($this->value instanceof AnnotationLineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'rectilinear': - $value = $this->asRectilinear()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'geospatial': - $value = $this->asGeospatial()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'rectilinear': - $args['value'] = AnnotationLineMeasureRectilinear::jsonDeserialize($data); - break; - case 'geospatial': - $args['value'] = AnnotationLineMeasureGeospatial::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = AnnotationLineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/AnnotationLineMeasureGeospatial.php b/src/Types/AnnotationLineMeasureGeospatial.php deleted file mode 100644 index 0ab85eda..00000000 --- a/src/Types/AnnotationLineMeasureGeospatial.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinear.php b/src/Types/AnnotationLineMeasureRectilinear.php deleted file mode 100644 index 99d0ca48..00000000 --- a/src/Types/AnnotationLineMeasureRectilinear.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([AnnotationLineMeasureRectilinearXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([AnnotationLineMeasureRectilinearYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([AnnotationLineMeasureRectilinearDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([AnnotationLineMeasureRectilinearAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([AnnotationLineMeasureRectilinearAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([AnnotationLineMeasureRectilinearSlopeItem::class])] - public ?array $slope; - - /** - * @var ?AnnotationLineMeasureRectilinearOrigin $origin - */ - #[JsonProperty('origin')] - public ?AnnotationLineMeasureRectilinearOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?AnnotationLineMeasureRectilinearOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ratio = $values['ratio'] ?? null; - $this->x = $values['x']; - $this->y = $values['y'] ?? null; - $this->distance = $values['distance']; - $this->area = $values['area']; - $this->angle = $values['angle'] ?? null; - $this->slope = $values['slope'] ?? null; - $this->origin = $values['origin'] ?? null; - $this->cyx = $values['cyx'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearAngleItem.php b/src/Types/AnnotationLineMeasureRectilinearAngleItem.php deleted file mode 100644 index 699075f2..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearAngleItemFraction.php deleted file mode 100644 index 44be064d..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearAreaItemFraction.php deleted file mode 100644 index 7aecd670..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearDistanceItemFraction.php deleted file mode 100644 index ee39b3f1..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationLineMeasureRectilinearSlopeItem.php deleted file mode 100644 index 32bdb9c1..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearSlopeItemFraction.php deleted file mode 100644 index b6acd1e5..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearXItemFraction.php deleted file mode 100644 index 6067be28..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationLineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationLineMeasureRectilinearYItemFraction.php deleted file mode 100644 index a93ebb04..00000000 --- a/src/Types/AnnotationLineMeasureRectilinearYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/AnnotationLink.php b/src/Types/AnnotationLink.php index 447800ef..6ca3b03a 100644 --- a/src/Types/AnnotationLink.php +++ b/src/Types/AnnotationLink.php @@ -197,7 +197,7 @@ class AnnotationLink extends JsonSerializableType public ?PdfAnnotationActions $actions; /** - * @var ?PdfLinkTarget $target + * @var ?PdfLinkTarget $target Where a link goes, by its `kind`. A newer server can add kinds: read one your client doesn't know as `unsupported`. */ #[JsonProperty('target')] public ?PdfLinkTarget $target; diff --git a/src/Types/AnnotationMutationMeta.php b/src/Types/AnnotationMutationMeta.php index 576d02e8..3fd823b9 100644 --- a/src/Types/AnnotationMutationMeta.php +++ b/src/Types/AnnotationMutationMeta.php @@ -39,17 +39,17 @@ class AnnotationMutationMeta extends JsonSerializableType public ?array $missingCharacters; /** - * @var array $changed + * @var array $changedRefs */ - #[JsonProperty('changed'), ArrayType([AnnotationRef::class])] - public array $changed; + #[JsonProperty('changedRefs'), ArrayType([AnnotationRef::class])] + public array $changedRefs; /** * @param array{ * affectedPages: array, * opId: string, * undoable: bool, - * changed: array, + * changedRefs: array, * cacheDelta?: ?CacheDelta, * missingCharacters?: ?array, * } $values @@ -62,7 +62,7 @@ public function __construct( $this->opId = $values['opId']; $this->undoable = $values['undoable']; $this->missingCharacters = $values['missingCharacters'] ?? null; - $this->changed = $values['changed']; + $this->changedRefs = $values['changedRefs']; } /** diff --git a/src/Types/AnnotationPolygon.php b/src/Types/AnnotationPolygon.php index 9bbd5eee..cb689dc2 100644 --- a/src/Types/AnnotationPolygon.php +++ b/src/Types/AnnotationPolygon.php @@ -269,10 +269,10 @@ class AnnotationPolygon extends JsonSerializableType public ?string $intent; /** - * @var ?AnnotationPolygonMeasure $measure + * @var ?PdfMeasurement $measure A measure, by its `subtype`. A newer server can add subtypes: read one your client doesn't know as `unknown`. */ #[JsonProperty('measure')] - public ?AnnotationPolygonMeasure $measure; + public ?PdfMeasurement $measure; /** * @var ?float $cloudyIntensity @@ -325,7 +325,7 @@ class AnnotationPolygon extends JsonSerializableType * captionEnabled?: ?bool, * captionCenter?: ?AnnotationPolygonCaptionCenter, * intent?: ?value-of, - * measure?: ?AnnotationPolygonMeasure, + * measure?: ?PdfMeasurement, * cloudyIntensity?: ?float, * } $values */ diff --git a/src/Types/AnnotationPolygonMeasure.php b/src/Types/AnnotationPolygonMeasure.php deleted file mode 100644 index f1259dd0..00000000 --- a/src/Types/AnnotationPolygonMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param AnnotationPolygonMeasureRectilinear $rectilinear - * @return AnnotationPolygonMeasure - */ - public static function rectilinear(AnnotationPolygonMeasureRectilinear $rectilinear): AnnotationPolygonMeasure - { - return new AnnotationPolygonMeasure([ - 'subtype' => 'rectilinear', - 'value' => $rectilinear, - ]); - } - - /** - * @param AnnotationPolygonMeasureGeospatial $geospatial - * @return AnnotationPolygonMeasure - */ - public static function geospatial(AnnotationPolygonMeasureGeospatial $geospatial): AnnotationPolygonMeasure - { - return new AnnotationPolygonMeasure([ - 'subtype' => 'geospatial', - 'value' => $geospatial, - ]); - } - - /** - * @param AnnotationPolygonMeasureUnknown $unknown - * @return AnnotationPolygonMeasure - */ - public static function unknown(AnnotationPolygonMeasureUnknown $unknown): AnnotationPolygonMeasure - { - return new AnnotationPolygonMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRectilinear(): bool - { - return $this->value instanceof AnnotationPolygonMeasureRectilinear && $this->subtype === 'rectilinear'; - } - - /** - * @return AnnotationPolygonMeasureRectilinear - */ - public function asRectilinear(): AnnotationPolygonMeasureRectilinear - { - if (!($this->value instanceof AnnotationPolygonMeasureRectilinear && $this->subtype === 'rectilinear')) { - throw new Exception( - "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeospatial(): bool - { - return $this->value instanceof AnnotationPolygonMeasureGeospatial && $this->subtype === 'geospatial'; - } - - /** - * @return AnnotationPolygonMeasureGeospatial - */ - public function asGeospatial(): AnnotationPolygonMeasureGeospatial - { - if (!($this->value instanceof AnnotationPolygonMeasureGeospatial && $this->subtype === 'geospatial')) { - throw new Exception( - "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof AnnotationPolygonMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return AnnotationPolygonMeasureUnknown - */ - public function asUnknown(): AnnotationPolygonMeasureUnknown - { - if (!($this->value instanceof AnnotationPolygonMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'rectilinear': - $value = $this->asRectilinear()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'geospatial': - $value = $this->asGeospatial()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'rectilinear': - $args['value'] = AnnotationPolygonMeasureRectilinear::jsonDeserialize($data); - break; - case 'geospatial': - $args['value'] = AnnotationPolygonMeasureGeospatial::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = AnnotationPolygonMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/AnnotationPolygonMeasureGeospatial.php b/src/Types/AnnotationPolygonMeasureGeospatial.php deleted file mode 100644 index cd0baf97..00000000 --- a/src/Types/AnnotationPolygonMeasureGeospatial.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinear.php b/src/Types/AnnotationPolygonMeasureRectilinear.php deleted file mode 100644 index f810454e..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinear.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([AnnotationPolygonMeasureRectilinearXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([AnnotationPolygonMeasureRectilinearYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([AnnotationPolygonMeasureRectilinearDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([AnnotationPolygonMeasureRectilinearAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([AnnotationPolygonMeasureRectilinearAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([AnnotationPolygonMeasureRectilinearSlopeItem::class])] - public ?array $slope; - - /** - * @var ?AnnotationPolygonMeasureRectilinearOrigin $origin - */ - #[JsonProperty('origin')] - public ?AnnotationPolygonMeasureRectilinearOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?AnnotationPolygonMeasureRectilinearOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ratio = $values['ratio'] ?? null; - $this->x = $values['x']; - $this->y = $values['y'] ?? null; - $this->distance = $values['distance']; - $this->area = $values['area']; - $this->angle = $values['angle'] ?? null; - $this->slope = $values['slope'] ?? null; - $this->origin = $values['origin'] ?? null; - $this->cyx = $values['cyx'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearAngleItem.php b/src/Types/AnnotationPolygonMeasureRectilinearAngleItem.php deleted file mode 100644 index 1cfe5b4c..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearAngleItemFraction.php deleted file mode 100644 index aa3a1a8f..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearAreaItemFraction.php deleted file mode 100644 index 2252e09e..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearDistanceItemFraction.php deleted file mode 100644 index 9ffc86a4..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItem.php deleted file mode 100644 index 769e4e0b..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearSlopeItemFraction.php deleted file mode 100644 index e3b46977..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearXItemFraction.php deleted file mode 100644 index 9d2f2806..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolygonMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPolygonMeasureRectilinearYItemFraction.php deleted file mode 100644 index 1f7741f4..00000000 --- a/src/Types/AnnotationPolygonMeasureRectilinearYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/AnnotationPolyline.php b/src/Types/AnnotationPolyline.php index 65ecec73..b6522752 100644 --- a/src/Types/AnnotationPolyline.php +++ b/src/Types/AnnotationPolyline.php @@ -269,10 +269,10 @@ class AnnotationPolyline extends JsonSerializableType public ?string $intent; /** - * @var ?AnnotationPolylineMeasure $measure + * @var ?PdfMeasurement $measure A measure, by its `subtype`. A newer server can add subtypes: read one your client doesn't know as `unknown`. */ #[JsonProperty('measure')] - public ?AnnotationPolylineMeasure $measure; + public ?PdfMeasurement $measure; /** * @var AnnotationPolylineLineEndings $lineEndings @@ -326,7 +326,7 @@ class AnnotationPolyline extends JsonSerializableType * captionEnabled?: ?bool, * captionCenter?: ?AnnotationPolylineCaptionCenter, * intent?: ?value-of, - * measure?: ?AnnotationPolylineMeasure, + * measure?: ?PdfMeasurement, * } $values */ public function __construct( diff --git a/src/Types/AnnotationPolylineMeasure.php b/src/Types/AnnotationPolylineMeasure.php deleted file mode 100644 index 9ab5f942..00000000 --- a/src/Types/AnnotationPolylineMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param AnnotationPolylineMeasureRectilinear $rectilinear - * @return AnnotationPolylineMeasure - */ - public static function rectilinear(AnnotationPolylineMeasureRectilinear $rectilinear): AnnotationPolylineMeasure - { - return new AnnotationPolylineMeasure([ - 'subtype' => 'rectilinear', - 'value' => $rectilinear, - ]); - } - - /** - * @param AnnotationPolylineMeasureGeospatial $geospatial - * @return AnnotationPolylineMeasure - */ - public static function geospatial(AnnotationPolylineMeasureGeospatial $geospatial): AnnotationPolylineMeasure - { - return new AnnotationPolylineMeasure([ - 'subtype' => 'geospatial', - 'value' => $geospatial, - ]); - } - - /** - * @param AnnotationPolylineMeasureUnknown $unknown - * @return AnnotationPolylineMeasure - */ - public static function unknown(AnnotationPolylineMeasureUnknown $unknown): AnnotationPolylineMeasure - { - return new AnnotationPolylineMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRectilinear(): bool - { - return $this->value instanceof AnnotationPolylineMeasureRectilinear && $this->subtype === 'rectilinear'; - } - - /** - * @return AnnotationPolylineMeasureRectilinear - */ - public function asRectilinear(): AnnotationPolylineMeasureRectilinear - { - if (!($this->value instanceof AnnotationPolylineMeasureRectilinear && $this->subtype === 'rectilinear')) { - throw new Exception( - "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeospatial(): bool - { - return $this->value instanceof AnnotationPolylineMeasureGeospatial && $this->subtype === 'geospatial'; - } - - /** - * @return AnnotationPolylineMeasureGeospatial - */ - public function asGeospatial(): AnnotationPolylineMeasureGeospatial - { - if (!($this->value instanceof AnnotationPolylineMeasureGeospatial && $this->subtype === 'geospatial')) { - throw new Exception( - "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof AnnotationPolylineMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return AnnotationPolylineMeasureUnknown - */ - public function asUnknown(): AnnotationPolylineMeasureUnknown - { - if (!($this->value instanceof AnnotationPolylineMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'rectilinear': - $value = $this->asRectilinear()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'geospatial': - $value = $this->asGeospatial()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'rectilinear': - $args['value'] = AnnotationPolylineMeasureRectilinear::jsonDeserialize($data); - break; - case 'geospatial': - $args['value'] = AnnotationPolylineMeasureGeospatial::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = AnnotationPolylineMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/AnnotationPolylineMeasureGeospatial.php b/src/Types/AnnotationPolylineMeasureGeospatial.php deleted file mode 100644 index 709d8ee3..00000000 --- a/src/Types/AnnotationPolylineMeasureGeospatial.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinear.php b/src/Types/AnnotationPolylineMeasureRectilinear.php deleted file mode 100644 index e071b913..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinear.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([AnnotationPolylineMeasureRectilinearXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([AnnotationPolylineMeasureRectilinearYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([AnnotationPolylineMeasureRectilinearDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([AnnotationPolylineMeasureRectilinearAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([AnnotationPolylineMeasureRectilinearAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([AnnotationPolylineMeasureRectilinearSlopeItem::class])] - public ?array $slope; - - /** - * @var ?AnnotationPolylineMeasureRectilinearOrigin $origin - */ - #[JsonProperty('origin')] - public ?AnnotationPolylineMeasureRectilinearOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?AnnotationPolylineMeasureRectilinearOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ratio = $values['ratio'] ?? null; - $this->x = $values['x']; - $this->y = $values['y'] ?? null; - $this->distance = $values['distance']; - $this->area = $values['area']; - $this->angle = $values['angle'] ?? null; - $this->slope = $values['slope'] ?? null; - $this->origin = $values['origin'] ?? null; - $this->cyx = $values['cyx'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearAngleItem.php b/src/Types/AnnotationPolylineMeasureRectilinearAngleItem.php deleted file mode 100644 index 3cce4d32..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearAngleItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearAngleItemFraction.php deleted file mode 100644 index 6a96edcf..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearAreaItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearAreaItemFraction.php deleted file mode 100644 index cb57b8d6..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearDistanceItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearDistanceItemFraction.php deleted file mode 100644 index 5205e8af..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearSlopeItem.php b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItem.php deleted file mode 100644 index 0070a519..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearSlopeItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearSlopeItemFraction.php deleted file mode 100644 index c598e094..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearXItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearXItemFraction.php deleted file mode 100644 index 650c5a5b..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/AnnotationPolylineMeasureRectilinearYItemFraction.php b/src/Types/AnnotationPolylineMeasureRectilinearYItemFraction.php deleted file mode 100644 index 0e25c352..00000000 --- a/src/Types/AnnotationPolylineMeasureRectilinearYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/Attachment.php b/src/Types/Attachment.php index e54289e8..7c292c5e 100644 --- a/src/Types/Attachment.php +++ b/src/Types/Attachment.php @@ -34,16 +34,16 @@ class Attachment extends JsonSerializableType public ?string $description; /** - * @var ?int $size + * @var ?int $sizeBytes */ - #[JsonProperty('size')] - public ?int $size; + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; /** - * @var ?string $checksum + * @var ?string $md5 */ - #[JsonProperty('checksum')] - public ?string $checksum; + #[JsonProperty('md5')] + public ?string $md5; /** * @var ?DateTime $createdAt @@ -70,8 +70,8 @@ class Attachment extends JsonSerializableType * index: int, * mimeType?: ?string, * description?: ?string, - * size?: ?int, - * checksum?: ?string, + * sizeBytes?: ?int, + * md5?: ?string, * createdAt?: ?DateTime, * modifiedAt?: ?DateTime, * } $values @@ -83,8 +83,8 @@ public function __construct( $this->name = $values['name']; $this->mimeType = $values['mimeType'] ?? null; $this->description = $values['description'] ?? null; - $this->size = $values['size'] ?? null; - $this->checksum = $values['checksum'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->md5 = $values['md5'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->modifiedAt = $values['modifiedAt'] ?? null; $this->index = $values['index']; diff --git a/src/Types/AttachmentFileInfo.php b/src/Types/AttachmentFileInfo.php index 39d96dd9..665e709b 100644 --- a/src/Types/AttachmentFileInfo.php +++ b/src/Types/AttachmentFileInfo.php @@ -28,16 +28,16 @@ class AttachmentFileInfo extends JsonSerializableType public ?string $description; /** - * @var ?int $size + * @var ?int $sizeBytes */ - #[JsonProperty('size')] - public ?int $size; + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; /** - * @var ?string $checksum + * @var ?string $md5 */ - #[JsonProperty('checksum')] - public ?string $checksum; + #[JsonProperty('md5')] + public ?string $md5; /** * @var ?DateTime $createdAt @@ -56,8 +56,8 @@ class AttachmentFileInfo extends JsonSerializableType * name: string, * mimeType?: ?string, * description?: ?string, - * size?: ?int, - * checksum?: ?string, + * sizeBytes?: ?int, + * md5?: ?string, * createdAt?: ?DateTime, * modifiedAt?: ?DateTime, * } $values @@ -68,8 +68,8 @@ public function __construct( $this->name = $values['name']; $this->mimeType = $values['mimeType'] ?? null; $this->description = $values['description'] ?? null; - $this->size = $values['size'] ?? null; - $this->checksum = $values['checksum'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->md5 = $values['md5'] ?? null; $this->createdAt = $values['createdAt'] ?? null; $this->modifiedAt = $values['modifiedAt'] ?? null; } diff --git a/src/Types/AttachmentMutationMeta.php b/src/Types/AttachmentMutationMeta.php index e08231f8..331c5726 100644 --- a/src/Types/AttachmentMutationMeta.php +++ b/src/Types/AttachmentMutationMeta.php @@ -39,17 +39,17 @@ class AttachmentMutationMeta extends JsonSerializableType public ?array $missingCharacters; /** - * @var array $changed + * @var array $changedRefs */ - #[JsonProperty('changed'), ArrayType([AttachmentRef::class])] - public array $changed; + #[JsonProperty('changedRefs'), ArrayType([AttachmentRef::class])] + public array $changedRefs; /** * @param array{ * affectedPages: array, * opId: string, * undoable: bool, - * changed: array, + * changedRefs: array, * cacheDelta?: ?CacheDelta, * missingCharacters?: ?array, * } $values @@ -62,7 +62,7 @@ public function __construct( $this->opId = $values['opId']; $this->undoable = $values['undoable']; $this->missingCharacters = $values['missingCharacters'] ?? null; - $this->changed = $values['changed']; + $this->changedRefs = $values['changedRefs']; } /** diff --git a/src/Types/CacheDelta.php b/src/Types/CacheDelta.php index 1ee21b44..00b8e14e 100644 --- a/src/Types/CacheDelta.php +++ b/src/Types/CacheDelta.php @@ -62,6 +62,12 @@ class CacheDelta extends JsonSerializableType #[JsonProperty('fontsVersion')] public ?int $fontsVersion; + /** + * @var ?int $contentsVersion + */ + #[JsonProperty('contentsVersion')] + public ?int $contentsVersion; + /** * @var ?int $layerVersion */ @@ -92,6 +98,7 @@ class CacheDelta extends JsonSerializableType * attachmentsVersion?: ?int, * outlineVersion?: ?int, * fontsVersion?: ?int, + * contentsVersion?: ?int, * layerVersion?: ?int, * working?: ?bool, * } $values @@ -108,6 +115,7 @@ public function __construct( $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; $this->outlineVersion = $values['outlineVersion'] ?? null; $this->fontsVersion = $values['fontsVersion'] ?? null; + $this->contentsVersion = $values['contentsVersion'] ?? null; $this->layerVersion = $values['layerVersion'] ?? null; $this->working = $values['working'] ?? null; $this->pages = $values['pages']; diff --git a/src/Types/ChangeItemFormsDeleteWidget.php b/src/Types/ChangeItemFormsDeleteWidget.php index d9c22cc1..a864667c 100644 --- a/src/Types/ChangeItemFormsDeleteWidget.php +++ b/src/Types/ChangeItemFormsDeleteWidget.php @@ -20,7 +20,7 @@ class ChangeItemFormsDeleteWidget extends JsonSerializableType public PageRef $page; /** - * @var ?FormField $field + * @var ?FormField $field A form field, by its `family`. A newer server can add families: read one your client doesn't know as `unknown`, keeping the fields every field has, with `rawValue` an empty string when the body has none. */ #[JsonProperty('field')] public ?FormField $field; diff --git a/src/Types/ChangeItemFormsRestoreWidget.php b/src/Types/ChangeItemFormsRestoreWidget.php index 1bd0433d..fc33f4d1 100644 --- a/src/Types/ChangeItemFormsRestoreWidget.php +++ b/src/Types/ChangeItemFormsRestoreWidget.php @@ -9,7 +9,7 @@ class ChangeItemFormsRestoreWidget extends JsonSerializableType { /** - * @var ?FormField $field + * @var ?FormField $field A form field, by its `family`. A newer server can add families: read one your client doesn't know as `unknown`, keeping the fields every field has, with `rawValue` an empty string when the body has none. */ #[JsonProperty('field')] public ?FormField $field; diff --git a/src/Types/ChangeItemPagesCopyLayoutPagesItem.php b/src/Types/ChangeItemPagesCopyLayoutPagesItem.php index be7632a7..8972948d 100644 --- a/src/Types/ChangeItemPagesCopyLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesCopyLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesCopyLayoutPagesItem extends JsonSerializableType public ChangeItemPagesCopyLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesCopyLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesCopyLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesCopyLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesCopyLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php b/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php index c2cc134a..2798487e 100644 --- a/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesDeleteLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesDeleteLayoutPagesItem extends JsonSerializableType public ChangeItemPagesDeleteLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesDeleteLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesDeleteLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesDeleteLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesDeleteLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php index a99ea830..42783999 100644 --- a/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesInsertBlankLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesInsertBlankLayoutPagesItem extends JsonSerializableType public ChangeItemPagesInsertBlankLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesInsertBlankLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesInsertBlankLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesInsertBlankLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesInsertBlankLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesInsertLayoutPagesItem.php b/src/Types/ChangeItemPagesInsertLayoutPagesItem.php index c5eac391..4067e56c 100644 --- a/src/Types/ChangeItemPagesInsertLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesInsertLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType public ChangeItemPagesInsertLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesInsertLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesInsertLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesInsertLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesInsertLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesReorderLayoutPagesItem.php b/src/Types/ChangeItemPagesReorderLayoutPagesItem.php index ef58dda2..fbbdef0a 100644 --- a/src/Types/ChangeItemPagesReorderLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesReorderLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesReorderLayoutPagesItem extends JsonSerializableType public ChangeItemPagesReorderLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesReorderLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesReorderLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesReorderLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesReorderLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php b/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php index 8321b1e4..0aadf0ba 100644 --- a/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesRestoreLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesRestoreLayoutPagesItem extends JsonSerializableType public ChangeItemPagesRestoreLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesRestoreLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesRestoreLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesRestoreLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesRestoreLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeItemPagesRotate.php b/src/Types/ChangeItemPagesRotate.php index 2ab8f46d..95305253 100644 --- a/src/Types/ChangeItemPagesRotate.php +++ b/src/Types/ChangeItemPagesRotate.php @@ -15,10 +15,10 @@ class ChangeItemPagesRotate extends JsonSerializableType public array $pages; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var ChangeItemPagesRotateLayout $layout @@ -35,7 +35,7 @@ class ChangeItemPagesRotate extends JsonSerializableType /** * @param array{ * pages: array, - * rotation: float, + * rotation: int, * layout: ChangeItemPagesRotateLayout, * meta: MutationMeta, * } $values diff --git a/src/Types/ChangeItemPagesRotateLayoutPagesItem.php b/src/Types/ChangeItemPagesRotateLayoutPagesItem.php index ad773096..ecfa9536 100644 --- a/src/Types/ChangeItemPagesRotateLayoutPagesItem.php +++ b/src/Types/ChangeItemPagesRotateLayoutPagesItem.php @@ -32,10 +32,10 @@ class ChangeItemPagesRotateLayoutPagesItem extends JsonSerializableType public ChangeItemPagesRotateLayoutPagesItemSize $size; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @var float $userUnit @@ -72,7 +72,7 @@ class ChangeItemPagesRotateLayoutPagesItem extends JsonSerializableType * index: int, * ref: PageRef, * size: ChangeItemPagesRotateLayoutPagesItemSize, - * rotation: float, + * rotation: int, * userUnit: float, * boxes: ChangeItemPagesRotateLayoutPagesItemBoxes, * pdfCropBox: ChangeItemPagesRotateLayoutPagesItemPdfCropBox, diff --git a/src/Types/ChangeOpPagesRotate.php b/src/Types/ChangeOpPagesRotate.php index 59bb698e..fda4cfb7 100644 --- a/src/Types/ChangeOpPagesRotate.php +++ b/src/Types/ChangeOpPagesRotate.php @@ -15,15 +15,15 @@ class ChangeOpPagesRotate extends JsonSerializableType public array $pages; /** - * @var float $rotation + * @var int $rotation */ #[JsonProperty('rotation')] - public float $rotation; + public int $rotation; /** * @param array{ * pages: array, - * rotation: float, + * rotation: int, * } $values */ public function __construct( diff --git a/src/Types/DeploymentLicenseStatusResponse.php b/src/Types/DeploymentLicenseStatusResponse.php index 2205c668..5a905aac 100644 --- a/src/Types/DeploymentLicenseStatusResponse.php +++ b/src/Types/DeploymentLicenseStatusResponse.php @@ -4,38 +4,39 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; class DeploymentLicenseStatusResponse extends JsonSerializableType { /** - * @var mixed $license + * @var array $license */ - #[JsonProperty('license')] - public mixed $license; + #[JsonProperty('license'), ArrayType(['string' => 'mixed'])] + public array $license; /** - * @var mixed $reporting + * @var ?array $reporting */ - #[JsonProperty('reporting')] - public mixed $reporting; + #[JsonProperty('reporting'), ArrayType(['string' => 'mixed'])] + public ?array $reporting; /** - * @var mixed $usage + * @var ?array $usage */ - #[JsonProperty('usage')] - public mixed $usage; + #[JsonProperty('usage'), ArrayType(['string' => 'mixed'])] + public ?array $usage; /** * @param array{ - * license?: mixed, - * reporting?: mixed, - * usage?: mixed, + * license: array, + * reporting?: ?array, + * usage?: ?array, * } $values */ public function __construct( - array $values = [], + array $values, ) { - $this->license = $values['license'] ?? null; + $this->license = $values['license']; $this->reporting = $values['reporting'] ?? null; $this->usage = $values['usage'] ?? null; } diff --git a/src/Types/DocAnnotationsCreate200Response.php b/src/Types/DocAnnotationsCreate200Response.php deleted file mode 100644 index e3df4b67..00000000 --- a/src/Types/DocAnnotationsCreate200Response.php +++ /dev/null @@ -1,42 +0,0 @@ -annotation = $values['annotation']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsCreateResponse.php b/src/Types/DocAnnotationsCreateResponse.php new file mode 100644 index 00000000..ef052d9e --- /dev/null +++ b/src/Types/DocAnnotationsCreateResponse.php @@ -0,0 +1,42 @@ +annotation = $values['annotation']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsDelete200Response.php b/src/Types/DocAnnotationsDelete200Response.php deleted file mode 100644 index fd0df102..00000000 --- a/src/Types/DocAnnotationsDelete200Response.php +++ /dev/null @@ -1,34 +0,0 @@ -meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsDeleteResponse.php b/src/Types/DocAnnotationsDeleteResponse.php new file mode 100644 index 00000000..7b7ee335 --- /dev/null +++ b/src/Types/DocAnnotationsDeleteResponse.php @@ -0,0 +1,34 @@ +meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsFlatten200Response.php b/src/Types/DocAnnotationsFlatten200Response.php deleted file mode 100644 index dab1661a..00000000 --- a/src/Types/DocAnnotationsFlatten200Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $usage - */ - #[JsonProperty('usage')] - public string $usage; - - /** - * @var array $results - */ - #[JsonProperty('results'), ArrayType([DocAnnotationsFlatten200ResponseResultsItem::class])] - public array $results; - - /** - * @var MutationMeta $meta - */ - #[JsonProperty('meta')] - public MutationMeta $meta; - - /** - * @param array{ - * page: PageRef, - * usage: value-of, - * results: array, - * meta: MutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->page = $values['page']; - $this->usage = $values['usage']; - $this->results = $values['results']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php b/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php deleted file mode 100644 index 0e30b7de..00000000 --- a/src/Types/DocAnnotationsFlatten200ResponseResultsItem.php +++ /dev/null @@ -1,42 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @param array{ - * ref: AnnotationRef, - * status: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ref = $values['ref']; - $this->status = $values['status']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php b/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php deleted file mode 100644 index 0a320ef5..00000000 --- a/src/Types/DocAnnotationsFlatten200ResponseResultsItemStatus.php +++ /dev/null @@ -1,9 +0,0 @@ - $usage + */ + #[JsonProperty('usage')] + public string $usage; + + /** + * @var array $results + */ + #[JsonProperty('results'), ArrayType([DocAnnotationsFlattenResponseResultsItem::class])] + public array $results; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * usage: value-of, + * results: array, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->usage = $values['usage']; + $this->results = $values['results']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsFlattenResponseResultsItem.php b/src/Types/DocAnnotationsFlattenResponseResultsItem.php new file mode 100644 index 00000000..fbbe7861 --- /dev/null +++ b/src/Types/DocAnnotationsFlattenResponseResultsItem.php @@ -0,0 +1,42 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * ref: AnnotationRef, + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ref = $values['ref']; + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsFlattenResponseResultsItemStatus.php b/src/Types/DocAnnotationsFlattenResponseResultsItemStatus.php new file mode 100644 index 00000000..ffa16ed5 --- /dev/null +++ b/src/Types/DocAnnotationsFlattenResponseResultsItemStatus.php @@ -0,0 +1,9 @@ + $order - */ - #[JsonProperty('order'), ArrayType([AnnotationRef::class])] - public array $order; - - /** - * @var AnnotationMutationMeta $meta - */ - #[JsonProperty('meta')] - public AnnotationMutationMeta $meta; - - /** - * @param array{ - * order: array, - * meta: AnnotationMutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->order = $values['order']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsReorderResponse.php b/src/Types/DocAnnotationsReorderResponse.php new file mode 100644 index 00000000..85d0a5a3 --- /dev/null +++ b/src/Types/DocAnnotationsReorderResponse.php @@ -0,0 +1,43 @@ + $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var AnnotationMutationMeta $meta + */ + #[JsonProperty('meta')] + public AnnotationMutationMeta $meta; + + /** + * @param array{ + * order: array, + * meta: AnnotationMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdate200Response.php b/src/Types/DocAnnotationsUpdate200Response.php deleted file mode 100644 index a51dae57..00000000 --- a/src/Types/DocAnnotationsUpdate200Response.php +++ /dev/null @@ -1,50 +0,0 @@ -annotation = $values['annotation']; - $this->appearance = $values['appearance']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseAppearance.php b/src/Types/DocAnnotationsUpdate200ResponseAppearance.php deleted file mode 100644 index 524d8772..00000000 --- a/src/Types/DocAnnotationsUpdate200ResponseAppearance.php +++ /dev/null @@ -1,42 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var bool $changed - */ - #[JsonProperty('changed')] - public bool $changed; - - /** - * @param array{ - * action: value-of, - * changed: bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->changed = $values['changed']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php b/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php deleted file mode 100644 index 6fa9f281..00000000 --- a/src/Types/DocAnnotationsUpdate200ResponseAppearanceAction.php +++ /dev/null @@ -1,11 +0,0 @@ -annotation = $values['annotation']; + $this->appearance = $values['appearance']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdateResponseAppearance.php b/src/Types/DocAnnotationsUpdateResponseAppearance.php new file mode 100644 index 00000000..d2016c35 --- /dev/null +++ b/src/Types/DocAnnotationsUpdateResponseAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsUpdateResponseAppearanceAction.php b/src/Types/DocAnnotationsUpdateResponseAppearanceAction.php new file mode 100644 index 00000000..020ad6ba --- /dev/null +++ b/src/Types/DocAnnotationsUpdateResponseAppearanceAction.php @@ -0,0 +1,11 @@ + $changes - */ - #[JsonProperty('changes'), ArrayType([DocChanges200ResponseChangesItem::class])] - public array $changes; - - /** - * @param array{ - * changes: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->changes = $values['changes']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocChanges200ResponseChangesItem.php b/src/Types/DocChanges200ResponseChangesItem.php deleted file mode 100644 index 124d7d5b..00000000 --- a/src/Types/DocChanges200ResponseChangesItem.php +++ /dev/null @@ -1,196 +0,0 @@ -status = $values['status']; - $this->value = $values['value']; - } - - /** - * @param DocChanges200ResponseChangesItemApplied $applied - * @return DocChanges200ResponseChangesItem - */ - public static function applied(DocChanges200ResponseChangesItemApplied $applied): DocChanges200ResponseChangesItem - { - return new DocChanges200ResponseChangesItem([ - 'status' => 'applied', - 'value' => $applied, - ]); - } - - /** - * @param DocChanges200ResponseChangesItemRefused $refused - * @return DocChanges200ResponseChangesItem - */ - public static function refused(DocChanges200ResponseChangesItemRefused $refused): DocChanges200ResponseChangesItem - { - return new DocChanges200ResponseChangesItem([ - 'status' => 'refused', - 'value' => $refused, - ]); - } - - /** - * @return bool - */ - public function isApplied(): bool - { - return $this->value instanceof DocChanges200ResponseChangesItemApplied && $this->status === 'applied'; - } - - /** - * @return DocChanges200ResponseChangesItemApplied - */ - public function asApplied(): DocChanges200ResponseChangesItemApplied - { - if (!($this->value instanceof DocChanges200ResponseChangesItemApplied && $this->status === 'applied')) { - throw new Exception( - "Expected applied; got " . $this->status . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isRefused(): bool - { - return $this->value instanceof DocChanges200ResponseChangesItemRefused && $this->status === 'refused'; - } - - /** - * @return DocChanges200ResponseChangesItemRefused - */ - public function asRefused(): DocChanges200ResponseChangesItemRefused - { - if (!($this->value instanceof DocChanges200ResponseChangesItemRefused && $this->status === 'refused')) { - throw new Exception( - "Expected refused; got " . $this->status . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['status'] = $this->status; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->status) { - case 'applied': - $value = $this->asApplied()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'refused': - $value = $this->asRefused()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('status', $data)) { - throw new Exception( - "JSON data is missing property 'status'", - ); - } - $status = $data['status']; - if (!(is_string($status))) { - throw new Exception( - "Expected property 'status' in JSON data to be string, instead received " . get_debug_type($data['status']), - ); - } - - $args['status'] = $status; - switch ($status) { - case 'applied': - $args['value'] = DocChanges200ResponseChangesItemApplied::jsonDeserialize($data); - break; - case 'refused': - $args['value'] = DocChanges200ResponseChangesItemRefused::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['status'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocChanges200ResponseChangesItemApplied.php b/src/Types/DocChanges200ResponseChangesItemApplied.php deleted file mode 100644 index 88aaff3a..00000000 --- a/src/Types/DocChanges200ResponseChangesItemApplied.php +++ /dev/null @@ -1,42 +0,0 @@ -opId = $values['opId']; - $this->result = $values['result']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocChanges200ResponseChangesItemRefused.php b/src/Types/DocChanges200ResponseChangesItemRefused.php deleted file mode 100644 index c11f1c70..00000000 --- a/src/Types/DocChanges200ResponseChangesItemRefused.php +++ /dev/null @@ -1,42 +0,0 @@ -opId = $values['opId']; - $this->error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocChangesResponse.php b/src/Types/DocChangesResponse.php new file mode 100644 index 00000000..ebf6ea94 --- /dev/null +++ b/src/Types/DocChangesResponse.php @@ -0,0 +1,35 @@ + $changes + */ + #[JsonProperty('changes'), ArrayType([DocChangesResponseChangesItem::class])] + public array $changes; + + /** + * @param array{ + * changes: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->changes = $values['changes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocChangesResponseChangesItem.php b/src/Types/DocChangesResponseChangesItem.php new file mode 100644 index 00000000..c625dced --- /dev/null +++ b/src/Types/DocChangesResponseChangesItem.php @@ -0,0 +1,196 @@ +status = $values['status']; + $this->value = $values['value']; + } + + /** + * @param DocChangesResponseChangesItemApplied $applied + * @return DocChangesResponseChangesItem + */ + public static function applied(DocChangesResponseChangesItemApplied $applied): DocChangesResponseChangesItem + { + return new DocChangesResponseChangesItem([ + 'status' => 'applied', + 'value' => $applied, + ]); + } + + /** + * @param DocChangesResponseChangesItemRefused $refused + * @return DocChangesResponseChangesItem + */ + public static function refused(DocChangesResponseChangesItemRefused $refused): DocChangesResponseChangesItem + { + return new DocChangesResponseChangesItem([ + 'status' => 'refused', + 'value' => $refused, + ]); + } + + /** + * @return bool + */ + public function isApplied(): bool + { + return $this->value instanceof DocChangesResponseChangesItemApplied && $this->status === 'applied'; + } + + /** + * @return DocChangesResponseChangesItemApplied + */ + public function asApplied(): DocChangesResponseChangesItemApplied + { + if (!($this->value instanceof DocChangesResponseChangesItemApplied && $this->status === 'applied')) { + throw new Exception( + "Expected applied; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isRefused(): bool + { + return $this->value instanceof DocChangesResponseChangesItemRefused && $this->status === 'refused'; + } + + /** + * @return DocChangesResponseChangesItemRefused + */ + public function asRefused(): DocChangesResponseChangesItemRefused + { + if (!($this->value instanceof DocChangesResponseChangesItemRefused && $this->status === 'refused')) { + throw new Exception( + "Expected refused; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['status'] = $this->status; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->status) { + case 'applied': + $value = $this->asApplied()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'refused': + $value = $this->asRefused()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('status', $data)) { + throw new Exception( + "JSON data is missing property 'status'", + ); + } + $status = $data['status']; + if (!(is_string($status))) { + throw new Exception( + "Expected property 'status' in JSON data to be string, instead received " . get_debug_type($data['status']), + ); + } + + $args['status'] = $status; + switch ($status) { + case 'applied': + $args['value'] = DocChangesResponseChangesItemApplied::jsonDeserialize($data); + break; + case 'refused': + $args['value'] = DocChangesResponseChangesItemRefused::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['status'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocChangesResponseChangesItemApplied.php b/src/Types/DocChangesResponseChangesItemApplied.php new file mode 100644 index 00000000..d8f193c5 --- /dev/null +++ b/src/Types/DocChangesResponseChangesItemApplied.php @@ -0,0 +1,42 @@ +opId = $values['opId']; + $this->result = $values['result']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocChangesResponseChangesItemRefused.php b/src/Types/DocChangesResponseChangesItemRefused.php new file mode 100644 index 00000000..eb9e6ca8 --- /dev/null +++ b/src/Types/DocChangesResponseChangesItemRefused.php @@ -0,0 +1,42 @@ +opId = $values['opId']; + $this->error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocDownloadLink200Response.php b/src/Types/DocDownloadLink200Response.php deleted file mode 100644 index 96342163..00000000 --- a/src/Types/DocDownloadLink200Response.php +++ /dev/null @@ -1,42 +0,0 @@ -url = $values['url']; - $this->expiresAt = $values['expiresAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocDownloadLinkResponse.php b/src/Types/DocDownloadLinkResponse.php new file mode 100644 index 00000000..2adfb27c --- /dev/null +++ b/src/Types/DocDownloadLinkResponse.php @@ -0,0 +1,44 @@ +url = $values['url']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsDeleteWidget200Response.php b/src/Types/DocFormsDeleteWidget200Response.php deleted file mode 100644 index b1cd846b..00000000 --- a/src/Types/DocFormsDeleteWidget200Response.php +++ /dev/null @@ -1,58 +0,0 @@ -widget = $values['widget']; - $this->page = $values['page']; - $this->field = $values['field'] ?? null; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsDeleteWidgetResponse.php b/src/Types/DocFormsDeleteWidgetResponse.php new file mode 100644 index 00000000..fd49b6c0 --- /dev/null +++ b/src/Types/DocFormsDeleteWidgetResponse.php @@ -0,0 +1,58 @@ +widget = $values['widget']; + $this->page = $values['page']; + $this->field = $values['field'] ?? null; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsList200Response.php b/src/Types/DocFormsList200Response.php deleted file mode 100644 index f06bd5f2..00000000 --- a/src/Types/DocFormsList200Response.php +++ /dev/null @@ -1,68 +0,0 @@ - $formKind - */ - #[JsonProperty('formKind')] - public string $formKind; - - /** - * @var bool $needsAppearances - */ - #[JsonProperty('needsAppearances')] - public bool $needsAppearances; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType([FormField::class])] - public array $fields; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] - public array $widgets; - - /** - * @var array $calculationOrder - */ - #[JsonProperty('calculationOrder'), ArrayType([new Union(FormFieldRef::class, 'null')])] - public array $calculationOrder; - - /** - * @param array{ - * formKind: value-of, - * needsAppearances: bool, - * fields: array, - * widgets: array, - * calculationOrder: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->formKind = $values['formKind']; - $this->needsAppearances = $values['needsAppearances']; - $this->fields = $values['fields']; - $this->widgets = $values['widgets']; - $this->calculationOrder = $values['calculationOrder']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsList200ResponseFormKind.php b/src/Types/DocFormsList200ResponseFormKind.php deleted file mode 100644 index 1f754b9a..00000000 --- a/src/Types/DocFormsList200ResponseFormKind.php +++ /dev/null @@ -1,10 +0,0 @@ - $formKind + */ + #[JsonProperty('formKind')] + public string $formKind; + + /** + * @var bool $needsAppearances + */ + #[JsonProperty('needsAppearances')] + public bool $needsAppearances; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var array $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([new Union(FormFieldRef::class, 'null')])] + public array $calculationOrder; + + /** + * @param array{ + * formKind: value-of, + * needsAppearances: bool, + * fields: array, + * widgets: array, + * calculationOrder: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->formKind = $values['formKind']; + $this->needsAppearances = $values['needsAppearances']; + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; + $this->calculationOrder = $values['calculationOrder']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsListResponseFormKind.php b/src/Types/DocFormsListResponseFormKind.php new file mode 100644 index 00000000..47ae79b4 --- /dev/null +++ b/src/Types/DocFormsListResponseFormKind.php @@ -0,0 +1,10 @@ + $calculationOrder - */ - #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] - public array $calculationOrder; - - /** - * @var FormMutationMeta $meta - */ - #[JsonProperty('meta')] - public FormMutationMeta $meta; - - /** - * @param array{ - * calculationOrder: array, - * meta: FormMutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->calculationOrder = $values['calculationOrder']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReorderCalculationsResponse.php b/src/Types/DocFormsReorderCalculationsResponse.php new file mode 100644 index 00000000..42e0463f --- /dev/null +++ b/src/Types/DocFormsReorderCalculationsResponse.php @@ -0,0 +1,43 @@ + $calculationOrder + */ + #[JsonProperty('calculationOrder'), ArrayType([FormFieldRef::class])] + public array $calculationOrder; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * calculationOrder: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->calculationOrder = $values['calculationOrder']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReorderWidgets200Response.php b/src/Types/DocFormsReorderWidgets200Response.php deleted file mode 100644 index 70cb39f8..00000000 --- a/src/Types/DocFormsReorderWidgets200Response.php +++ /dev/null @@ -1,51 +0,0 @@ - $order - */ - #[JsonProperty('order'), ArrayType([AnnotationRef::class])] - public array $order; - - /** - * @var FormMutationMeta $meta - */ - #[JsonProperty('meta')] - public FormMutationMeta $meta; - - /** - * @param array{ - * page: PageRef, - * order: array, - * meta: FormMutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->page = $values['page']; - $this->order = $values['order']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsReorderWidgetsResponse.php b/src/Types/DocFormsReorderWidgetsResponse.php new file mode 100644 index 00000000..9c8425d9 --- /dev/null +++ b/src/Types/DocFormsReorderWidgetsResponse.php @@ -0,0 +1,51 @@ + $order + */ + #[JsonProperty('order'), ArrayType([AnnotationRef::class])] + public array $order; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * page: PageRef, + * order: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->order = $values['order']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsReset200Response.php b/src/Types/DocFormsReset200Response.php deleted file mode 100644 index 1e0f1a7e..00000000 --- a/src/Types/DocFormsReset200Response.php +++ /dev/null @@ -1,51 +0,0 @@ - $fields - */ - #[JsonProperty('fields'), ArrayType([FormField::class])] - public array $fields; - - /** - * @var array $widgets - */ - #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] - public array $widgets; - - /** - * @var FormMutationMeta $meta - */ - #[JsonProperty('meta')] - public FormMutationMeta $meta; - - /** - * @param array{ - * fields: array, - * widgets: array, - * meta: FormMutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->widgets = $values['widgets']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsResetResponse.php b/src/Types/DocFormsResetResponse.php new file mode 100644 index 00000000..22d13ad5 --- /dev/null +++ b/src/Types/DocFormsResetResponse.php @@ -0,0 +1,51 @@ + $fields + */ + #[JsonProperty('fields'), ArrayType([FormField::class])] + public array $fields; + + /** + * @var array $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * fields: array, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsSetValue200Response.php b/src/Types/DocFormsSetValue200Response.php deleted file mode 100644 index 044b8023..00000000 --- a/src/Types/DocFormsSetValue200Response.php +++ /dev/null @@ -1,51 +0,0 @@ - $widgets - */ - #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] - public array $widgets; - - /** - * @var FormMutationMeta $meta - */ - #[JsonProperty('meta')] - public FormMutationMeta $meta; - - /** - * @param array{ - * field: FormField, - * widgets: array, - * meta: FormMutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->field = $values['field']; - $this->widgets = $values['widgets']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsSetValueResponse.php b/src/Types/DocFormsSetValueResponse.php new file mode 100644 index 00000000..d1de90c3 --- /dev/null +++ b/src/Types/DocFormsSetValueResponse.php @@ -0,0 +1,51 @@ + $widgets + */ + #[JsonProperty('widgets'), ArrayType([WidgetAnnotation::class])] + public array $widgets; + + /** + * @var FormMutationMeta $meta + */ + #[JsonProperty('meta')] + public FormMutationMeta $meta; + + /** + * @param array{ + * field: FormField, + * widgets: array, + * meta: FormMutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->field = $values['field']; + $this->widgets = $values['widgets']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsUpdateWidget200Response.php b/src/Types/DocFormsUpdateWidget200Response.php deleted file mode 100644 index 9a57fd38..00000000 --- a/src/Types/DocFormsUpdateWidget200Response.php +++ /dev/null @@ -1,50 +0,0 @@ -widget = $values['widget']; - $this->appearance = $values['appearance']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsUpdateWidget200ResponseAppearance.php b/src/Types/DocFormsUpdateWidget200ResponseAppearance.php deleted file mode 100644 index f724b293..00000000 --- a/src/Types/DocFormsUpdateWidget200ResponseAppearance.php +++ /dev/null @@ -1,42 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var bool $changed - */ - #[JsonProperty('changed')] - public bool $changed; - - /** - * @param array{ - * action: value-of, - * changed: bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->changed = $values['changed']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php b/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php deleted file mode 100644 index 1f4c9fe2..00000000 --- a/src/Types/DocFormsUpdateWidget200ResponseAppearanceAction.php +++ /dev/null @@ -1,11 +0,0 @@ -widget = $values['widget']; + $this->appearance = $values['appearance']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsUpdateWidgetResponseAppearance.php b/src/Types/DocFormsUpdateWidgetResponseAppearance.php new file mode 100644 index 00000000..50a450a5 --- /dev/null +++ b/src/Types/DocFormsUpdateWidgetResponseAppearance.php @@ -0,0 +1,42 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var bool $changed + */ + #[JsonProperty('changed')] + public bool $changed; + + /** + * @param array{ + * action: value-of, + * changed: bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->changed = $values['changed']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocFormsUpdateWidgetResponseAppearanceAction.php b/src/Types/DocFormsUpdateWidgetResponseAppearanceAction.php new file mode 100644 index 00000000..3940fe2a --- /dev/null +++ b/src/Types/DocFormsUpdateWidgetResponseAppearanceAction.php @@ -0,0 +1,11 @@ + $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var DocHead200ResponseEncryption $encryption - */ - #[JsonProperty('encryption')] - public DocHead200ResponseEncryption $encryption; - - /** - * @var DocHead200ResponsePermissions $permissions - */ - #[JsonProperty('permissions')] - public DocHead200ResponsePermissions $permissions; - - /** - * @var DocHead200ResponseAccess $access - */ - #[JsonProperty('access')] - public DocHead200ResponseAccess $access; - - /** - * @param array{ - * id: string, - * baseSha: string, - * storageSizeBytes: int, - * docVersion: int, - * state: value-of, - * encryption: DocHead200ResponseEncryption, - * permissions: DocHead200ResponsePermissions, - * access: DocHead200ResponseAccess, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->baseSha = $values['baseSha']; - $this->storageSizeBytes = $values['storageSizeBytes']; - $this->docVersion = $values['docVersion']; - $this->state = $values['state']; - $this->encryption = $values['encryption']; - $this->permissions = $values['permissions']; - $this->access = $values['access']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocHead200ResponseAccess.php b/src/Types/DocHead200ResponseAccess.php deleted file mode 100644 index f803b8fb..00000000 --- a/src/Types/DocHead200ResponseAccess.php +++ /dev/null @@ -1,51 +0,0 @@ -> $reasons - */ - #[JsonProperty('reasons'), ArrayType(['string'])] - public array $reasons; - - /** - * @var ?string $endpoint - */ - #[JsonProperty('endpoint')] - public ?string $endpoint; - - /** - * @param array{ - * required: bool, - * reasons: array>, - * endpoint?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->required = $values['required']; - $this->reasons = $values['reasons']; - $this->endpoint = $values['endpoint'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocHead200ResponseAccessReasonsItem.php b/src/Types/DocHead200ResponseAccessReasonsItem.php deleted file mode 100644 index 29937291..00000000 --- a/src/Types/DocHead200ResponseAccessReasonsItem.php +++ /dev/null @@ -1,10 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?bool $requiresPassword - */ - #[JsonProperty('requiresPassword')] - public ?bool $requiresPassword; - - /** - * @param array{ - * state: value-of, - * requiresPassword?: ?bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->state = $values['state']; - $this->requiresPassword = $values['requiresPassword'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocHead200ResponseEncryptionState.php b/src/Types/DocHead200ResponseEncryptionState.php deleted file mode 100644 index 3a502a50..00000000 --- a/src/Types/DocHead200ResponseEncryptionState.php +++ /dev/null @@ -1,11 +0,0 @@ - $openedAs - */ - #[JsonProperty('openedAs')] - public ?string $openedAs; - - /** - * @var ?int $securityHandlerRevision - */ - #[JsonProperty('securityHandlerRevision')] - public ?int $securityHandlerRevision; - - /** - * @var bool $canUpgradeToOwner - */ - #[JsonProperty('canUpgradeToOwner')] - public bool $canUpgradeToOwner; - - /** - * @param array{ - * known: bool, - * canUpgradeToOwner: bool, - * bits?: ?int, - * allAllowed?: ?bool, - * openedAs?: ?value-of, - * securityHandlerRevision?: ?int, - * } $values - */ - public function __construct( - array $values, - ) { - $this->known = $values['known']; - $this->bits = $values['bits'] ?? null; - $this->allAllowed = $values['allAllowed'] ?? null; - $this->openedAs = $values['openedAs'] ?? null; - $this->securityHandlerRevision = $values['securityHandlerRevision'] ?? null; - $this->canUpgradeToOwner = $values['canUpgradeToOwner']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocHead200ResponsePermissionsOpenedAs.php b/src/Types/DocHead200ResponsePermissionsOpenedAs.php deleted file mode 100644 index f4195ec2..00000000 --- a/src/Types/DocHead200ResponsePermissionsOpenedAs.php +++ /dev/null @@ -1,10 +0,0 @@ - $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var DocHeadResponseEncryption $encryption + */ + #[JsonProperty('encryption')] + public DocHeadResponseEncryption $encryption; + + /** + * @var DocHeadResponsePermissions $permissions + */ + #[JsonProperty('permissions')] + public DocHeadResponsePermissions $permissions; + + /** + * @var DocHeadResponseAccess $access + */ + #[JsonProperty('access')] + public DocHeadResponseAccess $access; + + /** + * @var array $engine + */ + #[JsonProperty('engine'), ArrayType(['string' => 'string'])] + public array $engine; + + /** + * @param array{ + * id: string, + * baseSha256: string, + * sizeBytes: int, + * docVersion: int, + * state: value-of, + * encryption: DocHeadResponseEncryption, + * permissions: DocHeadResponsePermissions, + * access: DocHeadResponseAccess, + * engine: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->baseSha256 = $values['baseSha256']; + $this->sizeBytes = $values['sizeBytes']; + $this->docVersion = $values['docVersion']; + $this->state = $values['state']; + $this->encryption = $values['encryption']; + $this->permissions = $values['permissions']; + $this->access = $values['access']; + $this->engine = $values['engine']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHeadResponseAccess.php b/src/Types/DocHeadResponseAccess.php new file mode 100644 index 00000000..eb548136 --- /dev/null +++ b/src/Types/DocHeadResponseAccess.php @@ -0,0 +1,51 @@ +> $reasons + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var ?string $endpoint + */ + #[JsonProperty('endpoint')] + public ?string $endpoint; + + /** + * @param array{ + * required: bool, + * reasons: array>, + * endpoint?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->required = $values['required']; + $this->reasons = $values['reasons']; + $this->endpoint = $values['endpoint'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHeadResponseAccessReasonsItem.php b/src/Types/DocHeadResponseAccessReasonsItem.php new file mode 100644 index 00000000..50818291 --- /dev/null +++ b/src/Types/DocHeadResponseAccessReasonsItem.php @@ -0,0 +1,10 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?bool $requiresPassword + */ + #[JsonProperty('requiresPassword')] + public ?bool $requiresPassword; + + /** + * @param array{ + * state: value-of, + * requiresPassword?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->state = $values['state']; + $this->requiresPassword = $values['requiresPassword'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHeadResponseEncryptionState.php b/src/Types/DocHeadResponseEncryptionState.php new file mode 100644 index 00000000..63cac7cf --- /dev/null +++ b/src/Types/DocHeadResponseEncryptionState.php @@ -0,0 +1,11 @@ + $openedAs + */ + #[JsonProperty('openedAs')] + public ?string $openedAs; + + /** + * @var ?int $securityHandlerRevision + */ + #[JsonProperty('securityHandlerRevision')] + public ?int $securityHandlerRevision; + + /** + * @var bool $canUpgradeToOwner + */ + #[JsonProperty('canUpgradeToOwner')] + public bool $canUpgradeToOwner; + + /** + * @param array{ + * known: bool, + * canUpgradeToOwner: bool, + * flags?: ?PdfPermissionFlags, + * allAllowed?: ?bool, + * openedAs?: ?value-of, + * securityHandlerRevision?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->known = $values['known']; + $this->flags = $values['flags'] ?? null; + $this->allAllowed = $values['allAllowed'] ?? null; + $this->openedAs = $values['openedAs'] ?? null; + $this->securityHandlerRevision = $values['securityHandlerRevision'] ?? null; + $this->canUpgradeToOwner = $values['canUpgradeToOwner']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocHeadResponsePermissionsOpenedAs.php b/src/Types/DocHeadResponsePermissionsOpenedAs.php new file mode 100644 index 00000000..57c7dcd7 --- /dev/null +++ b/src/Types/DocHeadResponsePermissionsOpenedAs.php @@ -0,0 +1,10 @@ + $pages - */ - #[JsonProperty('pages'), ArrayType([DocManifest200ResponsePagesItem::class])] - public array $pages; - - /** - * @param array{ - * docVersion: int, - * layoutVersion: int, - * metadataVersion: int, - * serverFonts: string, - * auditHead: int, - * baseSha: string, - * pages: array, - * actionsVersion?: ?int, - * attachmentsVersion?: ?int, - * annotationsVersion?: ?int, - * formsVersion?: ?int, - * outlineVersion?: ?int, - * fontsVersion?: ?int, - * layerVersion?: ?int, - * working?: ?bool, - * baseByteLength?: ?int, - * scopes?: ?DocManifest200ResponseScopes, - * protection?: ?DocManifest200ResponseProtection, - * } $values - */ - public function __construct( - array $values, - ) { - $this->docVersion = $values['docVersion']; - $this->layoutVersion = $values['layoutVersion']; - $this->metadataVersion = $values['metadataVersion']; - $this->actionsVersion = $values['actionsVersion'] ?? null; - $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; - $this->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; - $this->working = $values['working'] ?? null; - $this->baseByteLength = $values['baseByteLength'] ?? null; - $this->scopes = $values['scopes'] ?? null; - $this->protection = $values['protection'] ?? null; - $this->pages = $values['pages']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponsePagesItem.php b/src/Types/DocManifest200ResponsePagesItem.php deleted file mode 100644 index 4e0cc8fc..00000000 --- a/src/Types/DocManifest200ResponsePagesItem.php +++ /dev/null @@ -1,42 +0,0 @@ -page = $values['page']; - $this->cache = $values['cache']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponsePagesItemCache.php b/src/Types/DocManifest200ResponsePagesItemCache.php deleted file mode 100644 index 79b7ad38..00000000 --- a/src/Types/DocManifest200ResponsePagesItemCache.php +++ /dev/null @@ -1,50 +0,0 @@ -contentVersion = $values['contentVersion']; - $this->annotationVersion = $values['annotationVersion']; - $this->widgetVersion = $values['widgetVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtection.php b/src/Types/DocManifest200ResponseProtection.php deleted file mode 100644 index 9f37dd7b..00000000 --- a/src/Types/DocManifest200ResponseProtection.php +++ /dev/null @@ -1,67 +0,0 @@ - $enforced - */ - #[JsonProperty('enforced')] - public ?string $enforced; - - /** - * @var ?value-of $judged - */ - #[JsonProperty('judged')] - public ?string $judged; - - /** - * @var ?DocManifest200ResponseProtectionCertification $certification - */ - #[JsonProperty('certification')] - public ?DocManifest200ResponseProtectionCertification $certification; - - /** - * @var array $fieldLocks - */ - #[JsonProperty('fieldLocks'), ArrayType([DocManifest200ResponseProtectionFieldLocksItem::class])] - public array $fieldLocks; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @param array{ - * fieldLocks: array, - * policyVersion: int, - * enforced?: ?value-of, - * judged?: ?value-of, - * certification?: ?DocManifest200ResponseProtectionCertification, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enforced = $values['enforced'] ?? null; - $this->judged = $values['judged'] ?? null; - $this->certification = $values['certification'] ?? null; - $this->fieldLocks = $values['fieldLocks']; - $this->policyVersion = $values['policyVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtectionCertification.php b/src/Types/DocManifest200ResponseProtectionCertification.php deleted file mode 100644 index 25194bbe..00000000 --- a/src/Types/DocManifest200ResponseProtectionCertification.php +++ /dev/null @@ -1,42 +0,0 @@ -signatureIndex = $values['signatureIndex']; - $this->permission = $values['permission']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtectionEnforced.php b/src/Types/DocManifest200ResponseProtectionEnforced.php deleted file mode 100644 index 1a629e6e..00000000 --- a/src/Types/DocManifest200ResponseProtectionEnforced.php +++ /dev/null @@ -1,11 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var DocManifest200ResponseProtectionFieldLocksItemSpec $spec - */ - #[JsonProperty('spec')] - public DocManifest200ResponseProtectionFieldLocksItemSpec $spec; - - /** - * @param array{ - * signatureIndex: int, - * source: value-of, - * spec: DocManifest200ResponseProtectionFieldLocksItemSpec, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->source = $values['source']; - $this->spec = $values['spec']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php deleted file mode 100644 index 01ca0075..00000000 --- a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSource.php +++ /dev/null @@ -1,9 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php b/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php deleted file mode 100644 index 0b83cdeb..00000000 --- a/src/Types/DocManifest200ResponseProtectionFieldLocksItemSpecAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $content - */ - #[JsonProperty('content')] - public string $content; - - /** - * @var value-of $annotations - */ - #[JsonProperty('annotations')] - public string $annotations; - - /** - * @var value-of $forms - */ - #[JsonProperty('forms')] - public string $forms; - - /** - * @var value-of $layout - */ - #[JsonProperty('layout')] - public string $layout; - - /** - * @var value-of $attachments - */ - #[JsonProperty('attachments')] - public string $attachments; - - /** - * @var value-of $metadata - */ - #[JsonProperty('metadata')] - public string $metadata; - - /** - * @var value-of $actions - */ - #[JsonProperty('actions')] - public string $actions; - - /** - * @var value-of $outline - */ - #[JsonProperty('outline')] - public string $outline; - - /** - * @param array{ - * content: value-of, - * annotations: value-of, - * forms: value-of, - * layout: value-of, - * attachments: value-of, - * metadata: value-of, - * actions: value-of, - * outline: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->content = $values['content']; - $this->annotations = $values['annotations']; - $this->forms = $values['forms']; - $this->layout = $values['layout']; - $this->attachments = $values['attachments']; - $this->metadata = $values['metadata']; - $this->actions = $values['actions']; - $this->outline = $values['outline']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocManifest200ResponseScopesActions.php b/src/Types/DocManifest200ResponseScopesActions.php deleted file mode 100644 index 8739180a..00000000 --- a/src/Types/DocManifest200ResponseScopesActions.php +++ /dev/null @@ -1,9 +0,0 @@ - $pages + */ + #[JsonProperty('pages'), ArrayType([DocManifestResponsePagesItem::class])] + public array $pages; + + /** + * @param array{ + * docVersion: int, + * layoutVersion: int, + * metadataVersion: int, + * auditHead: int, + * baseSha256: string, + * pages: array, + * actionsVersion?: ?int, + * attachmentsVersion?: ?int, + * annotationsVersion?: ?int, + * formsVersion?: ?int, + * outlineVersion?: ?int, + * fontsVersion?: ?int, + * contentsVersion?: ?int, + * layerVersion?: ?int, + * working?: ?bool, + * baseSizeBytes?: ?int, + * scopes?: ?DocManifestResponseScopes, + * protection?: ?DocManifestResponseProtection, + * } $values + */ + public function __construct( + array $values, + ) { + $this->docVersion = $values['docVersion']; + $this->layoutVersion = $values['layoutVersion']; + $this->metadataVersion = $values['metadataVersion']; + $this->actionsVersion = $values['actionsVersion'] ?? null; + $this->attachmentsVersion = $values['attachmentsVersion'] ?? null; + $this->annotationsVersion = $values['annotationsVersion'] ?? null; + $this->formsVersion = $values['formsVersion'] ?? null; + $this->outlineVersion = $values['outlineVersion'] ?? null; + $this->fontsVersion = $values['fontsVersion'] ?? null; + $this->contentsVersion = $values['contentsVersion'] ?? null; + $this->auditHead = $values['auditHead']; + $this->baseSha256 = $values['baseSha256']; + $this->layerVersion = $values['layerVersion'] ?? null; + $this->working = $values['working'] ?? null; + $this->baseSizeBytes = $values['baseSizeBytes'] ?? null; + $this->scopes = $values['scopes'] ?? null; + $this->protection = $values['protection'] ?? null; + $this->pages = $values['pages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponsePagesItem.php b/src/Types/DocManifestResponsePagesItem.php new file mode 100644 index 00000000..4663d0dc --- /dev/null +++ b/src/Types/DocManifestResponsePagesItem.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->cache = $values['cache']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponsePagesItemCache.php b/src/Types/DocManifestResponsePagesItemCache.php new file mode 100644 index 00000000..87f59be7 --- /dev/null +++ b/src/Types/DocManifestResponsePagesItemCache.php @@ -0,0 +1,50 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + $this->widgetVersion = $values['widgetVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponseProtection.php b/src/Types/DocManifestResponseProtection.php new file mode 100644 index 00000000..ed70a301 --- /dev/null +++ b/src/Types/DocManifestResponseProtection.php @@ -0,0 +1,67 @@ + $enforced + */ + #[JsonProperty('enforced')] + public ?string $enforced; + + /** + * @var ?value-of $judged + */ + #[JsonProperty('judged')] + public ?string $judged; + + /** + * @var ?DocManifestResponseProtectionCertification $certification + */ + #[JsonProperty('certification')] + public ?DocManifestResponseProtectionCertification $certification; + + /** + * @var array $fieldLocks + */ + #[JsonProperty('fieldLocks'), ArrayType([DocManifestResponseProtectionFieldLocksItem::class])] + public array $fieldLocks; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @param array{ + * fieldLocks: array, + * policyVersion: int, + * enforced?: ?value-of, + * judged?: ?value-of, + * certification?: ?DocManifestResponseProtectionCertification, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enforced = $values['enforced'] ?? null; + $this->judged = $values['judged'] ?? null; + $this->certification = $values['certification'] ?? null; + $this->fieldLocks = $values['fieldLocks']; + $this->policyVersion = $values['policyVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponseProtectionCertification.php b/src/Types/DocManifestResponseProtectionCertification.php new file mode 100644 index 00000000..e1f3023c --- /dev/null +++ b/src/Types/DocManifestResponseProtectionCertification.php @@ -0,0 +1,42 @@ +signatureIndex = $values['signatureIndex']; + $this->permission = $values['permission']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponseProtectionEnforced.php b/src/Types/DocManifestResponseProtectionEnforced.php new file mode 100644 index 00000000..9339bc46 --- /dev/null +++ b/src/Types/DocManifestResponseProtectionEnforced.php @@ -0,0 +1,11 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var FieldLockSpec $spec + */ + #[JsonProperty('spec')] + public FieldLockSpec $spec; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * spec: FieldLockSpec, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + $this->spec = $values['spec']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponseProtectionFieldLocksItemSource.php b/src/Types/DocManifestResponseProtectionFieldLocksItemSource.php new file mode 100644 index 00000000..3d2c8b99 --- /dev/null +++ b/src/Types/DocManifestResponseProtectionFieldLocksItemSource.php @@ -0,0 +1,9 @@ + $content + */ + #[JsonProperty('content')] + public string $content; + + /** + * @var value-of $annotations + */ + #[JsonProperty('annotations')] + public string $annotations; + + /** + * @var value-of $forms + */ + #[JsonProperty('forms')] + public string $forms; + + /** + * @var value-of $layout + */ + #[JsonProperty('layout')] + public string $layout; + + /** + * @var value-of $attachments + */ + #[JsonProperty('attachments')] + public string $attachments; + + /** + * @var value-of $metadata + */ + #[JsonProperty('metadata')] + public string $metadata; + + /** + * @var value-of $actions + */ + #[JsonProperty('actions')] + public string $actions; + + /** + * @var value-of $outline + */ + #[JsonProperty('outline')] + public string $outline; + + /** + * @param array{ + * content: value-of, + * annotations: value-of, + * forms: value-of, + * layout: value-of, + * attachments: value-of, + * metadata: value-of, + * actions: value-of, + * outline: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->content = $values['content']; + $this->annotations = $values['annotations']; + $this->forms = $values['forms']; + $this->layout = $values['layout']; + $this->attachments = $values['attachments']; + $this->metadata = $values['metadata']; + $this->actions = $values['actions']; + $this->outline = $values['outline']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocManifestResponseScopesActions.php b/src/Types/DocManifestResponseScopesActions.php new file mode 100644 index 00000000..81d5ddbb --- /dev/null +++ b/src/Types/DocManifestResponseScopesActions.php @@ -0,0 +1,9 @@ + $pages - */ - #[JsonProperty('pages'), ArrayType([PageRef::class])] - public array $pages; - - /** - * @var value-of $usage - */ - #[JsonProperty('usage')] - public string $usage; - - /** - * @var array $results - */ - #[JsonProperty('results'), ArrayType([DocPagesFlatten200ResponseResultsItem::class])] - public array $results; - - /** - * @var MutationMeta $meta - */ - #[JsonProperty('meta')] - public MutationMeta $meta; - - /** - * @param array{ - * pages: array, - * usage: value-of, - * results: array, - * meta: MutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->pages = $values['pages']; - $this->usage = $values['usage']; - $this->results = $values['results']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseResultsItem.php b/src/Types/DocPagesFlatten200ResponseResultsItem.php deleted file mode 100644 index 07b73f92..00000000 --- a/src/Types/DocPagesFlatten200ResponseResultsItem.php +++ /dev/null @@ -1,42 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @param array{ - * page: PageRef, - * status: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->page = $values['page']; - $this->status = $values['status']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php b/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php deleted file mode 100644 index a0b79800..00000000 --- a/src/Types/DocPagesFlatten200ResponseResultsItemStatus.php +++ /dev/null @@ -1,9 +0,0 @@ - $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public array $pages; + + /** + * @var value-of $usage + */ + #[JsonProperty('usage')] + public string $usage; + + /** + * @var array $results + */ + #[JsonProperty('results'), ArrayType([DocPagesFlattenResponseResultsItem::class])] + public array $results; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * pages: array, + * usage: value-of, + * results: array, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pages = $values['pages']; + $this->usage = $values['usage']; + $this->results = $values['results']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlattenResponseResultsItem.php b/src/Types/DocPagesFlattenResponseResultsItem.php new file mode 100644 index 00000000..738ad9d5 --- /dev/null +++ b/src/Types/DocPagesFlattenResponseResultsItem.php @@ -0,0 +1,42 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * page: PageRef, + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesFlattenResponseResultsItemStatus.php b/src/Types/DocPagesFlattenResponseResultsItemStatus.php new file mode 100644 index 00000000..d7431adc --- /dev/null +++ b/src/Types/DocPagesFlattenResponseResultsItemStatus.php @@ -0,0 +1,9 @@ +layout = $values['layout']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayout.php b/src/Types/DocPagesRemoveName200ResponseLayout.php deleted file mode 100644 index 14cbca57..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesRemoveName200ResponseLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([DocPagesRemoveName200ResponseLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([DocPagesRemoveName200ResponseLayoutNamedPagesItem::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/DocPagesRemoveName200ResponseLayoutLabelsItem.php b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItem.php deleted file mode 100644 index 7e633235..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php deleted file mode 100644 index f6d2ec66..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php deleted file mode 100644 index 3c291364..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - */ - public static function page(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - */ - public static function template(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - */ - public static function dangling(DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesRemoveName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage - */ - public function asPage(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage - { - if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { - throw new Exception( - "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate - { - if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { - throw new Exception( - "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling - { - if (!($this->value instanceof DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { - throw new Exception( - "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'page': - $value = $this->asPage()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'template': - $value = $this->asTemplate()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'dangling': - $value = $this->asDangling()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'page': - $args['value'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index dd7909fd..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index f65f9a53..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index 289c2d37..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php deleted file mode 100644 index 19d4eeb9..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var DocPagesRemoveName200ResponseLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public DocPagesRemoveName200ResponseLayoutPagesItemBoxes $boxes; - - /** - * @var DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: DocPagesRemoveName200ResponseLayoutPagesItemSize, - * rotation: float, - * userUnit: float, - * boxes: DocPagesRemoveName200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox, - * label?: ?string, - * tabOrder?: ?value-of, - * actions?: ?PdfPageActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->ref = $values['ref']; - $this->label = $values['label'] ?? null; - $this->size = $values['size']; - $this->rotation = $values['rotation']; - $this->userUnit = $values['userUnit']; - $this->tabOrder = $values['tabOrder'] ?? null; - $this->boxes = $values['boxes']; - $this->pdfCropBox = $values['pdfCropBox']; - $this->actions = $values['actions'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.php deleted file mode 100644 index 62242665..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxes.php +++ /dev/null @@ -1,66 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index 0798814c..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesArt.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index d512453b..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesBleed.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index ef410951..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index f58a35ba..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesMedia.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index f2afa564..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 73d595d0..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemPdfCropBox.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->bottom = $values['bottom']; - $this->right = $values['right']; - $this->top = $values['top']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php deleted file mode 100644 index bc821fab..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemSize.php +++ /dev/null @@ -1,42 +0,0 @@ -width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php deleted file mode 100644 index 52c3296f..00000000 --- a/src/Types/DocPagesRemoveName200ResponseLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayout.php b/src/Types/DocPagesRemoveNameResponseLayout.php new file mode 100644 index 00000000..a31f140f --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayout.php @@ -0,0 +1,59 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesRemoveNameResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $labels + */ + #[JsonProperty('labels'), ArrayType([DocPagesRemoveNameResponseLayoutLabelsItem::class])] + public array $labels; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesRemoveNameResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * labels: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->labels = $values['labels']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.php b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.php new file mode 100644 index 00000000..bcb59369 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItem.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/DocPagesRemoveNameResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItemStyle.php new file mode 100644 index 00000000..a6344cd3 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutLabelsItemStyle.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/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 00000000..ecea2277 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage $page): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesRemoveNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesRemoveNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 00000000..beac77f3 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 00000000..9dfc12e9 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 00000000..2cbd4fcc --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php new file mode 100644 index 00000000..ace5c75b --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesRemoveNameResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesRemoveNameResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesRemoveNameResponseLayoutPagesItemSize, + * rotation: int, + * userUnit: float, + * boxes: DocPagesRemoveNameResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxes.php new file mode 100644 index 00000000..e745bb08 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxes.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..c7f9b5a7 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesArt.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..75749b30 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesBleed.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..6e31d9d6 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesCrop.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..a587f8d7 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesMedia.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/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..30dffad0 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemBoxesTrim.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/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 00000000..746af310 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemPdfCropBox.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/DocPagesRemoveNameResponseLayoutPagesItemSize.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemSize.php new file mode 100644 index 00000000..ae0758d1 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemSize.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/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php new file mode 100644 index 00000000..c5c3d7d1 --- /dev/null +++ b/src/Types/DocPagesRemoveNameResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ +layout = $values['layout']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayout.php b/src/Types/DocPagesSetName200ResponseLayout.php deleted file mode 100644 index 8897a0dd..00000000 --- a/src/Types/DocPagesSetName200ResponseLayout.php +++ /dev/null @@ -1,59 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([DocPagesSetName200ResponseLayoutPagesItem::class])] - public array $pages; - - /** - * @var array $labels - */ - #[JsonProperty('labels'), ArrayType([DocPagesSetName200ResponseLayoutLabelsItem::class])] - public array $labels; - - /** - * @var array $namedPages - */ - #[JsonProperty('namedPages'), ArrayType([DocPagesSetName200ResponseLayoutNamedPagesItem::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/DocPagesSetName200ResponseLayoutLabelsItem.php b/src/Types/DocPagesSetName200ResponseLayoutLabelsItem.php deleted file mode 100644 index 06d03ae1..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutLabelsItem.php +++ /dev/null @@ -1,58 +0,0 @@ - $style - */ - #[JsonProperty('style')] - public ?string $style; - - /** - * @var int $firstNumber - */ - #[JsonProperty('firstNumber')] - public int $firstNumber; - - /** - * @var string $prefix - */ - #[JsonProperty('prefix')] - public string $prefix; - - /** - * @param array{ - * firstPage: int, - * firstNumber: int, - * prefix: string, - * style?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->firstPage = $values['firstPage']; - $this->style = $values['style'] ?? null; - $this->firstNumber = $values['firstNumber']; - $this->prefix = $values['prefix']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php deleted file mode 100644 index 73bb0ece..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutLabelsItemStyle.php +++ /dev/null @@ -1,12 +0,0 @@ -name = $values['name']; - $this->target = $values['target']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php deleted file mode 100644 index d4d82c52..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTarget.php +++ /dev/null @@ -1,241 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage $page - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget - */ - public static function page(DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage $page): DocPagesSetName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'page', - 'value' => $page, - ]); - } - - /** - * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate $template - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget - */ - public static function template(DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesSetName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'template', - 'value' => $template, - ]); - } - - /** - * @param DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling $dangling - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTarget - */ - public static function dangling(DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesSetName200ResponseLayoutNamedPagesItemTarget - { - return new DocPagesSetName200ResponseLayoutNamedPagesItemTarget([ - 'kind' => 'dangling', - 'value' => $dangling, - ]); - } - - /** - * @return bool - */ - public function isPage(): bool - { - return $this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; - } - - /** - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage - */ - public function asPage(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage - { - if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { - throw new Exception( - "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isTemplate(): bool - { - return $this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; - } - - /** - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate - */ - public function asTemplate(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate - { - if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { - throw new Exception( - "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDangling(): bool - { - return $this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; - } - - /** - * @return DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling - */ - public function asDangling(): DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling - { - if (!($this->value instanceof DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { - throw new Exception( - "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'page': - $value = $this->asPage()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'template': - $value = $this->asTemplate()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'dangling': - $value = $this->asDangling()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'page': - $args['value'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); - break; - case 'template': - $args['value'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); - break; - case 'dangling': - $args['value'] = DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php deleted file mode 100644 index 37025f40..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetDangling.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php deleted file mode 100644 index 3f680a69..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetPage.php +++ /dev/null @@ -1,34 +0,0 @@ -page = $values['page']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php deleted file mode 100644 index b1046cad..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutNamedPagesItemTargetTemplate.php +++ /dev/null @@ -1,34 +0,0 @@ -objectNumber = $values['objectNumber']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php deleted file mode 100644 index 4a8d27fa..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $tabOrder - */ - #[JsonProperty('tabOrder')] - public ?string $tabOrder; - - /** - * @var DocPagesSetName200ResponseLayoutPagesItemBoxes $boxes - */ - #[JsonProperty('boxes')] - public DocPagesSetName200ResponseLayoutPagesItemBoxes $boxes; - - /** - * @var DocPagesSetName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox - */ - #[JsonProperty('pdfCropBox')] - public DocPagesSetName200ResponseLayoutPagesItemPdfCropBox $pdfCropBox; - - /** - * @var ?PdfPageActions $actions - */ - #[JsonProperty('actions')] - public ?PdfPageActions $actions; - - /** - * @param array{ - * index: int, - * ref: PageRef, - * size: DocPagesSetName200ResponseLayoutPagesItemSize, - * rotation: float, - * userUnit: float, - * boxes: DocPagesSetName200ResponseLayoutPagesItemBoxes, - * pdfCropBox: DocPagesSetName200ResponseLayoutPagesItemPdfCropBox, - * label?: ?string, - * tabOrder?: ?value-of, - * actions?: ?PdfPageActions, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->ref = $values['ref']; - $this->label = $values['label'] ?? null; - $this->size = $values['size']; - $this->rotation = $values['rotation']; - $this->userUnit = $values['userUnit']; - $this->tabOrder = $values['tabOrder'] ?? null; - $this->boxes = $values['boxes']; - $this->pdfCropBox = $values['pdfCropBox']; - $this->actions = $values['actions'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxes.php deleted file mode 100644 index 3b57aa74..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxes.php +++ /dev/null @@ -1,66 +0,0 @@ -media = $values['media']; - $this->crop = $values['crop']; - $this->bleed = $values['bleed']; - $this->trim = $values['trim']; - $this->art = $values['art']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.php deleted file mode 100644 index 2b7be2a7..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesArt.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.php deleted file mode 100644 index 2f32f7d3..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesBleed.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.php deleted file mode 100644 index b976c4d9..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesCrop.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.php deleted file mode 100644 index 691d5eef..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesMedia.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.php deleted file mode 100644 index 350f1dc8..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemBoxesTrim.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php deleted file mode 100644 index 3bce983a..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemPdfCropBox.php +++ /dev/null @@ -1,58 +0,0 @@ -left = $values['left']; - $this->bottom = $values['bottom']; - $this->right = $values['right']; - $this->top = $values['top']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php deleted file mode 100644 index 634c3405..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemSize.php +++ /dev/null @@ -1,42 +0,0 @@ -width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php deleted file mode 100644 index 4171c498..00000000 --- a/src/Types/DocPagesSetName200ResponseLayoutPagesItemTabOrder.php +++ /dev/null @@ -1,12 +0,0 @@ -layout = $values['layout']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayout.php b/src/Types/DocPagesSetNameResponseLayout.php new file mode 100644 index 00000000..3a8de4d3 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayout.php @@ -0,0 +1,59 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesSetNameResponseLayoutPagesItem::class])] + public array $pages; + + /** + * @var array $labels + */ + #[JsonProperty('labels'), ArrayType([DocPagesSetNameResponseLayoutLabelsItem::class])] + public array $labels; + + /** + * @var array $namedPages + */ + #[JsonProperty('namedPages'), ArrayType([DocPagesSetNameResponseLayoutNamedPagesItem::class])] + public array $namedPages; + + /** + * @param array{ + * pageCount: int, + * pages: array, + * labels: array, + * namedPages: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->pageCount = $values['pageCount']; + $this->pages = $values['pages']; + $this->labels = $values['labels']; + $this->namedPages = $values['namedPages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutLabelsItem.php b/src/Types/DocPagesSetNameResponseLayoutLabelsItem.php new file mode 100644 index 00000000..701f8f19 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutLabelsItem.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/DocPagesSetNameResponseLayoutLabelsItemStyle.php b/src/Types/DocPagesSetNameResponseLayoutLabelsItemStyle.php new file mode 100644 index 00000000..c8abc99e --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutLabelsItemStyle.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/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php new file mode 100644 index 00000000..a8f06dbe --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTarget.php @@ -0,0 +1,241 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetPage $page + * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget + */ + public static function page(DocPagesSetNameResponseLayoutNamedPagesItemTargetPage $page): DocPagesSetNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'page', + 'value' => $page, + ]); + } + + /** + * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate $template + * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget + */ + public static function template(DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate $template): DocPagesSetNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'template', + 'value' => $template, + ]); + } + + /** + * @param DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling $dangling + * @return DocPagesSetNameResponseLayoutNamedPagesItemTarget + */ + public static function dangling(DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling $dangling): DocPagesSetNameResponseLayoutNamedPagesItemTarget + { + return new DocPagesSetNameResponseLayoutNamedPagesItemTarget([ + 'kind' => 'dangling', + 'value' => $dangling, + ]); + } + + /** + * @return bool + */ + public function isPage(): bool + { + return $this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page'; + } + + /** + * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetPage + */ + public function asPage(): DocPagesSetNameResponseLayoutNamedPagesItemTargetPage + { + if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetPage && $this->kind === 'page')) { + throw new Exception( + "Expected page; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isTemplate(): bool + { + return $this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template'; + } + + /** + * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate + */ + public function asTemplate(): DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate + { + if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate && $this->kind === 'template')) { + throw new Exception( + "Expected template; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDangling(): bool + { + return $this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling'; + } + + /** + * @return DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling + */ + public function asDangling(): DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling + { + if (!($this->value instanceof DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling && $this->kind === 'dangling')) { + throw new Exception( + "Expected dangling; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'page': + $value = $this->asPage()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'template': + $value = $this->asTemplate()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'dangling': + $value = $this->asDangling()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'page': + $args['value'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetPage::jsonDeserialize($data); + break; + case 'template': + $args['value'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate::jsonDeserialize($data); + break; + case 'dangling': + $args['value'] = DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php new file mode 100644 index 00000000..c31c00d8 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetDangling.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php new file mode 100644 index 00000000..a25cfe71 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetPage.php @@ -0,0 +1,34 @@ +page = $values['page']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php new file mode 100644 index 00000000..9659bf01 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutNamedPagesItemTargetTemplate.php @@ -0,0 +1,34 @@ +objectNumber = $values['objectNumber']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutPagesItem.php b/src/Types/DocPagesSetNameResponseLayoutPagesItem.php new file mode 100644 index 00000000..c83d8a5f --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItem.php @@ -0,0 +1,106 @@ + $tabOrder + */ + #[JsonProperty('tabOrder')] + public ?string $tabOrder; + + /** + * @var DocPagesSetNameResponseLayoutPagesItemBoxes $boxes + */ + #[JsonProperty('boxes')] + public DocPagesSetNameResponseLayoutPagesItemBoxes $boxes; + + /** + * @var DocPagesSetNameResponseLayoutPagesItemPdfCropBox $pdfCropBox + */ + #[JsonProperty('pdfCropBox')] + public DocPagesSetNameResponseLayoutPagesItemPdfCropBox $pdfCropBox; + + /** + * @var ?PdfPageActions $actions + */ + #[JsonProperty('actions')] + public ?PdfPageActions $actions; + + /** + * @param array{ + * index: int, + * ref: PageRef, + * size: DocPagesSetNameResponseLayoutPagesItemSize, + * rotation: int, + * userUnit: float, + * boxes: DocPagesSetNameResponseLayoutPagesItemBoxes, + * pdfCropBox: DocPagesSetNameResponseLayoutPagesItemPdfCropBox, + * label?: ?string, + * tabOrder?: ?value-of, + * actions?: ?PdfPageActions, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->ref = $values['ref']; + $this->label = $values['label'] ?? null; + $this->size = $values['size']; + $this->rotation = $values['rotation']; + $this->userUnit = $values['userUnit']; + $this->tabOrder = $values['tabOrder'] ?? null; + $this->boxes = $values['boxes']; + $this->pdfCropBox = $values['pdfCropBox']; + $this->actions = $values['actions'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxes.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxes.php new file mode 100644 index 00000000..b82caa40 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxes.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/DocPagesSetNameResponseLayoutPagesItemBoxesArt.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesArt.php new file mode 100644 index 00000000..d4f214c3 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesArt.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/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.php new file mode 100644 index 00000000..25bc3446 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesBleed.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/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.php new file mode 100644 index 00000000..9e50b168 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesCrop.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/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.php new file mode 100644 index 00000000..c52dad08 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesMedia.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/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.php new file mode 100644 index 00000000..109b9333 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemBoxesTrim.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/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.php new file mode 100644 index 00000000..9c755930 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemPdfCropBox.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/DocPagesSetNameResponseLayoutPagesItemSize.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemSize.php new file mode 100644 index 00000000..b63b0ab8 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemSize.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/DocPagesSetNameResponseLayoutPagesItemTabOrder.php b/src/Types/DocPagesSetNameResponseLayoutPagesItemTabOrder.php new file mode 100644 index 00000000..fb7c0647 --- /dev/null +++ b/src/Types/DocPagesSetNameResponseLayoutPagesItemTabOrder.php @@ -0,0 +1,12 @@ +page = $values['page']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesSetScaleResponse.php b/src/Types/DocPagesSetScaleResponse.php new file mode 100644 index 00000000..effabaa7 --- /dev/null +++ b/src/Types/DocPagesSetScaleResponse.php @@ -0,0 +1,42 @@ +page = $values['page']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200Response.php b/src/Types/DocPagesViewports200Response.php deleted file mode 100644 index 039ea9e3..00000000 --- a/src/Types/DocPagesViewports200Response.php +++ /dev/null @@ -1,35 +0,0 @@ - $viewports - */ - #[JsonProperty('viewports'), ArrayType([DocPagesViewports200ResponseViewportsItem::class])] - public array $viewports; - - /** - * @param array{ - * viewports: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->viewports = $values['viewports']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItem.php b/src/Types/DocPagesViewports200ResponseViewportsItem.php deleted file mode 100644 index 3b0543a3..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItem.php +++ /dev/null @@ -1,58 +0,0 @@ -bbox = $values['bbox']; - $this->name = $values['name'] ?? null; - $this->measure = $values['measure'] ?? null; - $this->owned = $values['owned']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemBbox.php b/src/Types/DocPagesViewports200ResponseViewportsItemBbox.php deleted file mode 100644 index 0eb3ffdc..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemBbox.php +++ /dev/null @@ -1,58 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - $this->width = $values['width']; - $this->height = $values['height']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasure.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasure.php deleted file mode 100644 index 33fceb8f..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasure.php +++ /dev/null @@ -1,241 +0,0 @@ -subtype = $values['subtype']; - $this->value = $values['value']; - } - - /** - * @param DocPagesViewports200ResponseViewportsItemMeasureRectilinear $rectilinear - * @return DocPagesViewports200ResponseViewportsItemMeasure - */ - public static function rectilinear(DocPagesViewports200ResponseViewportsItemMeasureRectilinear $rectilinear): DocPagesViewports200ResponseViewportsItemMeasure - { - return new DocPagesViewports200ResponseViewportsItemMeasure([ - 'subtype' => 'rectilinear', - 'value' => $rectilinear, - ]); - } - - /** - * @param DocPagesViewports200ResponseViewportsItemMeasureGeospatial $geospatial - * @return DocPagesViewports200ResponseViewportsItemMeasure - */ - public static function geospatial(DocPagesViewports200ResponseViewportsItemMeasureGeospatial $geospatial): DocPagesViewports200ResponseViewportsItemMeasure - { - return new DocPagesViewports200ResponseViewportsItemMeasure([ - 'subtype' => 'geospatial', - 'value' => $geospatial, - ]); - } - - /** - * @param DocPagesViewports200ResponseViewportsItemMeasureUnknown $unknown - * @return DocPagesViewports200ResponseViewportsItemMeasure - */ - public static function unknown(DocPagesViewports200ResponseViewportsItemMeasureUnknown $unknown): DocPagesViewports200ResponseViewportsItemMeasure - { - return new DocPagesViewports200ResponseViewportsItemMeasure([ - 'subtype' => 'unknown', - 'value' => $unknown, - ]); - } - - /** - * @return bool - */ - public function isRectilinear(): bool - { - return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureRectilinear && $this->subtype === 'rectilinear'; - } - - /** - * @return DocPagesViewports200ResponseViewportsItemMeasureRectilinear - */ - public function asRectilinear(): DocPagesViewports200ResponseViewportsItemMeasureRectilinear - { - if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureRectilinear && $this->subtype === 'rectilinear')) { - throw new Exception( - "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isGeospatial(): bool - { - return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureGeospatial && $this->subtype === 'geospatial'; - } - - /** - * @return DocPagesViewports200ResponseViewportsItemMeasureGeospatial - */ - public function asGeospatial(): DocPagesViewports200ResponseViewportsItemMeasureGeospatial - { - if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureGeospatial && $this->subtype === 'geospatial')) { - throw new Exception( - "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnknown(): bool - { - return $this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureUnknown && $this->subtype === 'unknown'; - } - - /** - * @return DocPagesViewports200ResponseViewportsItemMeasureUnknown - */ - public function asUnknown(): DocPagesViewports200ResponseViewportsItemMeasureUnknown - { - if (!($this->value instanceof DocPagesViewports200ResponseViewportsItemMeasureUnknown && $this->subtype === 'unknown')) { - throw new Exception( - "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['subtype'] = $this->subtype; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->subtype) { - case 'rectilinear': - $value = $this->asRectilinear()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'geospatial': - $value = $this->asGeospatial()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unknown': - $value = $this->asUnknown()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('subtype', $data)) { - throw new Exception( - "JSON data is missing property 'subtype'", - ); - } - $subtype = $data['subtype']; - if (!(is_string($subtype))) { - throw new Exception( - "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), - ); - } - - $args['subtype'] = $subtype; - switch ($subtype) { - case 'rectilinear': - $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureRectilinear::jsonDeserialize($data); - break; - case 'geospatial': - $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureGeospatial::jsonDeserialize($data); - break; - case 'unknown': - $args['value'] = DocPagesViewports200ResponseViewportsItemMeasureUnknown::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['subtype'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php deleted file mode 100644 index 26771b95..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureGeospatial.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php deleted file mode 100644 index a57bde57..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinear.php +++ /dev/null @@ -1,99 +0,0 @@ - $x - */ - #[JsonProperty('x'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItem::class])] - public array $x; - - /** - * @var ?array $y - */ - #[JsonProperty('y'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItem::class])] - public ?array $y; - - /** - * @var array $distance - */ - #[JsonProperty('distance'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItem::class])] - public array $distance; - - /** - * @var array $area - */ - #[JsonProperty('area'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItem::class])] - public array $area; - - /** - * @var ?array $angle - */ - #[JsonProperty('angle'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem::class])] - public ?array $angle; - - /** - * @var ?array $slope - */ - #[JsonProperty('slope'), ArrayType([DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem::class])] - public ?array $slope; - - /** - * @var ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin $origin - */ - #[JsonProperty('origin')] - public ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin $origin; - - /** - * @var ?float $cyx - */ - #[JsonProperty('cyx')] - public ?float $cyx; - - /** - * @param array{ - * x: array, - * distance: array, - * area: array, - * ratio?: ?string, - * y?: ?array, - * angle?: ?array, - * slope?: ?array, - * origin?: ?DocPagesViewports200ResponseViewportsItemMeasureRectilinearOrigin, - * cyx?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->ratio = $values['ratio'] ?? null; - $this->x = $values['x']; - $this->y = $values['y'] ?? null; - $this->distance = $values['distance']; - $this->area = $values['area']; - $this->angle = $values['angle'] ?? null; - $this->slope = $values['slope'] ?? null; - $this->origin = $values['origin'] ?? null; - $this->cyx = $values['cyx'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.php deleted file mode 100644 index 7d3fff84..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.php deleted file mode 100644 index ca4825d0..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAngleItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.php deleted file mode 100644 index 29871241..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearAreaItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.php deleted file mode 100644 index 0130a611..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearDistanceItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -x = $values['x']; - $this->y = $values['y']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.php deleted file mode 100644 index 72f7d8c3..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItem.php +++ /dev/null @@ -1,106 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.php deleted file mode 100644 index 5bb26060..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearSlopeItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.php deleted file mode 100644 index 0cfaf7d8..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearXItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ - $fraction - */ - #[JsonProperty('fraction')] - public ?string $fraction; - - /** - * @var ?int $precision - */ - #[JsonProperty('precision')] - public ?int $precision; - - /** - * @var ?bool $fixed - */ - #[JsonProperty('fixed')] - public ?bool $fixed; - - /** - * @var ?string $thousands - */ - #[JsonProperty('thousands')] - public ?string $thousands; - - /** - * @var ?string $decimal - */ - #[JsonProperty('decimal')] - public ?string $decimal; - - /** - * @var ?string $prefixSpacing - */ - #[JsonProperty('prefixSpacing')] - public ?string $prefixSpacing; - - /** - * @var ?string $suffixSpacing - */ - #[JsonProperty('suffixSpacing')] - public ?string $suffixSpacing; - - /** - * @var ?value-of $labelPosition - */ - #[JsonProperty('labelPosition')] - public ?string $labelPosition; - - /** - * @param array{ - * unit: string, - * conversion?: ?float, - * fraction?: ?value-of, - * precision?: ?int, - * fixed?: ?bool, - * thousands?: ?string, - * decimal?: ?string, - * prefixSpacing?: ?string, - * suffixSpacing?: ?string, - * labelPosition?: ?value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->unit = $values['unit']; - $this->conversion = $values['conversion'] ?? null; - $this->fraction = $values['fraction'] ?? null; - $this->precision = $values['precision'] ?? null; - $this->fixed = $values['fixed'] ?? null; - $this->thousands = $values['thousands'] ?? null; - $this->decimal = $values['decimal'] ?? null; - $this->prefixSpacing = $values['prefixSpacing'] ?? null; - $this->suffixSpacing = $values['suffixSpacing'] ?? null; - $this->labelPosition = $values['labelPosition'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php b/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php deleted file mode 100644 index 62adbde5..00000000 --- a/src/Types/DocPagesViewports200ResponseViewportsItemMeasureRectilinearYItemFraction.php +++ /dev/null @@ -1,11 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/DocPagesViewportsResponse.php b/src/Types/DocPagesViewportsResponse.php new file mode 100644 index 00000000..e0e45835 --- /dev/null +++ b/src/Types/DocPagesViewportsResponse.php @@ -0,0 +1,35 @@ + $viewports + */ + #[JsonProperty('viewports'), ArrayType([DocPagesViewportsResponseViewportsItem::class])] + public array $viewports; + + /** + * @param array{ + * viewports: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->viewports = $values['viewports']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewportsResponseViewportsItem.php b/src/Types/DocPagesViewportsResponseViewportsItem.php new file mode 100644 index 00000000..a9dffbc9 --- /dev/null +++ b/src/Types/DocPagesViewportsResponseViewportsItem.php @@ -0,0 +1,58 @@ +bbox = $values['bbox']; + $this->name = $values['name'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->owned = $values['owned']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewportsResponseViewportsItemBbox.php b/src/Types/DocPagesViewportsResponseViewportsItemBbox.php new file mode 100644 index 00000000..1b051533 --- /dev/null +++ b/src/Types/DocPagesViewportsResponseViewportsItemBbox.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/DocRedactionsApply200Response.php b/src/Types/DocRedactionsApply200Response.php deleted file mode 100644 index dba3a673..00000000 --- a/src/Types/DocRedactionsApply200Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $results - */ - #[JsonProperty('results'), ArrayType([DocRedactionsApply200ResponseResultsItem::class])] - public array $results; - - /** - * @var int $removedAnnotationCount - */ - #[JsonProperty('removedAnnotationCount')] - public int $removedAnnotationCount; - - /** - * @var MutationMeta $meta - */ - #[JsonProperty('meta')] - public MutationMeta $meta; - - /** - * @param array{ - * scope: DocRedactionsApply200ResponseScope, - * results: array, - * removedAnnotationCount: int, - * meta: MutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->scope = $values['scope']; - $this->results = $values['results']; - $this->removedAnnotationCount = $values['removedAnnotationCount']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseResultsItem.php b/src/Types/DocRedactionsApply200ResponseResultsItem.php deleted file mode 100644 index bec6392f..00000000 --- a/src/Types/DocRedactionsApply200ResponseResultsItem.php +++ /dev/null @@ -1,50 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @var int $removedAnnotationCount - */ - #[JsonProperty('removedAnnotationCount')] - public int $removedAnnotationCount; - - /** - * @param array{ - * page: PageRef, - * status: value-of, - * removedAnnotationCount: int, - * } $values - */ - public function __construct( - array $values, - ) { - $this->page = $values['page']; - $this->status = $values['status']; - $this->removedAnnotationCount = $values['removedAnnotationCount']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php b/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php deleted file mode 100644 index 69dc8e68..00000000 --- a/src/Types/DocRedactionsApply200ResponseResultsItemStatus.php +++ /dev/null @@ -1,9 +0,0 @@ - $pages - */ - #[JsonProperty('pages'), ArrayType([PageRef::class])] - public ?array $pages; - - /** - * @var ?array $annotations - */ - #[JsonProperty('annotations'), ArrayType([AnnotationRef::class])] - public ?array $annotations; - - /** - * @param array{ - * pages?: ?array, - * annotations?: ?array, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->pages = $values['pages'] ?? null; - $this->annotations = $values['annotations'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocRedactionsApplyResponse.php b/src/Types/DocRedactionsApplyResponse.php new file mode 100644 index 00000000..addcc88b --- /dev/null +++ b/src/Types/DocRedactionsApplyResponse.php @@ -0,0 +1,59 @@ + $results + */ + #[JsonProperty('results'), ArrayType([DocRedactionsApplyResponseResultsItem::class])] + public array $results; + + /** + * @var int $removedAnnotationCount + */ + #[JsonProperty('removedAnnotationCount')] + public int $removedAnnotationCount; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * scope: DocRedactionsApplyResponseScope, + * results: array, + * removedAnnotationCount: int, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->scope = $values['scope']; + $this->results = $values['results']; + $this->removedAnnotationCount = $values['removedAnnotationCount']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApplyResponseResultsItem.php b/src/Types/DocRedactionsApplyResponseResultsItem.php new file mode 100644 index 00000000..acba2a22 --- /dev/null +++ b/src/Types/DocRedactionsApplyResponseResultsItem.php @@ -0,0 +1,50 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var int $removedAnnotationCount + */ + #[JsonProperty('removedAnnotationCount')] + public int $removedAnnotationCount; + + /** + * @param array{ + * page: PageRef, + * status: value-of, + * removedAnnotationCount: int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->page = $values['page']; + $this->status = $values['status']; + $this->removedAnnotationCount = $values['removedAnnotationCount']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocRedactionsApplyResponseResultsItemStatus.php b/src/Types/DocRedactionsApplyResponseResultsItemStatus.php new file mode 100644 index 00000000..a580b95f --- /dev/null +++ b/src/Types/DocRedactionsApplyResponseResultsItemStatus.php @@ -0,0 +1,9 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([PageRef::class])] + public ?array $pages; + + /** + * @var ?array $annotations + */ + #[JsonProperty('annotations'), ArrayType([AnnotationRef::class])] + public ?array $annotations; + + /** + * @param array{ + * pages?: ?array, + * annotations?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->pages = $values['pages'] ?? null; + $this->annotations = $values['annotations'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysis200Response.php b/src/Types/DocSignaturesAnalysis200Response.php deleted file mode 100644 index 0bd110d8..00000000 --- a/src/Types/DocSignaturesAnalysis200Response.php +++ /dev/null @@ -1,107 +0,0 @@ - $mode - */ - #[JsonProperty('mode')] - public string $mode; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @var DocSignaturesAnalysis200ResponseBasis $basis - */ - #[JsonProperty('basis')] - public DocSignaturesAnalysis200ResponseBasis $basis; - - /** - * @var DocSignaturesAnalysis200ResponseSince $since - */ - #[JsonProperty('since')] - public DocSignaturesAnalysis200ResponseSince $since; - - /** - * @var DocSignaturesAnalysis200ResponseUntil $until - */ - #[JsonProperty('until')] - public DocSignaturesAnalysis200ResponseUntil $until; - - /** - * @var array $restrictions - */ - #[JsonProperty('restrictions'), ArrayType([DocSignaturesAnalysis200ResponseRestrictionsItem::class])] - public array $restrictions; - - /** - * @var DocSignaturesAnalysis200ResponseCurrent $current - */ - #[JsonProperty('current')] - public DocSignaturesAnalysis200ResponseCurrent $current; - - /** - * @var DocSignaturesAnalysis200ResponseLater $later - */ - #[JsonProperty('later')] - public DocSignaturesAnalysis200ResponseLater $later; - - /** - * @var value-of $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var array $steps - */ - #[JsonProperty('steps'), ArrayType(['mixed'])] - public array $steps; - - /** - * @param array{ - * mode: value-of, - * policyVersion: int, - * basis: DocSignaturesAnalysis200ResponseBasis, - * since: DocSignaturesAnalysis200ResponseSince, - * until: DocSignaturesAnalysis200ResponseUntil, - * restrictions: array, - * current: DocSignaturesAnalysis200ResponseCurrent, - * later: DocSignaturesAnalysis200ResponseLater, - * verdict: value-of, - * steps: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->mode = $values['mode']; - $this->policyVersion = $values['policyVersion']; - $this->basis = $values['basis']; - $this->since = $values['since']; - $this->until = $values['until']; - $this->restrictions = $values['restrictions']; - $this->current = $values['current']; - $this->later = $values['later']; - $this->verdict = $values['verdict']; - $this->steps = $values['steps']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseBasis.php b/src/Types/DocSignaturesAnalysis200ResponseBasis.php deleted file mode 100644 index aa826deb..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseBasis.php +++ /dev/null @@ -1,50 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @param array{ - * version: DocSignaturesAnalysis200ResponseBasisVersion, - * editsVersion: int, - * source: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->version = $values['version']; - $this->editsVersion = $values['editsVersion']; - $this->source = $values['source']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseBasisSource.php b/src/Types/DocSignaturesAnalysis200ResponseBasisSource.php deleted file mode 100644 index 63a3d72d..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseBasisSource.php +++ /dev/null @@ -1,9 +0,0 @@ -sha256 = $values['sha256']; - $this->byteLength = $values['byteLength']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseCurrent.php b/src/Types/DocSignaturesAnalysis200ResponseCurrent.php deleted file mode 100644 index 59a7672d..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseCurrent.php +++ /dev/null @@ -1,67 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var bool $complete - */ - #[JsonProperty('complete')] - public bool $complete; - - /** - * @var ?DocSignaturesAnalysis200ResponseCurrentPrimary $primary - */ - #[JsonProperty('primary')] - public ?DocSignaturesAnalysis200ResponseCurrentPrimary $primary; - - /** - * @var array $findings - */ - #[JsonProperty('findings'), ArrayType([DocSignaturesAnalysis200ResponseCurrentFindingsItem::class])] - public array $findings; - - /** - * @var value-of $method - */ - #[JsonProperty('method')] - public string $method; - - /** - * @param array{ - * verdict: value-of, - * complete: bool, - * findings: array, - * method: value-of, - * primary?: ?DocSignaturesAnalysis200ResponseCurrentPrimary, - * } $values - */ - public function __construct( - array $values, - ) { - $this->verdict = $values['verdict']; - $this->complete = $values['complete']; - $this->primary = $values['primary'] ?? null; - $this->findings = $values['findings']; - $this->method = $values['method']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.php b/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.php deleted file mode 100644 index aa839133..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItem.php +++ /dev/null @@ -1,66 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var int $objectNumber - */ - #[JsonProperty('objectNumber')] - public int $objectNumber; - - /** - * @var ?string $edge - */ - #[JsonProperty('edge')] - public ?string $edge; - - /** - * @var ?string $detail - */ - #[JsonProperty('detail')] - public ?string $detail; - - /** - * @param array{ - * rule: string, - * verdict: value-of, - * objectNumber: int, - * edge?: ?string, - * detail?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->rule = $values['rule']; - $this->verdict = $values['verdict']; - $this->objectNumber = $values['objectNumber']; - $this->edge = $values['edge'] ?? null; - $this->detail = $values['detail'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.php b/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.php deleted file mode 100644 index 79c2d5b8..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseCurrentFindingsItemVerdict.php +++ /dev/null @@ -1,10 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var int $objectNumber - */ - #[JsonProperty('objectNumber')] - public int $objectNumber; - - /** - * @var ?string $edge - */ - #[JsonProperty('edge')] - public ?string $edge; - - /** - * @var ?string $detail - */ - #[JsonProperty('detail')] - public ?string $detail; - - /** - * @param array{ - * rule: string, - * verdict: value-of, - * objectNumber: int, - * edge?: ?string, - * detail?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->rule = $values['rule']; - $this->verdict = $values['verdict']; - $this->objectNumber = $values['objectNumber']; - $this->edge = $values['edge'] ?? null; - $this->detail = $values['detail'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.php b/src/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.php deleted file mode 100644 index 2145817d..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseCurrentPrimaryVerdict.php +++ /dev/null @@ -1,10 +0,0 @@ - $undoneObjectNumbers - */ - #[JsonProperty('undoneObjectNumbers'), ArrayType(['integer'])] - public array $undoneObjectNumbers; - - /** - * @param array{ - * revisionCount: int, - * undoneObjectNumbers: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->revisionCount = $values['revisionCount']; - $this->undoneObjectNumbers = $values['undoneObjectNumbers']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseMode.php b/src/Types/DocSignaturesAnalysis200ResponseMode.php deleted file mode 100644 index 10f67236..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var bool $own - */ - #[JsonProperty('own')] - public bool $own; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @var mixed $fields - */ - #[JsonProperty('fields')] - public mixed $fields; - - /** - * @param array{ - * signatureIndex: int, - * revisionIndex: int, - * source: value-of, - * own: bool, - * permission?: ?float, - * fields?: mixed, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->revisionIndex = $values['revisionIndex']; - $this->source = $values['source']; - $this->own = $values['own']; - $this->permission = $values['permission'] ?? null; - $this->fields = $values['fields'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.php b/src/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.php deleted file mode 100644 index 945972c4..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseRestrictionsItemSource.php +++ /dev/null @@ -1,10 +0,0 @@ -revisionIndex = $values['revisionIndex']; - $this->signatureIndex = $values['signatureIndex'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseUntil.php b/src/Types/DocSignaturesAnalysis200ResponseUntil.php deleted file mode 100644 index 3a93c523..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseUntil.php +++ /dev/null @@ -1,34 +0,0 @@ -revisionIndex = $values['revisionIndex']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesAnalysis200ResponseVerdict.php b/src/Types/DocSignaturesAnalysis200ResponseVerdict.php deleted file mode 100644 index d1110bac..00000000 --- a/src/Types/DocSignaturesAnalysis200ResponseVerdict.php +++ /dev/null @@ -1,11 +0,0 @@ - $mode + */ + #[JsonProperty('mode')] + public string $mode; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @var DocSignaturesAnalysisResponseBasis $basis + */ + #[JsonProperty('basis')] + public DocSignaturesAnalysisResponseBasis $basis; + + /** + * @var DocSignaturesAnalysisResponseSince $since + */ + #[JsonProperty('since')] + public DocSignaturesAnalysisResponseSince $since; + + /** + * @var DocSignaturesAnalysisResponseUntil $until + */ + #[JsonProperty('until')] + public DocSignaturesAnalysisResponseUntil $until; + + /** + * @var array $restrictions + */ + #[JsonProperty('restrictions'), ArrayType([DocSignaturesAnalysisResponseRestrictionsItem::class])] + public array $restrictions; + + /** + * @var DocSignaturesAnalysisResponseCurrent $current + */ + #[JsonProperty('current')] + public DocSignaturesAnalysisResponseCurrent $current; + + /** + * @var DocSignaturesAnalysisResponseLater $later + */ + #[JsonProperty('later')] + public DocSignaturesAnalysisResponseLater $later; + + /** + * @var value-of $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var array $steps + */ + #[JsonProperty('steps'), ArrayType(['mixed'])] + public array $steps; + + /** + * @param array{ + * mode: value-of, + * policyVersion: int, + * basis: DocSignaturesAnalysisResponseBasis, + * since: DocSignaturesAnalysisResponseSince, + * until: DocSignaturesAnalysisResponseUntil, + * restrictions: array, + * current: DocSignaturesAnalysisResponseCurrent, + * later: DocSignaturesAnalysisResponseLater, + * verdict: value-of, + * steps: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->mode = $values['mode']; + $this->policyVersion = $values['policyVersion']; + $this->basis = $values['basis']; + $this->since = $values['since']; + $this->until = $values['until']; + $this->restrictions = $values['restrictions']; + $this->current = $values['current']; + $this->later = $values['later']; + $this->verdict = $values['verdict']; + $this->steps = $values['steps']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseBasis.php b/src/Types/DocSignaturesAnalysisResponseBasis.php new file mode 100644 index 00000000..9c556f79 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseBasis.php @@ -0,0 +1,50 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @param array{ + * version: DocSignaturesAnalysisResponseBasisVersion, + * editsVersion: int, + * source: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->version = $values['version']; + $this->editsVersion = $values['editsVersion']; + $this->source = $values['source']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseBasisSource.php b/src/Types/DocSignaturesAnalysisResponseBasisSource.php new file mode 100644 index 00000000..cacc0d9c --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseBasisSource.php @@ -0,0 +1,9 @@ +sha256 = $values['sha256']; + $this->sizeBytes = $values['sizeBytes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseCurrent.php b/src/Types/DocSignaturesAnalysisResponseCurrent.php new file mode 100644 index 00000000..56f06462 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseCurrent.php @@ -0,0 +1,67 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var bool $complete + */ + #[JsonProperty('complete')] + public bool $complete; + + /** + * @var ?DocSignaturesAnalysisResponseCurrentPrimary $primary + */ + #[JsonProperty('primary')] + public ?DocSignaturesAnalysisResponseCurrentPrimary $primary; + + /** + * @var array $findings + */ + #[JsonProperty('findings'), ArrayType([DocSignaturesAnalysisResponseCurrentFindingsItem::class])] + public array $findings; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @param array{ + * verdict: value-of, + * complete: bool, + * findings: array, + * method: value-of, + * primary?: ?DocSignaturesAnalysisResponseCurrentPrimary, + * } $values + */ + public function __construct( + array $values, + ) { + $this->verdict = $values['verdict']; + $this->complete = $values['complete']; + $this->primary = $values['primary'] ?? null; + $this->findings = $values['findings']; + $this->method = $values['method']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItem.php b/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItem.php new file mode 100644 index 00000000..1d579901 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItem.php @@ -0,0 +1,66 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var int $objectNumber + */ + #[JsonProperty('objectNumber')] + public int $objectNumber; + + /** + * @var ?string $edge + */ + #[JsonProperty('edge')] + public ?string $edge; + + /** + * @var ?string $detail + */ + #[JsonProperty('detail')] + public ?string $detail; + + /** + * @param array{ + * rule: string, + * verdict: value-of, + * objectNumber: int, + * edge?: ?string, + * detail?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->rule = $values['rule']; + $this->verdict = $values['verdict']; + $this->objectNumber = $values['objectNumber']; + $this->edge = $values['edge'] ?? null; + $this->detail = $values['detail'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItemVerdict.php b/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItemVerdict.php new file mode 100644 index 00000000..0fa47833 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseCurrentFindingsItemVerdict.php @@ -0,0 +1,10 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var int $objectNumber + */ + #[JsonProperty('objectNumber')] + public int $objectNumber; + + /** + * @var ?string $edge + */ + #[JsonProperty('edge')] + public ?string $edge; + + /** + * @var ?string $detail + */ + #[JsonProperty('detail')] + public ?string $detail; + + /** + * @param array{ + * rule: string, + * verdict: value-of, + * objectNumber: int, + * edge?: ?string, + * detail?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->rule = $values['rule']; + $this->verdict = $values['verdict']; + $this->objectNumber = $values['objectNumber']; + $this->edge = $values['edge'] ?? null; + $this->detail = $values['detail'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseCurrentPrimaryVerdict.php b/src/Types/DocSignaturesAnalysisResponseCurrentPrimaryVerdict.php new file mode 100644 index 00000000..30a23e5e --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseCurrentPrimaryVerdict.php @@ -0,0 +1,10 @@ + $undoneObjectNumbers + */ + #[JsonProperty('undoneObjectNumbers'), ArrayType(['integer'])] + public array $undoneObjectNumbers; + + /** + * @param array{ + * revisionCount: int, + * undoneObjectNumbers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->revisionCount = $values['revisionCount']; + $this->undoneObjectNumbers = $values['undoneObjectNumbers']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseMode.php b/src/Types/DocSignaturesAnalysisResponseMode.php new file mode 100644 index 00000000..5a540d36 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseMode.php @@ -0,0 +1,9 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var bool $own + */ + #[JsonProperty('own')] + public bool $own; + + /** + * @var ?int $permission + */ + #[JsonProperty('permission')] + public ?int $permission; + + /** + * @var mixed $fields + */ + #[JsonProperty('fields')] + public mixed $fields; + + /** + * @param array{ + * signatureIndex: int, + * revisionIndex: int, + * source: value-of, + * own: bool, + * permission?: ?int, + * fields?: mixed, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->revisionIndex = $values['revisionIndex']; + $this->source = $values['source']; + $this->own = $values['own']; + $this->permission = $values['permission'] ?? null; + $this->fields = $values['fields'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseRestrictionsItemSource.php b/src/Types/DocSignaturesAnalysisResponseRestrictionsItemSource.php new file mode 100644 index 00000000..7b0c5f13 --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseRestrictionsItemSource.php @@ -0,0 +1,10 @@ +revisionIndex = $values['revisionIndex']; + $this->signatureIndex = $values['signatureIndex'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseUntil.php b/src/Types/DocSignaturesAnalysisResponseUntil.php new file mode 100644 index 00000000..c4c301eb --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseUntil.php @@ -0,0 +1,34 @@ +revisionIndex = $values['revisionIndex']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAnalysisResponseVerdict.php b/src/Types/DocSignaturesAnalysisResponseVerdict.php new file mode 100644 index 00000000..07fb6b0e --- /dev/null +++ b/src/Types/DocSignaturesAnalysisResponseVerdict.php @@ -0,0 +1,11 @@ + $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @param array{ - * status: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->status = $values['status']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesCancel200ResponseStatus.php b/src/Types/DocSignaturesCancel200ResponseStatus.php deleted file mode 100644 index 21e39272..00000000 --- a/src/Types/DocSignaturesCancel200ResponseStatus.php +++ /dev/null @@ -1,10 +0,0 @@ - $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @param array{ + * status: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->status = $values['status']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCancelResponseStatus.php b/src/Types/DocSignaturesCancelResponseStatus.php new file mode 100644 index 00000000..d4cd87f4 --- /dev/null +++ b/src/Types/DocSignaturesCancelResponseStatus.php @@ -0,0 +1,10 @@ + $status - */ - #[JsonProperty('status')] - public string $status; - - /** - * @var DocSignaturesComplete200ResponseSignature $signature - */ - #[JsonProperty('signature')] - public DocSignaturesComplete200ResponseSignature $signature; - - /** - * @var DocSignaturesComplete200ResponseVersion $version - */ - #[JsonProperty('version')] - public DocSignaturesComplete200ResponseVersion $version; - - /** - * @var DocSignaturesComplete200ResponsePrevious $previous - */ - #[JsonProperty('previous')] - public DocSignaturesComplete200ResponsePrevious $previous; - - /** - * @var DocSignaturesComplete200ResponseProtection $protection - */ - #[JsonProperty('protection')] - public DocSignaturesComplete200ResponseProtection $protection; - - /** - * @var MutationMeta $meta - */ - #[JsonProperty('meta')] - public MutationMeta $meta; - - /** - * @param array{ - * status: value-of, - * signature: DocSignaturesComplete200ResponseSignature, - * version: DocSignaturesComplete200ResponseVersion, - * previous: DocSignaturesComplete200ResponsePrevious, - * protection: DocSignaturesComplete200ResponseProtection, - * meta: MutationMeta, - * } $values - */ - public function __construct( - array $values, - ) { - $this->status = $values['status']; - $this->signature = $values['signature']; - $this->version = $values['version']; - $this->previous = $values['previous']; - $this->protection = $values['protection']; - $this->meta = $values['meta']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponsePrevious.php b/src/Types/DocSignaturesComplete200ResponsePrevious.php deleted file mode 100644 index 908998f9..00000000 --- a/src/Types/DocSignaturesComplete200ResponsePrevious.php +++ /dev/null @@ -1,42 +0,0 @@ -baseSha256 = $values['baseSha256']; - $this->editsVersion = $values['editsVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseProtection.php b/src/Types/DocSignaturesComplete200ResponseProtection.php deleted file mode 100644 index dfa32bc1..00000000 --- a/src/Types/DocSignaturesComplete200ResponseProtection.php +++ /dev/null @@ -1,67 +0,0 @@ - $enforced - */ - #[JsonProperty('enforced')] - public ?string $enforced; - - /** - * @var ?value-of $judged - */ - #[JsonProperty('judged')] - public ?string $judged; - - /** - * @var ?DocSignaturesComplete200ResponseProtectionCertification $certification - */ - #[JsonProperty('certification')] - public ?DocSignaturesComplete200ResponseProtectionCertification $certification; - - /** - * @var array $fieldLocks - */ - #[JsonProperty('fieldLocks'), ArrayType([DocSignaturesComplete200ResponseProtectionFieldLocksItem::class])] - public array $fieldLocks; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @param array{ - * fieldLocks: array, - * policyVersion: int, - * enforced?: ?value-of, - * judged?: ?value-of, - * certification?: ?DocSignaturesComplete200ResponseProtectionCertification, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enforced = $values['enforced'] ?? null; - $this->judged = $values['judged'] ?? null; - $this->certification = $values['certification'] ?? null; - $this->fieldLocks = $values['fieldLocks']; - $this->policyVersion = $values['policyVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseProtectionCertification.php b/src/Types/DocSignaturesComplete200ResponseProtectionCertification.php deleted file mode 100644 index c502707c..00000000 --- a/src/Types/DocSignaturesComplete200ResponseProtectionCertification.php +++ /dev/null @@ -1,42 +0,0 @@ -signatureIndex = $values['signatureIndex']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseProtectionEnforced.php b/src/Types/DocSignaturesComplete200ResponseProtectionEnforced.php deleted file mode 100644 index 74c88664..00000000 --- a/src/Types/DocSignaturesComplete200ResponseProtectionEnforced.php +++ /dev/null @@ -1,11 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var ?DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec $spec - */ - #[JsonProperty('spec')] - public ?DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec $spec; - - /** - * @param array{ - * signatureIndex: int, - * source: value-of, - * spec?: ?DocSignaturesComplete200ResponseProtectionFieldLocksItemSpec, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->source = $values['source']; - $this->spec = $values['spec'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.php b/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.php deleted file mode 100644 index 55090c54..00000000 --- a/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSource.php +++ /dev/null @@ -1,9 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.php b/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.php deleted file mode 100644 index f50df38c..00000000 --- a/src/Types/DocSignaturesComplete200ResponseProtectionFieldLocksItemSpecAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $kind - */ - #[JsonProperty('kind')] - public string $kind; - - /** - * @var ?string $filter - */ - #[JsonProperty('filter')] - public ?string $filter; - - /** - * @var ?string $subFilter - */ - #[JsonProperty('subFilter')] - public ?string $subFilter; - - /** - * @var ?array $byteRange - */ - #[JsonProperty('byteRange'), ArrayType(['mixed'])] - public ?array $byteRange; - - /** - * @var int $contentsSize - */ - #[JsonProperty('contentsSize')] - public int $contentsSize; - - /** - * @var ?value-of $coverage - */ - #[JsonProperty('coverage')] - public ?string $coverage; - - /** - * @var ?int $revisionIndex - */ - #[JsonProperty('revisionIndex')] - public ?int $revisionIndex; - - /** - * @var DocSignaturesComplete200ResponseSignatureSigner $signer - */ - #[JsonProperty('signer')] - public DocSignaturesComplete200ResponseSignatureSigner $signer; - - /** - * @var ?float $docMdp - */ - #[JsonProperty('docMdp')] - public ?float $docMdp; - - /** - * @var bool $catalogCertification - */ - #[JsonProperty('catalogCertification')] - public bool $catalogCertification; - - /** - * @var ?DocSignaturesComplete200ResponseSignatureFieldMdp $fieldMdp - */ - #[JsonProperty('fieldMdp')] - public ?DocSignaturesComplete200ResponseSignatureFieldMdp $fieldMdp; - - /** - * @var ?DocSignaturesComplete200ResponseSignatureLock $lock - */ - #[JsonProperty('lock')] - public ?DocSignaturesComplete200ResponseSignatureLock $lock; - - /** - * @var ?DocSignaturesComplete200ResponseSignatureSeedValue $seedValue - */ - #[JsonProperty('seedValue')] - public ?DocSignaturesComplete200ResponseSignatureSeedValue $seedValue; - - /** - * @param array{ - * index: int, - * field: FormFieldRef, - * fieldName: string, - * signed: bool, - * kind: value-of, - * contentsSize: int, - * signer: DocSignaturesComplete200ResponseSignatureSigner, - * catalogCertification: bool, - * widget?: ?FormWidget, - * filter?: ?string, - * subFilter?: ?string, - * byteRange?: ?array, - * coverage?: ?value-of, - * revisionIndex?: ?int, - * docMdp?: ?float, - * fieldMdp?: ?DocSignaturesComplete200ResponseSignatureFieldMdp, - * lock?: ?DocSignaturesComplete200ResponseSignatureLock, - * seedValue?: ?DocSignaturesComplete200ResponseSignatureSeedValue, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->field = $values['field']; - $this->fieldName = $values['fieldName']; - $this->widget = $values['widget'] ?? null; - $this->signed = $values['signed']; - $this->kind = $values['kind']; - $this->filter = $values['filter'] ?? null; - $this->subFilter = $values['subFilter'] ?? null; - $this->byteRange = $values['byteRange'] ?? null; - $this->contentsSize = $values['contentsSize']; - $this->coverage = $values['coverage'] ?? null; - $this->revisionIndex = $values['revisionIndex'] ?? null; - $this->signer = $values['signer']; - $this->docMdp = $values['docMdp'] ?? null; - $this->catalogCertification = $values['catalogCertification']; - $this->fieldMdp = $values['fieldMdp'] ?? null; - $this->lock = $values['lock'] ?? null; - $this->seedValue = $values['seedValue'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureCoverage.php b/src/Types/DocSignaturesComplete200ResponseSignatureCoverage.php deleted file mode 100644 index 3824166b..00000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureCoverage.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.php b/src/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.php deleted file mode 100644 index 8b6ebf48..00000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureFieldMdpAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureLockAction.php b/src/Types/DocSignaturesComplete200ResponseSignatureLockAction.php deleted file mode 100644 index cd03692a..00000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureLockAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $subFilters - */ - #[JsonProperty('subFilters'), ArrayType(['string'])] - public array $subFilters; - - /** - * @var array $digestMethods - */ - #[JsonProperty('digestMethods'), ArrayType(['string'])] - public array $digestMethods; - - /** - * @var array $reasons - */ - #[JsonProperty('reasons'), ArrayType(['string'])] - public array $reasons; - - /** - * @var bool $unsupportedRequired - */ - #[JsonProperty('unsupportedRequired')] - public bool $unsupportedRequired; - - /** - * @param array{ - * requiredFlags: int, - * presentFlags: int, - * subFilters: array, - * digestMethods: array, - * reasons: array, - * unsupportedRequired: bool, - * version?: ?int, - * mdp?: ?float, - * filter?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->requiredFlags = $values['requiredFlags']; - $this->presentFlags = $values['presentFlags']; - $this->version = $values['version'] ?? null; - $this->mdp = $values['mdp'] ?? null; - $this->filter = $values['filter'] ?? null; - $this->subFilters = $values['subFilters']; - $this->digestMethods = $values['digestMethods']; - $this->reasons = $values['reasons']; - $this->unsupportedRequired = $values['unsupportedRequired']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php b/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php deleted file mode 100644 index 8cee15bc..00000000 --- a/src/Types/DocSignaturesComplete200ResponseSignatureSigner.php +++ /dev/null @@ -1,68 +0,0 @@ -name = $values['name'] ?? null; - $this->reason = $values['reason'] ?? null; - $this->location = $values['location'] ?? null; - $this->contactInfo = $values['contactInfo'] ?? null; - $this->signedAt = $values['signedAt'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesComplete200ResponseStatus.php b/src/Types/DocSignaturesComplete200ResponseStatus.php deleted file mode 100644 index ab544f9b..00000000 --- a/src/Types/DocSignaturesComplete200ResponseStatus.php +++ /dev/null @@ -1,9 +0,0 @@ -sha256 = $values['sha256']; - $this->byteLength = $values['byteLength']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesCompleteResponse.php b/src/Types/DocSignaturesCompleteResponse.php new file mode 100644 index 00000000..8d20e4df --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponse.php @@ -0,0 +1,74 @@ + $status + */ + #[JsonProperty('status')] + public string $status; + + /** + * @var DocSignaturesCompleteResponseSignature $signature + */ + #[JsonProperty('signature')] + public DocSignaturesCompleteResponseSignature $signature; + + /** + * @var DocSignaturesCompleteResponseVersion $version + */ + #[JsonProperty('version')] + public DocSignaturesCompleteResponseVersion $version; + + /** + * @var DocSignaturesCompleteResponsePrevious $previous + */ + #[JsonProperty('previous')] + public DocSignaturesCompleteResponsePrevious $previous; + + /** + * @var DocSignaturesCompleteResponseProtection $protection + */ + #[JsonProperty('protection')] + public DocSignaturesCompleteResponseProtection $protection; + + /** + * @var MutationMeta $meta + */ + #[JsonProperty('meta')] + public MutationMeta $meta; + + /** + * @param array{ + * status: value-of, + * signature: DocSignaturesCompleteResponseSignature, + * version: DocSignaturesCompleteResponseVersion, + * previous: DocSignaturesCompleteResponsePrevious, + * protection: DocSignaturesCompleteResponseProtection, + * meta: MutationMeta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->status = $values['status']; + $this->signature = $values['signature']; + $this->version = $values['version']; + $this->previous = $values['previous']; + $this->protection = $values['protection']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponsePrevious.php b/src/Types/DocSignaturesCompleteResponsePrevious.php new file mode 100644 index 00000000..960f56e5 --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponsePrevious.php @@ -0,0 +1,42 @@ +baseSha256 = $values['baseSha256']; + $this->editsVersion = $values['editsVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseProtection.php b/src/Types/DocSignaturesCompleteResponseProtection.php new file mode 100644 index 00000000..b920d094 --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseProtection.php @@ -0,0 +1,67 @@ + $enforced + */ + #[JsonProperty('enforced')] + public ?string $enforced; + + /** + * @var ?value-of $judged + */ + #[JsonProperty('judged')] + public ?string $judged; + + /** + * @var ?DocSignaturesCompleteResponseProtectionCertification $certification + */ + #[JsonProperty('certification')] + public ?DocSignaturesCompleteResponseProtectionCertification $certification; + + /** + * @var array $fieldLocks + */ + #[JsonProperty('fieldLocks'), ArrayType([DocSignaturesCompleteResponseProtectionFieldLocksItem::class])] + public array $fieldLocks; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @param array{ + * fieldLocks: array, + * policyVersion: int, + * enforced?: ?value-of, + * judged?: ?value-of, + * certification?: ?DocSignaturesCompleteResponseProtectionCertification, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enforced = $values['enforced'] ?? null; + $this->judged = $values['judged'] ?? null; + $this->certification = $values['certification'] ?? null; + $this->fieldLocks = $values['fieldLocks']; + $this->policyVersion = $values['policyVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseProtectionCertification.php b/src/Types/DocSignaturesCompleteResponseProtectionCertification.php new file mode 100644 index 00000000..cc23dd3f --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseProtectionCertification.php @@ -0,0 +1,42 @@ +signatureIndex = $values['signatureIndex']; + $this->permission = $values['permission']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseProtectionEnforced.php b/src/Types/DocSignaturesCompleteResponseProtectionEnforced.php new file mode 100644 index 00000000..993e151a --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseProtectionEnforced.php @@ -0,0 +1,11 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var FieldLockSpec $spec + */ + #[JsonProperty('spec')] + public FieldLockSpec $spec; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * spec: FieldLockSpec, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + $this->spec = $values['spec']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseProtectionFieldLocksItemSource.php b/src/Types/DocSignaturesCompleteResponseProtectionFieldLocksItemSource.php new file mode 100644 index 00000000..6761a567 --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseProtectionFieldLocksItemSource.php @@ -0,0 +1,9 @@ + $kind + */ + #[JsonProperty('kind')] + public string $kind; + + /** + * @var ?string $filter + */ + #[JsonProperty('filter')] + public ?string $filter; + + /** + * @var ?string $subFilter + */ + #[JsonProperty('subFilter')] + public ?string $subFilter; + + /** + * @var ?array $byteRange + */ + #[JsonProperty('byteRange'), ArrayType(['mixed'])] + public ?array $byteRange; + + /** + * @var int $contentsSizeBytes + */ + #[JsonProperty('contentsSizeBytes')] + public int $contentsSizeBytes; + + /** + * @var ?value-of $coverage + */ + #[JsonProperty('coverage')] + public ?string $coverage; + + /** + * @var ?int $revisionIndex + */ + #[JsonProperty('revisionIndex')] + public ?int $revisionIndex; + + /** + * @var DocSignaturesCompleteResponseSignatureSigner $signer + */ + #[JsonProperty('signer')] + public DocSignaturesCompleteResponseSignatureSigner $signer; + + /** + * @var ?int $docMdp + */ + #[JsonProperty('docMdp')] + public ?int $docMdp; + + /** + * @var bool $catalogCertification + */ + #[JsonProperty('catalogCertification')] + public bool $catalogCertification; + + /** + * @var ?FieldLockSpec $fieldMdp + */ + #[JsonProperty('fieldMdp')] + public ?FieldLockSpec $fieldMdp; + + /** + * @var ?FieldLockSpec $lock + */ + #[JsonProperty('lock')] + public ?FieldLockSpec $lock; + + /** + * @var ?DocSignaturesCompleteResponseSignatureSeedValue $seedValue + */ + #[JsonProperty('seedValue')] + public ?DocSignaturesCompleteResponseSignatureSeedValue $seedValue; + + /** + * @param array{ + * index: int, + * field: FormFieldRef, + * fieldName: string, + * signed: bool, + * kind: value-of, + * contentsSizeBytes: int, + * signer: DocSignaturesCompleteResponseSignatureSigner, + * catalogCertification: bool, + * widget?: ?FormWidget, + * filter?: ?string, + * subFilter?: ?string, + * byteRange?: ?array, + * coverage?: ?value-of, + * revisionIndex?: ?int, + * docMdp?: ?int, + * fieldMdp?: ?FieldLockSpec, + * lock?: ?FieldLockSpec, + * seedValue?: ?DocSignaturesCompleteResponseSignatureSeedValue, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->field = $values['field']; + $this->fieldName = $values['fieldName']; + $this->widget = $values['widget'] ?? null; + $this->signed = $values['signed']; + $this->kind = $values['kind']; + $this->filter = $values['filter'] ?? null; + $this->subFilter = $values['subFilter'] ?? null; + $this->byteRange = $values['byteRange'] ?? null; + $this->contentsSizeBytes = $values['contentsSizeBytes']; + $this->coverage = $values['coverage'] ?? null; + $this->revisionIndex = $values['revisionIndex'] ?? null; + $this->signer = $values['signer']; + $this->docMdp = $values['docMdp'] ?? null; + $this->catalogCertification = $values['catalogCertification']; + $this->fieldMdp = $values['fieldMdp'] ?? null; + $this->lock = $values['lock'] ?? null; + $this->seedValue = $values['seedValue'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseSignatureCoverage.php b/src/Types/DocSignaturesCompleteResponseSignatureCoverage.php new file mode 100644 index 00000000..155eec26 --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseSignatureCoverage.php @@ -0,0 +1,10 @@ + $subFilters + */ + #[JsonProperty('subFilters'), ArrayType(['string'])] + public array $subFilters; + + /** + * @var bool $subFiltersRequired + */ + #[JsonProperty('subFiltersRequired')] + public bool $subFiltersRequired; + + /** + * @var array $digestMethods + */ + #[JsonProperty('digestMethods'), ArrayType(['string'])] + public array $digestMethods; + + /** + * @var bool $digestMethodsRequired + */ + #[JsonProperty('digestMethodsRequired')] + public bool $digestMethodsRequired; + + /** + * @var array $reasons + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var bool $reasonsRequired + */ + #[JsonProperty('reasonsRequired')] + public bool $reasonsRequired; + + /** + * @var bool $unsupportedRequired + */ + #[JsonProperty('unsupportedRequired')] + public bool $unsupportedRequired; + + /** + * @param array{ + * parserVersionRequired: bool, + * filterRequired: bool, + * subFilters: array, + * subFiltersRequired: bool, + * digestMethods: array, + * digestMethodsRequired: bool, + * reasons: array, + * reasonsRequired: bool, + * unsupportedRequired: bool, + * parserVersion?: ?int, + * mdp?: ?int, + * filter?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->parserVersion = $values['parserVersion'] ?? null; + $this->parserVersionRequired = $values['parserVersionRequired']; + $this->mdp = $values['mdp'] ?? null; + $this->filter = $values['filter'] ?? null; + $this->filterRequired = $values['filterRequired']; + $this->subFilters = $values['subFilters']; + $this->subFiltersRequired = $values['subFiltersRequired']; + $this->digestMethods = $values['digestMethods']; + $this->digestMethodsRequired = $values['digestMethodsRequired']; + $this->reasons = $values['reasons']; + $this->reasonsRequired = $values['reasonsRequired']; + $this->unsupportedRequired = $values['unsupportedRequired']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseSignatureSigner.php b/src/Types/DocSignaturesCompleteResponseSignatureSigner.php new file mode 100644 index 00000000..bb73441d --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseSignatureSigner.php @@ -0,0 +1,68 @@ +name = $values['name'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->location = $values['location'] ?? null; + $this->contactInfo = $values['contactInfo'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesCompleteResponseStatus.php b/src/Types/DocSignaturesCompleteResponseStatus.php new file mode 100644 index 00000000..b4ea5365 --- /dev/null +++ b/src/Types/DocSignaturesCompleteResponseStatus.php @@ -0,0 +1,9 @@ +sha256 = $values['sha256']; + $this->sizeBytes = $values['sizeBytes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesList200Response.php b/src/Types/DocSignaturesList200Response.php deleted file mode 100644 index adccc561..00000000 --- a/src/Types/DocSignaturesList200Response.php +++ /dev/null @@ -1,59 +0,0 @@ - $revisions - */ - #[JsonProperty('revisions'), ArrayType([DocSignaturesList200ResponseRevisionsItem::class])] - public array $revisions; - - /** - * @var array $signatures - */ - #[JsonProperty('signatures'), ArrayType([DocSignaturesList200ResponseSignaturesItem::class])] - public array $signatures; - - /** - * @var DocSignaturesList200ResponseProtection $protection - */ - #[JsonProperty('protection')] - public DocSignaturesList200ResponseProtection $protection; - - /** - * @param array{ - * chainValid: bool, - * revisions: array, - * signatures: array, - * protection: DocSignaturesList200ResponseProtection, - * } $values - */ - public function __construct( - array $values, - ) { - $this->chainValid = $values['chainValid']; - $this->revisions = $values['revisions']; - $this->signatures = $values['signatures']; - $this->protection = $values['protection']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseProtection.php b/src/Types/DocSignaturesList200ResponseProtection.php deleted file mode 100644 index f7bbc2d3..00000000 --- a/src/Types/DocSignaturesList200ResponseProtection.php +++ /dev/null @@ -1,67 +0,0 @@ - $enforced - */ - #[JsonProperty('enforced')] - public ?string $enforced; - - /** - * @var ?value-of $judged - */ - #[JsonProperty('judged')] - public ?string $judged; - - /** - * @var ?DocSignaturesList200ResponseProtectionCertification $certification - */ - #[JsonProperty('certification')] - public ?DocSignaturesList200ResponseProtectionCertification $certification; - - /** - * @var array $fieldLocks - */ - #[JsonProperty('fieldLocks'), ArrayType([DocSignaturesList200ResponseProtectionFieldLocksItem::class])] - public array $fieldLocks; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @param array{ - * fieldLocks: array, - * policyVersion: int, - * enforced?: ?value-of, - * judged?: ?value-of, - * certification?: ?DocSignaturesList200ResponseProtectionCertification, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enforced = $values['enforced'] ?? null; - $this->judged = $values['judged'] ?? null; - $this->certification = $values['certification'] ?? null; - $this->fieldLocks = $values['fieldLocks']; - $this->policyVersion = $values['policyVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseProtectionCertification.php b/src/Types/DocSignaturesList200ResponseProtectionCertification.php deleted file mode 100644 index 0388f0b9..00000000 --- a/src/Types/DocSignaturesList200ResponseProtectionCertification.php +++ /dev/null @@ -1,42 +0,0 @@ -signatureIndex = $values['signatureIndex']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseProtectionEnforced.php b/src/Types/DocSignaturesList200ResponseProtectionEnforced.php deleted file mode 100644 index d2b72343..00000000 --- a/src/Types/DocSignaturesList200ResponseProtectionEnforced.php +++ /dev/null @@ -1,11 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var ?DocSignaturesList200ResponseProtectionFieldLocksItemSpec $spec - */ - #[JsonProperty('spec')] - public ?DocSignaturesList200ResponseProtectionFieldLocksItemSpec $spec; - - /** - * @param array{ - * signatureIndex: int, - * source: value-of, - * spec?: ?DocSignaturesList200ResponseProtectionFieldLocksItemSpec, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->source = $values['source']; - $this->spec = $values['spec'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.php b/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.php deleted file mode 100644 index 73336f31..00000000 --- a/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSource.php +++ /dev/null @@ -1,9 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.php b/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.php deleted file mode 100644 index 7e4641b5..00000000 --- a/src/Types/DocSignaturesList200ResponseProtectionFieldLocksItemSpecAction.php +++ /dev/null @@ -1,10 +0,0 @@ -index = $values['index']; - $this->end = $values['end']; - $this->xrefOffset = $values['xrefOffset']; - $this->signatureIndex = $values['signatureIndex'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItem.php b/src/Types/DocSignaturesList200ResponseSignaturesItem.php deleted file mode 100644 index 52df30b8..00000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItem.php +++ /dev/null @@ -1,171 +0,0 @@ - $kind - */ - #[JsonProperty('kind')] - public string $kind; - - /** - * @var ?string $filter - */ - #[JsonProperty('filter')] - public ?string $filter; - - /** - * @var ?string $subFilter - */ - #[JsonProperty('subFilter')] - public ?string $subFilter; - - /** - * @var ?array $byteRange - */ - #[JsonProperty('byteRange'), ArrayType(['mixed'])] - public ?array $byteRange; - - /** - * @var int $contentsSize - */ - #[JsonProperty('contentsSize')] - public int $contentsSize; - - /** - * @var ?value-of $coverage - */ - #[JsonProperty('coverage')] - public ?string $coverage; - - /** - * @var ?int $revisionIndex - */ - #[JsonProperty('revisionIndex')] - public ?int $revisionIndex; - - /** - * @var DocSignaturesList200ResponseSignaturesItemSigner $signer - */ - #[JsonProperty('signer')] - public DocSignaturesList200ResponseSignaturesItemSigner $signer; - - /** - * @var ?float $docMdp - */ - #[JsonProperty('docMdp')] - public ?float $docMdp; - - /** - * @var bool $catalogCertification - */ - #[JsonProperty('catalogCertification')] - public bool $catalogCertification; - - /** - * @var ?DocSignaturesList200ResponseSignaturesItemFieldMdp $fieldMdp - */ - #[JsonProperty('fieldMdp')] - public ?DocSignaturesList200ResponseSignaturesItemFieldMdp $fieldMdp; - - /** - * @var ?DocSignaturesList200ResponseSignaturesItemLock $lock - */ - #[JsonProperty('lock')] - public ?DocSignaturesList200ResponseSignaturesItemLock $lock; - - /** - * @var ?DocSignaturesList200ResponseSignaturesItemSeedValue $seedValue - */ - #[JsonProperty('seedValue')] - public ?DocSignaturesList200ResponseSignaturesItemSeedValue $seedValue; - - /** - * @param array{ - * index: int, - * field: FormFieldRef, - * fieldName: string, - * signed: bool, - * kind: value-of, - * contentsSize: int, - * signer: DocSignaturesList200ResponseSignaturesItemSigner, - * catalogCertification: bool, - * widget?: ?FormWidget, - * filter?: ?string, - * subFilter?: ?string, - * byteRange?: ?array, - * coverage?: ?value-of, - * revisionIndex?: ?int, - * docMdp?: ?float, - * fieldMdp?: ?DocSignaturesList200ResponseSignaturesItemFieldMdp, - * lock?: ?DocSignaturesList200ResponseSignaturesItemLock, - * seedValue?: ?DocSignaturesList200ResponseSignaturesItemSeedValue, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->field = $values['field']; - $this->fieldName = $values['fieldName']; - $this->widget = $values['widget'] ?? null; - $this->signed = $values['signed']; - $this->kind = $values['kind']; - $this->filter = $values['filter'] ?? null; - $this->subFilter = $values['subFilter'] ?? null; - $this->byteRange = $values['byteRange'] ?? null; - $this->contentsSize = $values['contentsSize']; - $this->coverage = $values['coverage'] ?? null; - $this->revisionIndex = $values['revisionIndex'] ?? null; - $this->signer = $values['signer']; - $this->docMdp = $values['docMdp'] ?? null; - $this->catalogCertification = $values['catalogCertification']; - $this->fieldMdp = $values['fieldMdp'] ?? null; - $this->lock = $values['lock'] ?? null; - $this->seedValue = $values['seedValue'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemCoverage.php b/src/Types/DocSignaturesList200ResponseSignaturesItemCoverage.php deleted file mode 100644 index a4635283..00000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemCoverage.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.php b/src/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.php deleted file mode 100644 index 3a8cd3f6..00000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemFieldMdpAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemLockAction.php b/src/Types/DocSignaturesList200ResponseSignaturesItemLockAction.php deleted file mode 100644 index 64f8bfcb..00000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemLockAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $subFilters - */ - #[JsonProperty('subFilters'), ArrayType(['string'])] - public array $subFilters; - - /** - * @var array $digestMethods - */ - #[JsonProperty('digestMethods'), ArrayType(['string'])] - public array $digestMethods; - - /** - * @var array $reasons - */ - #[JsonProperty('reasons'), ArrayType(['string'])] - public array $reasons; - - /** - * @var bool $unsupportedRequired - */ - #[JsonProperty('unsupportedRequired')] - public bool $unsupportedRequired; - - /** - * @param array{ - * requiredFlags: int, - * presentFlags: int, - * subFilters: array, - * digestMethods: array, - * reasons: array, - * unsupportedRequired: bool, - * version?: ?int, - * mdp?: ?float, - * filter?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->requiredFlags = $values['requiredFlags']; - $this->presentFlags = $values['presentFlags']; - $this->version = $values['version'] ?? null; - $this->mdp = $values['mdp'] ?? null; - $this->filter = $values['filter'] ?? null; - $this->subFilters = $values['subFilters']; - $this->digestMethods = $values['digestMethods']; - $this->reasons = $values['reasons']; - $this->unsupportedRequired = $values['unsupportedRequired']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php b/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php deleted file mode 100644 index 24964f6f..00000000 --- a/src/Types/DocSignaturesList200ResponseSignaturesItemSigner.php +++ /dev/null @@ -1,68 +0,0 @@ -name = $values['name'] ?? null; - $this->reason = $values['reason'] ?? null; - $this->location = $values['location'] ?? null; - $this->contactInfo = $values['contactInfo'] ?? null; - $this->signedAt = $values['signedAt'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesListResponse.php b/src/Types/DocSignaturesListResponse.php new file mode 100644 index 00000000..a95386e6 --- /dev/null +++ b/src/Types/DocSignaturesListResponse.php @@ -0,0 +1,59 @@ + $revisions + */ + #[JsonProperty('revisions'), ArrayType([DocSignaturesListResponseRevisionsItem::class])] + public array $revisions; + + /** + * @var array $signatures + */ + #[JsonProperty('signatures'), ArrayType([DocSignaturesListResponseSignaturesItem::class])] + public array $signatures; + + /** + * @var DocSignaturesListResponseProtection $protection + */ + #[JsonProperty('protection')] + public DocSignaturesListResponseProtection $protection; + + /** + * @param array{ + * chainValid: bool, + * revisions: array, + * signatures: array, + * protection: DocSignaturesListResponseProtection, + * } $values + */ + public function __construct( + array $values, + ) { + $this->chainValid = $values['chainValid']; + $this->revisions = $values['revisions']; + $this->signatures = $values['signatures']; + $this->protection = $values['protection']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseProtection.php b/src/Types/DocSignaturesListResponseProtection.php new file mode 100644 index 00000000..2dd7ad92 --- /dev/null +++ b/src/Types/DocSignaturesListResponseProtection.php @@ -0,0 +1,67 @@ + $enforced + */ + #[JsonProperty('enforced')] + public ?string $enforced; + + /** + * @var ?value-of $judged + */ + #[JsonProperty('judged')] + public ?string $judged; + + /** + * @var ?DocSignaturesListResponseProtectionCertification $certification + */ + #[JsonProperty('certification')] + public ?DocSignaturesListResponseProtectionCertification $certification; + + /** + * @var array $fieldLocks + */ + #[JsonProperty('fieldLocks'), ArrayType([DocSignaturesListResponseProtectionFieldLocksItem::class])] + public array $fieldLocks; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @param array{ + * fieldLocks: array, + * policyVersion: int, + * enforced?: ?value-of, + * judged?: ?value-of, + * certification?: ?DocSignaturesListResponseProtectionCertification, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enforced = $values['enforced'] ?? null; + $this->judged = $values['judged'] ?? null; + $this->certification = $values['certification'] ?? null; + $this->fieldLocks = $values['fieldLocks']; + $this->policyVersion = $values['policyVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseProtectionCertification.php b/src/Types/DocSignaturesListResponseProtectionCertification.php new file mode 100644 index 00000000..63ac46bf --- /dev/null +++ b/src/Types/DocSignaturesListResponseProtectionCertification.php @@ -0,0 +1,42 @@ +signatureIndex = $values['signatureIndex']; + $this->permission = $values['permission']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseProtectionEnforced.php b/src/Types/DocSignaturesListResponseProtectionEnforced.php new file mode 100644 index 00000000..0f67e524 --- /dev/null +++ b/src/Types/DocSignaturesListResponseProtectionEnforced.php @@ -0,0 +1,11 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var FieldLockSpec $spec + */ + #[JsonProperty('spec')] + public FieldLockSpec $spec; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * spec: FieldLockSpec, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + $this->spec = $values['spec']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseProtectionFieldLocksItemSource.php b/src/Types/DocSignaturesListResponseProtectionFieldLocksItemSource.php new file mode 100644 index 00000000..de1b1eea --- /dev/null +++ b/src/Types/DocSignaturesListResponseProtectionFieldLocksItemSource.php @@ -0,0 +1,9 @@ +index = $values['index']; + $this->end = $values['end']; + $this->xrefOffset = $values['xrefOffset']; + $this->signatureIndex = $values['signatureIndex'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseSignaturesItem.php b/src/Types/DocSignaturesListResponseSignaturesItem.php new file mode 100644 index 00000000..0d49ca6b --- /dev/null +++ b/src/Types/DocSignaturesListResponseSignaturesItem.php @@ -0,0 +1,171 @@ + $kind + */ + #[JsonProperty('kind')] + public string $kind; + + /** + * @var ?string $filter + */ + #[JsonProperty('filter')] + public ?string $filter; + + /** + * @var ?string $subFilter + */ + #[JsonProperty('subFilter')] + public ?string $subFilter; + + /** + * @var ?array $byteRange + */ + #[JsonProperty('byteRange'), ArrayType(['mixed'])] + public ?array $byteRange; + + /** + * @var int $contentsSizeBytes + */ + #[JsonProperty('contentsSizeBytes')] + public int $contentsSizeBytes; + + /** + * @var ?value-of $coverage + */ + #[JsonProperty('coverage')] + public ?string $coverage; + + /** + * @var ?int $revisionIndex + */ + #[JsonProperty('revisionIndex')] + public ?int $revisionIndex; + + /** + * @var DocSignaturesListResponseSignaturesItemSigner $signer + */ + #[JsonProperty('signer')] + public DocSignaturesListResponseSignaturesItemSigner $signer; + + /** + * @var ?int $docMdp + */ + #[JsonProperty('docMdp')] + public ?int $docMdp; + + /** + * @var bool $catalogCertification + */ + #[JsonProperty('catalogCertification')] + public bool $catalogCertification; + + /** + * @var ?FieldLockSpec $fieldMdp + */ + #[JsonProperty('fieldMdp')] + public ?FieldLockSpec $fieldMdp; + + /** + * @var ?FieldLockSpec $lock + */ + #[JsonProperty('lock')] + public ?FieldLockSpec $lock; + + /** + * @var ?DocSignaturesListResponseSignaturesItemSeedValue $seedValue + */ + #[JsonProperty('seedValue')] + public ?DocSignaturesListResponseSignaturesItemSeedValue $seedValue; + + /** + * @param array{ + * index: int, + * field: FormFieldRef, + * fieldName: string, + * signed: bool, + * kind: value-of, + * contentsSizeBytes: int, + * signer: DocSignaturesListResponseSignaturesItemSigner, + * catalogCertification: bool, + * widget?: ?FormWidget, + * filter?: ?string, + * subFilter?: ?string, + * byteRange?: ?array, + * coverage?: ?value-of, + * revisionIndex?: ?int, + * docMdp?: ?int, + * fieldMdp?: ?FieldLockSpec, + * lock?: ?FieldLockSpec, + * seedValue?: ?DocSignaturesListResponseSignaturesItemSeedValue, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->field = $values['field']; + $this->fieldName = $values['fieldName']; + $this->widget = $values['widget'] ?? null; + $this->signed = $values['signed']; + $this->kind = $values['kind']; + $this->filter = $values['filter'] ?? null; + $this->subFilter = $values['subFilter'] ?? null; + $this->byteRange = $values['byteRange'] ?? null; + $this->contentsSizeBytes = $values['contentsSizeBytes']; + $this->coverage = $values['coverage'] ?? null; + $this->revisionIndex = $values['revisionIndex'] ?? null; + $this->signer = $values['signer']; + $this->docMdp = $values['docMdp'] ?? null; + $this->catalogCertification = $values['catalogCertification']; + $this->fieldMdp = $values['fieldMdp'] ?? null; + $this->lock = $values['lock'] ?? null; + $this->seedValue = $values['seedValue'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseSignaturesItemCoverage.php b/src/Types/DocSignaturesListResponseSignaturesItemCoverage.php new file mode 100644 index 00000000..9b2e0a5e --- /dev/null +++ b/src/Types/DocSignaturesListResponseSignaturesItemCoverage.php @@ -0,0 +1,10 @@ + $subFilters + */ + #[JsonProperty('subFilters'), ArrayType(['string'])] + public array $subFilters; + + /** + * @var bool $subFiltersRequired + */ + #[JsonProperty('subFiltersRequired')] + public bool $subFiltersRequired; + + /** + * @var array $digestMethods + */ + #[JsonProperty('digestMethods'), ArrayType(['string'])] + public array $digestMethods; + + /** + * @var bool $digestMethodsRequired + */ + #[JsonProperty('digestMethodsRequired')] + public bool $digestMethodsRequired; + + /** + * @var array $reasons + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var bool $reasonsRequired + */ + #[JsonProperty('reasonsRequired')] + public bool $reasonsRequired; + + /** + * @var bool $unsupportedRequired + */ + #[JsonProperty('unsupportedRequired')] + public bool $unsupportedRequired; + + /** + * @param array{ + * parserVersionRequired: bool, + * filterRequired: bool, + * subFilters: array, + * subFiltersRequired: bool, + * digestMethods: array, + * digestMethodsRequired: bool, + * reasons: array, + * reasonsRequired: bool, + * unsupportedRequired: bool, + * parserVersion?: ?int, + * mdp?: ?int, + * filter?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->parserVersion = $values['parserVersion'] ?? null; + $this->parserVersionRequired = $values['parserVersionRequired']; + $this->mdp = $values['mdp'] ?? null; + $this->filter = $values['filter'] ?? null; + $this->filterRequired = $values['filterRequired']; + $this->subFilters = $values['subFilters']; + $this->subFiltersRequired = $values['subFiltersRequired']; + $this->digestMethods = $values['digestMethods']; + $this->digestMethodsRequired = $values['digestMethodsRequired']; + $this->reasons = $values['reasons']; + $this->reasonsRequired = $values['reasonsRequired']; + $this->unsupportedRequired = $values['unsupportedRequired']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesListResponseSignaturesItemSigner.php b/src/Types/DocSignaturesListResponseSignaturesItemSigner.php new file mode 100644 index 00000000..cabb897b --- /dev/null +++ b/src/Types/DocSignaturesListResponseSignaturesItemSigner.php @@ -0,0 +1,68 @@ +name = $values['name'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->location = $values['location'] ?? null; + $this->contactInfo = $values['contactInfo'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesPrepare200Response.php b/src/Types/DocSignaturesPrepare200Response.php deleted file mode 100644 index fa5fd317..00000000 --- a/src/Types/DocSignaturesPrepare200Response.php +++ /dev/null @@ -1,91 +0,0 @@ - $algorithm - */ - #[JsonProperty('algorithm')] - public string $algorithm; - - /** - * @var array $byteRange - */ - #[JsonProperty('byteRange'), ArrayType(['mixed'])] - public array $byteRange; - - /** - * @var int $contentsSize - */ - #[JsonProperty('contentsSize')] - public int $contentsSize; - - /** - * @var string $subFilter - */ - #[JsonProperty('subFilter')] - public string $subFilter; - - /** - * @var DocSignaturesPrepare200ResponseExpectedVersion $expectedVersion - */ - #[JsonProperty('expectedVersion')] - public DocSignaturesPrepare200ResponseExpectedVersion $expectedVersion; - - /** - * @var ?string $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?string $expiresAt; - - /** - * @param array{ - * signingId: string, - * digest: string, - * algorithm: value-of, - * byteRange: array, - * contentsSize: int, - * subFilter: string, - * expectedVersion: DocSignaturesPrepare200ResponseExpectedVersion, - * expiresAt?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signingId = $values['signingId']; - $this->digest = $values['digest']; - $this->algorithm = $values['algorithm']; - $this->byteRange = $values['byteRange']; - $this->contentsSize = $values['contentsSize']; - $this->subFilter = $values['subFilter']; - $this->expectedVersion = $values['expectedVersion']; - $this->expiresAt = $values['expiresAt'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesPrepare200ResponseAlgorithm.php b/src/Types/DocSignaturesPrepare200ResponseAlgorithm.php deleted file mode 100644 index 9553cb4d..00000000 --- a/src/Types/DocSignaturesPrepare200ResponseAlgorithm.php +++ /dev/null @@ -1,10 +0,0 @@ -baseSha256 = $values['baseSha256']; - $this->editsVersion = $values['editsVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocSignaturesPrepareResponse.php b/src/Types/DocSignaturesPrepareResponse.php new file mode 100644 index 00000000..b03f12fc --- /dev/null +++ b/src/Types/DocSignaturesPrepareResponse.php @@ -0,0 +1,93 @@ + $algorithm + */ + #[JsonProperty('algorithm')] + public string $algorithm; + + /** + * @var array $byteRange + */ + #[JsonProperty('byteRange'), ArrayType(['mixed'])] + public array $byteRange; + + /** + * @var int $contentsSizeBytes + */ + #[JsonProperty('contentsSizeBytes')] + public int $contentsSizeBytes; + + /** + * @var string $subFilter + */ + #[JsonProperty('subFilter')] + public string $subFilter; + + /** + * @var DocSignaturesPrepareResponseExpectedVersion $expectedVersion + */ + #[JsonProperty('expectedVersion')] + public DocSignaturesPrepareResponseExpectedVersion $expectedVersion; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @param array{ + * signingId: string, + * digest: string, + * algorithm: value-of, + * byteRange: array, + * contentsSizeBytes: int, + * subFilter: string, + * expectedVersion: DocSignaturesPrepareResponseExpectedVersion, + * expiresAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signingId = $values['signingId']; + $this->digest = $values['digest']; + $this->algorithm = $values['algorithm']; + $this->byteRange = $values['byteRange']; + $this->contentsSizeBytes = $values['contentsSizeBytes']; + $this->subFilter = $values['subFilter']; + $this->expectedVersion = $values['expectedVersion']; + $this->expiresAt = $values['expiresAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesPrepareResponseAlgorithm.php b/src/Types/DocSignaturesPrepareResponseAlgorithm.php new file mode 100644 index 00000000..6278d65a --- /dev/null +++ b/src/Types/DocSignaturesPrepareResponseAlgorithm.php @@ -0,0 +1,10 @@ +baseSha256 = $values['baseSha256']; + $this->editsVersion = $values['editsVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocText200Response.php b/src/Types/DocText200Response.php deleted file mode 100644 index fe7b8917..00000000 --- a/src/Types/DocText200Response.php +++ /dev/null @@ -1,51 +0,0 @@ -> $charMap - */ - #[JsonProperty('charMap'), ArrayType([['mixed']])] - public ?array $charMap; - - /** - * @param array{ - * text: string, - * charCount: int, - * charMap?: ?array>, - * } $values - */ - public function __construct( - array $values, - ) { - $this->text = $values['text']; - $this->charCount = $values['charCount']; - $this->charMap = $values['charMap'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocTextResponse.php b/src/Types/DocTextResponse.php new file mode 100644 index 00000000..66495445 --- /dev/null +++ b/src/Types/DocTextResponse.php @@ -0,0 +1,51 @@ +> $charMap + */ + #[JsonProperty('charMap'), ArrayType([['mixed']])] + public ?array $charMap; + + /** + * @param array{ + * text: string, + * charCount: int, + * charMap?: ?array>, + * } $values + */ + public function __construct( + array $values, + ) { + $this->text = $values['text']; + $this->charCount = $values['charCount']; + $this->charMap = $values['charMap'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysis200Response.php b/src/Types/DocVersionsAnalysis200Response.php deleted file mode 100644 index 956885b8..00000000 --- a/src/Types/DocVersionsAnalysis200Response.php +++ /dev/null @@ -1,107 +0,0 @@ - $mode - */ - #[JsonProperty('mode')] - public string $mode; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @var DocVersionsAnalysis200ResponseBasis $basis - */ - #[JsonProperty('basis')] - public DocVersionsAnalysis200ResponseBasis $basis; - - /** - * @var DocVersionsAnalysis200ResponseSince $since - */ - #[JsonProperty('since')] - public DocVersionsAnalysis200ResponseSince $since; - - /** - * @var DocVersionsAnalysis200ResponseUntil $until - */ - #[JsonProperty('until')] - public DocVersionsAnalysis200ResponseUntil $until; - - /** - * @var array $restrictions - */ - #[JsonProperty('restrictions'), ArrayType([DocVersionsAnalysis200ResponseRestrictionsItem::class])] - public array $restrictions; - - /** - * @var DocVersionsAnalysis200ResponseCurrent $current - */ - #[JsonProperty('current')] - public DocVersionsAnalysis200ResponseCurrent $current; - - /** - * @var DocVersionsAnalysis200ResponseLater $later - */ - #[JsonProperty('later')] - public DocVersionsAnalysis200ResponseLater $later; - - /** - * @var value-of $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var array $steps - */ - #[JsonProperty('steps'), ArrayType(['mixed'])] - public array $steps; - - /** - * @param array{ - * mode: value-of, - * policyVersion: int, - * basis: DocVersionsAnalysis200ResponseBasis, - * since: DocVersionsAnalysis200ResponseSince, - * until: DocVersionsAnalysis200ResponseUntil, - * restrictions: array, - * current: DocVersionsAnalysis200ResponseCurrent, - * later: DocVersionsAnalysis200ResponseLater, - * verdict: value-of, - * steps: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->mode = $values['mode']; - $this->policyVersion = $values['policyVersion']; - $this->basis = $values['basis']; - $this->since = $values['since']; - $this->until = $values['until']; - $this->restrictions = $values['restrictions']; - $this->current = $values['current']; - $this->later = $values['later']; - $this->verdict = $values['verdict']; - $this->steps = $values['steps']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseBasis.php b/src/Types/DocVersionsAnalysis200ResponseBasis.php deleted file mode 100644 index 91e61a68..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseBasis.php +++ /dev/null @@ -1,50 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @param array{ - * version: DocVersionsAnalysis200ResponseBasisVersion, - * editsVersion: int, - * source: value-of, - * } $values - */ - public function __construct( - array $values, - ) { - $this->version = $values['version']; - $this->editsVersion = $values['editsVersion']; - $this->source = $values['source']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseBasisSource.php b/src/Types/DocVersionsAnalysis200ResponseBasisSource.php deleted file mode 100644 index 09e61bbe..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseBasisSource.php +++ /dev/null @@ -1,9 +0,0 @@ -sha256 = $values['sha256']; - $this->byteLength = $values['byteLength']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseCurrent.php b/src/Types/DocVersionsAnalysis200ResponseCurrent.php deleted file mode 100644 index e4ed1ed6..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseCurrent.php +++ /dev/null @@ -1,67 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var bool $complete - */ - #[JsonProperty('complete')] - public bool $complete; - - /** - * @var ?DocVersionsAnalysis200ResponseCurrentPrimary $primary - */ - #[JsonProperty('primary')] - public ?DocVersionsAnalysis200ResponseCurrentPrimary $primary; - - /** - * @var array $findings - */ - #[JsonProperty('findings'), ArrayType([DocVersionsAnalysis200ResponseCurrentFindingsItem::class])] - public array $findings; - - /** - * @var value-of $method - */ - #[JsonProperty('method')] - public string $method; - - /** - * @param array{ - * verdict: value-of, - * complete: bool, - * findings: array, - * method: value-of, - * primary?: ?DocVersionsAnalysis200ResponseCurrentPrimary, - * } $values - */ - public function __construct( - array $values, - ) { - $this->verdict = $values['verdict']; - $this->complete = $values['complete']; - $this->primary = $values['primary'] ?? null; - $this->findings = $values['findings']; - $this->method = $values['method']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.php b/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.php deleted file mode 100644 index 2ffa5d85..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItem.php +++ /dev/null @@ -1,66 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var int $objectNumber - */ - #[JsonProperty('objectNumber')] - public int $objectNumber; - - /** - * @var ?string $edge - */ - #[JsonProperty('edge')] - public ?string $edge; - - /** - * @var ?string $detail - */ - #[JsonProperty('detail')] - public ?string $detail; - - /** - * @param array{ - * rule: string, - * verdict: value-of, - * objectNumber: int, - * edge?: ?string, - * detail?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->rule = $values['rule']; - $this->verdict = $values['verdict']; - $this->objectNumber = $values['objectNumber']; - $this->edge = $values['edge'] ?? null; - $this->detail = $values['detail'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.php b/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.php deleted file mode 100644 index 21262cc6..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseCurrentFindingsItemVerdict.php +++ /dev/null @@ -1,10 +0,0 @@ - $verdict - */ - #[JsonProperty('verdict')] - public string $verdict; - - /** - * @var int $objectNumber - */ - #[JsonProperty('objectNumber')] - public int $objectNumber; - - /** - * @var ?string $edge - */ - #[JsonProperty('edge')] - public ?string $edge; - - /** - * @var ?string $detail - */ - #[JsonProperty('detail')] - public ?string $detail; - - /** - * @param array{ - * rule: string, - * verdict: value-of, - * objectNumber: int, - * edge?: ?string, - * detail?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->rule = $values['rule']; - $this->verdict = $values['verdict']; - $this->objectNumber = $values['objectNumber']; - $this->edge = $values['edge'] ?? null; - $this->detail = $values['detail'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.php b/src/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.php deleted file mode 100644 index 6bc920a9..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseCurrentPrimaryVerdict.php +++ /dev/null @@ -1,10 +0,0 @@ - $undoneObjectNumbers - */ - #[JsonProperty('undoneObjectNumbers'), ArrayType(['integer'])] - public array $undoneObjectNumbers; - - /** - * @param array{ - * revisionCount: int, - * undoneObjectNumbers: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->revisionCount = $values['revisionCount']; - $this->undoneObjectNumbers = $values['undoneObjectNumbers']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseMode.php b/src/Types/DocVersionsAnalysis200ResponseMode.php deleted file mode 100644 index 4cbb207f..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var bool $own - */ - #[JsonProperty('own')] - public bool $own; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @var mixed $fields - */ - #[JsonProperty('fields')] - public mixed $fields; - - /** - * @param array{ - * signatureIndex: int, - * revisionIndex: int, - * source: value-of, - * own: bool, - * permission?: ?float, - * fields?: mixed, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->revisionIndex = $values['revisionIndex']; - $this->source = $values['source']; - $this->own = $values['own']; - $this->permission = $values['permission'] ?? null; - $this->fields = $values['fields'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.php b/src/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.php deleted file mode 100644 index e6d5fa4f..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseRestrictionsItemSource.php +++ /dev/null @@ -1,10 +0,0 @@ -revisionIndex = $values['revisionIndex']; - $this->signatureIndex = $values['signatureIndex'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseUntil.php b/src/Types/DocVersionsAnalysis200ResponseUntil.php deleted file mode 100644 index 062e5ba2..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseUntil.php +++ /dev/null @@ -1,34 +0,0 @@ -revisionIndex = $values['revisionIndex']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsAnalysis200ResponseVerdict.php b/src/Types/DocVersionsAnalysis200ResponseVerdict.php deleted file mode 100644 index 47f83cbb..00000000 --- a/src/Types/DocVersionsAnalysis200ResponseVerdict.php +++ /dev/null @@ -1,11 +0,0 @@ - $mode + */ + #[JsonProperty('mode')] + public string $mode; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @var DocVersionsAnalysisResponseBasis $basis + */ + #[JsonProperty('basis')] + public DocVersionsAnalysisResponseBasis $basis; + + /** + * @var DocVersionsAnalysisResponseSince $since + */ + #[JsonProperty('since')] + public DocVersionsAnalysisResponseSince $since; + + /** + * @var DocVersionsAnalysisResponseUntil $until + */ + #[JsonProperty('until')] + public DocVersionsAnalysisResponseUntil $until; + + /** + * @var array $restrictions + */ + #[JsonProperty('restrictions'), ArrayType([DocVersionsAnalysisResponseRestrictionsItem::class])] + public array $restrictions; + + /** + * @var DocVersionsAnalysisResponseCurrent $current + */ + #[JsonProperty('current')] + public DocVersionsAnalysisResponseCurrent $current; + + /** + * @var DocVersionsAnalysisResponseLater $later + */ + #[JsonProperty('later')] + public DocVersionsAnalysisResponseLater $later; + + /** + * @var value-of $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var array $steps + */ + #[JsonProperty('steps'), ArrayType(['mixed'])] + public array $steps; + + /** + * @param array{ + * mode: value-of, + * policyVersion: int, + * basis: DocVersionsAnalysisResponseBasis, + * since: DocVersionsAnalysisResponseSince, + * until: DocVersionsAnalysisResponseUntil, + * restrictions: array, + * current: DocVersionsAnalysisResponseCurrent, + * later: DocVersionsAnalysisResponseLater, + * verdict: value-of, + * steps: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->mode = $values['mode']; + $this->policyVersion = $values['policyVersion']; + $this->basis = $values['basis']; + $this->since = $values['since']; + $this->until = $values['until']; + $this->restrictions = $values['restrictions']; + $this->current = $values['current']; + $this->later = $values['later']; + $this->verdict = $values['verdict']; + $this->steps = $values['steps']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseBasis.php b/src/Types/DocVersionsAnalysisResponseBasis.php new file mode 100644 index 00000000..ce08e4f1 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseBasis.php @@ -0,0 +1,50 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @param array{ + * version: DocVersionsAnalysisResponseBasisVersion, + * editsVersion: int, + * source: value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->version = $values['version']; + $this->editsVersion = $values['editsVersion']; + $this->source = $values['source']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseBasisSource.php b/src/Types/DocVersionsAnalysisResponseBasisSource.php new file mode 100644 index 00000000..4fa34570 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseBasisSource.php @@ -0,0 +1,9 @@ +sha256 = $values['sha256']; + $this->sizeBytes = $values['sizeBytes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseCurrent.php b/src/Types/DocVersionsAnalysisResponseCurrent.php new file mode 100644 index 00000000..10c7ed6b --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseCurrent.php @@ -0,0 +1,67 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var bool $complete + */ + #[JsonProperty('complete')] + public bool $complete; + + /** + * @var ?DocVersionsAnalysisResponseCurrentPrimary $primary + */ + #[JsonProperty('primary')] + public ?DocVersionsAnalysisResponseCurrentPrimary $primary; + + /** + * @var array $findings + */ + #[JsonProperty('findings'), ArrayType([DocVersionsAnalysisResponseCurrentFindingsItem::class])] + public array $findings; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @param array{ + * verdict: value-of, + * complete: bool, + * findings: array, + * method: value-of, + * primary?: ?DocVersionsAnalysisResponseCurrentPrimary, + * } $values + */ + public function __construct( + array $values, + ) { + $this->verdict = $values['verdict']; + $this->complete = $values['complete']; + $this->primary = $values['primary'] ?? null; + $this->findings = $values['findings']; + $this->method = $values['method']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseCurrentFindingsItem.php b/src/Types/DocVersionsAnalysisResponseCurrentFindingsItem.php new file mode 100644 index 00000000..24e61298 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseCurrentFindingsItem.php @@ -0,0 +1,66 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var int $objectNumber + */ + #[JsonProperty('objectNumber')] + public int $objectNumber; + + /** + * @var ?string $edge + */ + #[JsonProperty('edge')] + public ?string $edge; + + /** + * @var ?string $detail + */ + #[JsonProperty('detail')] + public ?string $detail; + + /** + * @param array{ + * rule: string, + * verdict: value-of, + * objectNumber: int, + * edge?: ?string, + * detail?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->rule = $values['rule']; + $this->verdict = $values['verdict']; + $this->objectNumber = $values['objectNumber']; + $this->edge = $values['edge'] ?? null; + $this->detail = $values['detail'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseCurrentFindingsItemVerdict.php b/src/Types/DocVersionsAnalysisResponseCurrentFindingsItemVerdict.php new file mode 100644 index 00000000..2c9c0b74 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseCurrentFindingsItemVerdict.php @@ -0,0 +1,10 @@ + $verdict + */ + #[JsonProperty('verdict')] + public string $verdict; + + /** + * @var int $objectNumber + */ + #[JsonProperty('objectNumber')] + public int $objectNumber; + + /** + * @var ?string $edge + */ + #[JsonProperty('edge')] + public ?string $edge; + + /** + * @var ?string $detail + */ + #[JsonProperty('detail')] + public ?string $detail; + + /** + * @param array{ + * rule: string, + * verdict: value-of, + * objectNumber: int, + * edge?: ?string, + * detail?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->rule = $values['rule']; + $this->verdict = $values['verdict']; + $this->objectNumber = $values['objectNumber']; + $this->edge = $values['edge'] ?? null; + $this->detail = $values['detail'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseCurrentPrimaryVerdict.php b/src/Types/DocVersionsAnalysisResponseCurrentPrimaryVerdict.php new file mode 100644 index 00000000..0eb27951 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseCurrentPrimaryVerdict.php @@ -0,0 +1,10 @@ + $undoneObjectNumbers + */ + #[JsonProperty('undoneObjectNumbers'), ArrayType(['integer'])] + public array $undoneObjectNumbers; + + /** + * @param array{ + * revisionCount: int, + * undoneObjectNumbers: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->revisionCount = $values['revisionCount']; + $this->undoneObjectNumbers = $values['undoneObjectNumbers']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseMode.php b/src/Types/DocVersionsAnalysisResponseMode.php new file mode 100644 index 00000000..1978720c --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseMode.php @@ -0,0 +1,9 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var bool $own + */ + #[JsonProperty('own')] + public bool $own; + + /** + * @var ?int $permission + */ + #[JsonProperty('permission')] + public ?int $permission; + + /** + * @var mixed $fields + */ + #[JsonProperty('fields')] + public mixed $fields; + + /** + * @param array{ + * signatureIndex: int, + * revisionIndex: int, + * source: value-of, + * own: bool, + * permission?: ?int, + * fields?: mixed, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->revisionIndex = $values['revisionIndex']; + $this->source = $values['source']; + $this->own = $values['own']; + $this->permission = $values['permission'] ?? null; + $this->fields = $values['fields'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseRestrictionsItemSource.php b/src/Types/DocVersionsAnalysisResponseRestrictionsItemSource.php new file mode 100644 index 00000000..de98761a --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseRestrictionsItemSource.php @@ -0,0 +1,10 @@ +revisionIndex = $values['revisionIndex']; + $this->signatureIndex = $values['signatureIndex'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseUntil.php b/src/Types/DocVersionsAnalysisResponseUntil.php new file mode 100644 index 00000000..b4d279e1 --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseUntil.php @@ -0,0 +1,34 @@ +revisionIndex = $values['revisionIndex']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsAnalysisResponseVerdict.php b/src/Types/DocVersionsAnalysisResponseVerdict.php new file mode 100644 index 00000000..246acf7f --- /dev/null +++ b/src/Types/DocVersionsAnalysisResponseVerdict.php @@ -0,0 +1,11 @@ + $versions - */ - #[JsonProperty('versions'), ArrayType([DocVersionsList200ResponseVersionsItem::class])] - public array $versions; - - /** - * @param array{ - * baseSha: string, - * versions: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->baseSha = $values['baseSha']; - $this->versions = $values['versions']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsList200ResponseVersionsItem.php b/src/Types/DocVersionsList200ResponseVersionsItem.php deleted file mode 100644 index 9d34195a..00000000 --- a/src/Types/DocVersionsList200ResponseVersionsItem.php +++ /dev/null @@ -1,82 +0,0 @@ - $producer - */ - #[JsonProperty('producer')] - public string $producer; - - /** - * @var ?string $signingId - */ - #[JsonProperty('signingId')] - public ?string $signingId; - - /** - * @var int $createdAt - */ - #[JsonProperty('createdAt')] - public int $createdAt; - - /** - * @param array{ - * sha256: string, - * byteLength: int, - * number: int, - * producer: value-of, - * createdAt: int, - * parentSha256?: ?string, - * signingId?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->sha256 = $values['sha256']; - $this->byteLength = $values['byteLength']; - $this->number = $values['number']; - $this->parentSha256 = $values['parentSha256'] ?? null; - $this->producer = $values['producer']; - $this->signingId = $values['signingId'] ?? null; - $this->createdAt = $values['createdAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsList200ResponseVersionsItemProducer.php b/src/Types/DocVersionsList200ResponseVersionsItemProducer.php deleted file mode 100644 index 5f9549b0..00000000 --- a/src/Types/DocVersionsList200ResponseVersionsItemProducer.php +++ /dev/null @@ -1,9 +0,0 @@ - $versions + */ + #[JsonProperty('versions'), ArrayType([DocVersionsListResponseVersionsItem::class])] + public array $versions; + + /** + * @param array{ + * baseSha256: string, + * versions: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->baseSha256 = $values['baseSha256']; + $this->versions = $values['versions']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsListResponseVersionsItem.php b/src/Types/DocVersionsListResponseVersionsItem.php new file mode 100644 index 00000000..1d164d37 --- /dev/null +++ b/src/Types/DocVersionsListResponseVersionsItem.php @@ -0,0 +1,84 @@ + $producer + */ + #[JsonProperty('producer')] + public string $producer; + + /** + * @var ?string $signingId + */ + #[JsonProperty('signingId')] + public ?string $signingId; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @param array{ + * sha256: string, + * sizeBytes: int, + * number: int, + * producer: value-of, + * createdAt: DateTime, + * parentSha256?: ?string, + * signingId?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->sha256 = $values['sha256']; + $this->sizeBytes = $values['sizeBytes']; + $this->number = $values['number']; + $this->parentSha256 = $values['parentSha256'] ?? null; + $this->producer = $values['producer']; + $this->signingId = $values['signingId'] ?? null; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsListResponseVersionsItemProducer.php b/src/Types/DocVersionsListResponseVersionsItemProducer.php new file mode 100644 index 00000000..2aae475e --- /dev/null +++ b/src/Types/DocVersionsListResponseVersionsItemProducer.php @@ -0,0 +1,9 @@ + $revisions - */ - #[JsonProperty('revisions'), ArrayType([DocVersionsSignatures200ResponseRevisionsItem::class])] - public array $revisions; - - /** - * @var array $signatures - */ - #[JsonProperty('signatures'), ArrayType([DocVersionsSignatures200ResponseSignaturesItem::class])] - public array $signatures; - - /** - * @var DocVersionsSignatures200ResponseProtection $protection - */ - #[JsonProperty('protection')] - public DocVersionsSignatures200ResponseProtection $protection; - - /** - * @param array{ - * chainValid: bool, - * revisions: array, - * signatures: array, - * protection: DocVersionsSignatures200ResponseProtection, - * } $values - */ - public function __construct( - array $values, - ) { - $this->chainValid = $values['chainValid']; - $this->revisions = $values['revisions']; - $this->signatures = $values['signatures']; - $this->protection = $values['protection']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseProtection.php b/src/Types/DocVersionsSignatures200ResponseProtection.php deleted file mode 100644 index 0c56764a..00000000 --- a/src/Types/DocVersionsSignatures200ResponseProtection.php +++ /dev/null @@ -1,67 +0,0 @@ - $enforced - */ - #[JsonProperty('enforced')] - public ?string $enforced; - - /** - * @var ?value-of $judged - */ - #[JsonProperty('judged')] - public ?string $judged; - - /** - * @var ?DocVersionsSignatures200ResponseProtectionCertification $certification - */ - #[JsonProperty('certification')] - public ?DocVersionsSignatures200ResponseProtectionCertification $certification; - - /** - * @var array $fieldLocks - */ - #[JsonProperty('fieldLocks'), ArrayType([DocVersionsSignatures200ResponseProtectionFieldLocksItem::class])] - public array $fieldLocks; - - /** - * @var int $policyVersion - */ - #[JsonProperty('policyVersion')] - public int $policyVersion; - - /** - * @param array{ - * fieldLocks: array, - * policyVersion: int, - * enforced?: ?value-of, - * judged?: ?value-of, - * certification?: ?DocVersionsSignatures200ResponseProtectionCertification, - * } $values - */ - public function __construct( - array $values, - ) { - $this->enforced = $values['enforced'] ?? null; - $this->judged = $values['judged'] ?? null; - $this->certification = $values['certification'] ?? null; - $this->fieldLocks = $values['fieldLocks']; - $this->policyVersion = $values['policyVersion']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseProtectionCertification.php b/src/Types/DocVersionsSignatures200ResponseProtectionCertification.php deleted file mode 100644 index 22bf04a1..00000000 --- a/src/Types/DocVersionsSignatures200ResponseProtectionCertification.php +++ /dev/null @@ -1,42 +0,0 @@ -signatureIndex = $values['signatureIndex']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseProtectionEnforced.php b/src/Types/DocVersionsSignatures200ResponseProtectionEnforced.php deleted file mode 100644 index d6111c32..00000000 --- a/src/Types/DocVersionsSignatures200ResponseProtectionEnforced.php +++ /dev/null @@ -1,11 +0,0 @@ - $source - */ - #[JsonProperty('source')] - public string $source; - - /** - * @var ?DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec $spec - */ - #[JsonProperty('spec')] - public ?DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec $spec; - - /** - * @param array{ - * signatureIndex: int, - * source: value-of, - * spec?: ?DocVersionsSignatures200ResponseProtectionFieldLocksItemSpec, - * } $values - */ - public function __construct( - array $values, - ) { - $this->signatureIndex = $values['signatureIndex']; - $this->source = $values['source']; - $this->spec = $values['spec'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.php b/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.php deleted file mode 100644 index 80f3ddbc..00000000 --- a/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSource.php +++ /dev/null @@ -1,9 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.php b/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.php deleted file mode 100644 index 44548717..00000000 --- a/src/Types/DocVersionsSignatures200ResponseProtectionFieldLocksItemSpecAction.php +++ /dev/null @@ -1,10 +0,0 @@ -index = $values['index']; - $this->end = $values['end']; - $this->xrefOffset = $values['xrefOffset']; - $this->signatureIndex = $values['signatureIndex'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItem.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItem.php deleted file mode 100644 index cf8b319f..00000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItem.php +++ /dev/null @@ -1,171 +0,0 @@ - $kind - */ - #[JsonProperty('kind')] - public string $kind; - - /** - * @var ?string $filter - */ - #[JsonProperty('filter')] - public ?string $filter; - - /** - * @var ?string $subFilter - */ - #[JsonProperty('subFilter')] - public ?string $subFilter; - - /** - * @var ?array $byteRange - */ - #[JsonProperty('byteRange'), ArrayType(['mixed'])] - public ?array $byteRange; - - /** - * @var int $contentsSize - */ - #[JsonProperty('contentsSize')] - public int $contentsSize; - - /** - * @var ?value-of $coverage - */ - #[JsonProperty('coverage')] - public ?string $coverage; - - /** - * @var ?int $revisionIndex - */ - #[JsonProperty('revisionIndex')] - public ?int $revisionIndex; - - /** - * @var DocVersionsSignatures200ResponseSignaturesItemSigner $signer - */ - #[JsonProperty('signer')] - public DocVersionsSignatures200ResponseSignaturesItemSigner $signer; - - /** - * @var ?float $docMdp - */ - #[JsonProperty('docMdp')] - public ?float $docMdp; - - /** - * @var bool $catalogCertification - */ - #[JsonProperty('catalogCertification')] - public bool $catalogCertification; - - /** - * @var ?DocVersionsSignatures200ResponseSignaturesItemFieldMdp $fieldMdp - */ - #[JsonProperty('fieldMdp')] - public ?DocVersionsSignatures200ResponseSignaturesItemFieldMdp $fieldMdp; - - /** - * @var ?DocVersionsSignatures200ResponseSignaturesItemLock $lock - */ - #[JsonProperty('lock')] - public ?DocVersionsSignatures200ResponseSignaturesItemLock $lock; - - /** - * @var ?DocVersionsSignatures200ResponseSignaturesItemSeedValue $seedValue - */ - #[JsonProperty('seedValue')] - public ?DocVersionsSignatures200ResponseSignaturesItemSeedValue $seedValue; - - /** - * @param array{ - * index: int, - * field: FormFieldRef, - * fieldName: string, - * signed: bool, - * kind: value-of, - * contentsSize: int, - * signer: DocVersionsSignatures200ResponseSignaturesItemSigner, - * catalogCertification: bool, - * widget?: ?FormWidget, - * filter?: ?string, - * subFilter?: ?string, - * byteRange?: ?array, - * coverage?: ?value-of, - * revisionIndex?: ?int, - * docMdp?: ?float, - * fieldMdp?: ?DocVersionsSignatures200ResponseSignaturesItemFieldMdp, - * lock?: ?DocVersionsSignatures200ResponseSignaturesItemLock, - * seedValue?: ?DocVersionsSignatures200ResponseSignaturesItemSeedValue, - * } $values - */ - public function __construct( - array $values, - ) { - $this->index = $values['index']; - $this->field = $values['field']; - $this->fieldName = $values['fieldName']; - $this->widget = $values['widget'] ?? null; - $this->signed = $values['signed']; - $this->kind = $values['kind']; - $this->filter = $values['filter'] ?? null; - $this->subFilter = $values['subFilter'] ?? null; - $this->byteRange = $values['byteRange'] ?? null; - $this->contentsSize = $values['contentsSize']; - $this->coverage = $values['coverage'] ?? null; - $this->revisionIndex = $values['revisionIndex'] ?? null; - $this->signer = $values['signer']; - $this->docMdp = $values['docMdp'] ?? null; - $this->catalogCertification = $values['catalogCertification']; - $this->fieldMdp = $values['fieldMdp'] ?? null; - $this->lock = $values['lock'] ?? null; - $this->seedValue = $values['seedValue'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.php deleted file mode 100644 index 1f294e78..00000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemCoverage.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.php deleted file mode 100644 index 26ace10e..00000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemFieldMdpAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $action - */ - #[JsonProperty('action')] - public string $action; - - /** - * @var array $fields - */ - #[JsonProperty('fields'), ArrayType(['string'])] - public array $fields; - - /** - * @var ?float $permission - */ - #[JsonProperty('permission')] - public ?float $permission; - - /** - * @param array{ - * action: value-of, - * fields: array, - * permission?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->action = $values['action']; - $this->fields = $values['fields']; - $this->permission = $values['permission'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.php deleted file mode 100644 index be755ffe..00000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemLockAction.php +++ /dev/null @@ -1,10 +0,0 @@ - $subFilters - */ - #[JsonProperty('subFilters'), ArrayType(['string'])] - public array $subFilters; - - /** - * @var array $digestMethods - */ - #[JsonProperty('digestMethods'), ArrayType(['string'])] - public array $digestMethods; - - /** - * @var array $reasons - */ - #[JsonProperty('reasons'), ArrayType(['string'])] - public array $reasons; - - /** - * @var bool $unsupportedRequired - */ - #[JsonProperty('unsupportedRequired')] - public bool $unsupportedRequired; - - /** - * @param array{ - * requiredFlags: int, - * presentFlags: int, - * subFilters: array, - * digestMethods: array, - * reasons: array, - * unsupportedRequired: bool, - * version?: ?int, - * mdp?: ?float, - * filter?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->requiredFlags = $values['requiredFlags']; - $this->presentFlags = $values['presentFlags']; - $this->version = $values['version'] ?? null; - $this->mdp = $values['mdp'] ?? null; - $this->filter = $values['filter'] ?? null; - $this->subFilters = $values['subFilters']; - $this->digestMethods = $values['digestMethods']; - $this->reasons = $values['reasons']; - $this->unsupportedRequired = $values['unsupportedRequired']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php b/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php deleted file mode 100644 index eac0190e..00000000 --- a/src/Types/DocVersionsSignatures200ResponseSignaturesItemSigner.php +++ /dev/null @@ -1,68 +0,0 @@ -name = $values['name'] ?? null; - $this->reason = $values['reason'] ?? null; - $this->location = $values['location'] ?? null; - $this->contactInfo = $values['contactInfo'] ?? null; - $this->signedAt = $values['signedAt'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocVersionsSignaturesResponse.php b/src/Types/DocVersionsSignaturesResponse.php new file mode 100644 index 00000000..0b3095fb --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponse.php @@ -0,0 +1,59 @@ + $revisions + */ + #[JsonProperty('revisions'), ArrayType([DocVersionsSignaturesResponseRevisionsItem::class])] + public array $revisions; + + /** + * @var array $signatures + */ + #[JsonProperty('signatures'), ArrayType([DocVersionsSignaturesResponseSignaturesItem::class])] + public array $signatures; + + /** + * @var DocVersionsSignaturesResponseProtection $protection + */ + #[JsonProperty('protection')] + public DocVersionsSignaturesResponseProtection $protection; + + /** + * @param array{ + * chainValid: bool, + * revisions: array, + * signatures: array, + * protection: DocVersionsSignaturesResponseProtection, + * } $values + */ + public function __construct( + array $values, + ) { + $this->chainValid = $values['chainValid']; + $this->revisions = $values['revisions']; + $this->signatures = $values['signatures']; + $this->protection = $values['protection']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseProtection.php b/src/Types/DocVersionsSignaturesResponseProtection.php new file mode 100644 index 00000000..f4415f0c --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseProtection.php @@ -0,0 +1,67 @@ + $enforced + */ + #[JsonProperty('enforced')] + public ?string $enforced; + + /** + * @var ?value-of $judged + */ + #[JsonProperty('judged')] + public ?string $judged; + + /** + * @var ?DocVersionsSignaturesResponseProtectionCertification $certification + */ + #[JsonProperty('certification')] + public ?DocVersionsSignaturesResponseProtectionCertification $certification; + + /** + * @var array $fieldLocks + */ + #[JsonProperty('fieldLocks'), ArrayType([DocVersionsSignaturesResponseProtectionFieldLocksItem::class])] + public array $fieldLocks; + + /** + * @var int $policyVersion + */ + #[JsonProperty('policyVersion')] + public int $policyVersion; + + /** + * @param array{ + * fieldLocks: array, + * policyVersion: int, + * enforced?: ?value-of, + * judged?: ?value-of, + * certification?: ?DocVersionsSignaturesResponseProtectionCertification, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enforced = $values['enforced'] ?? null; + $this->judged = $values['judged'] ?? null; + $this->certification = $values['certification'] ?? null; + $this->fieldLocks = $values['fieldLocks']; + $this->policyVersion = $values['policyVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseProtectionCertification.php b/src/Types/DocVersionsSignaturesResponseProtectionCertification.php new file mode 100644 index 00000000..de4649ef --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseProtectionCertification.php @@ -0,0 +1,42 @@ +signatureIndex = $values['signatureIndex']; + $this->permission = $values['permission']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseProtectionEnforced.php b/src/Types/DocVersionsSignaturesResponseProtectionEnforced.php new file mode 100644 index 00000000..a0a34ecc --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseProtectionEnforced.php @@ -0,0 +1,11 @@ + $source + */ + #[JsonProperty('source')] + public string $source; + + /** + * @var FieldLockSpec $spec + */ + #[JsonProperty('spec')] + public FieldLockSpec $spec; + + /** + * @param array{ + * signatureIndex: int, + * source: value-of, + * spec: FieldLockSpec, + * } $values + */ + public function __construct( + array $values, + ) { + $this->signatureIndex = $values['signatureIndex']; + $this->source = $values['source']; + $this->spec = $values['spec']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseProtectionFieldLocksItemSource.php b/src/Types/DocVersionsSignaturesResponseProtectionFieldLocksItemSource.php new file mode 100644 index 00000000..dbc65e14 --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseProtectionFieldLocksItemSource.php @@ -0,0 +1,9 @@ +index = $values['index']; + $this->end = $values['end']; + $this->xrefOffset = $values['xrefOffset']; + $this->signatureIndex = $values['signatureIndex'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseSignaturesItem.php b/src/Types/DocVersionsSignaturesResponseSignaturesItem.php new file mode 100644 index 00000000..05fcd97d --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseSignaturesItem.php @@ -0,0 +1,171 @@ + $kind + */ + #[JsonProperty('kind')] + public string $kind; + + /** + * @var ?string $filter + */ + #[JsonProperty('filter')] + public ?string $filter; + + /** + * @var ?string $subFilter + */ + #[JsonProperty('subFilter')] + public ?string $subFilter; + + /** + * @var ?array $byteRange + */ + #[JsonProperty('byteRange'), ArrayType(['mixed'])] + public ?array $byteRange; + + /** + * @var int $contentsSizeBytes + */ + #[JsonProperty('contentsSizeBytes')] + public int $contentsSizeBytes; + + /** + * @var ?value-of $coverage + */ + #[JsonProperty('coverage')] + public ?string $coverage; + + /** + * @var ?int $revisionIndex + */ + #[JsonProperty('revisionIndex')] + public ?int $revisionIndex; + + /** + * @var DocVersionsSignaturesResponseSignaturesItemSigner $signer + */ + #[JsonProperty('signer')] + public DocVersionsSignaturesResponseSignaturesItemSigner $signer; + + /** + * @var ?int $docMdp + */ + #[JsonProperty('docMdp')] + public ?int $docMdp; + + /** + * @var bool $catalogCertification + */ + #[JsonProperty('catalogCertification')] + public bool $catalogCertification; + + /** + * @var ?FieldLockSpec $fieldMdp + */ + #[JsonProperty('fieldMdp')] + public ?FieldLockSpec $fieldMdp; + + /** + * @var ?FieldLockSpec $lock + */ + #[JsonProperty('lock')] + public ?FieldLockSpec $lock; + + /** + * @var ?DocVersionsSignaturesResponseSignaturesItemSeedValue $seedValue + */ + #[JsonProperty('seedValue')] + public ?DocVersionsSignaturesResponseSignaturesItemSeedValue $seedValue; + + /** + * @param array{ + * index: int, + * field: FormFieldRef, + * fieldName: string, + * signed: bool, + * kind: value-of, + * contentsSizeBytes: int, + * signer: DocVersionsSignaturesResponseSignaturesItemSigner, + * catalogCertification: bool, + * widget?: ?FormWidget, + * filter?: ?string, + * subFilter?: ?string, + * byteRange?: ?array, + * coverage?: ?value-of, + * revisionIndex?: ?int, + * docMdp?: ?int, + * fieldMdp?: ?FieldLockSpec, + * lock?: ?FieldLockSpec, + * seedValue?: ?DocVersionsSignaturesResponseSignaturesItemSeedValue, + * } $values + */ + public function __construct( + array $values, + ) { + $this->index = $values['index']; + $this->field = $values['field']; + $this->fieldName = $values['fieldName']; + $this->widget = $values['widget'] ?? null; + $this->signed = $values['signed']; + $this->kind = $values['kind']; + $this->filter = $values['filter'] ?? null; + $this->subFilter = $values['subFilter'] ?? null; + $this->byteRange = $values['byteRange'] ?? null; + $this->contentsSizeBytes = $values['contentsSizeBytes']; + $this->coverage = $values['coverage'] ?? null; + $this->revisionIndex = $values['revisionIndex'] ?? null; + $this->signer = $values['signer']; + $this->docMdp = $values['docMdp'] ?? null; + $this->catalogCertification = $values['catalogCertification']; + $this->fieldMdp = $values['fieldMdp'] ?? null; + $this->lock = $values['lock'] ?? null; + $this->seedValue = $values['seedValue'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseSignaturesItemCoverage.php b/src/Types/DocVersionsSignaturesResponseSignaturesItemCoverage.php new file mode 100644 index 00000000..2462b93b --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseSignaturesItemCoverage.php @@ -0,0 +1,10 @@ + $subFilters + */ + #[JsonProperty('subFilters'), ArrayType(['string'])] + public array $subFilters; + + /** + * @var bool $subFiltersRequired + */ + #[JsonProperty('subFiltersRequired')] + public bool $subFiltersRequired; + + /** + * @var array $digestMethods + */ + #[JsonProperty('digestMethods'), ArrayType(['string'])] + public array $digestMethods; + + /** + * @var bool $digestMethodsRequired + */ + #[JsonProperty('digestMethodsRequired')] + public bool $digestMethodsRequired; + + /** + * @var array $reasons + */ + #[JsonProperty('reasons'), ArrayType(['string'])] + public array $reasons; + + /** + * @var bool $reasonsRequired + */ + #[JsonProperty('reasonsRequired')] + public bool $reasonsRequired; + + /** + * @var bool $unsupportedRequired + */ + #[JsonProperty('unsupportedRequired')] + public bool $unsupportedRequired; + + /** + * @param array{ + * parserVersionRequired: bool, + * filterRequired: bool, + * subFilters: array, + * subFiltersRequired: bool, + * digestMethods: array, + * digestMethodsRequired: bool, + * reasons: array, + * reasonsRequired: bool, + * unsupportedRequired: bool, + * parserVersion?: ?int, + * mdp?: ?int, + * filter?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->parserVersion = $values['parserVersion'] ?? null; + $this->parserVersionRequired = $values['parserVersionRequired']; + $this->mdp = $values['mdp'] ?? null; + $this->filter = $values['filter'] ?? null; + $this->filterRequired = $values['filterRequired']; + $this->subFilters = $values['subFilters']; + $this->subFiltersRequired = $values['subFiltersRequired']; + $this->digestMethods = $values['digestMethods']; + $this->digestMethodsRequired = $values['digestMethodsRequired']; + $this->reasons = $values['reasons']; + $this->reasonsRequired = $values['reasonsRequired']; + $this->unsupportedRequired = $values['unsupportedRequired']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocVersionsSignaturesResponseSignaturesItemSigner.php b/src/Types/DocVersionsSignaturesResponseSignaturesItemSigner.php new file mode 100644 index 00000000..b4fd91dd --- /dev/null +++ b/src/Types/DocVersionsSignaturesResponseSignaturesItemSigner.php @@ -0,0 +1,68 @@ +name = $values['name'] ?? null; + $this->reason = $values['reason'] ?? null; + $this->location = $values['location'] ?? null; + $this->contactInfo = $values['contactInfo'] ?? null; + $this->signedAt = $values['signedAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommit200Response.php b/src/Types/DocumentsCommit200Response.php deleted file mode 100644 index 91d6cd75..00000000 --- a/src/Types/DocumentsCommit200Response.php +++ /dev/null @@ -1,34 +0,0 @@ -document = $values['document']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsCommit200ResponseDocument.php b/src/Types/DocumentsCommit200ResponseDocument.php deleted file mode 100644 index 084e5d35..00000000 --- a/src/Types/DocumentsCommit200ResponseDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsCommit200ResponseDocumentState.php b/src/Types/DocumentsCommit200ResponseDocumentState.php deleted file mode 100644 index 9caaa928..00000000 --- a/src/Types/DocumentsCommit200ResponseDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommitResponseDocument.php b/src/Types/DocumentsCommitResponseDocument.php new file mode 100644 index 00000000..a2092878 --- /dev/null +++ b/src/Types/DocumentsCommitResponseDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsCommitResponseDocumentState.php b/src/Types/DocumentsCommitResponseDocumentState.php new file mode 100644 index 00000000..c4ccae8b --- /dev/null +++ b/src/Types/DocumentsCommitResponseDocumentState.php @@ -0,0 +1,11 @@ +document = $values['document']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet200ResponseDocument.php b/src/Types/DocumentsGet200ResponseDocument.php deleted file mode 100644 index 20356437..00000000 --- a/src/Types/DocumentsGet200ResponseDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsGet200ResponseDocumentState.php b/src/Types/DocumentsGet200ResponseDocumentState.php deleted file mode 100644 index 3d475283..00000000 --- a/src/Types/DocumentsGet200ResponseDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGetResponseDocument.php b/src/Types/DocumentsGetResponseDocument.php new file mode 100644 index 00000000..b9fc054e --- /dev/null +++ b/src/Types/DocumentsGetResponseDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsGetResponseDocumentState.php b/src/Types/DocumentsGetResponseDocumentState.php new file mode 100644 index 00000000..19ea22bb --- /dev/null +++ b/src/Types/DocumentsGetResponseDocumentState.php @@ -0,0 +1,11 @@ + $tag + * @var value-of $status */ - #[JsonProperty('tag')] - public string $tag; + #[JsonProperty('status')] + public string $status; /** * @var DocumentsImportFrom200ResponseDocument $document @@ -21,14 +21,14 @@ class DocumentsImportFrom200Response extends JsonSerializableType /** * @param array{ - * tag: value-of, + * status: value-of, * document: DocumentsImportFrom200ResponseDocument, * } $values */ public function __construct( array $values, ) { - $this->tag = $values['tag']; + $this->status = $values['status']; $this->document = $values['document']; } diff --git a/src/Types/DocumentsImportFrom200ResponseDocument.php b/src/Types/DocumentsImportFrom200ResponseDocument.php index b043306c..a2464eb9 100644 --- a/src/Types/DocumentsImportFrom200ResponseDocument.php +++ b/src/Types/DocumentsImportFrom200ResponseDocument.php @@ -5,6 +5,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; +use DateTime; +use CloudPDF\Core\Types\Date; class DocumentsImportFrom200ResponseDocument extends JsonSerializableType { @@ -39,16 +41,16 @@ class DocumentsImportFrom200ResponseDocument extends JsonSerializableType public string $state; /** - * @var ?string $baseSha + * @var ?string $baseSha256 */ - #[JsonProperty('baseSha')] - public ?string $baseSha; + #[JsonProperty('baseSha256')] + public ?string $baseSha256; /** - * @var ?float $storageSizeBytes + * @var ?int $sizeBytes */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; /** * @var ?array $metadata @@ -69,10 +71,10 @@ class DocumentsImportFrom200ResponseDocument extends JsonSerializableType public ?string $failureReason; /** - * @var ?value-of $thumbnailState + * @var value-of $thumbnailState */ #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; + public string $thumbnailState; /** * @var ?string $thumbnailUrl @@ -81,16 +83,16 @@ class DocumentsImportFrom200ResponseDocument extends JsonSerializableType public ?string $thumbnailUrl; /** - * @var float $createdAt + * @var DateTime $createdAt */ - #[JsonProperty('createdAt')] - public float $createdAt; + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; /** - * @var float $updatedAt + * @var DateTime $updatedAt */ - #[JsonProperty('updatedAt')] - public float $updatedAt; + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; /** * @var ?string $createdBy @@ -105,14 +107,14 @@ class DocumentsImportFrom200ResponseDocument extends JsonSerializableType * name: string, * folderId: string, * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, * metadata?: ?array, * idempotencyKey?: ?string, * failureReason?: ?string, - * thumbnailState?: ?value-of, * thumbnailUrl?: ?string, * createdBy?: ?string, * } $values @@ -125,12 +127,12 @@ public function __construct( $this->name = $values['name']; $this->folderId = $values['folderId']; $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; $this->metadata = $values['metadata'] ?? null; $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailState = $values['thumbnailState']; $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; $this->createdAt = $values['createdAt']; $this->updatedAt = $values['updatedAt']; diff --git a/src/Types/DocumentsImportFrom200ResponseStatus.php b/src/Types/DocumentsImportFrom200ResponseStatus.php new file mode 100644 index 00000000..3703c3cd --- /dev/null +++ b/src/Types/DocumentsImportFrom200ResponseStatus.php @@ -0,0 +1,10 @@ + $tag + * @var value-of $status */ - #[JsonProperty('tag')] - public string $tag; + #[JsonProperty('status')] + public string $status; /** * @var DocumentsImportFrom202ResponseDocument $document @@ -21,14 +21,14 @@ class DocumentsImportFrom202Response extends JsonSerializableType /** * @param array{ - * tag: value-of, + * status: value-of, * document: DocumentsImportFrom202ResponseDocument, * } $values */ public function __construct( array $values, ) { - $this->tag = $values['tag']; + $this->status = $values['status']; $this->document = $values['document']; } diff --git a/src/Types/DocumentsImportFrom202ResponseDocument.php b/src/Types/DocumentsImportFrom202ResponseDocument.php index 4dae8085..56bf7ebc 100644 --- a/src/Types/DocumentsImportFrom202ResponseDocument.php +++ b/src/Types/DocumentsImportFrom202ResponseDocument.php @@ -5,6 +5,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Types\ArrayType; +use DateTime; +use CloudPDF\Core\Types\Date; class DocumentsImportFrom202ResponseDocument extends JsonSerializableType { @@ -39,16 +41,16 @@ class DocumentsImportFrom202ResponseDocument extends JsonSerializableType public string $state; /** - * @var ?string $baseSha + * @var ?string $baseSha256 */ - #[JsonProperty('baseSha')] - public ?string $baseSha; + #[JsonProperty('baseSha256')] + public ?string $baseSha256; /** - * @var ?float $storageSizeBytes + * @var ?int $sizeBytes */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; /** * @var ?array $metadata @@ -69,10 +71,10 @@ class DocumentsImportFrom202ResponseDocument extends JsonSerializableType public ?string $failureReason; /** - * @var ?value-of $thumbnailState + * @var value-of $thumbnailState */ #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; + public string $thumbnailState; /** * @var ?string $thumbnailUrl @@ -81,16 +83,16 @@ class DocumentsImportFrom202ResponseDocument extends JsonSerializableType public ?string $thumbnailUrl; /** - * @var float $createdAt + * @var DateTime $createdAt */ - #[JsonProperty('createdAt')] - public float $createdAt; + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; /** - * @var float $updatedAt + * @var DateTime $updatedAt */ - #[JsonProperty('updatedAt')] - public float $updatedAt; + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; /** * @var ?string $createdBy @@ -105,14 +107,14 @@ class DocumentsImportFrom202ResponseDocument extends JsonSerializableType * name: string, * folderId: string, * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, * metadata?: ?array, * idempotencyKey?: ?string, * failureReason?: ?string, - * thumbnailState?: ?value-of, * thumbnailUrl?: ?string, * createdBy?: ?string, * } $values @@ -125,12 +127,12 @@ public function __construct( $this->name = $values['name']; $this->folderId = $values['folderId']; $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; $this->metadata = $values['metadata'] ?? null; $this->idempotencyKey = $values['idempotencyKey'] ?? null; $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; + $this->thumbnailState = $values['thumbnailState']; $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; $this->createdAt = $values['createdAt']; $this->updatedAt = $values['updatedAt']; diff --git a/src/Types/DocumentsImportFrom202ResponseStatus.php b/src/Types/DocumentsImportFrom202ResponseStatus.php new file mode 100644 index 00000000..240a5bdc --- /dev/null +++ b/src/Types/DocumentsImportFrom202ResponseStatus.php @@ -0,0 +1,10 @@ +tag = $values['tag']; - $this->value = $values['value']; - } - - /** - * @param DocumentsInit200ResponseCreated $created - * @return DocumentsInit200Response - */ - public static function created(DocumentsInit200ResponseCreated $created): DocumentsInit200Response - { - return new DocumentsInit200Response([ - 'tag' => 'created', - 'value' => $created, - ]); - } - - /** - * @param DocumentsInit200ResponseResumed $resumed - * @return DocumentsInit200Response - */ - public static function resumed(DocumentsInit200ResponseResumed $resumed): DocumentsInit200Response - { - return new DocumentsInit200Response([ - 'tag' => 'resumed', - 'value' => $resumed, - ]); - } - - /** - * @param DocumentsInit200ResponseDeduped $deduped - * @return DocumentsInit200Response - */ - public static function deduped(DocumentsInit200ResponseDeduped $deduped): DocumentsInit200Response - { - return new DocumentsInit200Response([ - 'tag' => 'deduped', - 'value' => $deduped, - ]); - } - - /** - * @return bool - */ - public function isCreated(): bool - { - return $this->value instanceof DocumentsInit200ResponseCreated && $this->tag === 'created'; - } - - /** - * @return DocumentsInit200ResponseCreated - */ - public function asCreated(): DocumentsInit200ResponseCreated - { - if (!($this->value instanceof DocumentsInit200ResponseCreated && $this->tag === 'created')) { - throw new Exception( - "Expected created; got " . $this->tag . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isResumed(): bool - { - return $this->value instanceof DocumentsInit200ResponseResumed && $this->tag === 'resumed'; - } - - /** - * @return DocumentsInit200ResponseResumed - */ - public function asResumed(): DocumentsInit200ResponseResumed - { - if (!($this->value instanceof DocumentsInit200ResponseResumed && $this->tag === 'resumed')) { - throw new Exception( - "Expected resumed; got " . $this->tag . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isDeduped(): bool - { - return $this->value instanceof DocumentsInit200ResponseDeduped && $this->tag === 'deduped'; - } - - /** - * @return DocumentsInit200ResponseDeduped - */ - public function asDeduped(): DocumentsInit200ResponseDeduped - { - if (!($this->value instanceof DocumentsInit200ResponseDeduped && $this->tag === 'deduped')) { - throw new Exception( - "Expected deduped; got " . $this->tag . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['tag'] = $this->tag; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->tag) { - case 'created': - $value = $this->asCreated()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'resumed': - $value = $this->asResumed()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'deduped': - $value = $this->asDeduped()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('tag', $data)) { - throw new Exception( - "JSON data is missing property 'tag'", - ); - } - $tag = $data['tag']; - if (!(is_string($tag))) { - throw new Exception( - "Expected property 'tag' in JSON data to be string, instead received " . get_debug_type($data['tag']), - ); - } - - $args['tag'] = $tag; - switch ($tag) { - case 'created': - $args['value'] = DocumentsInit200ResponseCreated::jsonDeserialize($data); - break; - case 'resumed': - $args['value'] = DocumentsInit200ResponseResumed::jsonDeserialize($data); - break; - case 'deduped': - $args['value'] = DocumentsInit200ResponseDeduped::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['tag'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/DocumentsInit200ResponseCreated.php b/src/Types/DocumentsInit200ResponseCreated.php deleted file mode 100644 index 8a6f6ada..00000000 --- a/src/Types/DocumentsInit200ResponseCreated.php +++ /dev/null @@ -1,42 +0,0 @@ -document = $values['document']; - $this->upload = $values['upload']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseCreatedDocument.php b/src/Types/DocumentsInit200ResponseCreatedDocument.php deleted file mode 100644 index 969e7532..00000000 --- a/src/Types/DocumentsInit200ResponseCreatedDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseCreatedDocumentState.php b/src/Types/DocumentsInit200ResponseCreatedDocumentState.php deleted file mode 100644 index 8b28efc3..00000000 --- a/src/Types/DocumentsInit200ResponseCreatedDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocumentsInit200ResponseCreatedUploadPresigned $presigned - * @return DocumentsInit200ResponseCreatedUpload - */ - public static function presigned(DocumentsInit200ResponseCreatedUploadPresigned $presigned): DocumentsInit200ResponseCreatedUpload - { - return new DocumentsInit200ResponseCreatedUpload([ - 'kind' => 'presigned', - 'value' => $presigned, - ]); - } - - /** - * @param DocumentsInit200ResponseCreatedUploadProxy $proxy - * @return DocumentsInit200ResponseCreatedUpload - */ - public static function proxy(DocumentsInit200ResponseCreatedUploadProxy $proxy): DocumentsInit200ResponseCreatedUpload - { - return new DocumentsInit200ResponseCreatedUpload([ - 'kind' => 'proxy', - 'value' => $proxy, - ]); - } - - /** - * @return bool - */ - public function isPresigned(): bool - { - return $this->value instanceof DocumentsInit200ResponseCreatedUploadPresigned && $this->kind === 'presigned'; - } - - /** - * @return DocumentsInit200ResponseCreatedUploadPresigned - */ - public function asPresigned(): DocumentsInit200ResponseCreatedUploadPresigned - { - if (!($this->value instanceof DocumentsInit200ResponseCreatedUploadPresigned && $this->kind === 'presigned')) { - throw new Exception( - "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isProxy(): bool - { - return $this->value instanceof DocumentsInit200ResponseCreatedUploadProxy && $this->kind === 'proxy'; - } - - /** - * @return DocumentsInit200ResponseCreatedUploadProxy - */ - public function asProxy(): DocumentsInit200ResponseCreatedUploadProxy - { - if (!($this->value instanceof DocumentsInit200ResponseCreatedUploadProxy && $this->kind === 'proxy')) { - throw new Exception( - "Expected proxy; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'presigned': - $value = $this->asPresigned()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'proxy': - $value = $this->asProxy()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'presigned': - $args['value'] = DocumentsInit200ResponseCreatedUploadPresigned::jsonDeserialize($data); - break; - case 'proxy': - $args['value'] = DocumentsInit200ResponseCreatedUploadProxy::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/DocumentsInit200ResponseCreatedUploadPresigned.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresigned.php deleted file mode 100644 index bc8cdb7c..00000000 --- a/src/Types/DocumentsInit200ResponseCreatedUploadPresigned.php +++ /dev/null @@ -1,42 +0,0 @@ -presigned = $values['presigned']; - $this->key = $values['key']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php deleted file mode 100644 index 55b7dd1e..00000000 --- a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresigned.php +++ /dev/null @@ -1,59 +0,0 @@ - $headers - */ - #[JsonProperty('headers'), ArrayType(['string' => 'string'])] - public array $headers; - - /** - * @var value-of $method - */ - #[JsonProperty('method')] - public string $method; - - /** - * @var float $expiresAt - */ - #[JsonProperty('expiresAt')] - public float $expiresAt; - - /** - * @param array{ - * url: string, - * headers: array, - * method: value-of, - * expiresAt: float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->url = $values['url']; - $this->headers = $values['headers']; - $this->method = $values['method']; - $this->expiresAt = $values['expiresAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php deleted file mode 100644 index 918f2bab..00000000 --- a/src/Types/DocumentsInit200ResponseCreatedUploadPresignedPresignedMethod.php +++ /dev/null @@ -1,8 +0,0 @@ -url = $values['url']; - $this->key = $values['key']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseDeduped.php b/src/Types/DocumentsInit200ResponseDeduped.php deleted file mode 100644 index bad8fcf2..00000000 --- a/src/Types/DocumentsInit200ResponseDeduped.php +++ /dev/null @@ -1,34 +0,0 @@ -document = $values['document']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseDedupedDocument.php b/src/Types/DocumentsInit200ResponseDedupedDocument.php deleted file mode 100644 index a560f550..00000000 --- a/src/Types/DocumentsInit200ResponseDedupedDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseDedupedDocumentState.php b/src/Types/DocumentsInit200ResponseDedupedDocumentState.php deleted file mode 100644 index 2cffb1f4..00000000 --- a/src/Types/DocumentsInit200ResponseDedupedDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -document = $values['document']; - $this->upload = $values['upload']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseResumedDocument.php b/src/Types/DocumentsInit200ResponseResumedDocument.php deleted file mode 100644 index 9dd674c0..00000000 --- a/src/Types/DocumentsInit200ResponseResumedDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseResumedDocumentState.php b/src/Types/DocumentsInit200ResponseResumedDocumentState.php deleted file mode 100644 index 28b61a5c..00000000 --- a/src/Types/DocumentsInit200ResponseResumedDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param DocumentsInit200ResponseResumedUploadPresigned $presigned - * @return DocumentsInit200ResponseResumedUpload - */ - public static function presigned(DocumentsInit200ResponseResumedUploadPresigned $presigned): DocumentsInit200ResponseResumedUpload - { - return new DocumentsInit200ResponseResumedUpload([ - 'kind' => 'presigned', - 'value' => $presigned, - ]); - } - - /** - * @param DocumentsInit200ResponseResumedUploadProxy $proxy - * @return DocumentsInit200ResponseResumedUpload - */ - public static function proxy(DocumentsInit200ResponseResumedUploadProxy $proxy): DocumentsInit200ResponseResumedUpload - { - return new DocumentsInit200ResponseResumedUpload([ - 'kind' => 'proxy', - 'value' => $proxy, - ]); - } - - /** - * @return bool - */ - public function isPresigned(): bool - { - return $this->value instanceof DocumentsInit200ResponseResumedUploadPresigned && $this->kind === 'presigned'; - } - - /** - * @return DocumentsInit200ResponseResumedUploadPresigned - */ - public function asPresigned(): DocumentsInit200ResponseResumedUploadPresigned - { - if (!($this->value instanceof DocumentsInit200ResponseResumedUploadPresigned && $this->kind === 'presigned')) { - throw new Exception( - "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isProxy(): bool - { - return $this->value instanceof DocumentsInit200ResponseResumedUploadProxy && $this->kind === 'proxy'; - } - - /** - * @return DocumentsInit200ResponseResumedUploadProxy - */ - public function asProxy(): DocumentsInit200ResponseResumedUploadProxy - { - if (!($this->value instanceof DocumentsInit200ResponseResumedUploadProxy && $this->kind === 'proxy')) { - throw new Exception( - "Expected proxy; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'presigned': - $value = $this->asPresigned()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'proxy': - $value = $this->asProxy()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'presigned': - $args['value'] = DocumentsInit200ResponseResumedUploadPresigned::jsonDeserialize($data); - break; - case 'proxy': - $args['value'] = DocumentsInit200ResponseResumedUploadProxy::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/DocumentsInit200ResponseResumedUploadPresigned.php b/src/Types/DocumentsInit200ResponseResumedUploadPresigned.php deleted file mode 100644 index f4aa7d87..00000000 --- a/src/Types/DocumentsInit200ResponseResumedUploadPresigned.php +++ /dev/null @@ -1,42 +0,0 @@ -presigned = $values['presigned']; - $this->key = $values['key']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php deleted file mode 100644 index bb017f9f..00000000 --- a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresigned.php +++ /dev/null @@ -1,59 +0,0 @@ - $headers - */ - #[JsonProperty('headers'), ArrayType(['string' => 'string'])] - public array $headers; - - /** - * @var value-of $method - */ - #[JsonProperty('method')] - public string $method; - - /** - * @var float $expiresAt - */ - #[JsonProperty('expiresAt')] - public float $expiresAt; - - /** - * @param array{ - * url: string, - * headers: array, - * method: value-of, - * expiresAt: float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->url = $values['url']; - $this->headers = $values['headers']; - $this->method = $values['method']; - $this->expiresAt = $values['expiresAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php deleted file mode 100644 index 21948b7a..00000000 --- a/src/Types/DocumentsInit200ResponseResumedUploadPresignedPresignedMethod.php +++ /dev/null @@ -1,8 +0,0 @@ -url = $values['url']; - $this->key = $values['key']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsInitResponse.php b/src/Types/DocumentsInitResponse.php new file mode 100644 index 00000000..3c8c6fca --- /dev/null +++ b/src/Types/DocumentsInitResponse.php @@ -0,0 +1,241 @@ +status = $values['status']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInitResponseCreated $created + * @return DocumentsInitResponse + */ + public static function created(DocumentsInitResponseCreated $created): DocumentsInitResponse + { + return new DocumentsInitResponse([ + 'status' => 'created', + 'value' => $created, + ]); + } + + /** + * @param DocumentsInitResponseResumed $resumed + * @return DocumentsInitResponse + */ + public static function resumed(DocumentsInitResponseResumed $resumed): DocumentsInitResponse + { + return new DocumentsInitResponse([ + 'status' => 'resumed', + 'value' => $resumed, + ]); + } + + /** + * @param DocumentsInitResponseDeduped $deduped + * @return DocumentsInitResponse + */ + public static function deduped(DocumentsInitResponseDeduped $deduped): DocumentsInitResponse + { + return new DocumentsInitResponse([ + 'status' => 'deduped', + 'value' => $deduped, + ]); + } + + /** + * @return bool + */ + public function isCreated(): bool + { + return $this->value instanceof DocumentsInitResponseCreated && $this->status === 'created'; + } + + /** + * @return DocumentsInitResponseCreated + */ + public function asCreated(): DocumentsInitResponseCreated + { + if (!($this->value instanceof DocumentsInitResponseCreated && $this->status === 'created')) { + throw new Exception( + "Expected created; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isResumed(): bool + { + return $this->value instanceof DocumentsInitResponseResumed && $this->status === 'resumed'; + } + + /** + * @return DocumentsInitResponseResumed + */ + public function asResumed(): DocumentsInitResponseResumed + { + if (!($this->value instanceof DocumentsInitResponseResumed && $this->status === 'resumed')) { + throw new Exception( + "Expected resumed; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isDeduped(): bool + { + return $this->value instanceof DocumentsInitResponseDeduped && $this->status === 'deduped'; + } + + /** + * @return DocumentsInitResponseDeduped + */ + public function asDeduped(): DocumentsInitResponseDeduped + { + if (!($this->value instanceof DocumentsInitResponseDeduped && $this->status === 'deduped')) { + throw new Exception( + "Expected deduped; got " . $this->status . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['status'] = $this->status; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->status) { + case 'created': + $value = $this->asCreated()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'resumed': + $value = $this->asResumed()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'deduped': + $value = $this->asDeduped()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('status', $data)) { + throw new Exception( + "JSON data is missing property 'status'", + ); + } + $status = $data['status']; + if (!(is_string($status))) { + throw new Exception( + "Expected property 'status' in JSON data to be string, instead received " . get_debug_type($data['status']), + ); + } + + $args['status'] = $status; + switch ($status) { + case 'created': + $args['value'] = DocumentsInitResponseCreated::jsonDeserialize($data); + break; + case 'resumed': + $args['value'] = DocumentsInitResponseResumed::jsonDeserialize($data); + break; + case 'deduped': + $args['value'] = DocumentsInitResponseDeduped::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['status'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocumentsInitResponseCreated.php b/src/Types/DocumentsInitResponseCreated.php new file mode 100644 index 00000000..0b8f7dac --- /dev/null +++ b/src/Types/DocumentsInitResponseCreated.php @@ -0,0 +1,42 @@ +document = $values['document']; + $this->upload = $values['upload']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseCreatedDocument.php b/src/Types/DocumentsInitResponseCreatedDocument.php new file mode 100644 index 00000000..763d1559 --- /dev/null +++ b/src/Types/DocumentsInitResponseCreatedDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseCreatedDocumentState.php b/src/Types/DocumentsInitResponseCreatedDocumentState.php new file mode 100644 index 00000000..6493badf --- /dev/null +++ b/src/Types/DocumentsInitResponseCreatedDocumentState.php @@ -0,0 +1,11 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInitResponseCreatedUploadPresigned $presigned + * @return DocumentsInitResponseCreatedUpload + */ + public static function presigned(DocumentsInitResponseCreatedUploadPresigned $presigned): DocumentsInitResponseCreatedUpload + { + return new DocumentsInitResponseCreatedUpload([ + 'kind' => 'presigned', + 'value' => $presigned, + ]); + } + + /** + * @param DocumentsInitResponseCreatedUploadProxy $proxy + * @return DocumentsInitResponseCreatedUpload + */ + public static function proxy(DocumentsInitResponseCreatedUploadProxy $proxy): DocumentsInitResponseCreatedUpload + { + return new DocumentsInitResponseCreatedUpload([ + 'kind' => 'proxy', + 'value' => $proxy, + ]); + } + + /** + * @return bool + */ + public function isPresigned(): bool + { + return $this->value instanceof DocumentsInitResponseCreatedUploadPresigned && $this->kind === 'presigned'; + } + + /** + * @return DocumentsInitResponseCreatedUploadPresigned + */ + public function asPresigned(): DocumentsInitResponseCreatedUploadPresigned + { + if (!($this->value instanceof DocumentsInitResponseCreatedUploadPresigned && $this->kind === 'presigned')) { + throw new Exception( + "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isProxy(): bool + { + return $this->value instanceof DocumentsInitResponseCreatedUploadProxy && $this->kind === 'proxy'; + } + + /** + * @return DocumentsInitResponseCreatedUploadProxy + */ + public function asProxy(): DocumentsInitResponseCreatedUploadProxy + { + if (!($this->value instanceof DocumentsInitResponseCreatedUploadProxy && $this->kind === 'proxy')) { + throw new Exception( + "Expected proxy; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'presigned': + $value = $this->asPresigned()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'proxy': + $value = $this->asProxy()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'presigned': + $args['value'] = DocumentsInitResponseCreatedUploadPresigned::jsonDeserialize($data); + break; + case 'proxy': + $args['value'] = DocumentsInitResponseCreatedUploadProxy::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/DocumentsInitResponseCreatedUploadPresigned.php b/src/Types/DocumentsInitResponseCreatedUploadPresigned.php new file mode 100644 index 00000000..aef30196 --- /dev/null +++ b/src/Types/DocumentsInitResponseCreatedUploadPresigned.php @@ -0,0 +1,42 @@ +presigned = $values['presigned']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseCreatedUploadPresignedPresigned.php b/src/Types/DocumentsInitResponseCreatedUploadPresignedPresigned.php new file mode 100644 index 00000000..aaf66f67 --- /dev/null +++ b/src/Types/DocumentsInitResponseCreatedUploadPresignedPresigned.php @@ -0,0 +1,61 @@ + $headers + */ + #[JsonProperty('headers'), ArrayType(['string' => 'string'])] + public array $headers; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @var DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public DateTime $expiresAt; + + /** + * @param array{ + * url: string, + * headers: array, + * method: value-of, + * expiresAt: DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->url = $values['url']; + $this->headers = $values['headers']; + $this->method = $values['method']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseCreatedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInitResponseCreatedUploadPresignedPresignedMethod.php new file mode 100644 index 00000000..c7cd6ef6 --- /dev/null +++ b/src/Types/DocumentsInitResponseCreatedUploadPresignedPresignedMethod.php @@ -0,0 +1,8 @@ +url = $values['url']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseDeduped.php b/src/Types/DocumentsInitResponseDeduped.php new file mode 100644 index 00000000..36f3f5a3 --- /dev/null +++ b/src/Types/DocumentsInitResponseDeduped.php @@ -0,0 +1,34 @@ +document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseDedupedDocument.php b/src/Types/DocumentsInitResponseDedupedDocument.php new file mode 100644 index 00000000..a9f7e038 --- /dev/null +++ b/src/Types/DocumentsInitResponseDedupedDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseDedupedDocumentState.php b/src/Types/DocumentsInitResponseDedupedDocumentState.php new file mode 100644 index 00000000..d6d0f0ce --- /dev/null +++ b/src/Types/DocumentsInitResponseDedupedDocumentState.php @@ -0,0 +1,11 @@ +document = $values['document']; + $this->upload = $values['upload']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseResumedDocument.php b/src/Types/DocumentsInitResponseResumedDocument.php new file mode 100644 index 00000000..200d3319 --- /dev/null +++ b/src/Types/DocumentsInitResponseResumedDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseResumedDocumentState.php b/src/Types/DocumentsInitResponseResumedDocumentState.php new file mode 100644 index 00000000..ab853b36 --- /dev/null +++ b/src/Types/DocumentsInitResponseResumedDocumentState.php @@ -0,0 +1,11 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocumentsInitResponseResumedUploadPresigned $presigned + * @return DocumentsInitResponseResumedUpload + */ + public static function presigned(DocumentsInitResponseResumedUploadPresigned $presigned): DocumentsInitResponseResumedUpload + { + return new DocumentsInitResponseResumedUpload([ + 'kind' => 'presigned', + 'value' => $presigned, + ]); + } + + /** + * @param DocumentsInitResponseResumedUploadProxy $proxy + * @return DocumentsInitResponseResumedUpload + */ + public static function proxy(DocumentsInitResponseResumedUploadProxy $proxy): DocumentsInitResponseResumedUpload + { + return new DocumentsInitResponseResumedUpload([ + 'kind' => 'proxy', + 'value' => $proxy, + ]); + } + + /** + * @return bool + */ + public function isPresigned(): bool + { + return $this->value instanceof DocumentsInitResponseResumedUploadPresigned && $this->kind === 'presigned'; + } + + /** + * @return DocumentsInitResponseResumedUploadPresigned + */ + public function asPresigned(): DocumentsInitResponseResumedUploadPresigned + { + if (!($this->value instanceof DocumentsInitResponseResumedUploadPresigned && $this->kind === 'presigned')) { + throw new Exception( + "Expected presigned; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isProxy(): bool + { + return $this->value instanceof DocumentsInitResponseResumedUploadProxy && $this->kind === 'proxy'; + } + + /** + * @return DocumentsInitResponseResumedUploadProxy + */ + public function asProxy(): DocumentsInitResponseResumedUploadProxy + { + if (!($this->value instanceof DocumentsInitResponseResumedUploadProxy && $this->kind === 'proxy')) { + throw new Exception( + "Expected proxy; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'presigned': + $value = $this->asPresigned()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'proxy': + $value = $this->asProxy()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'presigned': + $args['value'] = DocumentsInitResponseResumedUploadPresigned::jsonDeserialize($data); + break; + case 'proxy': + $args['value'] = DocumentsInitResponseResumedUploadProxy::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/DocumentsInitResponseResumedUploadPresigned.php b/src/Types/DocumentsInitResponseResumedUploadPresigned.php new file mode 100644 index 00000000..64f628df --- /dev/null +++ b/src/Types/DocumentsInitResponseResumedUploadPresigned.php @@ -0,0 +1,42 @@ +presigned = $values['presigned']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseResumedUploadPresignedPresigned.php b/src/Types/DocumentsInitResponseResumedUploadPresignedPresigned.php new file mode 100644 index 00000000..08be1bc0 --- /dev/null +++ b/src/Types/DocumentsInitResponseResumedUploadPresignedPresigned.php @@ -0,0 +1,61 @@ + $headers + */ + #[JsonProperty('headers'), ArrayType(['string' => 'string'])] + public array $headers; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @var DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public DateTime $expiresAt; + + /** + * @param array{ + * url: string, + * headers: array, + * method: value-of, + * expiresAt: DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->url = $values['url']; + $this->headers = $values['headers']; + $this->method = $values['method']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsInitResponseResumedUploadPresignedPresignedMethod.php b/src/Types/DocumentsInitResponseResumedUploadPresignedPresignedMethod.php new file mode 100644 index 00000000..52c091b0 --- /dev/null +++ b/src/Types/DocumentsInitResponseResumedUploadPresignedPresignedMethod.php @@ -0,0 +1,8 @@ +url = $values['url']; + $this->key = $values['key']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsLayersList200Response.php b/src/Types/DocumentsLayersList200Response.php deleted file mode 100644 index adca9763..00000000 --- a/src/Types/DocumentsLayersList200Response.php +++ /dev/null @@ -1,43 +0,0 @@ - $layers - */ - #[JsonProperty('layers'), ArrayType([DocumentsLayersList200ResponseLayersItem::class])] - public array $layers; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * layers: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->layers = $values['layers']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsLayersList200ResponseLayersItem.php b/src/Types/DocumentsLayersList200ResponseLayersItem.php deleted file mode 100644 index fe9b1791..00000000 --- a/src/Types/DocumentsLayersList200ResponseLayersItem.php +++ /dev/null @@ -1,90 +0,0 @@ -docId = $values['docId']; - $this->layerName = $values['layerName']; - $this->grantId = $values['grantId'] ?? null; - $this->visitorId = $values['visitorId'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->lastSeenAt = $values['lastSeenAt'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsLayersListResponse.php b/src/Types/DocumentsLayersListResponse.php new file mode 100644 index 00000000..cc29fe01 --- /dev/null +++ b/src/Types/DocumentsLayersListResponse.php @@ -0,0 +1,43 @@ + $layers + */ + #[JsonProperty('layers'), ArrayType([DocumentsLayersListResponseLayersItem::class])] + public array $layers; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * layers: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->layers = $values['layers']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsLayersListResponseLayersItem.php b/src/Types/DocumentsLayersListResponseLayersItem.php new file mode 100644 index 00000000..66abe33d --- /dev/null +++ b/src/Types/DocumentsLayersListResponseLayersItem.php @@ -0,0 +1,92 @@ +docId = $values['docId']; + $this->layerName = $values['layerName']; + $this->grantId = $values['grantId'] ?? null; + $this->visitorId = $values['visitorId'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->lastSeenAt = $values['lastSeenAt'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsList200Response.php b/src/Types/DocumentsList200Response.php deleted file mode 100644 index 861e2fed..00000000 --- a/src/Types/DocumentsList200Response.php +++ /dev/null @@ -1,43 +0,0 @@ - $documents - */ - #[JsonProperty('documents'), ArrayType([DocumentsList200ResponseDocumentsItem::class])] - public array $documents; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * documents: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->documents = $values['documents']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsList200ResponseDocumentsItem.php b/src/Types/DocumentsList200ResponseDocumentsItem.php deleted file mode 100644 index 5c8634df..00000000 --- a/src/Types/DocumentsList200ResponseDocumentsItem.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsList200ResponseDocumentsItemState.php b/src/Types/DocumentsList200ResponseDocumentsItemState.php deleted file mode 100644 index 551fbd94..00000000 --- a/src/Types/DocumentsList200ResponseDocumentsItemState.php +++ /dev/null @@ -1,11 +0,0 @@ - $documents + */ + #[JsonProperty('documents'), ArrayType([DocumentsListResponseDocumentsItem::class])] + public array $documents; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * documents: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->documents = $values['documents']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsListResponseDocumentsItem.php b/src/Types/DocumentsListResponseDocumentsItem.php new file mode 100644 index 00000000..638e5a80 --- /dev/null +++ b/src/Types/DocumentsListResponseDocumentsItem.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsListResponseDocumentsItemState.php b/src/Types/DocumentsListResponseDocumentsItemState.php new file mode 100644 index 00000000..6a60c221 --- /dev/null +++ b/src/Types/DocumentsListResponseDocumentsItemState.php @@ -0,0 +1,11 @@ +error = $values['error']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsThumbnailResponseError.php b/src/Types/DocumentsThumbnailResponseError.php deleted file mode 100644 index 71992308..00000000 --- a/src/Types/DocumentsThumbnailResponseError.php +++ /dev/null @@ -1,50 +0,0 @@ -code = $values['code']; - $this->message = $values['message']; - $this->state = $values['state']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUpdate200Response.php b/src/Types/DocumentsUpdate200Response.php deleted file mode 100644 index 0395cd2b..00000000 --- a/src/Types/DocumentsUpdate200Response.php +++ /dev/null @@ -1,34 +0,0 @@ -document = $values['document']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUpdate200ResponseDocument.php b/src/Types/DocumentsUpdate200ResponseDocument.php deleted file mode 100644 index 162b47dc..00000000 --- a/src/Types/DocumentsUpdate200ResponseDocument.php +++ /dev/null @@ -1,147 +0,0 @@ - $state - */ - #[JsonProperty('state')] - public string $state; - - /** - * @var ?string $baseSha - */ - #[JsonProperty('baseSha')] - public ?string $baseSha; - - /** - * @var ?float $storageSizeBytes - */ - #[JsonProperty('storageSizeBytes')] - public ?float $storageSizeBytes; - - /** - * @var ?array $metadata - */ - #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] - public ?array $metadata; - - /** - * @var ?string $idempotencyKey - */ - #[JsonProperty('idempotencyKey')] - public ?string $idempotencyKey; - - /** - * @var ?string $failureReason - */ - #[JsonProperty('failureReason')] - public ?string $failureReason; - - /** - * @var ?value-of $thumbnailState - */ - #[JsonProperty('thumbnailState')] - public ?string $thumbnailState; - - /** - * @var ?string $thumbnailUrl - */ - #[JsonProperty('thumbnailUrl')] - public ?string $thumbnailUrl; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @var ?string $createdBy - */ - #[JsonProperty('createdBy')] - public ?string $createdBy; - - /** - * @param array{ - * id: string, - * tenantId: string, - * name: string, - * folderId: string, - * state: value-of, - * createdAt: float, - * updatedAt: float, - * baseSha?: ?string, - * storageSizeBytes?: ?float, - * metadata?: ?array, - * idempotencyKey?: ?string, - * failureReason?: ?string, - * thumbnailState?: ?value-of, - * thumbnailUrl?: ?string, - * createdBy?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->name = $values['name']; - $this->folderId = $values['folderId']; - $this->state = $values['state']; - $this->baseSha = $values['baseSha'] ?? null; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - $this->metadata = $values['metadata'] ?? null; - $this->idempotencyKey = $values['idempotencyKey'] ?? null; - $this->failureReason = $values['failureReason'] ?? null; - $this->thumbnailState = $values['thumbnailState'] ?? null; - $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUpdate200ResponseDocumentState.php b/src/Types/DocumentsUpdate200ResponseDocumentState.php deleted file mode 100644 index 6dce8b23..00000000 --- a/src/Types/DocumentsUpdate200ResponseDocumentState.php +++ /dev/null @@ -1,11 +0,0 @@ -document = $values['document']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsUpdateResponseDocument.php b/src/Types/DocumentsUpdateResponseDocument.php new file mode 100644 index 00000000..fee92eaa --- /dev/null +++ b/src/Types/DocumentsUpdateResponseDocument.php @@ -0,0 +1,149 @@ + $state + */ + #[JsonProperty('state')] + public string $state; + + /** + * @var ?string $baseSha256 + */ + #[JsonProperty('baseSha256')] + public ?string $baseSha256; + + /** + * @var ?int $sizeBytes + */ + #[JsonProperty('sizeBytes')] + public ?int $sizeBytes; + + /** + * @var ?array $metadata + */ + #[JsonProperty('metadata'), ArrayType(['string' => 'mixed'])] + public ?array $metadata; + + /** + * @var ?string $idempotencyKey + */ + #[JsonProperty('idempotencyKey')] + public ?string $idempotencyKey; + + /** + * @var ?string $failureReason + */ + #[JsonProperty('failureReason')] + public ?string $failureReason; + + /** + * @var value-of $thumbnailState + */ + #[JsonProperty('thumbnailState')] + public string $thumbnailState; + + /** + * @var ?string $thumbnailUrl + */ + #[JsonProperty('thumbnailUrl')] + public ?string $thumbnailUrl; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @var ?string $createdBy + */ + #[JsonProperty('createdBy')] + public ?string $createdBy; + + /** + * @param array{ + * id: string, + * tenantId: string, + * name: string, + * folderId: string, + * state: value-of, + * thumbnailState: value-of, + * createdAt: DateTime, + * updatedAt: DateTime, + * baseSha256?: ?string, + * sizeBytes?: ?int, + * metadata?: ?array, + * idempotencyKey?: ?string, + * failureReason?: ?string, + * thumbnailUrl?: ?string, + * createdBy?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->name = $values['name']; + $this->folderId = $values['folderId']; + $this->state = $values['state']; + $this->baseSha256 = $values['baseSha256'] ?? null; + $this->sizeBytes = $values['sizeBytes'] ?? null; + $this->metadata = $values['metadata'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->failureReason = $values['failureReason'] ?? null; + $this->thumbnailState = $values['thumbnailState']; + $this->thumbnailUrl = $values['thumbnailUrl'] ?? null; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsUpdateResponseDocumentState.php b/src/Types/DocumentsUpdateResponseDocumentState.php new file mode 100644 index 00000000..085b35f5 --- /dev/null +++ b/src/Types/DocumentsUpdateResponseDocumentState.php @@ -0,0 +1,11 @@ +sha256 = $values['sha256']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/DocumentsUploadProxyResponse.php b/src/Types/DocumentsUploadProxyResponse.php new file mode 100644 index 00000000..db92a268 --- /dev/null +++ b/src/Types/DocumentsUploadProxyResponse.php @@ -0,0 +1,34 @@ +sha256 = $values['sha256']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EngineError.php b/src/Types/EngineError.php new file mode 100644 index 00000000..9c746aae --- /dev/null +++ b/src/Types/EngineError.php @@ -0,0 +1,51 @@ + $code Why the request failed. A newer server can add codes: read one your client doesn't know as `Unknown`. + */ + #[JsonProperty('code')] + public string $code; + + /** + * @var string $message + */ + #[JsonProperty('message')] + public string $message; + + /** + * @var ?array $details What a code carries besides its message, as each code says. + */ + #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] + public ?array $details; + + /** + * @param array{ + * code: value-of, + * message: string, + * details?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->code = $values['code']; + $this->message = $values['message']; + $this->details = $values['details'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/EngineErrorCode.php b/src/Types/EngineErrorCode.php new file mode 100644 index 00000000..201f96ed --- /dev/null +++ b/src/Types/EngineErrorCode.php @@ -0,0 +1,51 @@ + $name - */ - #[JsonProperty('name')] - public string $name; - - /** - * @var value-of $code - */ - #[JsonProperty('code')] - public string $code; - - /** - * @var string $message - */ - #[JsonProperty('message')] - public string $message; - - /** - * @var ?array $details - */ - #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] - public ?array $details; - - /** - * @param array{ - * name: value-of, - * code: value-of, - * message: string, - * details?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->name = $values['name']; - $this->code = $values['code']; - $this->message = $values['message']; - $this->details = $values['details'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/EngineErrorPayloadCode.php b/src/Types/EngineErrorPayloadCode.php deleted file mode 100644 index b9acda9e..00000000 --- a/src/Types/EngineErrorPayloadCode.php +++ /dev/null @@ -1,37 +0,0 @@ -error = $values['error']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldLockSpec.php b/src/Types/FieldLockSpec.php new file mode 100644 index 00000000..5402e2e4 --- /dev/null +++ b/src/Types/FieldLockSpec.php @@ -0,0 +1,51 @@ + $action + */ + #[JsonProperty('action')] + public string $action; + + /** + * @var array $fields + */ + #[JsonProperty('fields'), ArrayType(['string'])] + public array $fields; + + /** + * @var ?int $permission + */ + #[JsonProperty('permission')] + public ?int $permission; + + /** + * @param array{ + * action: value-of, + * fields: array, + * permission?: ?int, + * } $values + */ + public function __construct( + array $values, + ) { + $this->action = $values['action']; + $this->fields = $values['fields']; + $this->permission = $values['permission'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FieldLockSpecAction.php b/src/Types/FieldLockSpecAction.php new file mode 100644 index 00000000..118e440f --- /dev/null +++ b/src/Types/FieldLockSpecAction.php @@ -0,0 +1,10 @@ +folder = $values['folder']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersCreate200ResponseFolder.php b/src/Types/FoldersCreate200ResponseFolder.php deleted file mode 100644 index c8fa79df..00000000 --- a/src/Types/FoldersCreate200ResponseFolder.php +++ /dev/null @@ -1,82 +0,0 @@ -id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->parentId = $values['parentId']; - $this->name = $values['name']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersCreateResponse.php b/src/Types/FoldersCreateResponse.php new file mode 100644 index 00000000..802517eb --- /dev/null +++ b/src/Types/FoldersCreateResponse.php @@ -0,0 +1,34 @@ +folder = $values['folder']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersCreateResponseFolder.php b/src/Types/FoldersCreateResponseFolder.php new file mode 100644 index 00000000..04471d17 --- /dev/null +++ b/src/Types/FoldersCreateResponseFolder.php @@ -0,0 +1,84 @@ +id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->parentId = $values['parentId']; + $this->name = $values['name']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersGet200Response.php b/src/Types/FoldersGet200Response.php deleted file mode 100644 index f867d916..00000000 --- a/src/Types/FoldersGet200Response.php +++ /dev/null @@ -1,43 +0,0 @@ - $path The folders above this one, from the top level down. Neither root nor the folder itself. - */ - #[JsonProperty('path'), ArrayType([FoldersGet200ResponsePathItem::class])] - public array $path; - - /** - * @param array{ - * folder: FoldersGet200ResponseFolder, - * path: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->folder = $values['folder']; - $this->path = $values['path']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersGet200ResponseFolder.php b/src/Types/FoldersGet200ResponseFolder.php deleted file mode 100644 index e102eff2..00000000 --- a/src/Types/FoldersGet200ResponseFolder.php +++ /dev/null @@ -1,82 +0,0 @@ -id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->parentId = $values['parentId']; - $this->name = $values['name']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersGet200ResponsePathItem.php b/src/Types/FoldersGet200ResponsePathItem.php deleted file mode 100644 index 04cd299f..00000000 --- a/src/Types/FoldersGet200ResponsePathItem.php +++ /dev/null @@ -1,42 +0,0 @@ -id = $values['id']; - $this->name = $values['name']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersGetResponse.php b/src/Types/FoldersGetResponse.php new file mode 100644 index 00000000..fa473605 --- /dev/null +++ b/src/Types/FoldersGetResponse.php @@ -0,0 +1,43 @@ + $path The folders above this one, from the top level down. Neither root nor the folder itself. + */ + #[JsonProperty('path'), ArrayType([FoldersGetResponsePathItem::class])] + public array $path; + + /** + * @param array{ + * folder: FoldersGetResponseFolder, + * path: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->folder = $values['folder']; + $this->path = $values['path']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersGetResponseFolder.php b/src/Types/FoldersGetResponseFolder.php new file mode 100644 index 00000000..b50985d8 --- /dev/null +++ b/src/Types/FoldersGetResponseFolder.php @@ -0,0 +1,84 @@ +id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->parentId = $values['parentId']; + $this->name = $values['name']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersGetResponsePathItem.php b/src/Types/FoldersGetResponsePathItem.php new file mode 100644 index 00000000..0596bcb5 --- /dev/null +++ b/src/Types/FoldersGetResponsePathItem.php @@ -0,0 +1,42 @@ +id = $values['id']; + $this->name = $values['name']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersList200Response.php b/src/Types/FoldersList200Response.php deleted file mode 100644 index a1bd086c..00000000 --- a/src/Types/FoldersList200Response.php +++ /dev/null @@ -1,43 +0,0 @@ - $folders - */ - #[JsonProperty('folders'), ArrayType([FoldersList200ResponseFoldersItem::class])] - public array $folders; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * folders: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->folders = $values['folders']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersList200ResponseFoldersItem.php b/src/Types/FoldersList200ResponseFoldersItem.php deleted file mode 100644 index e81da247..00000000 --- a/src/Types/FoldersList200ResponseFoldersItem.php +++ /dev/null @@ -1,82 +0,0 @@ -id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->parentId = $values['parentId']; - $this->name = $values['name']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersListResponse.php b/src/Types/FoldersListResponse.php new file mode 100644 index 00000000..1b2147ec --- /dev/null +++ b/src/Types/FoldersListResponse.php @@ -0,0 +1,43 @@ + $folders + */ + #[JsonProperty('folders'), ArrayType([FoldersListResponseFoldersItem::class])] + public array $folders; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * folders: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->folders = $values['folders']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersListResponseFoldersItem.php b/src/Types/FoldersListResponseFoldersItem.php new file mode 100644 index 00000000..ce4323a2 --- /dev/null +++ b/src/Types/FoldersListResponseFoldersItem.php @@ -0,0 +1,84 @@ +id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->parentId = $values['parentId']; + $this->name = $values['name']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersUpdate200Response.php b/src/Types/FoldersUpdate200Response.php deleted file mode 100644 index 894f204c..00000000 --- a/src/Types/FoldersUpdate200Response.php +++ /dev/null @@ -1,34 +0,0 @@ -folder = $values['folder']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersUpdate200ResponseFolder.php b/src/Types/FoldersUpdate200ResponseFolder.php deleted file mode 100644 index f1569406..00000000 --- a/src/Types/FoldersUpdate200ResponseFolder.php +++ /dev/null @@ -1,82 +0,0 @@ -id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->parentId = $values['parentId']; - $this->name = $values['name']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - $this->createdBy = $values['createdBy'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FoldersUpdateResponse.php b/src/Types/FoldersUpdateResponse.php new file mode 100644 index 00000000..b374b0aa --- /dev/null +++ b/src/Types/FoldersUpdateResponse.php @@ -0,0 +1,34 @@ +folder = $values['folder']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FoldersUpdateResponseFolder.php b/src/Types/FoldersUpdateResponseFolder.php new file mode 100644 index 00000000..982e1375 --- /dev/null +++ b/src/Types/FoldersUpdateResponseFolder.php @@ -0,0 +1,84 @@ +id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->parentId = $values['parentId']; + $this->name = $values['name']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + $this->createdBy = $values['createdBy'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FontProgram.php b/src/Types/FontProgram.php index 93a3dc0a..a08b05a5 100644 --- a/src/Types/FontProgram.php +++ b/src/Types/FontProgram.php @@ -8,16 +8,16 @@ class FontProgram extends JsonSerializableType { /** - * @var ?string $displayHash + * @var ?string $displaySha256 */ - #[JsonProperty('displayHash')] - public ?string $displayHash; + #[JsonProperty('displaySha256')] + public ?string $displaySha256; /** - * @var ?string $sourceHash + * @var ?string $sourceSha256 */ - #[JsonProperty('sourceHash')] - public ?string $sourceHash; + #[JsonProperty('sourceSha256')] + public ?string $sourceSha256; /** * @var value-of $embedded @@ -47,8 +47,8 @@ class FontProgram extends JsonSerializableType * @param array{ * embedded: value-of, * canDownload: bool, - * displayHash?: ?string, - * sourceHash?: ?string, + * displaySha256?: ?string, + * sourceSha256?: ?string, * format?: ?value-of, * embeddingPermission?: ?value-of, * } $values @@ -56,8 +56,8 @@ class FontProgram extends JsonSerializableType public function __construct( array $values, ) { - $this->displayHash = $values['displayHash'] ?? null; - $this->sourceHash = $values['sourceHash'] ?? null; + $this->displaySha256 = $values['displaySha256'] ?? null; + $this->sourceSha256 = $values['sourceSha256'] ?? null; $this->embedded = $values['embedded']; $this->format = $values['format'] ?? null; $this->embeddingPermission = $values['embeddingPermission'] ?? null; diff --git a/src/Types/FontProgramInfo.php b/src/Types/FontProgramInfo.php index 6a4df9fd..409cbade 100644 --- a/src/Types/FontProgramInfo.php +++ b/src/Types/FontProgramInfo.php @@ -9,16 +9,16 @@ class FontProgramInfo extends JsonSerializableType { /** - * @var ?string $displayHash + * @var ?string $displaySha256 */ - #[JsonProperty('displayHash')] - public ?string $displayHash; + #[JsonProperty('displaySha256')] + public ?string $displaySha256; /** - * @var ?string $sourceHash + * @var ?string $sourceSha256 */ - #[JsonProperty('sourceHash')] - public ?string $sourceHash; + #[JsonProperty('sourceSha256')] + public ?string $sourceSha256; /** * @var value-of $embedded @@ -69,8 +69,8 @@ class FontProgramInfo extends JsonSerializableType * covers: array, * ascent: float, * descent: float, - * displayHash?: ?string, - * sourceHash?: ?string, + * displaySha256?: ?string, + * sourceSha256?: ?string, * format?: ?value-of, * embeddingPermission?: ?value-of, * } $values @@ -78,8 +78,8 @@ class FontProgramInfo extends JsonSerializableType public function __construct( array $values, ) { - $this->displayHash = $values['displayHash'] ?? null; - $this->sourceHash = $values['sourceHash'] ?? null; + $this->displaySha256 = $values['displaySha256'] ?? null; + $this->sourceSha256 = $values['sourceSha256'] ?? null; $this->embedded = $values['embedded']; $this->format = $values['format'] ?? null; $this->embeddingPermission = $values['embeddingPermission'] ?? null; diff --git a/src/Types/FormField.php b/src/Types/FormField.php index af149bc4..6c83fa07 100644 --- a/src/Types/FormField.php +++ b/src/Types/FormField.php @@ -5,6 +5,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; +/** + * A form field, by its `family`. A newer server can add families: read one your client doesn't know as `unknown`, keeping the fields every field has, with `rawValue` an empty string when the body has none. + */ class FormField extends JsonSerializableType { /** @@ -18,9 +21,9 @@ class FormField extends JsonSerializableType * |'signature' * |'unknown' * |'_unknown' - * ) $family + * ) $kind */ - public readonly string $family; + public readonly string $kind; /** * @var ( @@ -39,7 +42,7 @@ class FormField extends JsonSerializableType /** * @param array{ - * family: ( + * kind: ( * 'text' * |'checkbox' * |'radio' @@ -66,7 +69,7 @@ class FormField extends JsonSerializableType private function __construct( array $values, ) { - $this->family = $values['family']; + $this->kind = $values['kind']; $this->value = $values['value']; } @@ -77,7 +80,7 @@ private function __construct( public static function text(FormFieldText $text): FormField { return new FormField([ - 'family' => 'text', + 'kind' => 'text', 'value' => $text, ]); } @@ -89,7 +92,7 @@ public static function text(FormFieldText $text): FormField public static function checkbox(FormFieldCheckbox $checkbox): FormField { return new FormField([ - 'family' => 'checkbox', + 'kind' => 'checkbox', 'value' => $checkbox, ]); } @@ -101,7 +104,7 @@ public static function checkbox(FormFieldCheckbox $checkbox): FormField public static function radio(FormFieldRadio $radio): FormField { return new FormField([ - 'family' => 'radio', + 'kind' => 'radio', 'value' => $radio, ]); } @@ -113,7 +116,7 @@ public static function radio(FormFieldRadio $radio): FormField public static function combobox(FormFieldCombobox $combobox): FormField { return new FormField([ - 'family' => 'combobox', + 'kind' => 'combobox', 'value' => $combobox, ]); } @@ -125,7 +128,7 @@ public static function combobox(FormFieldCombobox $combobox): FormField public static function listbox(FormFieldListbox $listbox): FormField { return new FormField([ - 'family' => 'listbox', + 'kind' => 'listbox', 'value' => $listbox, ]); } @@ -137,7 +140,7 @@ public static function listbox(FormFieldListbox $listbox): FormField public static function pushbutton(FormFieldPushbutton $pushbutton): FormField { return new FormField([ - 'family' => 'pushbutton', + 'kind' => 'pushbutton', 'value' => $pushbutton, ]); } @@ -149,7 +152,7 @@ public static function pushbutton(FormFieldPushbutton $pushbutton): FormField public static function signature(FormFieldSignature $signature): FormField { return new FormField([ - 'family' => 'signature', + 'kind' => 'signature', 'value' => $signature, ]); } @@ -161,7 +164,7 @@ public static function signature(FormFieldSignature $signature): FormField public static function unknown(FormFieldUnknown $unknown): FormField { return new FormField([ - 'family' => 'unknown', + 'kind' => 'unknown', 'value' => $unknown, ]); } @@ -171,7 +174,7 @@ public static function unknown(FormFieldUnknown $unknown): FormField */ public function isText(): bool { - return $this->value instanceof FormFieldText && $this->family === 'text'; + return $this->value instanceof FormFieldText && $this->kind === 'text'; } /** @@ -179,9 +182,9 @@ public function isText(): bool */ public function asText(): FormFieldText { - if (!($this->value instanceof FormFieldText && $this->family === 'text')) { + if (!($this->value instanceof FormFieldText && $this->kind === 'text')) { throw new Exception( - "Expected text; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected text; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -193,7 +196,7 @@ public function asText(): FormFieldText */ public function isCheckbox(): bool { - return $this->value instanceof FormFieldCheckbox && $this->family === 'checkbox'; + return $this->value instanceof FormFieldCheckbox && $this->kind === 'checkbox'; } /** @@ -201,9 +204,9 @@ public function isCheckbox(): bool */ public function asCheckbox(): FormFieldCheckbox { - if (!($this->value instanceof FormFieldCheckbox && $this->family === 'checkbox')) { + if (!($this->value instanceof FormFieldCheckbox && $this->kind === 'checkbox')) { throw new Exception( - "Expected checkbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected checkbox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -215,7 +218,7 @@ public function asCheckbox(): FormFieldCheckbox */ public function isRadio(): bool { - return $this->value instanceof FormFieldRadio && $this->family === 'radio'; + return $this->value instanceof FormFieldRadio && $this->kind === 'radio'; } /** @@ -223,9 +226,9 @@ public function isRadio(): bool */ public function asRadio(): FormFieldRadio { - if (!($this->value instanceof FormFieldRadio && $this->family === 'radio')) { + if (!($this->value instanceof FormFieldRadio && $this->kind === 'radio')) { throw new Exception( - "Expected radio; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected radio; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -237,7 +240,7 @@ public function asRadio(): FormFieldRadio */ public function isCombobox(): bool { - return $this->value instanceof FormFieldCombobox && $this->family === 'combobox'; + return $this->value instanceof FormFieldCombobox && $this->kind === 'combobox'; } /** @@ -245,9 +248,9 @@ public function isCombobox(): bool */ public function asCombobox(): FormFieldCombobox { - if (!($this->value instanceof FormFieldCombobox && $this->family === 'combobox')) { + if (!($this->value instanceof FormFieldCombobox && $this->kind === 'combobox')) { throw new Exception( - "Expected combobox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected combobox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -259,7 +262,7 @@ public function asCombobox(): FormFieldCombobox */ public function isListbox(): bool { - return $this->value instanceof FormFieldListbox && $this->family === 'listbox'; + return $this->value instanceof FormFieldListbox && $this->kind === 'listbox'; } /** @@ -267,9 +270,9 @@ public function isListbox(): bool */ public function asListbox(): FormFieldListbox { - if (!($this->value instanceof FormFieldListbox && $this->family === 'listbox')) { + if (!($this->value instanceof FormFieldListbox && $this->kind === 'listbox')) { throw new Exception( - "Expected listbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected listbox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -281,7 +284,7 @@ public function asListbox(): FormFieldListbox */ public function isPushbutton(): bool { - return $this->value instanceof FormFieldPushbutton && $this->family === 'pushbutton'; + return $this->value instanceof FormFieldPushbutton && $this->kind === 'pushbutton'; } /** @@ -289,9 +292,9 @@ public function isPushbutton(): bool */ public function asPushbutton(): FormFieldPushbutton { - if (!($this->value instanceof FormFieldPushbutton && $this->family === 'pushbutton')) { + if (!($this->value instanceof FormFieldPushbutton && $this->kind === 'pushbutton')) { throw new Exception( - "Expected pushbutton; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected pushbutton; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -303,7 +306,7 @@ public function asPushbutton(): FormFieldPushbutton */ public function isSignature(): bool { - return $this->value instanceof FormFieldSignature && $this->family === 'signature'; + return $this->value instanceof FormFieldSignature && $this->kind === 'signature'; } /** @@ -311,9 +314,9 @@ public function isSignature(): bool */ public function asSignature(): FormFieldSignature { - if (!($this->value instanceof FormFieldSignature && $this->family === 'signature')) { + if (!($this->value instanceof FormFieldSignature && $this->kind === 'signature')) { throw new Exception( - "Expected signature; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected signature; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -325,7 +328,7 @@ public function asSignature(): FormFieldSignature */ public function isUnknown(): bool { - return $this->value instanceof FormFieldUnknown && $this->family === 'unknown'; + return $this->value instanceof FormFieldUnknown && $this->kind === 'unknown'; } /** @@ -333,9 +336,9 @@ public function isUnknown(): bool */ public function asUnknown(): FormFieldUnknown { - if (!($this->value instanceof FormFieldUnknown && $this->family === 'unknown')) { + if (!($this->value instanceof FormFieldUnknown && $this->kind === 'unknown')) { throw new Exception( - "Expected unknown; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -356,12 +359,12 @@ public function __toString(): string public function jsonSerialize(): array { $result = []; - $result['family'] = $this->family; + $result['kind'] = $this->kind; $base = parent::jsonSerialize(); $result = array_merge($base, $result); - switch ($this->family) { + switch ($this->kind) { case 'text': $value = $this->asText()->jsonSerialize(); $result = array_merge($value, $result); @@ -416,20 +419,20 @@ public function jsonSerialize(): array public static function jsonDeserialize(array $data): static { $args = []; - if (!array_key_exists('family', $data)) { + if (!array_key_exists('kind', $data)) { throw new Exception( - "JSON data is missing property 'family'", + "JSON data is missing property 'kind'", ); } - $family = $data['family']; - if (!(is_string($family))) { + $kind = $data['kind']; + if (!(is_string($kind))) { throw new Exception( - "Expected property 'family' in JSON data to be string, instead received " . get_debug_type($data['family']), + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), ); } - $args['family'] = $family; - switch ($family) { + $args['kind'] = $kind; + switch ($kind) { case 'text': $args['value'] = FormFieldText::jsonDeserialize($data); break; @@ -456,7 +459,7 @@ public static function jsonDeserialize(array $data): static break; case '_unknown': default: - $args['family'] = '_unknown'; + $args['kind'] = '_unknown'; $args['value'] = $data; } diff --git a/src/Types/FormFieldCheckbox.php b/src/Types/FormFieldCheckbox.php index 294a6fdd..dd566657 100644 --- a/src/Types/FormFieldCheckbox.php +++ b/src/Types/FormFieldCheckbox.php @@ -59,16 +59,16 @@ class FormFieldCheckbox extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldCheckboxValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldCheckboxValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldCheckboxDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldCheckboxDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -144,8 +144,8 @@ class FormFieldCheckbox extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldCheckboxValueEntry, - * defaultValueEntry: FormFieldCheckboxDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * checked: bool, * exportValue: string, diff --git a/src/Types/FormFieldCheckboxDefaultValueEntry.php b/src/Types/FormFieldCheckboxDefaultValueEntry.php deleted file mode 100644 index 6e8630d5..00000000 --- a/src/Types/FormFieldCheckboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldCheckboxDefaultValueEntryNone $none - * @return FormFieldCheckboxDefaultValueEntry - */ - public static function none(FormFieldCheckboxDefaultValueEntryNone $none): FormFieldCheckboxDefaultValueEntry - { - return new FormFieldCheckboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldCheckboxDefaultValueEntryScalar $scalar - * @return FormFieldCheckboxDefaultValueEntry - */ - public static function scalar(FormFieldCheckboxDefaultValueEntryScalar $scalar): FormFieldCheckboxDefaultValueEntry - { - return new FormFieldCheckboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldCheckboxDefaultValueEntryArray $array - * @return FormFieldCheckboxDefaultValueEntry - */ - public static function array(FormFieldCheckboxDefaultValueEntryArray $array): FormFieldCheckboxDefaultValueEntry - { - return new FormFieldCheckboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldCheckboxDefaultValueEntryUnsupported $unsupported - * @return FormFieldCheckboxDefaultValueEntry - */ - public static function unsupported(FormFieldCheckboxDefaultValueEntryUnsupported $unsupported): FormFieldCheckboxDefaultValueEntry - { - return new FormFieldCheckboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldCheckboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldCheckboxDefaultValueEntryNone - */ - public function asNone(): FormFieldCheckboxDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldCheckboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldCheckboxDefaultValueEntryScalar - */ - public function asScalar(): FormFieldCheckboxDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldCheckboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldCheckboxDefaultValueEntryArray - */ - public function asArray(): FormFieldCheckboxDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldCheckboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldCheckboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldCheckboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldCheckboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldCheckboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldCheckboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldCheckboxDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryArray.php b/src/Types/FormFieldCheckboxDefaultValueEntryArray.php deleted file mode 100644 index 5211e500..00000000 --- a/src/Types/FormFieldCheckboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryNone.php b/src/Types/FormFieldCheckboxDefaultValueEntryNone.php deleted file mode 100644 index 0d46e6bc..00000000 --- a/src/Types/FormFieldCheckboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php b/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php deleted file mode 100644 index 29626239..00000000 --- a/src/Types/FormFieldCheckboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php deleted file mode 100644 index 8bd3a002..00000000 --- a/src/Types/FormFieldCheckboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxValueEntry.php b/src/Types/FormFieldCheckboxValueEntry.php deleted file mode 100644 index 1c9e50b3..00000000 --- a/src/Types/FormFieldCheckboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldCheckboxValueEntryNone $none - * @return FormFieldCheckboxValueEntry - */ - public static function none(FormFieldCheckboxValueEntryNone $none): FormFieldCheckboxValueEntry - { - return new FormFieldCheckboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldCheckboxValueEntryScalar $scalar - * @return FormFieldCheckboxValueEntry - */ - public static function scalar(FormFieldCheckboxValueEntryScalar $scalar): FormFieldCheckboxValueEntry - { - return new FormFieldCheckboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldCheckboxValueEntryArray $array - * @return FormFieldCheckboxValueEntry - */ - public static function array(FormFieldCheckboxValueEntryArray $array): FormFieldCheckboxValueEntry - { - return new FormFieldCheckboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldCheckboxValueEntryUnsupported $unsupported - * @return FormFieldCheckboxValueEntry - */ - public static function unsupported(FormFieldCheckboxValueEntryUnsupported $unsupported): FormFieldCheckboxValueEntry - { - return new FormFieldCheckboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldCheckboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldCheckboxValueEntryNone - */ - public function asNone(): FormFieldCheckboxValueEntryNone - { - if (!($this->value instanceof FormFieldCheckboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldCheckboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldCheckboxValueEntryScalar - */ - public function asScalar(): FormFieldCheckboxValueEntryScalar - { - if (!($this->value instanceof FormFieldCheckboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldCheckboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldCheckboxValueEntryArray - */ - public function asArray(): FormFieldCheckboxValueEntryArray - { - if (!($this->value instanceof FormFieldCheckboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldCheckboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldCheckboxValueEntryUnsupported - */ - public function asUnsupported(): FormFieldCheckboxValueEntryUnsupported - { - if (!($this->value instanceof FormFieldCheckboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldCheckboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldCheckboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldCheckboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldCheckboxValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldCheckboxValueEntryArray.php b/src/Types/FormFieldCheckboxValueEntryArray.php deleted file mode 100644 index 7a77c58d..00000000 --- a/src/Types/FormFieldCheckboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxValueEntryNone.php b/src/Types/FormFieldCheckboxValueEntryNone.php deleted file mode 100644 index 5eb78dcf..00000000 --- a/src/Types/FormFieldCheckboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxValueEntryScalar.php b/src/Types/FormFieldCheckboxValueEntryScalar.php deleted file mode 100644 index 6d998061..00000000 --- a/src/Types/FormFieldCheckboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldCheckboxValueEntryUnsupported.php b/src/Types/FormFieldCheckboxValueEntryUnsupported.php deleted file mode 100644 index 2010b521..00000000 --- a/src/Types/FormFieldCheckboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldCombobox.php b/src/Types/FormFieldCombobox.php index a8a1f47c..2ebf464b 100644 --- a/src/Types/FormFieldCombobox.php +++ b/src/Types/FormFieldCombobox.php @@ -59,16 +59,16 @@ class FormFieldCombobox extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldComboboxValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldComboboxValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldComboboxDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldComboboxDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -156,8 +156,8 @@ class FormFieldCombobox extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldComboboxValueEntry, - * defaultValueEntry: FormFieldComboboxDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * value: string, * defaultValue: string, diff --git a/src/Types/FormFieldComboboxDefaultValueEntry.php b/src/Types/FormFieldComboboxDefaultValueEntry.php deleted file mode 100644 index 21c68a5a..00000000 --- a/src/Types/FormFieldComboboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldComboboxDefaultValueEntryNone $none - * @return FormFieldComboboxDefaultValueEntry - */ - public static function none(FormFieldComboboxDefaultValueEntryNone $none): FormFieldComboboxDefaultValueEntry - { - return new FormFieldComboboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldComboboxDefaultValueEntryScalar $scalar - * @return FormFieldComboboxDefaultValueEntry - */ - public static function scalar(FormFieldComboboxDefaultValueEntryScalar $scalar): FormFieldComboboxDefaultValueEntry - { - return new FormFieldComboboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldComboboxDefaultValueEntryArray $array - * @return FormFieldComboboxDefaultValueEntry - */ - public static function array(FormFieldComboboxDefaultValueEntryArray $array): FormFieldComboboxDefaultValueEntry - { - return new FormFieldComboboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldComboboxDefaultValueEntryUnsupported $unsupported - * @return FormFieldComboboxDefaultValueEntry - */ - public static function unsupported(FormFieldComboboxDefaultValueEntryUnsupported $unsupported): FormFieldComboboxDefaultValueEntry - { - return new FormFieldComboboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldComboboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldComboboxDefaultValueEntryNone - */ - public function asNone(): FormFieldComboboxDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldComboboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldComboboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldComboboxDefaultValueEntryScalar - */ - public function asScalar(): FormFieldComboboxDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldComboboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldComboboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldComboboxDefaultValueEntryArray - */ - public function asArray(): FormFieldComboboxDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldComboboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldComboboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldComboboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldComboboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldComboboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldComboboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldComboboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldComboboxDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryArray.php b/src/Types/FormFieldComboboxDefaultValueEntryArray.php deleted file mode 100644 index 9a9b1869..00000000 --- a/src/Types/FormFieldComboboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryNone.php b/src/Types/FormFieldComboboxDefaultValueEntryNone.php deleted file mode 100644 index a0a186e8..00000000 --- a/src/Types/FormFieldComboboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryScalar.php b/src/Types/FormFieldComboboxDefaultValueEntryScalar.php deleted file mode 100644 index cf26e557..00000000 --- a/src/Types/FormFieldComboboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php deleted file mode 100644 index 5cad6d38..00000000 --- a/src/Types/FormFieldComboboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldComboboxValueEntry.php b/src/Types/FormFieldComboboxValueEntry.php deleted file mode 100644 index 2752a2d6..00000000 --- a/src/Types/FormFieldComboboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldComboboxValueEntryNone $none - * @return FormFieldComboboxValueEntry - */ - public static function none(FormFieldComboboxValueEntryNone $none): FormFieldComboboxValueEntry - { - return new FormFieldComboboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldComboboxValueEntryScalar $scalar - * @return FormFieldComboboxValueEntry - */ - public static function scalar(FormFieldComboboxValueEntryScalar $scalar): FormFieldComboboxValueEntry - { - return new FormFieldComboboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldComboboxValueEntryArray $array - * @return FormFieldComboboxValueEntry - */ - public static function array(FormFieldComboboxValueEntryArray $array): FormFieldComboboxValueEntry - { - return new FormFieldComboboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldComboboxValueEntryUnsupported $unsupported - * @return FormFieldComboboxValueEntry - */ - public static function unsupported(FormFieldComboboxValueEntryUnsupported $unsupported): FormFieldComboboxValueEntry - { - return new FormFieldComboboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldComboboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldComboboxValueEntryNone - */ - public function asNone(): FormFieldComboboxValueEntryNone - { - if (!($this->value instanceof FormFieldComboboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldComboboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldComboboxValueEntryScalar - */ - public function asScalar(): FormFieldComboboxValueEntryScalar - { - if (!($this->value instanceof FormFieldComboboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldComboboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldComboboxValueEntryArray - */ - public function asArray(): FormFieldComboboxValueEntryArray - { - if (!($this->value instanceof FormFieldComboboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldComboboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldComboboxValueEntryUnsupported - */ - public function asUnsupported(): FormFieldComboboxValueEntryUnsupported - { - if (!($this->value instanceof FormFieldComboboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldComboboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldComboboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldComboboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldComboboxValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldComboboxValueEntryArray.php b/src/Types/FormFieldComboboxValueEntryArray.php deleted file mode 100644 index 5b8705f9..00000000 --- a/src/Types/FormFieldComboboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldComboboxValueEntryNone.php b/src/Types/FormFieldComboboxValueEntryNone.php deleted file mode 100644 index b629bae7..00000000 --- a/src/Types/FormFieldComboboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldComboboxValueEntryScalar.php b/src/Types/FormFieldComboboxValueEntryScalar.php deleted file mode 100644 index 05171cfb..00000000 --- a/src/Types/FormFieldComboboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldComboboxValueEntryUnsupported.php b/src/Types/FormFieldComboboxValueEntryUnsupported.php deleted file mode 100644 index cff88c9d..00000000 --- a/src/Types/FormFieldComboboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldDraft.php b/src/Types/FormFieldDraft.php index 285fb51e..f93ef0b3 100644 --- a/src/Types/FormFieldDraft.php +++ b/src/Types/FormFieldDraft.php @@ -17,9 +17,9 @@ class FormFieldDraft extends JsonSerializableType * |'pushbutton' * |'signature' * |'_unknown' - * ) $family + * ) $kind */ - public readonly string $family; + public readonly string $kind; /** * @var ( @@ -37,7 +37,7 @@ class FormFieldDraft extends JsonSerializableType /** * @param array{ - * family: ( + * kind: ( * 'text' * |'checkbox' * |'radio' @@ -62,7 +62,7 @@ class FormFieldDraft extends JsonSerializableType private function __construct( array $values, ) { - $this->family = $values['family']; + $this->kind = $values['kind']; $this->value = $values['value']; } @@ -73,7 +73,7 @@ private function __construct( public static function text(FormFieldDraftText $text): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'text', + 'kind' => 'text', 'value' => $text, ]); } @@ -85,7 +85,7 @@ public static function text(FormFieldDraftText $text): FormFieldDraft public static function checkbox(FormFieldDraftCheckbox $checkbox): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'checkbox', + 'kind' => 'checkbox', 'value' => $checkbox, ]); } @@ -97,7 +97,7 @@ public static function checkbox(FormFieldDraftCheckbox $checkbox): FormFieldDraf public static function radio(FormFieldDraftRadio $radio): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'radio', + 'kind' => 'radio', 'value' => $radio, ]); } @@ -109,7 +109,7 @@ public static function radio(FormFieldDraftRadio $radio): FormFieldDraft public static function combobox(FormFieldDraftCombobox $combobox): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'combobox', + 'kind' => 'combobox', 'value' => $combobox, ]); } @@ -121,7 +121,7 @@ public static function combobox(FormFieldDraftCombobox $combobox): FormFieldDraf public static function listbox(FormFieldDraftListbox $listbox): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'listbox', + 'kind' => 'listbox', 'value' => $listbox, ]); } @@ -133,7 +133,7 @@ public static function listbox(FormFieldDraftListbox $listbox): FormFieldDraft public static function pushbutton(FormFieldDraftPushbutton $pushbutton): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'pushbutton', + 'kind' => 'pushbutton', 'value' => $pushbutton, ]); } @@ -145,7 +145,7 @@ public static function pushbutton(FormFieldDraftPushbutton $pushbutton): FormFie public static function signature(FormFieldDraftSignature $signature): FormFieldDraft { return new FormFieldDraft([ - 'family' => 'signature', + 'kind' => 'signature', 'value' => $signature, ]); } @@ -155,7 +155,7 @@ public static function signature(FormFieldDraftSignature $signature): FormFieldD */ public function isText(): bool { - return $this->value instanceof FormFieldDraftText && $this->family === 'text'; + return $this->value instanceof FormFieldDraftText && $this->kind === 'text'; } /** @@ -163,9 +163,9 @@ public function isText(): bool */ public function asText(): FormFieldDraftText { - if (!($this->value instanceof FormFieldDraftText && $this->family === 'text')) { + if (!($this->value instanceof FormFieldDraftText && $this->kind === 'text')) { throw new Exception( - "Expected text; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected text; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -177,7 +177,7 @@ public function asText(): FormFieldDraftText */ public function isCheckbox(): bool { - return $this->value instanceof FormFieldDraftCheckbox && $this->family === 'checkbox'; + return $this->value instanceof FormFieldDraftCheckbox && $this->kind === 'checkbox'; } /** @@ -185,9 +185,9 @@ public function isCheckbox(): bool */ public function asCheckbox(): FormFieldDraftCheckbox { - if (!($this->value instanceof FormFieldDraftCheckbox && $this->family === 'checkbox')) { + if (!($this->value instanceof FormFieldDraftCheckbox && $this->kind === 'checkbox')) { throw new Exception( - "Expected checkbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected checkbox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -199,7 +199,7 @@ public function asCheckbox(): FormFieldDraftCheckbox */ public function isRadio(): bool { - return $this->value instanceof FormFieldDraftRadio && $this->family === 'radio'; + return $this->value instanceof FormFieldDraftRadio && $this->kind === 'radio'; } /** @@ -207,9 +207,9 @@ public function isRadio(): bool */ public function asRadio(): FormFieldDraftRadio { - if (!($this->value instanceof FormFieldDraftRadio && $this->family === 'radio')) { + if (!($this->value instanceof FormFieldDraftRadio && $this->kind === 'radio')) { throw new Exception( - "Expected radio; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected radio; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -221,7 +221,7 @@ public function asRadio(): FormFieldDraftRadio */ public function isCombobox(): bool { - return $this->value instanceof FormFieldDraftCombobox && $this->family === 'combobox'; + return $this->value instanceof FormFieldDraftCombobox && $this->kind === 'combobox'; } /** @@ -229,9 +229,9 @@ public function isCombobox(): bool */ public function asCombobox(): FormFieldDraftCombobox { - if (!($this->value instanceof FormFieldDraftCombobox && $this->family === 'combobox')) { + if (!($this->value instanceof FormFieldDraftCombobox && $this->kind === 'combobox')) { throw new Exception( - "Expected combobox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected combobox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -243,7 +243,7 @@ public function asCombobox(): FormFieldDraftCombobox */ public function isListbox(): bool { - return $this->value instanceof FormFieldDraftListbox && $this->family === 'listbox'; + return $this->value instanceof FormFieldDraftListbox && $this->kind === 'listbox'; } /** @@ -251,9 +251,9 @@ public function isListbox(): bool */ public function asListbox(): FormFieldDraftListbox { - if (!($this->value instanceof FormFieldDraftListbox && $this->family === 'listbox')) { + if (!($this->value instanceof FormFieldDraftListbox && $this->kind === 'listbox')) { throw new Exception( - "Expected listbox; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected listbox; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -265,7 +265,7 @@ public function asListbox(): FormFieldDraftListbox */ public function isPushbutton(): bool { - return $this->value instanceof FormFieldDraftPushbutton && $this->family === 'pushbutton'; + return $this->value instanceof FormFieldDraftPushbutton && $this->kind === 'pushbutton'; } /** @@ -273,9 +273,9 @@ public function isPushbutton(): bool */ public function asPushbutton(): FormFieldDraftPushbutton { - if (!($this->value instanceof FormFieldDraftPushbutton && $this->family === 'pushbutton')) { + if (!($this->value instanceof FormFieldDraftPushbutton && $this->kind === 'pushbutton')) { throw new Exception( - "Expected pushbutton; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected pushbutton; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -287,7 +287,7 @@ public function asPushbutton(): FormFieldDraftPushbutton */ public function isSignature(): bool { - return $this->value instanceof FormFieldDraftSignature && $this->family === 'signature'; + return $this->value instanceof FormFieldDraftSignature && $this->kind === 'signature'; } /** @@ -295,9 +295,9 @@ public function isSignature(): bool */ public function asSignature(): FormFieldDraftSignature { - if (!($this->value instanceof FormFieldDraftSignature && $this->family === 'signature')) { + if (!($this->value instanceof FormFieldDraftSignature && $this->kind === 'signature')) { throw new Exception( - "Expected signature; got " . $this->family . " with value of type " . get_debug_type($this->value), + "Expected signature; got " . $this->kind . " with value of type " . get_debug_type($this->value), ); } @@ -318,12 +318,12 @@ public function __toString(): string public function jsonSerialize(): array { $result = []; - $result['family'] = $this->family; + $result['kind'] = $this->kind; $base = parent::jsonSerialize(); $result = array_merge($base, $result); - switch ($this->family) { + switch ($this->kind) { case 'text': $value = $this->asText()->jsonSerialize(); $result = array_merge($value, $result); @@ -374,20 +374,20 @@ public function jsonSerialize(): array public static function jsonDeserialize(array $data): static { $args = []; - if (!array_key_exists('family', $data)) { + if (!array_key_exists('kind', $data)) { throw new Exception( - "JSON data is missing property 'family'", + "JSON data is missing property 'kind'", ); } - $family = $data['family']; - if (!(is_string($family))) { + $kind = $data['kind']; + if (!(is_string($kind))) { throw new Exception( - "Expected property 'family' in JSON data to be string, instead received " . get_debug_type($data['family']), + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), ); } - $args['family'] = $family; - switch ($family) { + $args['kind'] = $kind; + switch ($kind) { case 'text': $args['value'] = FormFieldDraftText::jsonDeserialize($data); break; @@ -411,7 +411,7 @@ public static function jsonDeserialize(array $data): static break; case '_unknown': default: - $args['family'] = '_unknown'; + $args['kind'] = '_unknown'; $args['value'] = $data; } diff --git a/src/Types/FormFieldListbox.php b/src/Types/FormFieldListbox.php index 5b268a52..45b18a21 100644 --- a/src/Types/FormFieldListbox.php +++ b/src/Types/FormFieldListbox.php @@ -59,16 +59,16 @@ class FormFieldListbox extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldListboxValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldListboxValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldListboxDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldListboxDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -162,8 +162,8 @@ class FormFieldListbox extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldListboxValueEntry, - * defaultValueEntry: FormFieldListboxDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * selectedValues: array, * defaultValue: array, diff --git a/src/Types/FormFieldListboxDefaultValueEntry.php b/src/Types/FormFieldListboxDefaultValueEntry.php deleted file mode 100644 index e7550efd..00000000 --- a/src/Types/FormFieldListboxDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldListboxDefaultValueEntryNone $none - * @return FormFieldListboxDefaultValueEntry - */ - public static function none(FormFieldListboxDefaultValueEntryNone $none): FormFieldListboxDefaultValueEntry - { - return new FormFieldListboxDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldListboxDefaultValueEntryScalar $scalar - * @return FormFieldListboxDefaultValueEntry - */ - public static function scalar(FormFieldListboxDefaultValueEntryScalar $scalar): FormFieldListboxDefaultValueEntry - { - return new FormFieldListboxDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldListboxDefaultValueEntryArray $array - * @return FormFieldListboxDefaultValueEntry - */ - public static function array(FormFieldListboxDefaultValueEntryArray $array): FormFieldListboxDefaultValueEntry - { - return new FormFieldListboxDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldListboxDefaultValueEntryUnsupported $unsupported - * @return FormFieldListboxDefaultValueEntry - */ - public static function unsupported(FormFieldListboxDefaultValueEntryUnsupported $unsupported): FormFieldListboxDefaultValueEntry - { - return new FormFieldListboxDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldListboxDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldListboxDefaultValueEntryNone - */ - public function asNone(): FormFieldListboxDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldListboxDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldListboxDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldListboxDefaultValueEntryScalar - */ - public function asScalar(): FormFieldListboxDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldListboxDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldListboxDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldListboxDefaultValueEntryArray - */ - public function asArray(): FormFieldListboxDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldListboxDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldListboxDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldListboxDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldListboxDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldListboxDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldListboxDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldListboxDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldListboxDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldListboxDefaultValueEntryArray.php b/src/Types/FormFieldListboxDefaultValueEntryArray.php deleted file mode 100644 index 33476286..00000000 --- a/src/Types/FormFieldListboxDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldListboxDefaultValueEntryNone.php b/src/Types/FormFieldListboxDefaultValueEntryNone.php deleted file mode 100644 index c10d5c3d..00000000 --- a/src/Types/FormFieldListboxDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldListboxDefaultValueEntryScalar.php b/src/Types/FormFieldListboxDefaultValueEntryScalar.php deleted file mode 100644 index e3d34685..00000000 --- a/src/Types/FormFieldListboxDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php b/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php deleted file mode 100644 index a8238d3c..00000000 --- a/src/Types/FormFieldListboxDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldListboxValueEntry.php b/src/Types/FormFieldListboxValueEntry.php deleted file mode 100644 index 092df6f3..00000000 --- a/src/Types/FormFieldListboxValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldListboxValueEntryNone $none - * @return FormFieldListboxValueEntry - */ - public static function none(FormFieldListboxValueEntryNone $none): FormFieldListboxValueEntry - { - return new FormFieldListboxValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldListboxValueEntryScalar $scalar - * @return FormFieldListboxValueEntry - */ - public static function scalar(FormFieldListboxValueEntryScalar $scalar): FormFieldListboxValueEntry - { - return new FormFieldListboxValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldListboxValueEntryArray $array - * @return FormFieldListboxValueEntry - */ - public static function array(FormFieldListboxValueEntryArray $array): FormFieldListboxValueEntry - { - return new FormFieldListboxValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldListboxValueEntryUnsupported $unsupported - * @return FormFieldListboxValueEntry - */ - public static function unsupported(FormFieldListboxValueEntryUnsupported $unsupported): FormFieldListboxValueEntry - { - return new FormFieldListboxValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldListboxValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldListboxValueEntryNone - */ - public function asNone(): FormFieldListboxValueEntryNone - { - if (!($this->value instanceof FormFieldListboxValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldListboxValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldListboxValueEntryScalar - */ - public function asScalar(): FormFieldListboxValueEntryScalar - { - if (!($this->value instanceof FormFieldListboxValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldListboxValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldListboxValueEntryArray - */ - public function asArray(): FormFieldListboxValueEntryArray - { - if (!($this->value instanceof FormFieldListboxValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldListboxValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldListboxValueEntryUnsupported - */ - public function asUnsupported(): FormFieldListboxValueEntryUnsupported - { - if (!($this->value instanceof FormFieldListboxValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldListboxValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldListboxValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldListboxValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldListboxValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldListboxValueEntryArray.php b/src/Types/FormFieldListboxValueEntryArray.php deleted file mode 100644 index 6749a3bc..00000000 --- a/src/Types/FormFieldListboxValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldListboxValueEntryNone.php b/src/Types/FormFieldListboxValueEntryNone.php deleted file mode 100644 index f7c7f484..00000000 --- a/src/Types/FormFieldListboxValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldListboxValueEntryScalar.php b/src/Types/FormFieldListboxValueEntryScalar.php deleted file mode 100644 index 6276b53d..00000000 --- a/src/Types/FormFieldListboxValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldListboxValueEntryUnsupported.php b/src/Types/FormFieldListboxValueEntryUnsupported.php deleted file mode 100644 index 9a0402eb..00000000 --- a/src/Types/FormFieldListboxValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldPatch.php b/src/Types/FormFieldPatch.php index aec5f45f..9e6599c2 100644 --- a/src/Types/FormFieldPatch.php +++ b/src/Types/FormFieldPatch.php @@ -58,10 +58,10 @@ class FormFieldPatch extends JsonSerializableType public ?FieldActionsPatch $actions; /** - * @var ?value-of $family + * @var ?value-of $kind */ - #[JsonProperty('family')] - public ?string $family; + #[JsonProperty('kind')] + public ?string $kind; /** * @var ( @@ -136,7 +136,7 @@ class FormFieldPatch extends JsonSerializableType * mappingName?: ?string, * groupId?: ?string, * actions?: ?FieldActionsPatch, - * family?: ?value-of, + * kind?: ?value-of, * defaultValue?: ( * string * |array @@ -163,7 +163,7 @@ public function __construct( $this->mappingName = $values['mappingName'] ?? null; $this->groupId = $values['groupId'] ?? null; $this->actions = $values['actions'] ?? null; - $this->family = $values['family'] ?? null; + $this->kind = $values['kind'] ?? null; $this->defaultValue = $values['defaultValue'] ?? null; $this->maxLength = $values['maxLength'] ?? null; $this->multiline = $values['multiline'] ?? null; diff --git a/src/Types/FormFieldPatchFamily.php b/src/Types/FormFieldPatchFamily.php deleted file mode 100644 index 4b3d42bd..00000000 --- a/src/Types/FormFieldPatchFamily.php +++ /dev/null @@ -1,14 +0,0 @@ -, * alternateName?: ?string, * mappingName?: ?string, diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntry.php b/src/Types/FormFieldPushbuttonDefaultValueEntry.php deleted file mode 100644 index c1f2dcdc..00000000 --- a/src/Types/FormFieldPushbuttonDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldPushbuttonDefaultValueEntryNone $none - * @return FormFieldPushbuttonDefaultValueEntry - */ - public static function none(FormFieldPushbuttonDefaultValueEntryNone $none): FormFieldPushbuttonDefaultValueEntry - { - return new FormFieldPushbuttonDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldPushbuttonDefaultValueEntryScalar $scalar - * @return FormFieldPushbuttonDefaultValueEntry - */ - public static function scalar(FormFieldPushbuttonDefaultValueEntryScalar $scalar): FormFieldPushbuttonDefaultValueEntry - { - return new FormFieldPushbuttonDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldPushbuttonDefaultValueEntryArray $array - * @return FormFieldPushbuttonDefaultValueEntry - */ - public static function array(FormFieldPushbuttonDefaultValueEntryArray $array): FormFieldPushbuttonDefaultValueEntry - { - return new FormFieldPushbuttonDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldPushbuttonDefaultValueEntryUnsupported $unsupported - * @return FormFieldPushbuttonDefaultValueEntry - */ - public static function unsupported(FormFieldPushbuttonDefaultValueEntryUnsupported $unsupported): FormFieldPushbuttonDefaultValueEntry - { - return new FormFieldPushbuttonDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldPushbuttonDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldPushbuttonDefaultValueEntryNone - */ - public function asNone(): FormFieldPushbuttonDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldPushbuttonDefaultValueEntryScalar - */ - public function asScalar(): FormFieldPushbuttonDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldPushbuttonDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldPushbuttonDefaultValueEntryArray - */ - public function asArray(): FormFieldPushbuttonDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldPushbuttonDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldPushbuttonDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldPushbuttonDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldPushbuttonDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldPushbuttonDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldPushbuttonDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldPushbuttonDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryArray.php b/src/Types/FormFieldPushbuttonDefaultValueEntryArray.php deleted file mode 100644 index 5c8280cb..00000000 --- a/src/Types/FormFieldPushbuttonDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php b/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php deleted file mode 100644 index 09a06f00..00000000 --- a/src/Types/FormFieldPushbuttonDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php b/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php deleted file mode 100644 index 5713f615..00000000 --- a/src/Types/FormFieldPushbuttonDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php b/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php deleted file mode 100644 index e37fcdf8..00000000 --- a/src/Types/FormFieldPushbuttonDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonValueEntry.php b/src/Types/FormFieldPushbuttonValueEntry.php deleted file mode 100644 index 992025a1..00000000 --- a/src/Types/FormFieldPushbuttonValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldPushbuttonValueEntryNone $none - * @return FormFieldPushbuttonValueEntry - */ - public static function none(FormFieldPushbuttonValueEntryNone $none): FormFieldPushbuttonValueEntry - { - return new FormFieldPushbuttonValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldPushbuttonValueEntryScalar $scalar - * @return FormFieldPushbuttonValueEntry - */ - public static function scalar(FormFieldPushbuttonValueEntryScalar $scalar): FormFieldPushbuttonValueEntry - { - return new FormFieldPushbuttonValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldPushbuttonValueEntryArray $array - * @return FormFieldPushbuttonValueEntry - */ - public static function array(FormFieldPushbuttonValueEntryArray $array): FormFieldPushbuttonValueEntry - { - return new FormFieldPushbuttonValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldPushbuttonValueEntryUnsupported $unsupported - * @return FormFieldPushbuttonValueEntry - */ - public static function unsupported(FormFieldPushbuttonValueEntryUnsupported $unsupported): FormFieldPushbuttonValueEntry - { - return new FormFieldPushbuttonValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldPushbuttonValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldPushbuttonValueEntryNone - */ - public function asNone(): FormFieldPushbuttonValueEntryNone - { - if (!($this->value instanceof FormFieldPushbuttonValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldPushbuttonValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldPushbuttonValueEntryScalar - */ - public function asScalar(): FormFieldPushbuttonValueEntryScalar - { - if (!($this->value instanceof FormFieldPushbuttonValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldPushbuttonValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldPushbuttonValueEntryArray - */ - public function asArray(): FormFieldPushbuttonValueEntryArray - { - if (!($this->value instanceof FormFieldPushbuttonValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldPushbuttonValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldPushbuttonValueEntryUnsupported - */ - public function asUnsupported(): FormFieldPushbuttonValueEntryUnsupported - { - if (!($this->value instanceof FormFieldPushbuttonValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldPushbuttonValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldPushbuttonValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldPushbuttonValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldPushbuttonValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldPushbuttonValueEntryArray.php b/src/Types/FormFieldPushbuttonValueEntryArray.php deleted file mode 100644 index 05951c4a..00000000 --- a/src/Types/FormFieldPushbuttonValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonValueEntryNone.php b/src/Types/FormFieldPushbuttonValueEntryNone.php deleted file mode 100644 index 6d5433a3..00000000 --- a/src/Types/FormFieldPushbuttonValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonValueEntryScalar.php b/src/Types/FormFieldPushbuttonValueEntryScalar.php deleted file mode 100644 index 9aa654c0..00000000 --- a/src/Types/FormFieldPushbuttonValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldPushbuttonValueEntryUnsupported.php b/src/Types/FormFieldPushbuttonValueEntryUnsupported.php deleted file mode 100644 index 8e2c71d2..00000000 --- a/src/Types/FormFieldPushbuttonValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldRadio.php b/src/Types/FormFieldRadio.php index 617e1720..bde09925 100644 --- a/src/Types/FormFieldRadio.php +++ b/src/Types/FormFieldRadio.php @@ -59,16 +59,16 @@ class FormFieldRadio extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldRadioValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldRadioValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldRadioDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldRadioDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -150,8 +150,8 @@ class FormFieldRadio extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldRadioValueEntry, - * defaultValueEntry: FormFieldRadioDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * value: string, * radiosInUnison: bool, diff --git a/src/Types/FormFieldRadioDefaultValueEntry.php b/src/Types/FormFieldRadioDefaultValueEntry.php deleted file mode 100644 index 36d91315..00000000 --- a/src/Types/FormFieldRadioDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldRadioDefaultValueEntryNone $none - * @return FormFieldRadioDefaultValueEntry - */ - public static function none(FormFieldRadioDefaultValueEntryNone $none): FormFieldRadioDefaultValueEntry - { - return new FormFieldRadioDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldRadioDefaultValueEntryScalar $scalar - * @return FormFieldRadioDefaultValueEntry - */ - public static function scalar(FormFieldRadioDefaultValueEntryScalar $scalar): FormFieldRadioDefaultValueEntry - { - return new FormFieldRadioDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldRadioDefaultValueEntryArray $array - * @return FormFieldRadioDefaultValueEntry - */ - public static function array(FormFieldRadioDefaultValueEntryArray $array): FormFieldRadioDefaultValueEntry - { - return new FormFieldRadioDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldRadioDefaultValueEntryUnsupported $unsupported - * @return FormFieldRadioDefaultValueEntry - */ - public static function unsupported(FormFieldRadioDefaultValueEntryUnsupported $unsupported): FormFieldRadioDefaultValueEntry - { - return new FormFieldRadioDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldRadioDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldRadioDefaultValueEntryNone - */ - public function asNone(): FormFieldRadioDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldRadioDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldRadioDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldRadioDefaultValueEntryScalar - */ - public function asScalar(): FormFieldRadioDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldRadioDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldRadioDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldRadioDefaultValueEntryArray - */ - public function asArray(): FormFieldRadioDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldRadioDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldRadioDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldRadioDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldRadioDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldRadioDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldRadioDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldRadioDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldRadioDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldRadioDefaultValueEntryArray.php b/src/Types/FormFieldRadioDefaultValueEntryArray.php deleted file mode 100644 index 5c32f730..00000000 --- a/src/Types/FormFieldRadioDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldRadioDefaultValueEntryNone.php b/src/Types/FormFieldRadioDefaultValueEntryNone.php deleted file mode 100644 index dd183b43..00000000 --- a/src/Types/FormFieldRadioDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldRadioDefaultValueEntryScalar.php b/src/Types/FormFieldRadioDefaultValueEntryScalar.php deleted file mode 100644 index 5e654de4..00000000 --- a/src/Types/FormFieldRadioDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php b/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php deleted file mode 100644 index 64047bf5..00000000 --- a/src/Types/FormFieldRadioDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldRadioValueEntry.php b/src/Types/FormFieldRadioValueEntry.php deleted file mode 100644 index f1149e5c..00000000 --- a/src/Types/FormFieldRadioValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldRadioValueEntryNone $none - * @return FormFieldRadioValueEntry - */ - public static function none(FormFieldRadioValueEntryNone $none): FormFieldRadioValueEntry - { - return new FormFieldRadioValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldRadioValueEntryScalar $scalar - * @return FormFieldRadioValueEntry - */ - public static function scalar(FormFieldRadioValueEntryScalar $scalar): FormFieldRadioValueEntry - { - return new FormFieldRadioValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldRadioValueEntryArray $array - * @return FormFieldRadioValueEntry - */ - public static function array(FormFieldRadioValueEntryArray $array): FormFieldRadioValueEntry - { - return new FormFieldRadioValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldRadioValueEntryUnsupported $unsupported - * @return FormFieldRadioValueEntry - */ - public static function unsupported(FormFieldRadioValueEntryUnsupported $unsupported): FormFieldRadioValueEntry - { - return new FormFieldRadioValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldRadioValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldRadioValueEntryNone - */ - public function asNone(): FormFieldRadioValueEntryNone - { - if (!($this->value instanceof FormFieldRadioValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldRadioValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldRadioValueEntryScalar - */ - public function asScalar(): FormFieldRadioValueEntryScalar - { - if (!($this->value instanceof FormFieldRadioValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldRadioValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldRadioValueEntryArray - */ - public function asArray(): FormFieldRadioValueEntryArray - { - if (!($this->value instanceof FormFieldRadioValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldRadioValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldRadioValueEntryUnsupported - */ - public function asUnsupported(): FormFieldRadioValueEntryUnsupported - { - if (!($this->value instanceof FormFieldRadioValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldRadioValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldRadioValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldRadioValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldRadioValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldRadioValueEntryArray.php b/src/Types/FormFieldRadioValueEntryArray.php deleted file mode 100644 index 8511158c..00000000 --- a/src/Types/FormFieldRadioValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldRadioValueEntryNone.php b/src/Types/FormFieldRadioValueEntryNone.php deleted file mode 100644 index 9dbae0e2..00000000 --- a/src/Types/FormFieldRadioValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldRadioValueEntryScalar.php b/src/Types/FormFieldRadioValueEntryScalar.php deleted file mode 100644 index 50b3e184..00000000 --- a/src/Types/FormFieldRadioValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldRadioValueEntryUnsupported.php b/src/Types/FormFieldRadioValueEntryUnsupported.php deleted file mode 100644 index b198320d..00000000 --- a/src/Types/FormFieldRadioValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldSignature.php b/src/Types/FormFieldSignature.php index 9327e603..9e0c2f1b 100644 --- a/src/Types/FormFieldSignature.php +++ b/src/Types/FormFieldSignature.php @@ -59,16 +59,16 @@ class FormFieldSignature extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldSignatureValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldSignatureValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldSignatureDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldSignatureDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -132,8 +132,8 @@ class FormFieldSignature extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldSignatureValueEntry, - * defaultValueEntry: FormFieldSignatureDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * alternateName?: ?string, * mappingName?: ?string, diff --git a/src/Types/FormFieldSignatureDefaultValueEntry.php b/src/Types/FormFieldSignatureDefaultValueEntry.php deleted file mode 100644 index 9e93337c..00000000 --- a/src/Types/FormFieldSignatureDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldSignatureDefaultValueEntryNone $none - * @return FormFieldSignatureDefaultValueEntry - */ - public static function none(FormFieldSignatureDefaultValueEntryNone $none): FormFieldSignatureDefaultValueEntry - { - return new FormFieldSignatureDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldSignatureDefaultValueEntryScalar $scalar - * @return FormFieldSignatureDefaultValueEntry - */ - public static function scalar(FormFieldSignatureDefaultValueEntryScalar $scalar): FormFieldSignatureDefaultValueEntry - { - return new FormFieldSignatureDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldSignatureDefaultValueEntryArray $array - * @return FormFieldSignatureDefaultValueEntry - */ - public static function array(FormFieldSignatureDefaultValueEntryArray $array): FormFieldSignatureDefaultValueEntry - { - return new FormFieldSignatureDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldSignatureDefaultValueEntryUnsupported $unsupported - * @return FormFieldSignatureDefaultValueEntry - */ - public static function unsupported(FormFieldSignatureDefaultValueEntryUnsupported $unsupported): FormFieldSignatureDefaultValueEntry - { - return new FormFieldSignatureDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldSignatureDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldSignatureDefaultValueEntryNone - */ - public function asNone(): FormFieldSignatureDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldSignatureDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldSignatureDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldSignatureDefaultValueEntryScalar - */ - public function asScalar(): FormFieldSignatureDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldSignatureDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldSignatureDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldSignatureDefaultValueEntryArray - */ - public function asArray(): FormFieldSignatureDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldSignatureDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldSignatureDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldSignatureDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldSignatureDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldSignatureDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldSignatureDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldSignatureDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldSignatureDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryArray.php b/src/Types/FormFieldSignatureDefaultValueEntryArray.php deleted file mode 100644 index e41d8c5c..00000000 --- a/src/Types/FormFieldSignatureDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryNone.php b/src/Types/FormFieldSignatureDefaultValueEntryNone.php deleted file mode 100644 index 6cdd77a1..00000000 --- a/src/Types/FormFieldSignatureDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryScalar.php b/src/Types/FormFieldSignatureDefaultValueEntryScalar.php deleted file mode 100644 index 27f2c94a..00000000 --- a/src/Types/FormFieldSignatureDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php b/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php deleted file mode 100644 index 12088521..00000000 --- a/src/Types/FormFieldSignatureDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldSignatureValueEntry.php b/src/Types/FormFieldSignatureValueEntry.php deleted file mode 100644 index a8b9673b..00000000 --- a/src/Types/FormFieldSignatureValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldSignatureValueEntryNone $none - * @return FormFieldSignatureValueEntry - */ - public static function none(FormFieldSignatureValueEntryNone $none): FormFieldSignatureValueEntry - { - return new FormFieldSignatureValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldSignatureValueEntryScalar $scalar - * @return FormFieldSignatureValueEntry - */ - public static function scalar(FormFieldSignatureValueEntryScalar $scalar): FormFieldSignatureValueEntry - { - return new FormFieldSignatureValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldSignatureValueEntryArray $array - * @return FormFieldSignatureValueEntry - */ - public static function array(FormFieldSignatureValueEntryArray $array): FormFieldSignatureValueEntry - { - return new FormFieldSignatureValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldSignatureValueEntryUnsupported $unsupported - * @return FormFieldSignatureValueEntry - */ - public static function unsupported(FormFieldSignatureValueEntryUnsupported $unsupported): FormFieldSignatureValueEntry - { - return new FormFieldSignatureValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldSignatureValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldSignatureValueEntryNone - */ - public function asNone(): FormFieldSignatureValueEntryNone - { - if (!($this->value instanceof FormFieldSignatureValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldSignatureValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldSignatureValueEntryScalar - */ - public function asScalar(): FormFieldSignatureValueEntryScalar - { - if (!($this->value instanceof FormFieldSignatureValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldSignatureValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldSignatureValueEntryArray - */ - public function asArray(): FormFieldSignatureValueEntryArray - { - if (!($this->value instanceof FormFieldSignatureValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldSignatureValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldSignatureValueEntryUnsupported - */ - public function asUnsupported(): FormFieldSignatureValueEntryUnsupported - { - if (!($this->value instanceof FormFieldSignatureValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldSignatureValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldSignatureValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldSignatureValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldSignatureValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldSignatureValueEntryArray.php b/src/Types/FormFieldSignatureValueEntryArray.php deleted file mode 100644 index b5267e64..00000000 --- a/src/Types/FormFieldSignatureValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldSignatureValueEntryNone.php b/src/Types/FormFieldSignatureValueEntryNone.php deleted file mode 100644 index 64002749..00000000 --- a/src/Types/FormFieldSignatureValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldSignatureValueEntryScalar.php b/src/Types/FormFieldSignatureValueEntryScalar.php deleted file mode 100644 index e530b81a..00000000 --- a/src/Types/FormFieldSignatureValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldSignatureValueEntryUnsupported.php b/src/Types/FormFieldSignatureValueEntryUnsupported.php deleted file mode 100644 index 3f2a8c70..00000000 --- a/src/Types/FormFieldSignatureValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldText.php b/src/Types/FormFieldText.php index 089306e0..b935749c 100644 --- a/src/Types/FormFieldText.php +++ b/src/Types/FormFieldText.php @@ -59,16 +59,16 @@ class FormFieldText extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldTextValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldTextValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldTextDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldTextDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -168,8 +168,8 @@ class FormFieldText extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldTextValueEntry, - * defaultValueEntry: FormFieldTextDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * value: string, * defaultValue: string, diff --git a/src/Types/FormFieldTextDefaultValueEntry.php b/src/Types/FormFieldTextDefaultValueEntry.php deleted file mode 100644 index 6fca464f..00000000 --- a/src/Types/FormFieldTextDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldTextDefaultValueEntryNone $none - * @return FormFieldTextDefaultValueEntry - */ - public static function none(FormFieldTextDefaultValueEntryNone $none): FormFieldTextDefaultValueEntry - { - return new FormFieldTextDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldTextDefaultValueEntryScalar $scalar - * @return FormFieldTextDefaultValueEntry - */ - public static function scalar(FormFieldTextDefaultValueEntryScalar $scalar): FormFieldTextDefaultValueEntry - { - return new FormFieldTextDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldTextDefaultValueEntryArray $array - * @return FormFieldTextDefaultValueEntry - */ - public static function array(FormFieldTextDefaultValueEntryArray $array): FormFieldTextDefaultValueEntry - { - return new FormFieldTextDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldTextDefaultValueEntryUnsupported $unsupported - * @return FormFieldTextDefaultValueEntry - */ - public static function unsupported(FormFieldTextDefaultValueEntryUnsupported $unsupported): FormFieldTextDefaultValueEntry - { - return new FormFieldTextDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldTextDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldTextDefaultValueEntryNone - */ - public function asNone(): FormFieldTextDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldTextDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldTextDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldTextDefaultValueEntryScalar - */ - public function asScalar(): FormFieldTextDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldTextDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldTextDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldTextDefaultValueEntryArray - */ - public function asArray(): FormFieldTextDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldTextDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldTextDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldTextDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldTextDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldTextDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldTextDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldTextDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldTextDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldTextDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldTextDefaultValueEntryArray.php b/src/Types/FormFieldTextDefaultValueEntryArray.php deleted file mode 100644 index 1867f1fc..00000000 --- a/src/Types/FormFieldTextDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldTextDefaultValueEntryNone.php b/src/Types/FormFieldTextDefaultValueEntryNone.php deleted file mode 100644 index 3d61644e..00000000 --- a/src/Types/FormFieldTextDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldTextDefaultValueEntryScalar.php b/src/Types/FormFieldTextDefaultValueEntryScalar.php deleted file mode 100644 index 4e42f8d3..00000000 --- a/src/Types/FormFieldTextDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldTextDefaultValueEntryUnsupported.php b/src/Types/FormFieldTextDefaultValueEntryUnsupported.php deleted file mode 100644 index c4703c54..00000000 --- a/src/Types/FormFieldTextDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldTextValueEntry.php b/src/Types/FormFieldTextValueEntry.php deleted file mode 100644 index ddd8c276..00000000 --- a/src/Types/FormFieldTextValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldTextValueEntryNone $none - * @return FormFieldTextValueEntry - */ - public static function none(FormFieldTextValueEntryNone $none): FormFieldTextValueEntry - { - return new FormFieldTextValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldTextValueEntryScalar $scalar - * @return FormFieldTextValueEntry - */ - public static function scalar(FormFieldTextValueEntryScalar $scalar): FormFieldTextValueEntry - { - return new FormFieldTextValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldTextValueEntryArray $array - * @return FormFieldTextValueEntry - */ - public static function array(FormFieldTextValueEntryArray $array): FormFieldTextValueEntry - { - return new FormFieldTextValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldTextValueEntryUnsupported $unsupported - * @return FormFieldTextValueEntry - */ - public static function unsupported(FormFieldTextValueEntryUnsupported $unsupported): FormFieldTextValueEntry - { - return new FormFieldTextValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldTextValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldTextValueEntryNone - */ - public function asNone(): FormFieldTextValueEntryNone - { - if (!($this->value instanceof FormFieldTextValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldTextValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldTextValueEntryScalar - */ - public function asScalar(): FormFieldTextValueEntryScalar - { - if (!($this->value instanceof FormFieldTextValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldTextValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldTextValueEntryArray - */ - public function asArray(): FormFieldTextValueEntryArray - { - if (!($this->value instanceof FormFieldTextValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldTextValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldTextValueEntryUnsupported - */ - public function asUnsupported(): FormFieldTextValueEntryUnsupported - { - if (!($this->value instanceof FormFieldTextValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldTextValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldTextValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldTextValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldTextValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldTextValueEntryArray.php b/src/Types/FormFieldTextValueEntryArray.php deleted file mode 100644 index 2e2606de..00000000 --- a/src/Types/FormFieldTextValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldTextValueEntryNone.php b/src/Types/FormFieldTextValueEntryNone.php deleted file mode 100644 index e9e7c341..00000000 --- a/src/Types/FormFieldTextValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldTextValueEntryScalar.php b/src/Types/FormFieldTextValueEntryScalar.php deleted file mode 100644 index c7b538ed..00000000 --- a/src/Types/FormFieldTextValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldTextValueEntryUnsupported.php b/src/Types/FormFieldTextValueEntryUnsupported.php deleted file mode 100644 index 8110b47f..00000000 --- a/src/Types/FormFieldTextValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldUnknown.php b/src/Types/FormFieldUnknown.php index 7d88c4c3..fd5cd52a 100644 --- a/src/Types/FormFieldUnknown.php +++ b/src/Types/FormFieldUnknown.php @@ -59,16 +59,16 @@ class FormFieldUnknown extends JsonSerializableType public ?string $mappingName; /** - * @var FormFieldUnknownValueEntry $valueEntry + * @var FormValueEntry $valueEntry */ #[JsonProperty('valueEntry')] - public FormFieldUnknownValueEntry $valueEntry; + public FormValueEntry $valueEntry; /** - * @var FormFieldUnknownDefaultValueEntry $defaultValueEntry + * @var FormValueEntry $defaultValueEntry */ #[JsonProperty('defaultValueEntry')] - public FormFieldUnknownDefaultValueEntry $defaultValueEntry; + public FormValueEntry $defaultValueEntry; /** * @var ?PdfFieldActions $actions @@ -138,8 +138,8 @@ class FormFieldUnknown extends JsonSerializableType * readOnly: bool, * required: bool, * noExport: bool, - * valueEntry: FormFieldUnknownValueEntry, - * defaultValueEntry: FormFieldUnknownDefaultValueEntry, + * valueEntry: FormValueEntry, + * defaultValueEntry: FormValueEntry, * widgets: array, * rawValue: string, * alternateName?: ?string, diff --git a/src/Types/FormFieldUnknownDefaultValueEntry.php b/src/Types/FormFieldUnknownDefaultValueEntry.php deleted file mode 100644 index bce9a991..00000000 --- a/src/Types/FormFieldUnknownDefaultValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldUnknownDefaultValueEntryNone $none - * @return FormFieldUnknownDefaultValueEntry - */ - public static function none(FormFieldUnknownDefaultValueEntryNone $none): FormFieldUnknownDefaultValueEntry - { - return new FormFieldUnknownDefaultValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldUnknownDefaultValueEntryScalar $scalar - * @return FormFieldUnknownDefaultValueEntry - */ - public static function scalar(FormFieldUnknownDefaultValueEntryScalar $scalar): FormFieldUnknownDefaultValueEntry - { - return new FormFieldUnknownDefaultValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldUnknownDefaultValueEntryArray $array - * @return FormFieldUnknownDefaultValueEntry - */ - public static function array(FormFieldUnknownDefaultValueEntryArray $array): FormFieldUnknownDefaultValueEntry - { - return new FormFieldUnknownDefaultValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldUnknownDefaultValueEntryUnsupported $unsupported - * @return FormFieldUnknownDefaultValueEntry - */ - public static function unsupported(FormFieldUnknownDefaultValueEntryUnsupported $unsupported): FormFieldUnknownDefaultValueEntry - { - return new FormFieldUnknownDefaultValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldUnknownDefaultValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldUnknownDefaultValueEntryNone - */ - public function asNone(): FormFieldUnknownDefaultValueEntryNone - { - if (!($this->value instanceof FormFieldUnknownDefaultValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldUnknownDefaultValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldUnknownDefaultValueEntryScalar - */ - public function asScalar(): FormFieldUnknownDefaultValueEntryScalar - { - if (!($this->value instanceof FormFieldUnknownDefaultValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldUnknownDefaultValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldUnknownDefaultValueEntryArray - */ - public function asArray(): FormFieldUnknownDefaultValueEntryArray - { - if (!($this->value instanceof FormFieldUnknownDefaultValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldUnknownDefaultValueEntryUnsupported - */ - public function asUnsupported(): FormFieldUnknownDefaultValueEntryUnsupported - { - if (!($this->value instanceof FormFieldUnknownDefaultValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldUnknownDefaultValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldUnknownDefaultValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldUnknownDefaultValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldUnknownDefaultValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryArray.php b/src/Types/FormFieldUnknownDefaultValueEntryArray.php deleted file mode 100644 index 91b0da0a..00000000 --- a/src/Types/FormFieldUnknownDefaultValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryNone.php b/src/Types/FormFieldUnknownDefaultValueEntryNone.php deleted file mode 100644 index fe4bd9d1..00000000 --- a/src/Types/FormFieldUnknownDefaultValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryScalar.php b/src/Types/FormFieldUnknownDefaultValueEntryScalar.php deleted file mode 100644 index 031044b3..00000000 --- a/src/Types/FormFieldUnknownDefaultValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php b/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php deleted file mode 100644 index 3bb6e7d1..00000000 --- a/src/Types/FormFieldUnknownDefaultValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldUnknownValueEntry.php b/src/Types/FormFieldUnknownValueEntry.php deleted file mode 100644 index 2acba432..00000000 --- a/src/Types/FormFieldUnknownValueEntry.php +++ /dev/null @@ -1,286 +0,0 @@ -kind = $values['kind']; - $this->value = $values['value']; - } - - /** - * @param FormFieldUnknownValueEntryNone $none - * @return FormFieldUnknownValueEntry - */ - public static function none(FormFieldUnknownValueEntryNone $none): FormFieldUnknownValueEntry - { - return new FormFieldUnknownValueEntry([ - 'kind' => 'none', - 'value' => $none, - ]); - } - - /** - * @param FormFieldUnknownValueEntryScalar $scalar - * @return FormFieldUnknownValueEntry - */ - public static function scalar(FormFieldUnknownValueEntryScalar $scalar): FormFieldUnknownValueEntry - { - return new FormFieldUnknownValueEntry([ - 'kind' => 'scalar', - 'value' => $scalar, - ]); - } - - /** - * @param FormFieldUnknownValueEntryArray $array - * @return FormFieldUnknownValueEntry - */ - public static function array(FormFieldUnknownValueEntryArray $array): FormFieldUnknownValueEntry - { - return new FormFieldUnknownValueEntry([ - 'kind' => 'array', - 'value' => $array, - ]); - } - - /** - * @param FormFieldUnknownValueEntryUnsupported $unsupported - * @return FormFieldUnknownValueEntry - */ - public static function unsupported(FormFieldUnknownValueEntryUnsupported $unsupported): FormFieldUnknownValueEntry - { - return new FormFieldUnknownValueEntry([ - 'kind' => 'unsupported', - 'value' => $unsupported, - ]); - } - - /** - * @return bool - */ - public function isNone(): bool - { - return $this->value instanceof FormFieldUnknownValueEntryNone && $this->kind === 'none'; - } - - /** - * @return FormFieldUnknownValueEntryNone - */ - public function asNone(): FormFieldUnknownValueEntryNone - { - if (!($this->value instanceof FormFieldUnknownValueEntryNone && $this->kind === 'none')) { - throw new Exception( - "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isScalar(): bool - { - return $this->value instanceof FormFieldUnknownValueEntryScalar && $this->kind === 'scalar'; - } - - /** - * @return FormFieldUnknownValueEntryScalar - */ - public function asScalar(): FormFieldUnknownValueEntryScalar - { - if (!($this->value instanceof FormFieldUnknownValueEntryScalar && $this->kind === 'scalar')) { - throw new Exception( - "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isArray(): bool - { - return $this->value instanceof FormFieldUnknownValueEntryArray && $this->kind === 'array'; - } - - /** - * @return FormFieldUnknownValueEntryArray - */ - public function asArray(): FormFieldUnknownValueEntryArray - { - if (!($this->value instanceof FormFieldUnknownValueEntryArray && $this->kind === 'array')) { - throw new Exception( - "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return bool - */ - public function isUnsupported(): bool - { - return $this->value instanceof FormFieldUnknownValueEntryUnsupported && $this->kind === 'unsupported'; - } - - /** - * @return FormFieldUnknownValueEntryUnsupported - */ - public function asUnsupported(): FormFieldUnknownValueEntryUnsupported - { - if (!($this->value instanceof FormFieldUnknownValueEntryUnsupported && $this->kind === 'unsupported')) { - throw new Exception( - "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), - ); - } - - return $this->value; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } - - /** - * @return array - */ - public function jsonSerialize(): array - { - $result = []; - $result['kind'] = $this->kind; - - $base = parent::jsonSerialize(); - $result = array_merge($base, $result); - - switch ($this->kind) { - case 'none': - $value = $this->asNone()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'scalar': - $value = $this->asScalar()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'array': - $value = $this->asArray()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case 'unsupported': - $value = $this->asUnsupported()->jsonSerialize(); - $result = array_merge($value, $result); - break; - case '_unknown': - default: - if (is_null($this->value)) { - break; - } - if ($this->value instanceof JsonSerializableType) { - $value = $this->value->jsonSerialize(); - $result = array_merge($value, $result); - } elseif (is_array($this->value)) { - $result = array_merge($this->value, $result); - } - } - - return $result; - } - - /** - * @param array $data - */ - public static function jsonDeserialize(array $data): static - { - $args = []; - if (!array_key_exists('kind', $data)) { - throw new Exception( - "JSON data is missing property 'kind'", - ); - } - $kind = $data['kind']; - if (!(is_string($kind))) { - throw new Exception( - "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), - ); - } - - $args['kind'] = $kind; - switch ($kind) { - case 'none': - $args['value'] = FormFieldUnknownValueEntryNone::jsonDeserialize($data); - break; - case 'scalar': - $args['value'] = FormFieldUnknownValueEntryScalar::jsonDeserialize($data); - break; - case 'array': - $args['value'] = FormFieldUnknownValueEntryArray::jsonDeserialize($data); - break; - case 'unsupported': - $args['value'] = FormFieldUnknownValueEntryUnsupported::jsonDeserialize($data); - break; - case '_unknown': - default: - $args['kind'] = '_unknown'; - $args['value'] = $data; - } - - // @phpstan-ignore-next-line - return new static($args); - } -} diff --git a/src/Types/FormFieldUnknownValueEntryArray.php b/src/Types/FormFieldUnknownValueEntryArray.php deleted file mode 100644 index a8b531ff..00000000 --- a/src/Types/FormFieldUnknownValueEntryArray.php +++ /dev/null @@ -1,35 +0,0 @@ - $values - */ - #[JsonProperty('values'), ArrayType(['string'])] - public array $values; - - /** - * @param array{ - * values: array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->values = $values['values']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldUnknownValueEntryNone.php b/src/Types/FormFieldUnknownValueEntryNone.php deleted file mode 100644 index ba572a8d..00000000 --- a/src/Types/FormFieldUnknownValueEntryNone.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormFieldUnknownValueEntryScalar.php b/src/Types/FormFieldUnknownValueEntryScalar.php deleted file mode 100644 index 1bb45b4c..00000000 --- a/src/Types/FormFieldUnknownValueEntryScalar.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $values['value']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/FormFieldUnknownValueEntryUnsupported.php b/src/Types/FormFieldUnknownValueEntryUnsupported.php deleted file mode 100644 index e562cb50..00000000 --- a/src/Types/FormFieldUnknownValueEntryUnsupported.php +++ /dev/null @@ -1,26 +0,0 @@ -toJson(); - } -} diff --git a/src/Types/FormValueEntry.php b/src/Types/FormValueEntry.php new file mode 100644 index 00000000..4f8fe699 --- /dev/null +++ b/src/Types/FormValueEntry.php @@ -0,0 +1,289 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param FormValueEntryNone $none + * @return FormValueEntry + */ + public static function none(FormValueEntryNone $none): FormValueEntry + { + return new FormValueEntry([ + 'kind' => 'none', + 'value' => $none, + ]); + } + + /** + * @param FormValueEntryScalar $scalar + * @return FormValueEntry + */ + public static function scalar(FormValueEntryScalar $scalar): FormValueEntry + { + return new FormValueEntry([ + 'kind' => 'scalar', + 'value' => $scalar, + ]); + } + + /** + * @param FormValueEntryArray $array + * @return FormValueEntry + */ + public static function array(FormValueEntryArray $array): FormValueEntry + { + return new FormValueEntry([ + 'kind' => 'array', + 'value' => $array, + ]); + } + + /** + * @param FormValueEntryUnsupported $unsupported + * @return FormValueEntry + */ + public static function unsupported(FormValueEntryUnsupported $unsupported): FormValueEntry + { + return new FormValueEntry([ + 'kind' => 'unsupported', + 'value' => $unsupported, + ]); + } + + /** + * @return bool + */ + public function isNone(): bool + { + return $this->value instanceof FormValueEntryNone && $this->kind === 'none'; + } + + /** + * @return FormValueEntryNone + */ + public function asNone(): FormValueEntryNone + { + if (!($this->value instanceof FormValueEntryNone && $this->kind === 'none')) { + throw new Exception( + "Expected none; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isScalar(): bool + { + return $this->value instanceof FormValueEntryScalar && $this->kind === 'scalar'; + } + + /** + * @return FormValueEntryScalar + */ + public function asScalar(): FormValueEntryScalar + { + if (!($this->value instanceof FormValueEntryScalar && $this->kind === 'scalar')) { + throw new Exception( + "Expected scalar; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isArray(): bool + { + return $this->value instanceof FormValueEntryArray && $this->kind === 'array'; + } + + /** + * @return FormValueEntryArray + */ + public function asArray(): FormValueEntryArray + { + if (!($this->value instanceof FormValueEntryArray && $this->kind === 'array')) { + throw new Exception( + "Expected array; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnsupported(): bool + { + return $this->value instanceof FormValueEntryUnsupported && $this->kind === 'unsupported'; + } + + /** + * @return FormValueEntryUnsupported + */ + public function asUnsupported(): FormValueEntryUnsupported + { + if (!($this->value instanceof FormValueEntryUnsupported && $this->kind === 'unsupported')) { + throw new Exception( + "Expected unsupported; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'none': + $value = $this->asNone()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'scalar': + $value = $this->asScalar()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'array': + $value = $this->asArray()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unsupported': + $value = $this->asUnsupported()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'none': + $args['value'] = FormValueEntryNone::jsonDeserialize($data); + break; + case 'scalar': + $args['value'] = FormValueEntryScalar::jsonDeserialize($data); + break; + case 'array': + $args['value'] = FormValueEntryArray::jsonDeserialize($data); + break; + case 'unsupported': + $args['value'] = FormValueEntryUnsupported::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/FormValueEntryArray.php b/src/Types/FormValueEntryArray.php new file mode 100644 index 00000000..e582b8d7 --- /dev/null +++ b/src/Types/FormValueEntryArray.php @@ -0,0 +1,35 @@ + $values + */ + #[JsonProperty('values'), ArrayType(['string'])] + public array $values; + + /** + * @param array{ + * values: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->values = $values['values']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormValueEntryNone.php b/src/Types/FormValueEntryNone.php new file mode 100644 index 00000000..7f28f579 --- /dev/null +++ b/src/Types/FormValueEntryNone.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/FormValueEntryScalar.php b/src/Types/FormValueEntryScalar.php new file mode 100644 index 00000000..d7eb9166 --- /dev/null +++ b/src/Types/FormValueEntryScalar.php @@ -0,0 +1,34 @@ +value = $values['value']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/FormValueEntryUnsupported.php b/src/Types/FormValueEntryUnsupported.php new file mode 100644 index 00000000..fa29f9d9 --- /dev/null +++ b/src/Types/FormValueEntryUnsupported.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/GrantsArchive200Response.php b/src/Types/GrantsArchive200Response.php deleted file mode 100644 index ab02af31..00000000 --- a/src/Types/GrantsArchive200Response.php +++ /dev/null @@ -1,34 +0,0 @@ -grant = $values['grant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsArchive200ResponseGrant.php b/src/Types/GrantsArchive200ResponseGrant.php deleted file mode 100644 index f870e2bd..00000000 --- a/src/Types/GrantsArchive200ResponseGrant.php +++ /dev/null @@ -1,203 +0,0 @@ - $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var ?string $layerName - */ - #[JsonProperty('layerName')] - public ?string $layerName; - - /** - * @var bool $keepVisitorLayers - */ - #[JsonProperty('keepVisitorLayers')] - public bool $keepVisitorLayers; - - /** - * @var ?float $visitorIdleSeconds - */ - #[JsonProperty('visitorIdleSeconds')] - public ?float $visitorIdleSeconds; - - /** - * @var ?GrantsArchive200ResponseGrantVisitorIdentity $visitorIdentity - */ - #[JsonProperty('visitorIdentity')] - public ?GrantsArchive200ResponseGrantVisitorIdentity $visitorIdentity; - - /** - * @var ?Identity $identity - */ - #[JsonProperty('identity')] - public ?Identity $identity; - - /** - * @var array $scope - */ - #[JsonProperty('scope'), ArrayType(['string'])] - public array $scope; - - /** - * @var ?array $origins - */ - #[JsonProperty('origins'), ArrayType(['string'])] - public ?array $origins; - - /** - * @var bool $passphraseProtected - */ - #[JsonProperty('passphraseProtected')] - public bool $passphraseProtected; - - /** - * @var float $sessionTtlSeconds - */ - #[JsonProperty('sessionTtlSeconds')] - public float $sessionTtlSeconds; - - /** - * @var bool $disabled - */ - #[JsonProperty('disabled')] - public bool $disabled; - - /** - * @var ?float $archivedAt - */ - #[JsonProperty('archivedAt')] - public ?float $archivedAt; - - /** - * @var ?float $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?float $expiresAt; - - /** - * @var float $exchangeCount - */ - #[JsonProperty('exchangeCount')] - public float $exchangeCount; - - /** - * @var ?float $lastExchangedAt - */ - #[JsonProperty('lastExchangedAt')] - public ?float $lastExchangedAt; - - /** - * @var string $createdBy - */ - #[JsonProperty('createdBy')] - public string $createdBy; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @param array{ - * id: string, - * tenantId: string, - * docId: string, - * layerMode: value-of, - * keepVisitorLayers: bool, - * scope: array, - * passphraseProtected: bool, - * sessionTtlSeconds: float, - * disabled: bool, - * exchangeCount: float, - * createdBy: string, - * createdAt: float, - * updatedAt: float, - * name?: ?string, - * layerName?: ?string, - * visitorIdleSeconds?: ?float, - * visitorIdentity?: ?GrantsArchive200ResponseGrantVisitorIdentity, - * identity?: ?Identity, - * origins?: ?array, - * archivedAt?: ?float, - * expiresAt?: ?float, - * lastExchangedAt?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->docId = $values['docId']; - $this->name = $values['name'] ?? null; - $this->layerMode = $values['layerMode']; - $this->layerName = $values['layerName'] ?? null; - $this->keepVisitorLayers = $values['keepVisitorLayers']; - $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; - $this->visitorIdentity = $values['visitorIdentity'] ?? null; - $this->identity = $values['identity'] ?? null; - $this->scope = $values['scope']; - $this->origins = $values['origins'] ?? null; - $this->passphraseProtected = $values['passphraseProtected']; - $this->sessionTtlSeconds = $values['sessionTtlSeconds']; - $this->disabled = $values['disabled']; - $this->archivedAt = $values['archivedAt'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->exchangeCount = $values['exchangeCount']; - $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; - $this->createdBy = $values['createdBy']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsArchive200ResponseGrantLayerMode.php b/src/Types/GrantsArchive200ResponseGrantLayerMode.php deleted file mode 100644 index 556ad715..00000000 --- a/src/Types/GrantsArchive200ResponseGrantLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $ask - */ - #[JsonProperty('ask')] - public string $ask; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsArchive200ResponseGrantVisitorIdentityFields, - * ask: value-of, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->ask = $values['ask']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsArchive200ResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsArchive200ResponseGrantVisitorIdentityAsk.php deleted file mode 100644 index b61f1fb0..00000000 --- a/src/Types/GrantsArchive200ResponseGrantVisitorIdentityAsk.php +++ /dev/null @@ -1,9 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsArchive200ResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsArchive200ResponseGrantVisitorIdentityFieldsDisplayName.php deleted file mode 100644 index df84ceef..00000000 --- a/src/Types/GrantsArchive200ResponseGrantVisitorIdentityFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ -grant = $values['grant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsArchiveResponseGrant.php b/src/Types/GrantsArchiveResponseGrant.php new file mode 100644 index 00000000..b506f97a --- /dev/null +++ b/src/Types/GrantsArchiveResponseGrant.php @@ -0,0 +1,205 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName + */ + #[JsonProperty('layerName')] + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?int $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?int $visitorIdleSeconds; + + /** + * @var ?GrantsArchiveResponseGrantVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?GrantsArchiveResponseGrantVisitorIdentity $visitorIdentity; + + /** + * @var ?Identity $identity + */ + #[JsonProperty('identity')] + public ?Identity $identity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passphraseProtected + */ + #[JsonProperty('passphraseProtected')] + public bool $passphraseProtected; + + /** + * @var int $sessionTtlSeconds + */ + #[JsonProperty('sessionTtlSeconds')] + public int $sessionTtlSeconds; + + /** + * @var bool $disabled + */ + #[JsonProperty('disabled')] + public bool $disabled; + + /** + * @var ?DateTime $archivedAt + */ + #[JsonProperty('archivedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $archivedAt; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @var int $exchangeCount + */ + #[JsonProperty('exchangeCount')] + public int $exchangeCount; + + /** + * @var ?DateTime $lastExchangedAt + */ + #[JsonProperty('lastExchangedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $lastExchangedAt; + + /** + * @var string $createdBy + */ + #[JsonProperty('createdBy')] + public string $createdBy; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @param array{ + * id: string, + * tenantId: string, + * docId: string, + * layerMode: value-of, + * keepVisitorLayers: bool, + * scope: array, + * passphraseProtected: bool, + * sessionTtlSeconds: int, + * disabled: bool, + * exchangeCount: int, + * createdBy: string, + * createdAt: DateTime, + * updatedAt: DateTime, + * name?: ?string, + * layerName?: ?string, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?GrantsArchiveResponseGrantVisitorIdentity, + * identity?: ?Identity, + * origins?: ?array, + * archivedAt?: ?DateTime, + * expiresAt?: ?DateTime, + * lastExchangedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->docId = $values['docId']; + $this->name = $values['name'] ?? null; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->identity = $values['identity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passphraseProtected = $values['passphraseProtected']; + $this->sessionTtlSeconds = $values['sessionTtlSeconds']; + $this->disabled = $values['disabled']; + $this->archivedAt = $values['archivedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->exchangeCount = $values['exchangeCount']; + $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; + $this->createdBy = $values['createdBy']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsArchiveResponseGrantLayerMode.php b/src/Types/GrantsArchiveResponseGrantLayerMode.php new file mode 100644 index 00000000..29ce841d --- /dev/null +++ b/src/Types/GrantsArchiveResponseGrantLayerMode.php @@ -0,0 +1,9 @@ + $ask + */ + #[JsonProperty('ask')] + public string $ask; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsArchiveResponseGrantVisitorIdentityFields, + * ask: value-of, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->ask = $values['ask']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsArchiveResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsArchiveResponseGrantVisitorIdentityAsk.php new file mode 100644 index 00000000..e11702fa --- /dev/null +++ b/src/Types/GrantsArchiveResponseGrantVisitorIdentityAsk.php @@ -0,0 +1,9 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsArchiveResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsArchiveResponseGrantVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..e35ab909 --- /dev/null +++ b/src/Types/GrantsArchiveResponseGrantVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ +grant = $values['grant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsCreate200ResponseGrant.php b/src/Types/GrantsCreate200ResponseGrant.php deleted file mode 100644 index 5f3b7276..00000000 --- a/src/Types/GrantsCreate200ResponseGrant.php +++ /dev/null @@ -1,203 +0,0 @@ - $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var ?string $layerName - */ - #[JsonProperty('layerName')] - public ?string $layerName; - - /** - * @var bool $keepVisitorLayers - */ - #[JsonProperty('keepVisitorLayers')] - public bool $keepVisitorLayers; - - /** - * @var ?float $visitorIdleSeconds - */ - #[JsonProperty('visitorIdleSeconds')] - public ?float $visitorIdleSeconds; - - /** - * @var ?GrantsCreate200ResponseGrantVisitorIdentity $visitorIdentity - */ - #[JsonProperty('visitorIdentity')] - public ?GrantsCreate200ResponseGrantVisitorIdentity $visitorIdentity; - - /** - * @var ?Identity $identity - */ - #[JsonProperty('identity')] - public ?Identity $identity; - - /** - * @var array $scope - */ - #[JsonProperty('scope'), ArrayType(['string'])] - public array $scope; - - /** - * @var ?array $origins - */ - #[JsonProperty('origins'), ArrayType(['string'])] - public ?array $origins; - - /** - * @var bool $passphraseProtected - */ - #[JsonProperty('passphraseProtected')] - public bool $passphraseProtected; - - /** - * @var float $sessionTtlSeconds - */ - #[JsonProperty('sessionTtlSeconds')] - public float $sessionTtlSeconds; - - /** - * @var bool $disabled - */ - #[JsonProperty('disabled')] - public bool $disabled; - - /** - * @var ?float $archivedAt - */ - #[JsonProperty('archivedAt')] - public ?float $archivedAt; - - /** - * @var ?float $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?float $expiresAt; - - /** - * @var float $exchangeCount - */ - #[JsonProperty('exchangeCount')] - public float $exchangeCount; - - /** - * @var ?float $lastExchangedAt - */ - #[JsonProperty('lastExchangedAt')] - public ?float $lastExchangedAt; - - /** - * @var string $createdBy - */ - #[JsonProperty('createdBy')] - public string $createdBy; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @param array{ - * id: string, - * tenantId: string, - * docId: string, - * layerMode: value-of, - * keepVisitorLayers: bool, - * scope: array, - * passphraseProtected: bool, - * sessionTtlSeconds: float, - * disabled: bool, - * exchangeCount: float, - * createdBy: string, - * createdAt: float, - * updatedAt: float, - * name?: ?string, - * layerName?: ?string, - * visitorIdleSeconds?: ?float, - * visitorIdentity?: ?GrantsCreate200ResponseGrantVisitorIdentity, - * identity?: ?Identity, - * origins?: ?array, - * archivedAt?: ?float, - * expiresAt?: ?float, - * lastExchangedAt?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->docId = $values['docId']; - $this->name = $values['name'] ?? null; - $this->layerMode = $values['layerMode']; - $this->layerName = $values['layerName'] ?? null; - $this->keepVisitorLayers = $values['keepVisitorLayers']; - $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; - $this->visitorIdentity = $values['visitorIdentity'] ?? null; - $this->identity = $values['identity'] ?? null; - $this->scope = $values['scope']; - $this->origins = $values['origins'] ?? null; - $this->passphraseProtected = $values['passphraseProtected']; - $this->sessionTtlSeconds = $values['sessionTtlSeconds']; - $this->disabled = $values['disabled']; - $this->archivedAt = $values['archivedAt'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->exchangeCount = $values['exchangeCount']; - $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; - $this->createdBy = $values['createdBy']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsCreate200ResponseGrantLayerMode.php b/src/Types/GrantsCreate200ResponseGrantLayerMode.php deleted file mode 100644 index 56ddf11e..00000000 --- a/src/Types/GrantsCreate200ResponseGrantLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $ask - */ - #[JsonProperty('ask')] - public string $ask; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsCreate200ResponseGrantVisitorIdentityFields, - * ask: value-of, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->ask = $values['ask']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsCreate200ResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsCreate200ResponseGrantVisitorIdentityAsk.php deleted file mode 100644 index f9d1a32f..00000000 --- a/src/Types/GrantsCreate200ResponseGrantVisitorIdentityAsk.php +++ /dev/null @@ -1,9 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsCreate200ResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsCreate200ResponseGrantVisitorIdentityFieldsDisplayName.php deleted file mode 100644 index ee79c009..00000000 --- a/src/Types/GrantsCreate200ResponseGrantVisitorIdentityFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ -grant = $values['grant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsCreateResponseGrant.php b/src/Types/GrantsCreateResponseGrant.php new file mode 100644 index 00000000..becf9a98 --- /dev/null +++ b/src/Types/GrantsCreateResponseGrant.php @@ -0,0 +1,205 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName + */ + #[JsonProperty('layerName')] + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?int $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?int $visitorIdleSeconds; + + /** + * @var ?GrantsCreateResponseGrantVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?GrantsCreateResponseGrantVisitorIdentity $visitorIdentity; + + /** + * @var ?Identity $identity + */ + #[JsonProperty('identity')] + public ?Identity $identity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passphraseProtected + */ + #[JsonProperty('passphraseProtected')] + public bool $passphraseProtected; + + /** + * @var int $sessionTtlSeconds + */ + #[JsonProperty('sessionTtlSeconds')] + public int $sessionTtlSeconds; + + /** + * @var bool $disabled + */ + #[JsonProperty('disabled')] + public bool $disabled; + + /** + * @var ?DateTime $archivedAt + */ + #[JsonProperty('archivedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $archivedAt; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @var int $exchangeCount + */ + #[JsonProperty('exchangeCount')] + public int $exchangeCount; + + /** + * @var ?DateTime $lastExchangedAt + */ + #[JsonProperty('lastExchangedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $lastExchangedAt; + + /** + * @var string $createdBy + */ + #[JsonProperty('createdBy')] + public string $createdBy; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @param array{ + * id: string, + * tenantId: string, + * docId: string, + * layerMode: value-of, + * keepVisitorLayers: bool, + * scope: array, + * passphraseProtected: bool, + * sessionTtlSeconds: int, + * disabled: bool, + * exchangeCount: int, + * createdBy: string, + * createdAt: DateTime, + * updatedAt: DateTime, + * name?: ?string, + * layerName?: ?string, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?GrantsCreateResponseGrantVisitorIdentity, + * identity?: ?Identity, + * origins?: ?array, + * archivedAt?: ?DateTime, + * expiresAt?: ?DateTime, + * lastExchangedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->docId = $values['docId']; + $this->name = $values['name'] ?? null; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->identity = $values['identity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passphraseProtected = $values['passphraseProtected']; + $this->sessionTtlSeconds = $values['sessionTtlSeconds']; + $this->disabled = $values['disabled']; + $this->archivedAt = $values['archivedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->exchangeCount = $values['exchangeCount']; + $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; + $this->createdBy = $values['createdBy']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsCreateResponseGrantLayerMode.php b/src/Types/GrantsCreateResponseGrantLayerMode.php new file mode 100644 index 00000000..606e22ee --- /dev/null +++ b/src/Types/GrantsCreateResponseGrantLayerMode.php @@ -0,0 +1,9 @@ + $ask + */ + #[JsonProperty('ask')] + public string $ask; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsCreateResponseGrantVisitorIdentityFields, + * ask: value-of, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->ask = $values['ask']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsCreateResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsCreateResponseGrantVisitorIdentityAsk.php new file mode 100644 index 00000000..8041578d --- /dev/null +++ b/src/Types/GrantsCreateResponseGrantVisitorIdentityAsk.php @@ -0,0 +1,9 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsCreateResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsCreateResponseGrantVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..91fe4649 --- /dev/null +++ b/src/Types/GrantsCreateResponseGrantVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var GrantsExchange200ResponseVisitor $visitor - */ - #[JsonProperty('visitor')] - public GrantsExchange200ResponseVisitor $visitor; - - /** - * @var float $expiresAt - */ - #[JsonProperty('expiresAt')] - public float $expiresAt; - - /** - * @param array{ - * token: string, - * docId: string, - * layerName: string, - * layerMode: value-of, - * visitor: GrantsExchange200ResponseVisitor, - * expiresAt: float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->token = $values['token']; - $this->docId = $values['docId']; - $this->layerName = $values['layerName']; - $this->layerMode = $values['layerMode']; - $this->visitor = $values['visitor']; - $this->expiresAt = $values['expiresAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsExchange200ResponseLayerMode.php b/src/Types/GrantsExchange200ResponseLayerMode.php deleted file mode 100644 index 08954137..00000000 --- a/src/Types/GrantsExchange200ResponseLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ -handle = $values['handle']; - $this->keep = $values['keep']; - $this->identityRequest = $values['identityRequest'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsExchange200ResponseVisitorIdentityRequest.php b/src/Types/GrantsExchange200ResponseVisitorIdentityRequest.php deleted file mode 100644 index 0e466ab8..00000000 --- a/src/Types/GrantsExchange200ResponseVisitorIdentityRequest.php +++ /dev/null @@ -1,67 +0,0 @@ -> $missing - */ - #[JsonProperty('missing'), ArrayType(['string'])] - public array $missing; - - /** - * @var array> $invalid - */ - #[JsonProperty('invalid'), ArrayType(['string'])] - public array $invalid; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsExchange200ResponseVisitorIdentityRequestFields, - * missing: array>, - * invalid: array>, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->missing = $values['missing']; - $this->invalid = $values['invalid']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFields.php b/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFields.php deleted file mode 100644 index 0bd433d9..00000000 --- a/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFields.php +++ /dev/null @@ -1,66 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php b/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php deleted file mode 100644 index ea3c822e..00000000 --- a/src/Types/GrantsExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ - $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var GrantsExchangeResponseVisitor $visitor + */ + #[JsonProperty('visitor')] + public GrantsExchangeResponseVisitor $visitor; + + /** + * @var DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public DateTime $expiresAt; + + /** + * @param array{ + * token: string, + * docId: string, + * layerName: string, + * layerMode: value-of, + * visitor: GrantsExchangeResponseVisitor, + * expiresAt: DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->token = $values['token']; + $this->docId = $values['docId']; + $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->visitor = $values['visitor']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsExchangeResponseLayerMode.php b/src/Types/GrantsExchangeResponseLayerMode.php new file mode 100644 index 00000000..ccaa43d5 --- /dev/null +++ b/src/Types/GrantsExchangeResponseLayerMode.php @@ -0,0 +1,9 @@ +handle = $values['handle']; + $this->keep = $values['keep']; + $this->identityRequest = $values['identityRequest'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsExchangeResponseVisitorIdentityRequest.php b/src/Types/GrantsExchangeResponseVisitorIdentityRequest.php new file mode 100644 index 00000000..73beea5f --- /dev/null +++ b/src/Types/GrantsExchangeResponseVisitorIdentityRequest.php @@ -0,0 +1,67 @@ +> $missing + */ + #[JsonProperty('missing'), ArrayType(['string'])] + public array $missing; + + /** + * @var array> $invalid + */ + #[JsonProperty('invalid'), ArrayType(['string'])] + public array $invalid; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsExchangeResponseVisitorIdentityRequestFields, + * missing: array>, + * invalid: array>, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->missing = $values['missing']; + $this->invalid = $values['invalid']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsExchangeResponseVisitorIdentityRequestFields.php b/src/Types/GrantsExchangeResponseVisitorIdentityRequestFields.php new file mode 100644 index 00000000..1f10686a --- /dev/null +++ b/src/Types/GrantsExchangeResponseVisitorIdentityRequestFields.php @@ -0,0 +1,66 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsExchangeResponseVisitorIdentityRequestFieldsDisplayName.php b/src/Types/GrantsExchangeResponseVisitorIdentityRequestFieldsDisplayName.php new file mode 100644 index 00000000..75c6244e --- /dev/null +++ b/src/Types/GrantsExchangeResponseVisitorIdentityRequestFieldsDisplayName.php @@ -0,0 +1,9 @@ +grant = $values['grant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsGet200ResponseGrant.php b/src/Types/GrantsGet200ResponseGrant.php deleted file mode 100644 index 6dc1b2fe..00000000 --- a/src/Types/GrantsGet200ResponseGrant.php +++ /dev/null @@ -1,203 +0,0 @@ - $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var ?string $layerName - */ - #[JsonProperty('layerName')] - public ?string $layerName; - - /** - * @var bool $keepVisitorLayers - */ - #[JsonProperty('keepVisitorLayers')] - public bool $keepVisitorLayers; - - /** - * @var ?float $visitorIdleSeconds - */ - #[JsonProperty('visitorIdleSeconds')] - public ?float $visitorIdleSeconds; - - /** - * @var ?GrantsGet200ResponseGrantVisitorIdentity $visitorIdentity - */ - #[JsonProperty('visitorIdentity')] - public ?GrantsGet200ResponseGrantVisitorIdentity $visitorIdentity; - - /** - * @var ?Identity $identity - */ - #[JsonProperty('identity')] - public ?Identity $identity; - - /** - * @var array $scope - */ - #[JsonProperty('scope'), ArrayType(['string'])] - public array $scope; - - /** - * @var ?array $origins - */ - #[JsonProperty('origins'), ArrayType(['string'])] - public ?array $origins; - - /** - * @var bool $passphraseProtected - */ - #[JsonProperty('passphraseProtected')] - public bool $passphraseProtected; - - /** - * @var float $sessionTtlSeconds - */ - #[JsonProperty('sessionTtlSeconds')] - public float $sessionTtlSeconds; - - /** - * @var bool $disabled - */ - #[JsonProperty('disabled')] - public bool $disabled; - - /** - * @var ?float $archivedAt - */ - #[JsonProperty('archivedAt')] - public ?float $archivedAt; - - /** - * @var ?float $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?float $expiresAt; - - /** - * @var float $exchangeCount - */ - #[JsonProperty('exchangeCount')] - public float $exchangeCount; - - /** - * @var ?float $lastExchangedAt - */ - #[JsonProperty('lastExchangedAt')] - public ?float $lastExchangedAt; - - /** - * @var string $createdBy - */ - #[JsonProperty('createdBy')] - public string $createdBy; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @param array{ - * id: string, - * tenantId: string, - * docId: string, - * layerMode: value-of, - * keepVisitorLayers: bool, - * scope: array, - * passphraseProtected: bool, - * sessionTtlSeconds: float, - * disabled: bool, - * exchangeCount: float, - * createdBy: string, - * createdAt: float, - * updatedAt: float, - * name?: ?string, - * layerName?: ?string, - * visitorIdleSeconds?: ?float, - * visitorIdentity?: ?GrantsGet200ResponseGrantVisitorIdentity, - * identity?: ?Identity, - * origins?: ?array, - * archivedAt?: ?float, - * expiresAt?: ?float, - * lastExchangedAt?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->docId = $values['docId']; - $this->name = $values['name'] ?? null; - $this->layerMode = $values['layerMode']; - $this->layerName = $values['layerName'] ?? null; - $this->keepVisitorLayers = $values['keepVisitorLayers']; - $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; - $this->visitorIdentity = $values['visitorIdentity'] ?? null; - $this->identity = $values['identity'] ?? null; - $this->scope = $values['scope']; - $this->origins = $values['origins'] ?? null; - $this->passphraseProtected = $values['passphraseProtected']; - $this->sessionTtlSeconds = $values['sessionTtlSeconds']; - $this->disabled = $values['disabled']; - $this->archivedAt = $values['archivedAt'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->exchangeCount = $values['exchangeCount']; - $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; - $this->createdBy = $values['createdBy']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsGet200ResponseGrantLayerMode.php b/src/Types/GrantsGet200ResponseGrantLayerMode.php deleted file mode 100644 index 7e8fa82c..00000000 --- a/src/Types/GrantsGet200ResponseGrantLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $ask - */ - #[JsonProperty('ask')] - public string $ask; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsGet200ResponseGrantVisitorIdentityFields, - * ask: value-of, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->ask = $values['ask']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsGet200ResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsGet200ResponseGrantVisitorIdentityAsk.php deleted file mode 100644 index abf1964b..00000000 --- a/src/Types/GrantsGet200ResponseGrantVisitorIdentityAsk.php +++ /dev/null @@ -1,9 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsGet200ResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsGet200ResponseGrantVisitorIdentityFieldsDisplayName.php deleted file mode 100644 index 6d6a2325..00000000 --- a/src/Types/GrantsGet200ResponseGrantVisitorIdentityFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ -grant = $values['grant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsGetResponseGrant.php b/src/Types/GrantsGetResponseGrant.php new file mode 100644 index 00000000..3d879f04 --- /dev/null +++ b/src/Types/GrantsGetResponseGrant.php @@ -0,0 +1,205 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName + */ + #[JsonProperty('layerName')] + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?int $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?int $visitorIdleSeconds; + + /** + * @var ?GrantsGetResponseGrantVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?GrantsGetResponseGrantVisitorIdentity $visitorIdentity; + + /** + * @var ?Identity $identity + */ + #[JsonProperty('identity')] + public ?Identity $identity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passphraseProtected + */ + #[JsonProperty('passphraseProtected')] + public bool $passphraseProtected; + + /** + * @var int $sessionTtlSeconds + */ + #[JsonProperty('sessionTtlSeconds')] + public int $sessionTtlSeconds; + + /** + * @var bool $disabled + */ + #[JsonProperty('disabled')] + public bool $disabled; + + /** + * @var ?DateTime $archivedAt + */ + #[JsonProperty('archivedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $archivedAt; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @var int $exchangeCount + */ + #[JsonProperty('exchangeCount')] + public int $exchangeCount; + + /** + * @var ?DateTime $lastExchangedAt + */ + #[JsonProperty('lastExchangedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $lastExchangedAt; + + /** + * @var string $createdBy + */ + #[JsonProperty('createdBy')] + public string $createdBy; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @param array{ + * id: string, + * tenantId: string, + * docId: string, + * layerMode: value-of, + * keepVisitorLayers: bool, + * scope: array, + * passphraseProtected: bool, + * sessionTtlSeconds: int, + * disabled: bool, + * exchangeCount: int, + * createdBy: string, + * createdAt: DateTime, + * updatedAt: DateTime, + * name?: ?string, + * layerName?: ?string, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?GrantsGetResponseGrantVisitorIdentity, + * identity?: ?Identity, + * origins?: ?array, + * archivedAt?: ?DateTime, + * expiresAt?: ?DateTime, + * lastExchangedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->docId = $values['docId']; + $this->name = $values['name'] ?? null; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->identity = $values['identity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passphraseProtected = $values['passphraseProtected']; + $this->sessionTtlSeconds = $values['sessionTtlSeconds']; + $this->disabled = $values['disabled']; + $this->archivedAt = $values['archivedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->exchangeCount = $values['exchangeCount']; + $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; + $this->createdBy = $values['createdBy']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsGetResponseGrantLayerMode.php b/src/Types/GrantsGetResponseGrantLayerMode.php new file mode 100644 index 00000000..be0a5362 --- /dev/null +++ b/src/Types/GrantsGetResponseGrantLayerMode.php @@ -0,0 +1,9 @@ + $ask + */ + #[JsonProperty('ask')] + public string $ask; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsGetResponseGrantVisitorIdentityFields, + * ask: value-of, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->ask = $values['ask']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsGetResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsGetResponseGrantVisitorIdentityAsk.php new file mode 100644 index 00000000..ccc631f1 --- /dev/null +++ b/src/Types/GrantsGetResponseGrantVisitorIdentityAsk.php @@ -0,0 +1,9 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsGetResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsGetResponseGrantVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..ae5f0a4a --- /dev/null +++ b/src/Types/GrantsGetResponseGrantVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $grants - */ - #[JsonProperty('grants'), ArrayType([GrantsList200ResponseGrantsItem::class])] - public array $grants; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * grants: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->grants = $values['grants']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsList200ResponseGrantsItem.php b/src/Types/GrantsList200ResponseGrantsItem.php deleted file mode 100644 index 460a0dd1..00000000 --- a/src/Types/GrantsList200ResponseGrantsItem.php +++ /dev/null @@ -1,203 +0,0 @@ - $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var ?string $layerName - */ - #[JsonProperty('layerName')] - public ?string $layerName; - - /** - * @var bool $keepVisitorLayers - */ - #[JsonProperty('keepVisitorLayers')] - public bool $keepVisitorLayers; - - /** - * @var ?float $visitorIdleSeconds - */ - #[JsonProperty('visitorIdleSeconds')] - public ?float $visitorIdleSeconds; - - /** - * @var ?GrantsList200ResponseGrantsItemVisitorIdentity $visitorIdentity - */ - #[JsonProperty('visitorIdentity')] - public ?GrantsList200ResponseGrantsItemVisitorIdentity $visitorIdentity; - - /** - * @var ?Identity $identity - */ - #[JsonProperty('identity')] - public ?Identity $identity; - - /** - * @var array $scope - */ - #[JsonProperty('scope'), ArrayType(['string'])] - public array $scope; - - /** - * @var ?array $origins - */ - #[JsonProperty('origins'), ArrayType(['string'])] - public ?array $origins; - - /** - * @var bool $passphraseProtected - */ - #[JsonProperty('passphraseProtected')] - public bool $passphraseProtected; - - /** - * @var float $sessionTtlSeconds - */ - #[JsonProperty('sessionTtlSeconds')] - public float $sessionTtlSeconds; - - /** - * @var bool $disabled - */ - #[JsonProperty('disabled')] - public bool $disabled; - - /** - * @var ?float $archivedAt - */ - #[JsonProperty('archivedAt')] - public ?float $archivedAt; - - /** - * @var ?float $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?float $expiresAt; - - /** - * @var float $exchangeCount - */ - #[JsonProperty('exchangeCount')] - public float $exchangeCount; - - /** - * @var ?float $lastExchangedAt - */ - #[JsonProperty('lastExchangedAt')] - public ?float $lastExchangedAt; - - /** - * @var string $createdBy - */ - #[JsonProperty('createdBy')] - public string $createdBy; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @param array{ - * id: string, - * tenantId: string, - * docId: string, - * layerMode: value-of, - * keepVisitorLayers: bool, - * scope: array, - * passphraseProtected: bool, - * sessionTtlSeconds: float, - * disabled: bool, - * exchangeCount: float, - * createdBy: string, - * createdAt: float, - * updatedAt: float, - * name?: ?string, - * layerName?: ?string, - * visitorIdleSeconds?: ?float, - * visitorIdentity?: ?GrantsList200ResponseGrantsItemVisitorIdentity, - * identity?: ?Identity, - * origins?: ?array, - * archivedAt?: ?float, - * expiresAt?: ?float, - * lastExchangedAt?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->docId = $values['docId']; - $this->name = $values['name'] ?? null; - $this->layerMode = $values['layerMode']; - $this->layerName = $values['layerName'] ?? null; - $this->keepVisitorLayers = $values['keepVisitorLayers']; - $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; - $this->visitorIdentity = $values['visitorIdentity'] ?? null; - $this->identity = $values['identity'] ?? null; - $this->scope = $values['scope']; - $this->origins = $values['origins'] ?? null; - $this->passphraseProtected = $values['passphraseProtected']; - $this->sessionTtlSeconds = $values['sessionTtlSeconds']; - $this->disabled = $values['disabled']; - $this->archivedAt = $values['archivedAt'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->exchangeCount = $values['exchangeCount']; - $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; - $this->createdBy = $values['createdBy']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsList200ResponseGrantsItemLayerMode.php b/src/Types/GrantsList200ResponseGrantsItemLayerMode.php deleted file mode 100644 index c3726883..00000000 --- a/src/Types/GrantsList200ResponseGrantsItemLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $ask - */ - #[JsonProperty('ask')] - public string $ask; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsList200ResponseGrantsItemVisitorIdentityFields, - * ask: value-of, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->ask = $values['ask']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityAsk.php b/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityAsk.php deleted file mode 100644 index adc0d7a6..00000000 --- a/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityAsk.php +++ /dev/null @@ -1,9 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityFieldsDisplayName.php deleted file mode 100644 index 6dc3198f..00000000 --- a/src/Types/GrantsList200ResponseGrantsItemVisitorIdentityFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ - $grants + */ + #[JsonProperty('grants'), ArrayType([GrantsListResponseGrantsItem::class])] + public array $grants; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * grants: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->grants = $values['grants']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsListResponseGrantsItem.php b/src/Types/GrantsListResponseGrantsItem.php new file mode 100644 index 00000000..e306ffb9 --- /dev/null +++ b/src/Types/GrantsListResponseGrantsItem.php @@ -0,0 +1,205 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName + */ + #[JsonProperty('layerName')] + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?int $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?int $visitorIdleSeconds; + + /** + * @var ?GrantsListResponseGrantsItemVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?GrantsListResponseGrantsItemVisitorIdentity $visitorIdentity; + + /** + * @var ?Identity $identity + */ + #[JsonProperty('identity')] + public ?Identity $identity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passphraseProtected + */ + #[JsonProperty('passphraseProtected')] + public bool $passphraseProtected; + + /** + * @var int $sessionTtlSeconds + */ + #[JsonProperty('sessionTtlSeconds')] + public int $sessionTtlSeconds; + + /** + * @var bool $disabled + */ + #[JsonProperty('disabled')] + public bool $disabled; + + /** + * @var ?DateTime $archivedAt + */ + #[JsonProperty('archivedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $archivedAt; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @var int $exchangeCount + */ + #[JsonProperty('exchangeCount')] + public int $exchangeCount; + + /** + * @var ?DateTime $lastExchangedAt + */ + #[JsonProperty('lastExchangedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $lastExchangedAt; + + /** + * @var string $createdBy + */ + #[JsonProperty('createdBy')] + public string $createdBy; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @param array{ + * id: string, + * tenantId: string, + * docId: string, + * layerMode: value-of, + * keepVisitorLayers: bool, + * scope: array, + * passphraseProtected: bool, + * sessionTtlSeconds: int, + * disabled: bool, + * exchangeCount: int, + * createdBy: string, + * createdAt: DateTime, + * updatedAt: DateTime, + * name?: ?string, + * layerName?: ?string, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?GrantsListResponseGrantsItemVisitorIdentity, + * identity?: ?Identity, + * origins?: ?array, + * archivedAt?: ?DateTime, + * expiresAt?: ?DateTime, + * lastExchangedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->docId = $values['docId']; + $this->name = $values['name'] ?? null; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->identity = $values['identity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passphraseProtected = $values['passphraseProtected']; + $this->sessionTtlSeconds = $values['sessionTtlSeconds']; + $this->disabled = $values['disabled']; + $this->archivedAt = $values['archivedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->exchangeCount = $values['exchangeCount']; + $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; + $this->createdBy = $values['createdBy']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsListResponseGrantsItemLayerMode.php b/src/Types/GrantsListResponseGrantsItemLayerMode.php new file mode 100644 index 00000000..9e43bdd6 --- /dev/null +++ b/src/Types/GrantsListResponseGrantsItemLayerMode.php @@ -0,0 +1,9 @@ + $ask + */ + #[JsonProperty('ask')] + public string $ask; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsListResponseGrantsItemVisitorIdentityFields, + * ask: value-of, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->ask = $values['ask']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsListResponseGrantsItemVisitorIdentityAsk.php b/src/Types/GrantsListResponseGrantsItemVisitorIdentityAsk.php new file mode 100644 index 00000000..cbad1563 --- /dev/null +++ b/src/Types/GrantsListResponseGrantsItemVisitorIdentityAsk.php @@ -0,0 +1,9 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsListResponseGrantsItemVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsListResponseGrantsItemVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..1ba94ae6 --- /dev/null +++ b/src/Types/GrantsListResponseGrantsItemVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ +grant = $values['grant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsUpdate200ResponseGrant.php b/src/Types/GrantsUpdate200ResponseGrant.php deleted file mode 100644 index b662d460..00000000 --- a/src/Types/GrantsUpdate200ResponseGrant.php +++ /dev/null @@ -1,203 +0,0 @@ - $layerMode - */ - #[JsonProperty('layerMode')] - public string $layerMode; - - /** - * @var ?string $layerName - */ - #[JsonProperty('layerName')] - public ?string $layerName; - - /** - * @var bool $keepVisitorLayers - */ - #[JsonProperty('keepVisitorLayers')] - public bool $keepVisitorLayers; - - /** - * @var ?float $visitorIdleSeconds - */ - #[JsonProperty('visitorIdleSeconds')] - public ?float $visitorIdleSeconds; - - /** - * @var ?GrantsUpdate200ResponseGrantVisitorIdentity $visitorIdentity - */ - #[JsonProperty('visitorIdentity')] - public ?GrantsUpdate200ResponseGrantVisitorIdentity $visitorIdentity; - - /** - * @var ?Identity $identity - */ - #[JsonProperty('identity')] - public ?Identity $identity; - - /** - * @var array $scope - */ - #[JsonProperty('scope'), ArrayType(['string'])] - public array $scope; - - /** - * @var ?array $origins - */ - #[JsonProperty('origins'), ArrayType(['string'])] - public ?array $origins; - - /** - * @var bool $passphraseProtected - */ - #[JsonProperty('passphraseProtected')] - public bool $passphraseProtected; - - /** - * @var float $sessionTtlSeconds - */ - #[JsonProperty('sessionTtlSeconds')] - public float $sessionTtlSeconds; - - /** - * @var bool $disabled - */ - #[JsonProperty('disabled')] - public bool $disabled; - - /** - * @var ?float $archivedAt - */ - #[JsonProperty('archivedAt')] - public ?float $archivedAt; - - /** - * @var ?float $expiresAt - */ - #[JsonProperty('expiresAt')] - public ?float $expiresAt; - - /** - * @var float $exchangeCount - */ - #[JsonProperty('exchangeCount')] - public float $exchangeCount; - - /** - * @var ?float $lastExchangedAt - */ - #[JsonProperty('lastExchangedAt')] - public ?float $lastExchangedAt; - - /** - * @var string $createdBy - */ - #[JsonProperty('createdBy')] - public string $createdBy; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @var float $updatedAt - */ - #[JsonProperty('updatedAt')] - public float $updatedAt; - - /** - * @param array{ - * id: string, - * tenantId: string, - * docId: string, - * layerMode: value-of, - * keepVisitorLayers: bool, - * scope: array, - * passphraseProtected: bool, - * sessionTtlSeconds: float, - * disabled: bool, - * exchangeCount: float, - * createdBy: string, - * createdAt: float, - * updatedAt: float, - * name?: ?string, - * layerName?: ?string, - * visitorIdleSeconds?: ?float, - * visitorIdentity?: ?GrantsUpdate200ResponseGrantVisitorIdentity, - * identity?: ?Identity, - * origins?: ?array, - * archivedAt?: ?float, - * expiresAt?: ?float, - * lastExchangedAt?: ?float, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->tenantId = $values['tenantId']; - $this->docId = $values['docId']; - $this->name = $values['name'] ?? null; - $this->layerMode = $values['layerMode']; - $this->layerName = $values['layerName'] ?? null; - $this->keepVisitorLayers = $values['keepVisitorLayers']; - $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; - $this->visitorIdentity = $values['visitorIdentity'] ?? null; - $this->identity = $values['identity'] ?? null; - $this->scope = $values['scope']; - $this->origins = $values['origins'] ?? null; - $this->passphraseProtected = $values['passphraseProtected']; - $this->sessionTtlSeconds = $values['sessionTtlSeconds']; - $this->disabled = $values['disabled']; - $this->archivedAt = $values['archivedAt'] ?? null; - $this->expiresAt = $values['expiresAt'] ?? null; - $this->exchangeCount = $values['exchangeCount']; - $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; - $this->createdBy = $values['createdBy']; - $this->createdAt = $values['createdAt']; - $this->updatedAt = $values['updatedAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsUpdate200ResponseGrantLayerMode.php b/src/Types/GrantsUpdate200ResponseGrantLayerMode.php deleted file mode 100644 index db278daa..00000000 --- a/src/Types/GrantsUpdate200ResponseGrantLayerMode.php +++ /dev/null @@ -1,9 +0,0 @@ - $ask - */ - #[JsonProperty('ask')] - public string $ask; - - /** - * @var ?string $purpose - */ - #[JsonProperty('purpose')] - public ?string $purpose; - - /** - * @var ?string $privacyUrl - */ - #[JsonProperty('privacyUrl')] - public ?string $privacyUrl; - - /** - * @param array{ - * fields: GrantsUpdate200ResponseGrantVisitorIdentityFields, - * ask: value-of, - * purpose?: ?string, - * privacyUrl?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->fields = $values['fields']; - $this->ask = $values['ask']; - $this->purpose = $values['purpose'] ?? null; - $this->privacyUrl = $values['privacyUrl'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityAsk.php deleted file mode 100644 index 6549e30f..00000000 --- a/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityAsk.php +++ /dev/null @@ -1,9 +0,0 @@ - $displayName - */ - #[JsonProperty('displayName')] - public ?string $displayName; - - /** - * @var ?value-of $email - */ - #[JsonProperty('email')] - public ?string $email; - - /** - * @var ?value-of $title - */ - #[JsonProperty('title')] - public ?string $title; - - /** - * @var ?value-of $organization - */ - #[JsonProperty('organization')] - public ?string $organization; - - /** - * @var ?value-of $organizationalUnit - */ - #[JsonProperty('organizationalUnit')] - public ?string $organizationalUnit; - - /** - * @param array{ - * displayName?: ?value-of, - * email?: ?value-of, - * title?: ?value-of, - * organization?: ?value-of, - * organizationalUnit?: ?value-of, - * } $values - */ - public function __construct( - array $values = [], - ) { - $this->displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityFieldsDisplayName.php deleted file mode 100644 index 8ac8d385..00000000 --- a/src/Types/GrantsUpdate200ResponseGrantVisitorIdentityFieldsDisplayName.php +++ /dev/null @@ -1,9 +0,0 @@ -grant = $values['grant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsUpdateResponseGrant.php b/src/Types/GrantsUpdateResponseGrant.php new file mode 100644 index 00000000..a237273d --- /dev/null +++ b/src/Types/GrantsUpdateResponseGrant.php @@ -0,0 +1,205 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName + */ + #[JsonProperty('layerName')] + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?int $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?int $visitorIdleSeconds; + + /** + * @var ?GrantsUpdateResponseGrantVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?GrantsUpdateResponseGrantVisitorIdentity $visitorIdentity; + + /** + * @var ?Identity $identity + */ + #[JsonProperty('identity')] + public ?Identity $identity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passphraseProtected + */ + #[JsonProperty('passphraseProtected')] + public bool $passphraseProtected; + + /** + * @var int $sessionTtlSeconds + */ + #[JsonProperty('sessionTtlSeconds')] + public int $sessionTtlSeconds; + + /** + * @var bool $disabled + */ + #[JsonProperty('disabled')] + public bool $disabled; + + /** + * @var ?DateTime $archivedAt + */ + #[JsonProperty('archivedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $archivedAt; + + /** + * @var ?DateTime $expiresAt + */ + #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $expiresAt; + + /** + * @var int $exchangeCount + */ + #[JsonProperty('exchangeCount')] + public int $exchangeCount; + + /** + * @var ?DateTime $lastExchangedAt + */ + #[JsonProperty('lastExchangedAt'), Date(Date::TYPE_DATETIME)] + public ?DateTime $lastExchangedAt; + + /** + * @var string $createdBy + */ + #[JsonProperty('createdBy')] + public string $createdBy; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @var DateTime $updatedAt + */ + #[JsonProperty('updatedAt'), Date(Date::TYPE_DATETIME)] + public DateTime $updatedAt; + + /** + * @param array{ + * id: string, + * tenantId: string, + * docId: string, + * layerMode: value-of, + * keepVisitorLayers: bool, + * scope: array, + * passphraseProtected: bool, + * sessionTtlSeconds: int, + * disabled: bool, + * exchangeCount: int, + * createdBy: string, + * createdAt: DateTime, + * updatedAt: DateTime, + * name?: ?string, + * layerName?: ?string, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?GrantsUpdateResponseGrantVisitorIdentity, + * identity?: ?Identity, + * origins?: ?array, + * archivedAt?: ?DateTime, + * expiresAt?: ?DateTime, + * lastExchangedAt?: ?DateTime, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->tenantId = $values['tenantId']; + $this->docId = $values['docId']; + $this->name = $values['name'] ?? null; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->identity = $values['identity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passphraseProtected = $values['passphraseProtected']; + $this->sessionTtlSeconds = $values['sessionTtlSeconds']; + $this->disabled = $values['disabled']; + $this->archivedAt = $values['archivedAt'] ?? null; + $this->expiresAt = $values['expiresAt'] ?? null; + $this->exchangeCount = $values['exchangeCount']; + $this->lastExchangedAt = $values['lastExchangedAt'] ?? null; + $this->createdBy = $values['createdBy']; + $this->createdAt = $values['createdAt']; + $this->updatedAt = $values['updatedAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsUpdateResponseGrantLayerMode.php b/src/Types/GrantsUpdateResponseGrantLayerMode.php new file mode 100644 index 00000000..46ad2d11 --- /dev/null +++ b/src/Types/GrantsUpdateResponseGrantLayerMode.php @@ -0,0 +1,9 @@ + $ask + */ + #[JsonProperty('ask')] + public string $ask; + + /** + * @var ?string $purpose + */ + #[JsonProperty('purpose')] + public ?string $purpose; + + /** + * @var ?string $privacyUrl + */ + #[JsonProperty('privacyUrl')] + public ?string $privacyUrl; + + /** + * @param array{ + * fields: GrantsUpdateResponseGrantVisitorIdentityFields, + * ask: value-of, + * purpose?: ?string, + * privacyUrl?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->fields = $values['fields']; + $this->ask = $values['ask']; + $this->purpose = $values['purpose'] ?? null; + $this->privacyUrl = $values['privacyUrl'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsUpdateResponseGrantVisitorIdentityAsk.php b/src/Types/GrantsUpdateResponseGrantVisitorIdentityAsk.php new file mode 100644 index 00000000..a1af3a6b --- /dev/null +++ b/src/Types/GrantsUpdateResponseGrantVisitorIdentityAsk.php @@ -0,0 +1,9 @@ + $displayName + */ + #[JsonProperty('displayName')] + public ?string $displayName; + + /** + * @var ?value-of $email + */ + #[JsonProperty('email')] + public ?string $email; + + /** + * @var ?value-of $title + */ + #[JsonProperty('title')] + public ?string $title; + + /** + * @var ?value-of $organization + */ + #[JsonProperty('organization')] + public ?string $organization; + + /** + * @var ?value-of $organizationalUnit + */ + #[JsonProperty('organizationalUnit')] + public ?string $organizationalUnit; + + /** + * @param array{ + * displayName?: ?value-of, + * email?: ?value-of, + * title?: ?value-of, + * organization?: ?value-of, + * organizationalUnit?: ?value-of, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsUpdateResponseGrantVisitorIdentityFieldsDisplayName.php b/src/Types/GrantsUpdateResponseGrantVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..7acfdcc7 --- /dev/null +++ b/src/Types/GrantsUpdateResponseGrantVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $visitors - */ - #[JsonProperty('visitors'), ArrayType([GrantsVisitorsList200ResponseVisitorsItem::class])] - public array $visitors; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * visitors: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->visitors = $values['visitors']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsVisitorsList200ResponseVisitorsItem.php b/src/Types/GrantsVisitorsList200ResponseVisitorsItem.php deleted file mode 100644 index c420661e..00000000 --- a/src/Types/GrantsVisitorsList200ResponseVisitorsItem.php +++ /dev/null @@ -1,82 +0,0 @@ -visitorId = $values['visitorId']; - $this->answers = $values['answers']; - $this->emailVerified = $values['emailVerified']; - $this->consentedAt = $values['consentedAt'] ?? null; - $this->firstSeenAt = $values['firstSeenAt']; - $this->lastSeenAt = $values['lastSeenAt']; - $this->layer = $values['layer'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsVisitorsList200ResponseVisitorsItemAnswers.php b/src/Types/GrantsVisitorsList200ResponseVisitorsItemAnswers.php deleted file mode 100644 index b6daf392..00000000 --- a/src/Types/GrantsVisitorsList200ResponseVisitorsItemAnswers.php +++ /dev/null @@ -1,66 +0,0 @@ -displayName = $values['displayName'] ?? null; - $this->email = $values['email'] ?? null; - $this->title = $values['title'] ?? null; - $this->organization = $values['organization'] ?? null; - $this->organizationalUnit = $values['organizationalUnit'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsVisitorsList200ResponseVisitorsItemLayer.php b/src/Types/GrantsVisitorsList200ResponseVisitorsItemLayer.php deleted file mode 100644 index 70e111c4..00000000 --- a/src/Types/GrantsVisitorsList200ResponseVisitorsItemLayer.php +++ /dev/null @@ -1,42 +0,0 @@ -layerName = $values['layerName']; - $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/GrantsVisitorsListResponse.php b/src/Types/GrantsVisitorsListResponse.php new file mode 100644 index 00000000..af2c2bd6 --- /dev/null +++ b/src/Types/GrantsVisitorsListResponse.php @@ -0,0 +1,43 @@ + $visitors + */ + #[JsonProperty('visitors'), ArrayType([GrantsVisitorsListResponseVisitorsItem::class])] + public array $visitors; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * visitors: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->visitors = $values['visitors']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsVisitorsListResponseVisitorsItem.php b/src/Types/GrantsVisitorsListResponseVisitorsItem.php new file mode 100644 index 00000000..1e13aa62 --- /dev/null +++ b/src/Types/GrantsVisitorsListResponseVisitorsItem.php @@ -0,0 +1,84 @@ +visitorId = $values['visitorId']; + $this->answers = $values['answers']; + $this->emailVerified = $values['emailVerified']; + $this->consentedAt = $values['consentedAt'] ?? null; + $this->firstSeenAt = $values['firstSeenAt']; + $this->lastSeenAt = $values['lastSeenAt']; + $this->layer = $values['layer'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsVisitorsListResponseVisitorsItemAnswers.php b/src/Types/GrantsVisitorsListResponseVisitorsItemAnswers.php new file mode 100644 index 00000000..f7c75d0b --- /dev/null +++ b/src/Types/GrantsVisitorsListResponseVisitorsItemAnswers.php @@ -0,0 +1,66 @@ +displayName = $values['displayName'] ?? null; + $this->email = $values['email'] ?? null; + $this->title = $values['title'] ?? null; + $this->organization = $values['organization'] ?? null; + $this->organizationalUnit = $values['organizationalUnit'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/GrantsVisitorsListResponseVisitorsItemLayer.php b/src/Types/GrantsVisitorsListResponseVisitorsItemLayer.php new file mode 100644 index 00000000..b5499e50 --- /dev/null +++ b/src/Types/GrantsVisitorsListResponseVisitorsItemLayer.php @@ -0,0 +1,42 @@ +layerName = $values['layerName']; + $this->sizeBytes = $values['sizeBytes'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/OutlineItem.php b/src/Types/OutlineItem.php index 9c5b45b0..ad9449b2 100644 --- a/src/Types/OutlineItem.php +++ b/src/Types/OutlineItem.php @@ -26,7 +26,7 @@ class OutlineItem extends JsonSerializableType public string $title; /** - * @var ?PdfLinkTarget $target + * @var ?PdfLinkTarget $target Where a link goes, by its `kind`. A newer server can add kinds: read one your client doesn't know as `unsupported`. */ #[JsonProperty('target')] public ?PdfLinkTarget $target; diff --git a/src/Types/OutlineMutationMeta.php b/src/Types/OutlineMutationMeta.php index d2c13958..e27943d2 100644 --- a/src/Types/OutlineMutationMeta.php +++ b/src/Types/OutlineMutationMeta.php @@ -39,17 +39,17 @@ class OutlineMutationMeta extends JsonSerializableType public ?array $missingCharacters; /** - * @var array $changed + * @var array $changedRefs */ - #[JsonProperty('changed'), ArrayType([OutlineItemRef::class])] - public array $changed; + #[JsonProperty('changedRefs'), ArrayType([OutlineItemRef::class])] + public array $changedRefs; /** * @param array{ * affectedPages: array, * opId: string, * undoable: bool, - * changed: array, + * changedRefs: array, * cacheDelta?: ?CacheDelta, * missingCharacters?: ?array, * } $values @@ -62,7 +62,7 @@ public function __construct( $this->opId = $values['opId']; $this->undoable = $values['undoable']; $this->missingCharacters = $values['missingCharacters'] ?? null; - $this->changed = $values['changed']; + $this->changedRefs = $values['changedRefs']; } /** diff --git a/src/Types/PdfActionNode.php b/src/Types/PdfActionNode.php index 1e343c87..e8f53b43 100644 --- a/src/Types/PdfActionNode.php +++ b/src/Types/PdfActionNode.php @@ -5,6 +5,9 @@ use CloudPDF\Core\Json\JsonSerializableType; use Exception; +/** + * An action, by its `type`. A newer server can add types: read one your client doesn't know as `unknown`, keeping its `subtype` and `next`. + */ class PdfActionNode extends JsonSerializableType { /** diff --git a/src/Types/PdfActionNodeSubmitFormPayload.php b/src/Types/PdfActionNodeSubmitFormPayload.php index bd451b65..ff727116 100644 --- a/src/Types/PdfActionNodeSubmitFormPayload.php +++ b/src/Types/PdfActionNodeSubmitFormPayload.php @@ -21,10 +21,70 @@ class PdfActionNodeSubmitFormPayload extends JsonSerializableType public ?array $fields; /** - * @var PdfActionNodeSubmitFormPayloadFlags $flags + * @var bool $exclude */ - #[JsonProperty('flags')] - public PdfActionNodeSubmitFormPayloadFlags $flags; + #[JsonProperty('exclude')] + public bool $exclude; + + /** + * @var bool $includeNoValueFields + */ + #[JsonProperty('includeNoValueFields')] + public bool $includeNoValueFields; + + /** + * @var value-of $format + */ + #[JsonProperty('format')] + public string $format; + + /** + * @var value-of $method + */ + #[JsonProperty('method')] + public string $method; + + /** + * @var bool $submitCoordinates + */ + #[JsonProperty('submitCoordinates')] + public bool $submitCoordinates; + + /** + * @var bool $includeAppendSaves + */ + #[JsonProperty('includeAppendSaves')] + public bool $includeAppendSaves; + + /** + * @var bool $includeAnnotations + */ + #[JsonProperty('includeAnnotations')] + public bool $includeAnnotations; + + /** + * @var bool $canonicalFormat + */ + #[JsonProperty('canonicalFormat')] + public bool $canonicalFormat; + + /** + * @var bool $exclNonUserAnnots + */ + #[JsonProperty('exclNonUserAnnots')] + public bool $exclNonUserAnnots; + + /** + * @var bool $exclFKey + */ + #[JsonProperty('exclFKey')] + public bool $exclFKey; + + /** + * @var bool $embedForm + */ + #[JsonProperty('embedForm')] + public bool $embedForm; /** * @var ?string $charSet @@ -35,7 +95,17 @@ class PdfActionNodeSubmitFormPayload extends JsonSerializableType /** * @param array{ * url: string, - * flags: PdfActionNodeSubmitFormPayloadFlags, + * exclude: bool, + * includeNoValueFields: bool, + * format: value-of, + * method: value-of, + * submitCoordinates: bool, + * includeAppendSaves: bool, + * includeAnnotations: bool, + * canonicalFormat: bool, + * exclNonUserAnnots: bool, + * exclFKey: bool, + * embedForm: bool, * fields?: ?array, * charSet?: ?string, * } $values @@ -45,7 +115,17 @@ public function __construct( ) { $this->url = $values['url']; $this->fields = $values['fields'] ?? null; - $this->flags = $values['flags']; + $this->exclude = $values['exclude']; + $this->includeNoValueFields = $values['includeNoValueFields']; + $this->format = $values['format']; + $this->method = $values['method']; + $this->submitCoordinates = $values['submitCoordinates']; + $this->includeAppendSaves = $values['includeAppendSaves']; + $this->includeAnnotations = $values['includeAnnotations']; + $this->canonicalFormat = $values['canonicalFormat']; + $this->exclNonUserAnnots = $values['exclNonUserAnnots']; + $this->exclFKey = $values['exclFKey']; + $this->embedForm = $values['embedForm']; $this->charSet = $values['charSet'] ?? null; } diff --git a/src/Types/PdfActionNodeSubmitFormPayloadFlags.php b/src/Types/PdfActionNodeSubmitFormPayloadFlags.php deleted file mode 100644 index 3e17dc4d..00000000 --- a/src/Types/PdfActionNodeSubmitFormPayloadFlags.php +++ /dev/null @@ -1,122 +0,0 @@ - $format - */ - #[JsonProperty('format')] - public string $format; - - /** - * @var value-of $method - */ - #[JsonProperty('method')] - public string $method; - - /** - * @var bool $submitCoordinates - */ - #[JsonProperty('submitCoordinates')] - public bool $submitCoordinates; - - /** - * @var bool $includeAppendSaves - */ - #[JsonProperty('includeAppendSaves')] - public bool $includeAppendSaves; - - /** - * @var bool $includeAnnotations - */ - #[JsonProperty('includeAnnotations')] - public bool $includeAnnotations; - - /** - * @var bool $canonicalFormat - */ - #[JsonProperty('canonicalFormat')] - public bool $canonicalFormat; - - /** - * @var bool $exclNonUserAnnots - */ - #[JsonProperty('exclNonUserAnnots')] - public bool $exclNonUserAnnots; - - /** - * @var bool $exclFKey - */ - #[JsonProperty('exclFKey')] - public bool $exclFKey; - - /** - * @var bool $embedForm - */ - #[JsonProperty('embedForm')] - public bool $embedForm; - - /** - * @param array{ - * raw: int, - * exclude: bool, - * includeNoValueFields: bool, - * format: value-of, - * method: value-of, - * submitCoordinates: bool, - * includeAppendSaves: bool, - * includeAnnotations: bool, - * canonicalFormat: bool, - * exclNonUserAnnots: bool, - * exclFKey: bool, - * embedForm: bool, - * } $values - */ - public function __construct( - array $values, - ) { - $this->raw = $values['raw']; - $this->exclude = $values['exclude']; - $this->includeNoValueFields = $values['includeNoValueFields']; - $this->format = $values['format']; - $this->method = $values['method']; - $this->submitCoordinates = $values['submitCoordinates']; - $this->includeAppendSaves = $values['includeAppendSaves']; - $this->includeAnnotations = $values['includeAnnotations']; - $this->canonicalFormat = $values['canonicalFormat']; - $this->exclNonUserAnnots = $values['exclNonUserAnnots']; - $this->exclFKey = $values['exclFKey']; - $this->embedForm = $values['embedForm']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/PdfActionNodeSubmitFormPayloadFlagsFormat.php b/src/Types/PdfActionNodeSubmitFormPayloadFlagsFormat.php deleted file mode 100644 index 1d9c97a2..00000000 --- a/src/Types/PdfActionNodeSubmitFormPayloadFlagsFormat.php +++ /dev/null @@ -1,11 +0,0 @@ -> $warnings */ @@ -35,7 +29,6 @@ class PdfActionTree extends JsonSerializableType /** * @param array{ * incomplete: bool, - * warningFlags: int, * warnings: array>, * root?: ?PdfActionNode, * } $values @@ -45,7 +38,6 @@ public function __construct( ) { $this->root = $values['root'] ?? null; $this->incomplete = $values['incomplete']; - $this->warningFlags = $values['warningFlags']; $this->warnings = $values['warnings']; } diff --git a/src/Types/PdfActionWriteSubmitForm.php b/src/Types/PdfActionWriteSubmitForm.php index 03287524..6072b6ae 100644 --- a/src/Types/PdfActionWriteSubmitForm.php +++ b/src/Types/PdfActionWriteSubmitForm.php @@ -21,10 +21,70 @@ class PdfActionWriteSubmitForm extends JsonSerializableType public ?array $fields; /** - * @var ?int $flags + * @var ?bool $exclude */ - #[JsonProperty('flags')] - public ?int $flags; + #[JsonProperty('exclude')] + public ?bool $exclude; + + /** + * @var ?bool $includeNoValueFields + */ + #[JsonProperty('includeNoValueFields')] + public ?bool $includeNoValueFields; + + /** + * @var ?value-of $format + */ + #[JsonProperty('format')] + public ?string $format; + + /** + * @var ?value-of $method + */ + #[JsonProperty('method')] + public ?string $method; + + /** + * @var ?bool $submitCoordinates + */ + #[JsonProperty('submitCoordinates')] + public ?bool $submitCoordinates; + + /** + * @var ?bool $includeAppendSaves + */ + #[JsonProperty('includeAppendSaves')] + public ?bool $includeAppendSaves; + + /** + * @var ?bool $includeAnnotations + */ + #[JsonProperty('includeAnnotations')] + public ?bool $includeAnnotations; + + /** + * @var ?bool $canonicalFormat + */ + #[JsonProperty('canonicalFormat')] + public ?bool $canonicalFormat; + + /** + * @var ?bool $exclNonUserAnnots + */ + #[JsonProperty('exclNonUserAnnots')] + public ?bool $exclNonUserAnnots; + + /** + * @var ?bool $exclFKey + */ + #[JsonProperty('exclFKey')] + public ?bool $exclFKey; + + /** + * @var ?bool $embedForm + */ + #[JsonProperty('embedForm')] + public ?bool $embedForm; /** * @var ?array $next @@ -36,7 +96,17 @@ class PdfActionWriteSubmitForm extends JsonSerializableType * @param array{ * url: string, * fields?: ?array, - * flags?: ?int, + * exclude?: ?bool, + * includeNoValueFields?: ?bool, + * format?: ?value-of, + * method?: ?value-of, + * submitCoordinates?: ?bool, + * includeAppendSaves?: ?bool, + * includeAnnotations?: ?bool, + * canonicalFormat?: ?bool, + * exclNonUserAnnots?: ?bool, + * exclFKey?: ?bool, + * embedForm?: ?bool, * next?: ?array, * } $values */ @@ -45,7 +115,17 @@ public function __construct( ) { $this->url = $values['url']; $this->fields = $values['fields'] ?? null; - $this->flags = $values['flags'] ?? null; + $this->exclude = $values['exclude'] ?? null; + $this->includeNoValueFields = $values['includeNoValueFields'] ?? null; + $this->format = $values['format'] ?? null; + $this->method = $values['method'] ?? null; + $this->submitCoordinates = $values['submitCoordinates'] ?? null; + $this->includeAppendSaves = $values['includeAppendSaves'] ?? null; + $this->includeAnnotations = $values['includeAnnotations'] ?? null; + $this->canonicalFormat = $values['canonicalFormat'] ?? null; + $this->exclNonUserAnnots = $values['exclNonUserAnnots'] ?? null; + $this->exclFKey = $values['exclFKey'] ?? null; + $this->embedForm = $values['embedForm'] ?? null; $this->next = $values['next'] ?? null; } diff --git a/src/Types/PdfActionWriteSubmitFormFormat.php b/src/Types/PdfActionWriteSubmitFormFormat.php new file mode 100644 index 00000000..94eae9b2 --- /dev/null +++ b/src/Types/PdfActionWriteSubmitFormFormat.php @@ -0,0 +1,11 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param PdfMeasurementRectilinear $rectilinear + * @return PdfMeasurement + */ + public static function rectilinear(PdfMeasurementRectilinear $rectilinear): PdfMeasurement + { + return new PdfMeasurement([ + 'subtype' => 'rectilinear', + 'value' => $rectilinear, + ]); + } + + /** + * @param PdfMeasurementGeospatial $geospatial + * @return PdfMeasurement + */ + public static function geospatial(PdfMeasurementGeospatial $geospatial): PdfMeasurement + { + return new PdfMeasurement([ + 'subtype' => 'geospatial', + 'value' => $geospatial, + ]); + } + + /** + * @param PdfMeasurementUnknown $unknown + * @return PdfMeasurement + */ + public static function unknown(PdfMeasurementUnknown $unknown): PdfMeasurement + { + return new PdfMeasurement([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRectilinear(): bool + { + return $this->value instanceof PdfMeasurementRectilinear && $this->subtype === 'rectilinear'; + } + + /** + * @return PdfMeasurementRectilinear + */ + public function asRectilinear(): PdfMeasurementRectilinear + { + if (!($this->value instanceof PdfMeasurementRectilinear && $this->subtype === 'rectilinear')) { + throw new Exception( + "Expected rectilinear; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeospatial(): bool + { + return $this->value instanceof PdfMeasurementGeospatial && $this->subtype === 'geospatial'; + } + + /** + * @return PdfMeasurementGeospatial + */ + public function asGeospatial(): PdfMeasurementGeospatial + { + if (!($this->value instanceof PdfMeasurementGeospatial && $this->subtype === 'geospatial')) { + throw new Exception( + "Expected geospatial; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof PdfMeasurementUnknown && $this->subtype === 'unknown'; + } + + /** + * @return PdfMeasurementUnknown + */ + public function asUnknown(): PdfMeasurementUnknown + { + if (!($this->value instanceof PdfMeasurementUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'rectilinear': + $value = $this->asRectilinear()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'geospatial': + $value = $this->asGeospatial()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'rectilinear': + $args['value'] = PdfMeasurementRectilinear::jsonDeserialize($data); + break; + case 'geospatial': + $args['value'] = PdfMeasurementGeospatial::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = PdfMeasurementUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/PdfMeasurementGeospatial.php b/src/Types/PdfMeasurementGeospatial.php new file mode 100644 index 00000000..5196ffb4 --- /dev/null +++ b/src/Types/PdfMeasurementGeospatial.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinear.php b/src/Types/PdfMeasurementRectilinear.php new file mode 100644 index 00000000..b3f19d2f --- /dev/null +++ b/src/Types/PdfMeasurementRectilinear.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([PdfMeasurementRectilinearXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([PdfMeasurementRectilinearYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([PdfMeasurementRectilinearDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([PdfMeasurementRectilinearAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([PdfMeasurementRectilinearAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([PdfMeasurementRectilinearSlopeItem::class])] + public ?array $slope; + + /** + * @var ?PdfMeasurementRectilinearOrigin $origin + */ + #[JsonProperty('origin')] + public ?PdfMeasurementRectilinearOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?PdfMeasurementRectilinearOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearAngleItem.php b/src/Types/PdfMeasurementRectilinearAngleItem.php new file mode 100644 index 00000000..e82602a3 --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearAngleItemFraction.php b/src/Types/PdfMeasurementRectilinearAngleItemFraction.php new file mode 100644 index 00000000..68311d19 --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearAreaItemFraction.php b/src/Types/PdfMeasurementRectilinearAreaItemFraction.php new file mode 100644 index 00000000..5a459ae8 --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearDistanceItemFraction.php b/src/Types/PdfMeasurementRectilinearDistanceItemFraction.php new file mode 100644 index 00000000..8371a98a --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearSlopeItem.php b/src/Types/PdfMeasurementRectilinearSlopeItem.php new file mode 100644 index 00000000..064692bf --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearSlopeItemFraction.php b/src/Types/PdfMeasurementRectilinearSlopeItemFraction.php new file mode 100644 index 00000000..28a5994f --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearXItemFraction.php b/src/Types/PdfMeasurementRectilinearXItemFraction.php new file mode 100644 index 00000000..380090f4 --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/PdfMeasurementRectilinearYItemFraction.php b/src/Types/PdfMeasurementRectilinearYItemFraction.php new file mode 100644 index 00000000..4fd302d4 --- /dev/null +++ b/src/Types/PdfMeasurementRectilinearYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/PdfPermissionFlags.php b/src/Types/PdfPermissionFlags.php new file mode 100644 index 00000000..423eb393 --- /dev/null +++ b/src/Types/PdfPermissionFlags.php @@ -0,0 +1,90 @@ +print = $values['print']; + $this->modifyContents = $values['modifyContents']; + $this->copy = $values['copy']; + $this->modifyAnnotations = $values['modifyAnnotations']; + $this->fillForms = $values['fillForms']; + $this->copyForAccessibility = $values['copyForAccessibility']; + $this->assemble = $values['assemble']; + $this->printHighQuality = $values['printHighQuality']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreate200Response.php b/src/Types/TenantsCreate200Response.php deleted file mode 100644 index 4acafe99..00000000 --- a/src/Types/TenantsCreate200Response.php +++ /dev/null @@ -1,42 +0,0 @@ -tenant = $values['tenant']; - $this->created = $values['created']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsCreate200ResponseTenant.php b/src/Types/TenantsCreate200ResponseTenant.php deleted file mode 100644 index d30860b8..00000000 --- a/src/Types/TenantsCreate200ResponseTenant.php +++ /dev/null @@ -1,75 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public ?string $status; - - /** - * @var ?array $features - */ - #[JsonProperty('features'), ArrayType([TenantFeature::class])] - public ?array $features; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @param array{ - * id: string, - * name: string, - * autoProvisioned: bool, - * createdAt: float, - * status?: ?value-of, - * features?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->name = $values['name']; - $this->autoProvisioned = $values['autoProvisioned']; - $this->status = $values['status'] ?? null; - $this->features = $values['features'] ?? null; - $this->createdAt = $values['createdAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsCreate200ResponseTenantStatus.php b/src/Types/TenantsCreate200ResponseTenantStatus.php deleted file mode 100644 index 4eb9d494..00000000 --- a/src/Types/TenantsCreate200ResponseTenantStatus.php +++ /dev/null @@ -1,9 +0,0 @@ -tenant = $values['tenant']; + $this->created = $values['created']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreateResponseTenant.php b/src/Types/TenantsCreateResponseTenant.php new file mode 100644 index 00000000..d39f1691 --- /dev/null +++ b/src/Types/TenantsCreateResponseTenant.php @@ -0,0 +1,77 @@ + $status + */ + #[JsonProperty('status')] + public ?string $status; + + /** + * @var ?array $features + */ + #[JsonProperty('features'), ArrayType([TenantFeature::class])] + public ?array $features; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @param array{ + * id: string, + * name: string, + * autoProvisioned: bool, + * createdAt: DateTime, + * status?: ?value-of, + * features?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->status = $values['status'] ?? null; + $this->features = $values['features'] ?? null; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsCreateResponseTenantStatus.php b/src/Types/TenantsCreateResponseTenantStatus.php new file mode 100644 index 00000000..2e847aca --- /dev/null +++ b/src/Types/TenantsCreateResponseTenantStatus.php @@ -0,0 +1,9 @@ +tenant = $values['tenant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsGet200ResponseTenant.php b/src/Types/TenantsGet200ResponseTenant.php deleted file mode 100644 index c8417279..00000000 --- a/src/Types/TenantsGet200ResponseTenant.php +++ /dev/null @@ -1,75 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public ?string $status; - - /** - * @var ?array $features - */ - #[JsonProperty('features'), ArrayType([TenantFeature::class])] - public ?array $features; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @param array{ - * id: string, - * name: string, - * autoProvisioned: bool, - * createdAt: float, - * status?: ?value-of, - * features?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->name = $values['name']; - $this->autoProvisioned = $values['autoProvisioned']; - $this->status = $values['status'] ?? null; - $this->features = $values['features'] ?? null; - $this->createdAt = $values['createdAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsGet200ResponseTenantStatus.php b/src/Types/TenantsGet200ResponseTenantStatus.php deleted file mode 100644 index bc3d2504..00000000 --- a/src/Types/TenantsGet200ResponseTenantStatus.php +++ /dev/null @@ -1,9 +0,0 @@ -tenant = $values['tenant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGetResponseTenant.php b/src/Types/TenantsGetResponseTenant.php new file mode 100644 index 00000000..75a1d8d7 --- /dev/null +++ b/src/Types/TenantsGetResponseTenant.php @@ -0,0 +1,77 @@ + $status + */ + #[JsonProperty('status')] + public ?string $status; + + /** + * @var ?array $features + */ + #[JsonProperty('features'), ArrayType([TenantFeature::class])] + public ?array $features; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @param array{ + * id: string, + * name: string, + * autoProvisioned: bool, + * createdAt: DateTime, + * status?: ?value-of, + * features?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->status = $values['status'] ?? null; + $this->features = $values['features'] ?? null; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsGetResponseTenantStatus.php b/src/Types/TenantsGetResponseTenantStatus.php new file mode 100644 index 00000000..24c937d4 --- /dev/null +++ b/src/Types/TenantsGetResponseTenantStatus.php @@ -0,0 +1,9 @@ + $tenants - */ - #[JsonProperty('tenants'), ArrayType([TenantsList200ResponseTenantsItem::class])] - public array $tenants; - - /** - * @var ?string $nextCursor - */ - #[JsonProperty('nextCursor')] - public ?string $nextCursor; - - /** - * @param array{ - * tenants: array, - * nextCursor?: ?string, - * } $values - */ - public function __construct( - array $values, - ) { - $this->tenants = $values['tenants']; - $this->nextCursor = $values['nextCursor'] ?? null; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsList200ResponseTenantsItem.php b/src/Types/TenantsList200ResponseTenantsItem.php deleted file mode 100644 index 55898aeb..00000000 --- a/src/Types/TenantsList200ResponseTenantsItem.php +++ /dev/null @@ -1,75 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public ?string $status; - - /** - * @var ?array $features - */ - #[JsonProperty('features'), ArrayType([TenantFeature::class])] - public ?array $features; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @param array{ - * id: string, - * name: string, - * autoProvisioned: bool, - * createdAt: float, - * status?: ?value-of, - * features?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->name = $values['name']; - $this->autoProvisioned = $values['autoProvisioned']; - $this->status = $values['status'] ?? null; - $this->features = $values['features'] ?? null; - $this->createdAt = $values['createdAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsList200ResponseTenantsItemStatus.php b/src/Types/TenantsList200ResponseTenantsItemStatus.php deleted file mode 100644 index cf4b0f87..00000000 --- a/src/Types/TenantsList200ResponseTenantsItemStatus.php +++ /dev/null @@ -1,9 +0,0 @@ - $tenants + */ + #[JsonProperty('tenants'), ArrayType([TenantsListResponseTenantsItem::class])] + public array $tenants; + + /** + * @var ?string $nextCursor + */ + #[JsonProperty('nextCursor')] + public ?string $nextCursor; + + /** + * @param array{ + * tenants: array, + * nextCursor?: ?string, + * } $values + */ + public function __construct( + array $values, + ) { + $this->tenants = $values['tenants']; + $this->nextCursor = $values['nextCursor'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsListResponseTenantsItem.php b/src/Types/TenantsListResponseTenantsItem.php new file mode 100644 index 00000000..6edd868f --- /dev/null +++ b/src/Types/TenantsListResponseTenantsItem.php @@ -0,0 +1,77 @@ + $status + */ + #[JsonProperty('status')] + public ?string $status; + + /** + * @var ?array $features + */ + #[JsonProperty('features'), ArrayType([TenantFeature::class])] + public ?array $features; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @param array{ + * id: string, + * name: string, + * autoProvisioned: bool, + * createdAt: DateTime, + * status?: ?value-of, + * features?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->status = $values['status'] ?? null; + $this->features = $values['features'] ?? null; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsListResponseTenantsItemStatus.php b/src/Types/TenantsListResponseTenantsItemStatus.php new file mode 100644 index 00000000..a8c7daae --- /dev/null +++ b/src/Types/TenantsListResponseTenantsItemStatus.php @@ -0,0 +1,9 @@ +tenant = $values['tenant']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUpdate200ResponseTenant.php b/src/Types/TenantsUpdate200ResponseTenant.php deleted file mode 100644 index 42ced47a..00000000 --- a/src/Types/TenantsUpdate200ResponseTenant.php +++ /dev/null @@ -1,75 +0,0 @@ - $status - */ - #[JsonProperty('status')] - public ?string $status; - - /** - * @var ?array $features - */ - #[JsonProperty('features'), ArrayType([TenantFeature::class])] - public ?array $features; - - /** - * @var float $createdAt - */ - #[JsonProperty('createdAt')] - public float $createdAt; - - /** - * @param array{ - * id: string, - * name: string, - * autoProvisioned: bool, - * createdAt: float, - * status?: ?value-of, - * features?: ?array, - * } $values - */ - public function __construct( - array $values, - ) { - $this->id = $values['id']; - $this->name = $values['name']; - $this->autoProvisioned = $values['autoProvisioned']; - $this->status = $values['status'] ?? null; - $this->features = $values['features'] ?? null; - $this->createdAt = $values['createdAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUpdate200ResponseTenantStatus.php b/src/Types/TenantsUpdate200ResponseTenantStatus.php deleted file mode 100644 index eb719a5c..00000000 --- a/src/Types/TenantsUpdate200ResponseTenantStatus.php +++ /dev/null @@ -1,9 +0,0 @@ -tenant = $values['tenant']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsUpdateResponseTenant.php b/src/Types/TenantsUpdateResponseTenant.php new file mode 100644 index 00000000..bd365a3a --- /dev/null +++ b/src/Types/TenantsUpdateResponseTenant.php @@ -0,0 +1,77 @@ + $status + */ + #[JsonProperty('status')] + public ?string $status; + + /** + * @var ?array $features + */ + #[JsonProperty('features'), ArrayType([TenantFeature::class])] + public ?array $features; + + /** + * @var DateTime $createdAt + */ + #[JsonProperty('createdAt'), Date(Date::TYPE_DATETIME)] + public DateTime $createdAt; + + /** + * @param array{ + * id: string, + * name: string, + * autoProvisioned: bool, + * createdAt: DateTime, + * status?: ?value-of, + * features?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->id = $values['id']; + $this->name = $values['name']; + $this->autoProvisioned = $values['autoProvisioned']; + $this->status = $values['status'] ?? null; + $this->features = $values['features'] ?? null; + $this->createdAt = $values['createdAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsUpdateResponseTenantStatus.php b/src/Types/TenantsUpdateResponseTenantStatus.php new file mode 100644 index 00000000..ecd2c29e --- /dev/null +++ b/src/Types/TenantsUpdateResponseTenantStatus.php @@ -0,0 +1,9 @@ +tenantId = $values['tenantId']; - $this->periodStart = $values['periodStart']; - $this->periodEnd = $values['periodEnd']; - $this->metrics = $values['metrics']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsage200ResponseMetrics.php b/src/Types/TenantsUsage200ResponseMetrics.php deleted file mode 100644 index 9c015d6a..00000000 --- a/src/Types/TenantsUsage200ResponseMetrics.php +++ /dev/null @@ -1,50 +0,0 @@ -pdfViews = $values['pdfViews']; - $this->pdfUploads = $values['pdfUploads']; - $this->storageBytes = $values['storageBytes']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TenantsUsageResponse.php b/src/Types/TenantsUsageResponse.php new file mode 100644 index 00000000..8a327d84 --- /dev/null +++ b/src/Types/TenantsUsageResponse.php @@ -0,0 +1,67 @@ + $moduleMeters + */ + #[JsonProperty('moduleMeters'), ArrayType(['string' => 'integer'])] + public array $moduleMeters; + + /** + * @param array{ + * tenantId: string, + * periodStart: string, + * periodEnd: string, + * metrics: TenantsUsageResponseMetrics, + * moduleMeters: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->tenantId = $values['tenantId']; + $this->periodStart = $values['periodStart']; + $this->periodEnd = $values['periodEnd']; + $this->metrics = $values['metrics']; + $this->moduleMeters = $values['moduleMeters']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TenantsUsageResponseMetrics.php b/src/Types/TenantsUsageResponseMetrics.php new file mode 100644 index 00000000..2fc3afb3 --- /dev/null +++ b/src/Types/TenantsUsageResponseMetrics.php @@ -0,0 +1,50 @@ +pdfViews = $values['pdfViews']; + $this->pdfUploads = $values['pdfUploads']; + $this->storageBytes = $values['storageBytes']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/TokensIssue200Response.php b/src/Types/TokensIssue200Response.php deleted file mode 100644 index ae3661e9..00000000 --- a/src/Types/TokensIssue200Response.php +++ /dev/null @@ -1,50 +0,0 @@ -token = $values['token']; - $this->jti = $values['jti']; - $this->expiresAt = $values['expiresAt']; - } - - /** - * @return string - */ - public function __toString(): string - { - return $this->toJson(); - } -} diff --git a/src/Types/TokensIssueRequestDoc.php b/src/Types/TokensIssueRequestDoc.php index b0f33c0f..b4928410 100644 --- a/src/Types/TokensIssueRequestDoc.php +++ b/src/Types/TokensIssueRequestDoc.php @@ -45,17 +45,17 @@ class TokensIssueRequestDoc extends JsonSerializableType public ?array $origins; /** - * @var int $expiresIn + * @var int $expiresInSeconds */ - #[JsonProperty('expiresIn')] - public int $expiresIn; + #[JsonProperty('expiresInSeconds')] + public int $expiresInSeconds; /** * @param array{ * sub: string, * docId: string, * scope: array, - * expiresIn: int, + * expiresInSeconds: int, * layerName?: ?string, * identity?: ?Identity, * origins?: ?array, @@ -70,7 +70,7 @@ public function __construct( $this->scope = $values['scope']; $this->identity = $values['identity'] ?? null; $this->origins = $values['origins'] ?? null; - $this->expiresIn = $values['expiresIn']; + $this->expiresInSeconds = $values['expiresInSeconds']; } /** diff --git a/src/Types/TokensIssueRequestTenant.php b/src/Types/TokensIssueRequestTenant.php index 195abd10..fbdc802f 100644 --- a/src/Types/TokensIssueRequestTenant.php +++ b/src/Types/TokensIssueRequestTenant.php @@ -21,16 +21,16 @@ class TokensIssueRequestTenant extends JsonSerializableType public array $scope; /** - * @var int $expiresIn + * @var int $expiresInSeconds */ - #[JsonProperty('expiresIn')] - public int $expiresIn; + #[JsonProperty('expiresInSeconds')] + public int $expiresInSeconds; /** * @param array{ * sub: string, * scope: array, - * expiresIn: int, + * expiresInSeconds: int, * } $values */ public function __construct( @@ -38,7 +38,7 @@ public function __construct( ) { $this->sub = $values['sub']; $this->scope = $values['scope']; - $this->expiresIn = $values['expiresIn']; + $this->expiresInSeconds = $values['expiresInSeconds']; } /** diff --git a/src/Types/TokensIssueRequestUpload.php b/src/Types/TokensIssueRequestUpload.php index 73bb311c..9bd419e8 100644 --- a/src/Types/TokensIssueRequestUpload.php +++ b/src/Types/TokensIssueRequestUpload.php @@ -45,15 +45,15 @@ class TokensIssueRequestUpload extends JsonSerializableType public ?array $origins; /** - * @var int $expiresIn + * @var int $expiresInSeconds */ - #[JsonProperty('expiresIn')] - public int $expiresIn; + #[JsonProperty('expiresInSeconds')] + public int $expiresInSeconds; /** * @param array{ * sub: string, - * expiresIn: int, + * expiresInSeconds: int, * folderId?: ?string, * metadata?: ?array, * maxFiles?: ?int, @@ -70,7 +70,7 @@ public function __construct( $this->maxFiles = $values['maxFiles'] ?? null; $this->maxBytes = $values['maxBytes'] ?? null; $this->origins = $values['origins'] ?? null; - $this->expiresIn = $values['expiresIn']; + $this->expiresInSeconds = $values['expiresInSeconds']; } /** diff --git a/src/Types/TokensIssueResponse.php b/src/Types/TokensIssueResponse.php new file mode 100644 index 00000000..63a2b362 --- /dev/null +++ b/src/Types/TokensIssueResponse.php @@ -0,0 +1,52 @@ +token = $values['token']; + $this->jti = $values['jti']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/WidgetAnnotation.php b/src/Types/WidgetAnnotation.php index 33558ae7..e5941e2e 100644 --- a/src/Types/WidgetAnnotation.php +++ b/src/Types/WidgetAnnotation.php @@ -209,10 +209,10 @@ class WidgetAnnotation extends JsonSerializableType public WidgetAnnotationBox $box; /** - * @var ?float $rotation + * @var ?int $rotation */ #[JsonProperty('rotation')] - public ?float $rotation; + public ?int $rotation; /** * @var ?string $color @@ -287,10 +287,16 @@ class WidgetAnnotation extends JsonSerializableType public ?FormFieldRef $field; /** - * @var value-of $fieldFamily + * @var value-of $fieldKind Its field's family. A newer server can add families: read one your client doesn't know as `unknown`. */ - #[JsonProperty('fieldFamily')] - public string $fieldFamily; + #[JsonProperty('fieldKind')] + public string $fieldKind; + + /** + * @var bool $hasMark + */ + #[JsonProperty('hasMark')] + public bool $hasMark; /** * @param array{ @@ -314,7 +320,8 @@ class WidgetAnnotation extends JsonSerializableType * strokeWidth: float, * borderStyle: value-of, * textAlign: value-of, - * fieldFamily: value-of, + * fieldKind: value-of, + * hasMark: bool, * appearanceState?: ?string, * structurePosition?: ?array, * nm?: ?string, @@ -331,7 +338,7 @@ class WidgetAnnotation extends JsonSerializableType * modifiedBy?: ?string, * importedBy?: ?string, * actions?: ?PdfAnnotationActions, - * rotation?: ?float, + * rotation?: ?int, * color?: ?string, * interiorColor?: ?string, * dashArray?: ?array, @@ -392,7 +399,8 @@ public function __construct( $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; $this->field = $values['field'] ?? null; - $this->fieldFamily = $values['fieldFamily']; + $this->fieldKind = $values['fieldKind']; + $this->hasMark = $values['hasMark']; } /** diff --git a/src/Types/WidgetAnnotationFieldFamily.php b/src/Types/WidgetAnnotationFieldFamily.php deleted file mode 100644 index 409e13dc..00000000 --- a/src/Types/WidgetAnnotationFieldFamily.php +++ /dev/null @@ -1,15 +0,0 @@ -, * field?: mixed, - * fieldFamily?: mixed, + * fieldKind?: mixed, + * hasMark?: mixed, * } $values */ public function __construct( @@ -399,7 +406,8 @@ public function __construct( $this->caption = $values['caption'] ?? null; $this->checkStyle = $values['checkStyle'] ?? null; $this->field = $values['field'] ?? null; - $this->fieldFamily = $values['fieldFamily'] ?? null; + $this->fieldKind = $values['fieldKind'] ?? null; + $this->hasMark = $values['hasMark'] ?? null; } /** diff --git a/src/Types/WidgetPlacement.php b/src/Types/WidgetPlacement.php index a5cc86fa..dfb12867 100644 --- a/src/Types/WidgetPlacement.php +++ b/src/Types/WidgetPlacement.php @@ -27,10 +27,10 @@ class WidgetPlacement extends JsonSerializableType public ?WidgetPlacementBox $box; /** - * @var ?float $rotation + * @var ?int $rotation */ #[JsonProperty('rotation')] - public ?float $rotation; + public ?int $rotation; /** * @var ?string $exportValue @@ -115,7 +115,7 @@ class WidgetPlacement extends JsonSerializableType * page: PageRef, * rect?: ?WidgetPlacementRect, * box?: ?WidgetPlacementBox, - * rotation?: ?float, + * rotation?: ?int, * exportValue?: ?string, * actions?: ?WidgetActionsPatch, * color?: ?string, diff --git a/tests/Core/Client/RawClientTest.php b/tests/Core/Client/RawClientTest.php index 2d2f144f..45ca8631 100644 --- a/tests/Core/Client/RawClientTest.php +++ b/tests/Core/Client/RawClientTest.php @@ -2,6 +2,7 @@ namespace CloudPDF\Tests\Core\Client; +use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\RequestInterface; @@ -140,6 +141,38 @@ public function testEncodedPathParamDoesNotTraverse(): void ); } + /** + * @throws ClientExceptionInterface + */ + public function testRejectsDotSegmentPaths(): void + { + foreach (['/plants/..', '/plants/./leaves', '/plants/../leaves/L1', '/plants/%2e%2E/leaves'] as $path) { + $request = new JsonApiRequest($this->baseUrl, $path, HttpMethod::DELETE); + try { + $this->rawClient->sendRequest($request); + $this->fail("Expected InvalidArgumentException for path {$path}"); + } catch (InvalidArgumentException $e) { + $this->assertStringContainsString('path segments are not allowed', $e->getMessage()); + } + } + $this->assertNull($this->mockClient->getLastRequest()); + } + + /** + * @throws ClientExceptionInterface + */ + public function testAllowsPathSegmentsContainingDots(): void + { + $this->mockClient->append(self::createResponse(200)); + + $request = new JsonApiRequest($this->baseUrl, '/plants/v1.2/...', HttpMethod::GET); + $this->rawClient->sendRequest($request); + + $lastRequest = $this->mockClient->getLastRequest(); + $this->assertInstanceOf(RequestInterface::class, $lastRequest); + $this->assertEquals('https://api.example.com/plants/v1.2/...', (string)$lastRequest->getUri()); + } + /** * @throws ClientExceptionInterface */ diff --git a/tests/Core/Json/NullPropertyTest.php b/tests/Core/Json/NullPropertyTest.php index 84d85a26..aa1eb0c1 100644 --- a/tests/Core/Json/NullPropertyTest.php +++ b/tests/Core/Json/NullPropertyTest.php @@ -2,9 +2,12 @@ namespace CloudPDF\Tests\Core\Json; +use DateTime; use PHPUnit\Framework\TestCase; +use JsonException; use CloudPDF\Core\Json\JsonProperty; use CloudPDF\Core\Json\JsonSerializableType; +use CloudPDF\Core\Types\Date; class NullProperty extends JsonSerializableType { @@ -20,10 +23,24 @@ class NullProperty extends JsonSerializableType #[JsonProperty('null_property')] public ?string $nullProperty; + /** + * @var DateTime|null $nullDate + */ + #[JsonProperty('null_date'), Date(Date::TYPE_DATE)] + public ?DateTime $nullDate; + + /** + * @var DateTime|null $nullDateTime + */ + #[JsonProperty('null_datetime'), Date(Date::TYPE_DATETIME)] + public ?DateTime $nullDateTime; + /** * @param array{ * nonNullProperty: string, * nullProperty?: string|null, + * nullDate?: DateTime|null, + * nullDateTime?: DateTime|null, * } $values */ public function __construct( @@ -31,6 +48,8 @@ public function __construct( ) { $this->nonNullProperty = $values['nonNullProperty']; $this->nullProperty = $values['nullProperty'] ?? null; + $this->nullDate = $values['nullDate'] ?? null; + $this->nullDateTime = $values['nullDateTime'] ?? null; } } @@ -50,4 +69,34 @@ public function testNullPropertiesAreOmitted(): void $this->assertArrayNotHasKey('null_property', $serialized, 'null_property should be omitted from the serialized JSON.'); $this->assertEquals('Test String', $serialized['non_null_property'], 'non_null_property should have the correct value.'); } + + public function testNullDatePropertiesDeserialize(): void + { + $object = NullProperty::fromJson('{"non_null_property": "Test String", "null_date": null, "null_datetime": null}'); + $this->assertEquals('Test String', $object->nonNullProperty); + $this->assertNull($object->nullDate, 'null_date should deserialize to null.'); + $this->assertNull($object->nullDateTime, 'null_datetime should deserialize to null.'); + } + + public function testMissingDatePropertiesDeserialize(): void + { + $object = NullProperty::fromJson('{"non_null_property": "Test String"}'); + $this->assertNull($object->nullDate, 'Omitted null_date should deserialize to null.'); + $this->assertNull($object->nullDateTime, 'Omitted null_datetime should deserialize to null.'); + } + + public function testNonNullDatePropertiesDeserialize(): void + { + $object = NullProperty::fromJson('{"non_null_property": "Test String", "null_date": "2023-01-01", "null_datetime": "2023-01-01T12:00:00Z"}'); + $this->assertInstanceOf(DateTime::class, $object->nullDate); + $this->assertEquals('2023-01-01', $object->nullDate->format('Y-m-d')); + $this->assertInstanceOf(DateTime::class, $object->nullDateTime); + $this->assertEquals('2023-01-01T12:00:00+00:00', $object->nullDateTime->format(DateTime::ATOM)); + } + + public function testInvalidDatePropertyThrows(): void + { + $this->expectException(JsonException::class); + NullProperty::fromJson('{"non_null_property": "Test String", "null_datetime": 12345}'); + } }