diff --git a/.fern/metadata.json b/.fern/metadata.json index 0734e705..7d035a7f 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "e074ee8465006a168ff6d8cfa73928df13ae159c", + "originGitCommit": "4b156274cbffac1a19f266d36d27b4ed07bf2b53", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.2.0", + "requestedVersion": "3.3.0", "ciProvider": "github", - "sdkVersion": "3.2.0" + "sdkVersion": "3.3.0" } \ No newline at end of file diff --git a/README.md b/README.md index 691634f0..ade7e533 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ use CloudPDF\Doc\Requests\DocChangesRequest; use CloudPDF\Doc\Types\DocChangesRequestChangesItem; $client = new CloudPDFClient( - embedPdfVersion: '3.2', + embedPdfVersion: '3.3', token: '', ); $client->doc->changes( diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 1673aac9..ab50e0d8 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.2.0", - "sdkVersion": "3.2.0", + "canonicalVersion": "3.3.0", + "sdkVersion": "3.3.0", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "92b335b44d0957c70139f64ee3dd92e19d9d3a1452c90077002ed31dbddc3e7d", - "gitCommit": "e074ee8465006a168ff6d8cfa73928df13ae159c", + "openapiSha256": "8d6fda1d157a3f3f82d3a16835381932eaa6efe3054100bb0aa63c0ad5ac6909", + "gitCommit": "4b156274cbffac1a19f266d36d27b4ed07bf2b53", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index 172c53a8..db4d2c70 100644 --- a/reference.md +++ b/reference.md @@ -5877,7 +5877,7 @@ $client->doc->signatures->analysis(
-Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. +Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A document timestamp (`kind: 'timestamp'`) may leave `field` out, since 3.3: the engine then makes a field of no size for it, under a name no other field has, and the answer names it in `field`. That needs `doc.sign` for the document. The signature is made over the layer's own base: the upload, or the version its last signature made.
@@ -5937,6 +5937,186 @@ $client->doc->signatures->prepare( + + + + +
$client->doc->signatures->validationInfo($docId, $layerName, $request) -> ?DocSignaturesValidationInfoResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each entry is one DER object, base64. It reads the layer as it is now, so entries stored and not yet sealed by a signature are among them. Arrived in 3.3. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->signatures->validationInfo( + 'docId', + 'layerName', + new ValidationInfoSignaturesRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+ +
$client->doc->signatures->addValidationInfo($docId, $layerName, $request) -> ?DocSignaturesAddValidationInfoResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Each entry is one DER object of at most 16 MiB, base64. An entry the file already holds, byte for byte, is not stored again: `added` counts the new ones. An entry that is not one DER object fails the request and nothing is stored; the error names it, as in `certificates[1]`. The server stores what it is given and asks no certificate authority: collect the answers first. It needs `doc.sign` for the document, not for a group of fields, and is refused after a certification that allows no changes. It cannot be undone, and it leaves undo for earlier changes as it was. Arrived in 3.3. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->signatures->addValidationInfo( + 'docId', + 'layerName', + new DocSignaturesAddValidationInfoRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$idempotencyKey:** `?string` — Names the change: 1 to 255 printable ASCII characters. A retry under the same key on the same layer answers with what the first request committed, and changes nothing. + +
+
+ +
+
+ +**$certificates:** `?array` + +
+
+ +
+
+ +**$ocspResponses:** `?array` + +
+
+ +
+
+ +**$crls:** `?array` + +
+
+
+
+ +
@@ -6028,7 +6208,7 @@ $client->doc->versions->list(
-Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every caller. +Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every caller. A version never changes, but the rules that judge it can: with `engine`, the `analysis` value of the layer's head, a settled answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`.
@@ -6119,7 +6299,7 @@ $client->doc->versions->analysis(
-**$policy:** `?int` +**$engine:** `?string` — The `analysis` engine value from the layer's head (`engine.analysis`): the rules the answer is judged with. With it, a settled answer is cached.
@@ -6290,6 +6470,20 @@ $client->doc->versions->revision(
+#### 📝 Description + +
+
+ +
+
+ +A version never changes, but what the server reads from it can: with `engine`, the `signatures` value of the layer's head, the answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`. +
+
+
+
+ #### 🔌 Usage
@@ -6343,6 +6537,14 @@ $client->doc->versions->signatures(
+**$engine:** `?string` — The `signatures` engine value from the layer's head (`engine.signatures`): what the answer is computed with besides the file. With it, the answer is cached. + +
+
+ +
+
+ **$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead.
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index efe1838b..11b5e3ce 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -82,11 +82,11 @@ public function __construct( ?array $options = null, ) { $defaultHeaders = [ - 'EmbedPDF-Version' => '3.2', + 'EmbedPDF-Version' => '3.3', 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.2.0', - 'User-Agent' => 'cloudpdf/sdk/3.2.0', + 'X-Fern-SDK-Version' => '3.3.0', + 'User-Agent' => 'cloudpdf/sdk/3.3.0', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Doc/Signatures/Requests/DocSignaturesAddValidationInfoRequest.php b/src/Doc/Signatures/Requests/DocSignaturesAddValidationInfoRequest.php new file mode 100644 index 00000000..3e34253b --- /dev/null +++ b/src/Doc/Signatures/Requests/DocSignaturesAddValidationInfoRequest.php @@ -0,0 +1,57 @@ + $certificates + */ + #[JsonProperty('certificates'), ArrayType(['string'])] + public ?array $certificates; + + /** + * @var ?array $ocspResponses + */ + #[JsonProperty('ocspResponses'), ArrayType(['string'])] + public ?array $ocspResponses; + + /** + * @var ?array $crls + */ + #[JsonProperty('crls'), ArrayType(['string'])] + public ?array $crls; + + /** + * @param array{ + * documentPassword?: ?string, + * idempotencyKey?: ?string, + * certificates?: ?array, + * ocspResponses?: ?array, + * crls?: ?array, + * } $values + */ + public function __construct( + array $values = [], + ) { + $this->documentPassword = $values['documentPassword'] ?? null; + $this->idempotencyKey = $values['idempotencyKey'] ?? null; + $this->certificates = $values['certificates'] ?? null; + $this->ocspResponses = $values['ocspResponses'] ?? null; + $this->crls = $values['crls'] ?? null; + } +} diff --git a/src/Doc/Signatures/Requests/ValidationInfoSignaturesRequest.php b/src/Doc/Signatures/Requests/ValidationInfoSignaturesRequest.php new file mode 100644 index 00000000..bcf238ae --- /dev/null +++ b/src/Doc/Signatures/Requests/ValidationInfoSignaturesRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Signatures/SignaturesClient.php b/src/Doc/Signatures/SignaturesClient.php index 3eeb39fb..407b5b12 100644 --- a/src/Doc/Signatures/SignaturesClient.php +++ b/src/Doc/Signatures/SignaturesClient.php @@ -23,6 +23,10 @@ use CloudPDF\Types\DocSignaturesPrepareResponse; use CloudPDF\Core\Multipart\MultipartFormData; use CloudPDF\Core\Multipart\MultipartApiRequest; +use CloudPDF\Doc\Signatures\Requests\ValidationInfoSignaturesRequest; +use CloudPDF\Types\DocSignaturesValidationInfoResponse; +use CloudPDF\Doc\Signatures\Requests\DocSignaturesAddValidationInfoRequest; +use CloudPDF\Types\DocSignaturesAddValidationInfoResponse; class SignaturesClient { @@ -337,7 +341,7 @@ public function analysis(string $docId, string $layerName, AnalysisSignaturesReq } /** - * Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). The signature is made over the layer's own base: the upload, or the version its last signature made. + * Multipart: a JSON `body` part (field, subFilter, digest, contentsSize, signer, certify, lock), naming the appearance PDF it may carry as `resources: { appearance: '' }`, and that PDF as the part `resource:`. A certification (`certify.permission`) additionally requires `doc.sign.certify`. The layer is read-only until the signing completes, is cancelled, or expires (15 minutes). A document timestamp (`kind: 'timestamp'`) may leave `field` out, since 3.3: the engine then makes a field of no size for it, under a name no other field has, and the answer names it in `field`. That needs `doc.sign` for the document. The signature is made over the layer's own base: the upload, or the version its last signature made. * * Example: * ```php @@ -403,4 +407,136 @@ public function prepare(string $docId, string $layerName, PrepareSignaturesReque body: $response->getBody()->getContents(), ); } + + /** + * Each entry is one DER object, base64. It reads the layer as it is now, so entries stored and not yet sealed by a signature are among them. Arrived in 3.3. + * + * Example: + * ```php + * $client->doc->signatures->validationInfo( + * 'docId', + * 'layerName', + * new ValidationInfoSignaturesRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param ValidationInfoSignaturesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocSignaturesValidationInfoResponse + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function validationInfo(string $docId, string $layerName, ValidationInfoSignaturesRequest $request = new ValidationInfoSignaturesRequest(), ?array $options = null): ?DocSignaturesValidationInfoResponse + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/signatures/validation-info", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocSignaturesValidationInfoResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Each entry is one DER object of at most 16 MiB, base64. An entry the file already holds, byte for byte, is not stored again: `added` counts the new ones. An entry that is not one DER object fails the request and nothing is stored; the error names it, as in `certificates[1]`. The server stores what it is given and asks no certificate authority: collect the answers first. It needs `doc.sign` for the document, not for a group of fields, and is refused after a certification that allows no changes. It cannot be undone, and it leaves undo for earlier changes as it was. Arrived in 3.3. + * + * Example: + * ```php + * $client->doc->signatures->addValidationInfo( + * 'docId', + * 'layerName', + * new DocSignaturesAddValidationInfoRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param DocSignaturesAddValidationInfoRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocSignaturesAddValidationInfoResponse + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function addValidationInfo(string $docId, string $layerName, DocSignaturesAddValidationInfoRequest $request = new DocSignaturesAddValidationInfoRequest(), ?array $options = null): ?DocSignaturesAddValidationInfoResponse + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + if ($request->idempotencyKey != null) { + $headers['Idempotency-Key'] = $request->idempotencyKey; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Saas->value, + path: "v1/docs/{$docId}/layers/{$layerName}/signatures/validation-info", + method: HttpMethod::POST, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocSignaturesAddValidationInfoResponse::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } } diff --git a/src/Doc/Versions/Requests/AnalysisVersionsRequest.php b/src/Doc/Versions/Requests/AnalysisVersionsRequest.php index 1ae89bb8..5ba5b039 100644 --- a/src/Doc/Versions/Requests/AnalysisVersionsRequest.php +++ b/src/Doc/Versions/Requests/AnalysisVersionsRequest.php @@ -28,9 +28,9 @@ class AnalysisVersionsRequest extends JsonSerializableType public ?int $until; /** - * @var ?int $policy + * @var ?string $engine The `analysis` engine value from the layer's head (`engine.analysis`): the rules the answer is judged with. With it, a settled answer is cached. */ - public ?int $policy; + public ?string $engine; /** * @var ?string $documentPassword Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. @@ -43,7 +43,7 @@ class AnalysisVersionsRequest extends JsonSerializableType * sinceRevision?: ?int, * level?: ?value-of, * until?: ?int, - * policy?: ?int, + * engine?: ?string, * documentPassword?: ?string, * } $values */ @@ -54,7 +54,7 @@ public function __construct( $this->sinceRevision = $values['sinceRevision'] ?? null; $this->level = $values['level'] ?? null; $this->until = $values['until'] ?? null; - $this->policy = $values['policy'] ?? null; + $this->engine = $values['engine'] ?? null; $this->documentPassword = $values['documentPassword'] ?? null; } } diff --git a/src/Doc/Versions/Requests/SignaturesVersionsRequest.php b/src/Doc/Versions/Requests/SignaturesVersionsRequest.php index 5553d64a..124df86a 100644 --- a/src/Doc/Versions/Requests/SignaturesVersionsRequest.php +++ b/src/Doc/Versions/Requests/SignaturesVersionsRequest.php @@ -6,6 +6,11 @@ class SignaturesVersionsRequest extends JsonSerializableType { + /** + * @var ?string $engine The `signatures` engine value from the layer's head (`engine.signatures`): what the answer is computed with besides the file. With it, the answer is cached. + */ + public ?string $engine; + /** * @var ?string $documentPassword Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. */ @@ -13,12 +18,14 @@ class SignaturesVersionsRequest extends JsonSerializableType /** * @param array{ + * engine?: ?string, * documentPassword?: ?string, * } $values */ public function __construct( array $values = [], ) { + $this->engine = $values['engine'] ?? null; $this->documentPassword = $values['documentPassword'] ?? null; } } diff --git a/src/Doc/Versions/VersionsClient.php b/src/Doc/Versions/VersionsClient.php index db46311f..749a370f 100644 --- a/src/Doc/Versions/VersionsClient.php +++ b/src/Doc/Versions/VersionsClient.php @@ -124,7 +124,7 @@ public function list(string $docId, string $layerName, ListVersionsRequest $requ } /** - * Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every caller. + * Exactly one of `since.signature` / `since.revision`; `until=` defaults to the last. The same answer for every caller. A version never changes, but the rules that judge it can: with `engine`, the `analysis` value of the layer's head, a settled answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`. * * Example: * ```php @@ -168,8 +168,8 @@ public function analysis(string $docId, string $layerName, string $sha256, Analy if ($request->until != null) { $query['until'] = $request->until; } - if ($request->policy != null) { - $query['policy'] = $request->policy; + if ($request->engine != null) { + $query['engine'] = $request->engine; } $headers = []; if ($request->documentPassword != null) { @@ -325,6 +325,8 @@ public function revision(string $docId, string $layerName, string $sha256, int $ } /** + * A version never changes, but what the server reads from it can: with `engine`, the `signatures` value of the layer's head, the answer is `immutable`. Without it, or with another value, the answer is this server's own, with `no-store` and the current value in `EmbedPDF-Engine`. + * * Example: * ```php * $client->doc->versions->signatures( @@ -354,6 +356,10 @@ public function revision(string $docId, string $layerName, string $sha256, int $ public function signatures(string $docId, string $layerName, string $sha256, SignaturesVersionsRequest $request = new SignaturesVersionsRequest(), ?array $options = null): ?DocVersionsSignaturesResponse { $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->engine != null) { + $query['engine'] = $request->engine; + } $headers = []; if ($request->documentPassword != null) { $headers['X-Document-Password'] = $request->documentPassword; @@ -365,6 +371,7 @@ public function signatures(string $docId, string $layerName, string $sha256, Sig path: "v1/docs/{$docId}/layers/{$layerName}/versions/signatures/{$sha256}", method: HttpMethod::GET, headers: $headers, + query: $query, ), $options, ); diff --git a/src/Types/DocSignaturesAddValidationInfoResponse.php b/src/Types/DocSignaturesAddValidationInfoResponse.php new file mode 100644 index 00000000..d9d89319 --- /dev/null +++ b/src/Types/DocSignaturesAddValidationInfoResponse.php @@ -0,0 +1,42 @@ +added = $values['added']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesAddValidationInfoResponseAdded.php b/src/Types/DocSignaturesAddValidationInfoResponseAdded.php new file mode 100644 index 00000000..8a8341c3 --- /dev/null +++ b/src/Types/DocSignaturesAddValidationInfoResponseAdded.php @@ -0,0 +1,50 @@ +certificates = $values['certificates']; + $this->ocspResponses = $values['ocspResponses']; + $this->crls = $values['crls']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocSignaturesPrepareResponse.php b/src/Types/DocSignaturesPrepareResponse.php index b03f12fc..79f14883 100644 --- a/src/Types/DocSignaturesPrepareResponse.php +++ b/src/Types/DocSignaturesPrepareResponse.php @@ -58,6 +58,12 @@ class DocSignaturesPrepareResponse extends JsonSerializableType #[JsonProperty('expiresAt'), Date(Date::TYPE_DATETIME)] public ?DateTime $expiresAt; + /** + * @var ?FormFieldRef $field + */ + #[JsonProperty('field')] + public ?FormFieldRef $field; + /** * @param array{ * signingId: string, @@ -68,6 +74,7 @@ class DocSignaturesPrepareResponse extends JsonSerializableType * subFilter: string, * expectedVersion: DocSignaturesPrepareResponseExpectedVersion, * expiresAt?: ?DateTime, + * field?: ?FormFieldRef, * } $values */ public function __construct( @@ -81,6 +88,7 @@ public function __construct( $this->subFilter = $values['subFilter']; $this->expectedVersion = $values['expectedVersion']; $this->expiresAt = $values['expiresAt'] ?? null; + $this->field = $values['field'] ?? null; } /** diff --git a/src/Types/DocSignaturesValidationInfoResponse.php b/src/Types/DocSignaturesValidationInfoResponse.php new file mode 100644 index 00000000..cd863a91 --- /dev/null +++ b/src/Types/DocSignaturesValidationInfoResponse.php @@ -0,0 +1,51 @@ + $certificates + */ + #[JsonProperty('certificates'), ArrayType(['string'])] + public array $certificates; + + /** + * @var array $ocspResponses + */ + #[JsonProperty('ocspResponses'), ArrayType(['string'])] + public array $ocspResponses; + + /** + * @var array $crls + */ + #[JsonProperty('crls'), ArrayType(['string'])] + public array $crls; + + /** + * @param array{ + * certificates: array, + * ocspResponses: array, + * crls: array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->certificates = $values['certificates']; + $this->ocspResponses = $values['ocspResponses']; + $this->crls = $values['crls']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +}