diff --git a/.fern/metadata.json b/.fern/metadata.json index 29c44a1e..f8841114 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "7ded7de29f4cc0dc9da18042fca6afd5c9557bfc", + "originGitCommit": "07aa3f26c82243b36a5ec94f7072130c7298d977", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.16", + "requestedVersion": "3.0.0-alpha.17", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.16" + "sdkVersion": "3.0.0-alpha.17" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 2f13edb3..856a4205 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.16", - "sdkVersion": "3.0.0-alpha.16", + "canonicalVersion": "3.0.0-next.17", + "sdkVersion": "3.0.0-alpha.17", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "06543c26918bd79d426bf242c5a3091cdb7d298d3ac3296addabee2be80edb15", - "gitCommit": "7ded7de29f4cc0dc9da18042fca6afd5c9557bfc", + "openapiSha256": "8fa53cef2776eb0de9ec50c263aa547b309a04d1a2ecb6ee54b6338d6698dc00", + "gitCommit": "07aa3f26c82243b36a5ec94f7072130c7298d977", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index c5f923b5..f08927f4 100644 --- a/reference.md +++ b/reference.md @@ -221,6 +221,88 @@ $client->doc->download( + + + + +
$client->doc->downloadLink($docId, $layerName, $request) -> ?DocDownloadLink200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +The link opens the layer as it is when created: once the layer changes, it answers 404, so create it right before handing it over. It downloads that one file and nothing else, and a password-protected document is checked when the link is created. Deployments that verify tokens with their own keys (JWKS) mint links on their backend: a doc token with `layer_name`, a `download: { docVersion, mode: "incremental" }` claim and a short `exp`, passed as `link` on the versioned download URL. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->downloadLink( + 'docId', + 'layerName', + new DocDownloadLinkRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ 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. + +
+
+ +
+
+ +**$expiresIn:** `?int` + +
+
+
+
+ +
@@ -450,7 +532,7 @@ $client->doc->text(
-Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. Mounted only when the deployment can sign (HS256 mode). +Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. A link that asks its visitors who they are on open returns 422 VisitorIdentityRequired until the required answers are given; `error.details` carries `fields` (what the link asks), `missing`, `invalid`, `purpose` and `privacyUrl`. A link that asks before the first change issues the session at once with `visitor.identityRequest`, and writes answer 403 VisitorIdentityRequired with the same details until the visitor exchanges again with their answers. Answers that can not be taken answer 422 on any link. Mounted only when the deployment can sign (HS256 mode).
@@ -494,6 +576,30 @@ $client->shares->exchange( **$password:** `?string` + + + +
+
+ +**$visitorHandle:** `?string` + +
+
+ +
+
+ +**$restart:** `?bool` + +
+
+ +
+
+ +**$visitorIdentity:** `?SharesExchangeRequestVisitorIdentity` +
@@ -561,6 +667,14 @@ $client->shares->list( **$docId:** `?string` + + + +
+
+ +**$archived:** `?bool` +
@@ -637,6 +751,14 @@ $client->shares->create(
+**$layerMode:** `?string` + +
+
+ +
+
+ **$layerName:** `?string`
@@ -645,6 +767,30 @@ $client->shares->create(
+**$keepVisitorLayers:** `?bool` + +
+
+ +
+
+ +**$visitorIdleSeconds:** `?int` + +
+
+ +
+
+ +**$visitorIdentity:** `?SharesCreateRequestVisitorIdentity` + +
+
+ +
+
+ **$scope:** `array`
@@ -839,6 +985,46 @@ $client->shares->update(
+**$layerMode:** `?string` + +
+
+ +
+
+ +**$layerName:** `?string` + +
+
+ +
+
+ +**$keepVisitorLayers:** `?bool` + +
+
+ +
+
+ +**$visitorIdleSeconds:** `?int` + +
+
+ +
+
+ +**$visitorIdentity:** `?SharesUpdateRequestVisitorIdentity` + +
+
+ +
+
+ **$scope:** `?array`
@@ -887,6 +1073,71 @@ $client->shares->update(
+ +
+ + +
$client->shares->archive($tenantId, $shareId) -> ?SharesArchive200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Archiving is final: an archived link never exchanges again, and to share again you create a new link. Pausing (`disabled`) is the reversible stop. An archived link no longer counts as using its shared layer, so that layer can be deleted. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->shares->archive( + 'tenantId', + 'shareId', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$shareId:** `string` + +
+
+
+
+ +
@@ -5406,3 +5657,297 @@ $client->doc->metadata->custom->get(
+## Documents Layers +
$client->documents->layers->list($tenantId, $id, $request) -> ?DocumentsLayersList200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->layers->list( + 'tenantId', + 'id', + new ListLayersRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$cursor:** `?string` + +
+
+ +
+
+ +**$shareId:** `?string` + +
+
+
+
+ + +
+
+
+ +
$client->documents->layers->delete($tenantId, $id, $layerName) +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->documents->layers->delete( + 'tenantId', + 'id', + 'layerName', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$id:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+
+
+ + +
+
+
+ +## Shares Visitors +
$client->shares->visitors->list($tenantId, $shareId, $request) -> ?SharesVisitorsList200Response +
+
+ +#### 📝 Description + +
+
+ +
+
+ +An archived link's visitors are listed too. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->shares->visitors->list( + 'tenantId', + 'shareId', + new ListVisitorsRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$shareId:** `string` + +
+
+ +
+
+ +**$limit:** `?int` + +
+
+ +
+
+ +**$cursor:** `?string` + +
+
+
+
+ + +
+
+
+ +
$client->shares->visitors->delete($tenantId, $shareId, $visitorId) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Their handle brings them back as a new visitor, who is asked again. Deleting a visitor already deleted changes nothing. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->shares->visitors->delete( + 'tenantId', + 'shareId', + 'visitorId', +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$tenantId:** `string` + +
+
+ +
+
+ +**$shareId:** `string` + +
+
+ +
+
+ +**$visitorId:** `string` + +
+
+
+
+ + +
+
+
+ diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 20bb2e30..356ea0c5 100644 --- a/src/CloudPDFClient.php +++ b/src/CloudPDFClient.php @@ -76,8 +76,8 @@ public function __construct( $defaultHeaders = [ 'X-Fern-Language' => 'PHP', 'X-Fern-SDK-Name' => 'CloudPDF', - 'X-Fern-SDK-Version' => '3.0.0-alpha.16', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.16', + 'X-Fern-SDK-Version' => '3.0.0-alpha.17', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.17', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Doc/DocClient.php b/src/Doc/DocClient.php index 1f1dbf42..1399e25d 100644 --- a/src/Doc/DocClient.php +++ b/src/Doc/DocClient.php @@ -24,6 +24,8 @@ use CloudPDF\Doc\Requests\DocChangesRequest; use CloudPDF\Types\DocChanges200Response; use CloudPDF\Doc\Requests\DownloadDocRequest; +use CloudPDF\Doc\Requests\DocDownloadLinkRequest; +use CloudPDF\Types\DocDownloadLink200Response; use CloudPDF\Doc\Requests\ManifestDocRequest; use CloudPDF\Types\DocManifest200Response; use CloudPDF\Doc\Requests\RenderDocRequest; @@ -307,6 +309,71 @@ public function download(string $docId, string $layerName, DownloadDocRequest $r ); } + /** + * The link opens the layer as it is when created: once the layer changes, it answers 404, so create it right before handing it over. It downloads that one file and nothing else, and a password-protected document is checked when the link is created. Deployments that verify tokens with their own keys (JWKS) mint links on their backend: a doc token with `layer_name`, a `download: { docVersion, mode: "incremental" }` claim and a short `exp`, passed as `link` on the versioned download URL. + * + * Example: + * ```php + * $client->doc->downloadLink( + * 'docId', + * 'layerName', + * new DocDownloadLinkRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param DocDownloadLinkRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocDownloadLink200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function downloadLink(string $docId, string $layerName, DocDownloadLinkRequest $request = new DocDownloadLinkRequest(), ?array $options = null): ?DocDownloadLink200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/download-link", + 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 DocDownloadLink200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + /** * Example: * ```php diff --git a/src/Doc/Requests/DocDownloadLinkRequest.php b/src/Doc/Requests/DocDownloadLinkRequest.php new file mode 100644 index 00000000..d49b179b --- /dev/null +++ b/src/Doc/Requests/DocDownloadLinkRequest.php @@ -0,0 +1,33 @@ +documentPassword = $values['documentPassword'] ?? null; + $this->expiresIn = $values['expiresIn'] ?? null; + } +} diff --git a/src/Documents/DocumentsClient.php b/src/Documents/DocumentsClient.php index b74a0e5a..009faa6f 100644 --- a/src/Documents/DocumentsClient.php +++ b/src/Documents/DocumentsClient.php @@ -2,6 +2,7 @@ namespace CloudPDF\Documents; +use CloudPDF\Documents\Layers\LayersClient; use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Documents\Requests\ListDocumentsRequest; @@ -26,6 +27,11 @@ class DocumentsClient { + /** + * @var LayersClient $layers + */ + public LayersClient $layers; + /** * @var array{ * baseUrl?: string, @@ -58,6 +64,7 @@ public function __construct( ) { $this->client = $client; $this->options = $options ?? []; + $this->layers = new LayersClient($this->client, $this->options); } /** diff --git a/src/Documents/Layers/LayersClient.php b/src/Documents/Layers/LayersClient.php new file mode 100644 index 00000000..c22a1709 --- /dev/null +++ b/src/Documents/Layers/LayersClient.php @@ -0,0 +1,169 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * Example: + * ```php + * $client->documents->layers->list( + * 'tenantId', + * 'id', + * new ListLayersRequest([]), + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param ListLayersRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocumentsLayersList200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function list(string $tenantId, string $id, ListLayersRequest $request = new ListLayersRequest(), ?array $options = null): ?DocumentsLayersList200Response + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->cursor != null) { + $query['cursor'] = $request->cursor; + } + if ($request->shareId != null) { + $query['shareId'] = $request->shareId; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/layers", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocumentsLayersList200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->documents->layers->delete( + * 'tenantId', + * 'id', + * 'layerName', + * ); + * ``` + * + * @param string $tenantId + * @param string $id + * @param string $layerName + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function delete(string $tenantId, string $id, 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'] ?? '', + path: "v1/tenants/{$tenantId}/documents/{$id}/layers/{$layerName}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Documents/Layers/Requests/ListLayersRequest.php b/src/Documents/Layers/Requests/ListLayersRequest.php new file mode 100644 index 00000000..0538addf --- /dev/null +++ b/src/Documents/Layers/Requests/ListLayersRequest.php @@ -0,0 +1,38 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + $this->shareId = $values['shareId'] ?? null; + } +} diff --git a/src/Shares/Requests/ListSharesRequest.php b/src/Shares/Requests/ListSharesRequest.php index a89c4f3a..dea6c6b8 100644 --- a/src/Shares/Requests/ListSharesRequest.php +++ b/src/Shares/Requests/ListSharesRequest.php @@ -21,11 +21,17 @@ class ListSharesRequest extends JsonSerializableType */ public ?string $docId; + /** + * @var ?bool $archived + */ + public ?bool $archived; + /** * @param array{ * limit?: ?int, * cursor?: ?string, * docId?: ?string, + * archived?: ?bool, * } $values */ public function __construct( @@ -34,5 +40,6 @@ public function __construct( $this->limit = $values['limit'] ?? null; $this->cursor = $values['cursor'] ?? null; $this->docId = $values['docId'] ?? null; + $this->archived = $values['archived'] ?? null; } } diff --git a/src/Shares/Requests/SharesCreateRequest.php b/src/Shares/Requests/SharesCreateRequest.php index 65c83b84..7f76021f 100644 --- a/src/Shares/Requests/SharesCreateRequest.php +++ b/src/Shares/Requests/SharesCreateRequest.php @@ -4,6 +4,8 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Shares\Types\SharesCreateRequestLayerMode; +use CloudPDF\Shares\Types\SharesCreateRequestVisitorIdentity; use CloudPDF\Core\Types\ArrayType; class SharesCreateRequest extends JsonSerializableType @@ -14,12 +16,36 @@ class SharesCreateRequest extends JsonSerializableType #[JsonProperty('docId')] public string $docId; + /** + * @var ?value-of $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 ?SharesCreateRequestVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesCreateRequestVisitorIdentity $visitorIdentity; + /** * @var array $scope */ @@ -54,7 +80,11 @@ class SharesCreateRequest extends JsonSerializableType * @param array{ * docId: string, * scope: array, + * layerMode?: ?value-of, * layerName?: ?string, + * keepVisitorLayers?: ?bool, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?SharesCreateRequestVisitorIdentity, * origins?: ?array, * password?: ?string, * sessionTtlSeconds?: ?int, @@ -65,7 +95,11 @@ public function __construct( array $values, ) { $this->docId = $values['docId']; + $this->layerMode = $values['layerMode'] ?? null; $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers'] ?? null; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope']; $this->origins = $values['origins'] ?? null; $this->password = $values['password'] ?? null; diff --git a/src/Shares/Requests/SharesExchangeRequest.php b/src/Shares/Requests/SharesExchangeRequest.php index 923cdd82..0d14548b 100644 --- a/src/Shares/Requests/SharesExchangeRequest.php +++ b/src/Shares/Requests/SharesExchangeRequest.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Shares\Types\SharesExchangeRequestVisitorIdentity; class SharesExchangeRequest extends JsonSerializableType { @@ -19,10 +20,31 @@ class SharesExchangeRequest extends JsonSerializableType #[JsonProperty('password')] public ?string $password; + /** + * @var ?string $visitorHandle + */ + #[JsonProperty('visitorHandle')] + public ?string $visitorHandle; + + /** + * @var ?bool $restart + */ + #[JsonProperty('restart')] + public ?bool $restart; + + /** + * @var ?SharesExchangeRequestVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesExchangeRequestVisitorIdentity $visitorIdentity; + /** * @param array{ * shareToken: string, * password?: ?string, + * visitorHandle?: ?string, + * restart?: ?bool, + * visitorIdentity?: ?SharesExchangeRequestVisitorIdentity, * } $values */ public function __construct( @@ -30,5 +52,8 @@ public function __construct( ) { $this->shareToken = $values['shareToken']; $this->password = $values['password'] ?? null; + $this->visitorHandle = $values['visitorHandle'] ?? null; + $this->restart = $values['restart'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; } } diff --git a/src/Shares/Requests/SharesUpdateRequest.php b/src/Shares/Requests/SharesUpdateRequest.php index 2f147fd9..6dc58369 100644 --- a/src/Shares/Requests/SharesUpdateRequest.php +++ b/src/Shares/Requests/SharesUpdateRequest.php @@ -3,11 +3,43 @@ namespace CloudPDF\Shares\Requests; use CloudPDF\Core\Json\JsonSerializableType; +use CloudPDF\Shares\Types\SharesUpdateRequestLayerMode; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Shares\Types\SharesUpdateRequestVisitorIdentity; use CloudPDF\Core\Types\ArrayType; class SharesUpdateRequest extends JsonSerializableType { + /** + * @var ?value-of $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 ?SharesUpdateRequestVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesUpdateRequestVisitorIdentity $visitorIdentity; + /** * @var ?array $scope */ @@ -46,6 +78,11 @@ class SharesUpdateRequest extends JsonSerializableType /** * @param array{ + * layerMode?: ?value-of, + * layerName?: ?string, + * keepVisitorLayers?: ?bool, + * visitorIdleSeconds?: ?int, + * visitorIdentity?: ?SharesUpdateRequestVisitorIdentity, * scope?: ?array, * origins?: ?array, * password?: ?string, @@ -57,6 +94,11 @@ class SharesUpdateRequest extends JsonSerializableType public function __construct( array $values = [], ) { + $this->layerMode = $values['layerMode'] ?? null; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers'] ?? null; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope'] ?? null; $this->origins = $values['origins'] ?? null; $this->password = $values['password'] ?? null; diff --git a/src/Shares/SharesClient.php b/src/Shares/SharesClient.php index 1eea0a6b..dd3870f9 100644 --- a/src/Shares/SharesClient.php +++ b/src/Shares/SharesClient.php @@ -2,6 +2,7 @@ namespace CloudPDF\Shares; +use CloudPDF\Shares\Visitors\VisitorsClient; use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; use CloudPDF\Shares\Requests\SharesExchangeRequest; @@ -19,9 +20,15 @@ use CloudPDF\Types\SharesGet200Response; use CloudPDF\Shares\Requests\SharesUpdateRequest; use CloudPDF\Types\SharesUpdate200Response; +use CloudPDF\Types\SharesArchive200Response; class SharesClient { + /** + * @var VisitorsClient $visitors + */ + public VisitorsClient $visitors; + /** * @var array{ * baseUrl?: string, @@ -54,10 +61,11 @@ public function __construct( ) { $this->client = $client; $this->options = $options ?? []; + $this->visitors = new VisitorsClient($this->client, $this->options); } /** - * Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. Mounted only when the deployment can sign (HS256 mode). + * Unauthenticated, but requires a browser Origin header, checked against the grant allowlist. Unknown, revoked, and disabled tokens are indistinguishable (404). Passphrase-protected grants return 422 SharePasswordRequired until `password` is supplied. A link that asks its visitors who they are on open returns 422 VisitorIdentityRequired until the required answers are given; `error.details` carries `fields` (what the link asks), `missing`, `invalid`, `purpose` and `privacyUrl`. A link that asks before the first change issues the session at once with `visitor.identityRequest`, and writes answer 403 VisitorIdentityRequired with the same details until the visitor exchanges again with their answers. Answers that can not be taken answer 422 on any link. Mounted only when the deployment can sign (HS256 mode). * * Example: * ```php @@ -150,6 +158,9 @@ public function list(string $tenantId, ListSharesRequest $request = new ListShar if ($request->docId != null) { $query['docId'] = $request->docId; } + if ($request->archived != null) { + $query['archived'] = $request->archived; + } try { $response = $this->client->sendRequest( new JsonApiRequest( @@ -403,4 +414,61 @@ public function update(string $tenantId, string $shareId, SharesUpdateRequest $r body: $response->getBody()->getContents(), ); } + + /** + * Archiving is final: an archived link never exchanges again, and to share again you create a new link. Pausing (`disabled`) is the reversible stop. An archived link no longer counts as using its shared layer, so that layer can be deleted. + * + * Example: + * ```php + * $client->shares->archive( + * 'tenantId', + * 'shareId', + * ); + * ``` + * + * @param string $tenantId + * @param string $shareId + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SharesArchive200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function archive(string $tenantId, string $shareId, ?array $options = null): ?SharesArchive200Response + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/shares/{$shareId}/archive", + method: HttpMethod::POST, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SharesArchive200Response::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/Shares/Types/SharesCreateRequestLayerMode.php b/src/Shares/Types/SharesCreateRequestLayerMode.php new file mode 100644 index 00000000..773ac0ee --- /dev/null +++ b/src/Shares/Types/SharesCreateRequestLayerMode.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: SharesCreateRequestVisitorIdentityFields, + * 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/Shares/Types/SharesCreateRequestVisitorIdentityAsk.php b/src/Shares/Types/SharesCreateRequestVisitorIdentityAsk.php new file mode 100644 index 00000000..a5b92003 --- /dev/null +++ b/src/Shares/Types/SharesCreateRequestVisitorIdentityAsk.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/Shares/Types/SharesCreateRequestVisitorIdentityFieldsDisplayName.php b/src/Shares/Types/SharesCreateRequestVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..51d33484 --- /dev/null +++ b/src/Shares/Types/SharesCreateRequestVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ +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/Shares/Types/SharesUpdateRequestLayerMode.php b/src/Shares/Types/SharesUpdateRequestLayerMode.php new file mode 100644 index 00000000..75359dd9 --- /dev/null +++ b/src/Shares/Types/SharesUpdateRequestLayerMode.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: SharesUpdateRequestVisitorIdentityFields, + * 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/Shares/Types/SharesUpdateRequestVisitorIdentityAsk.php b/src/Shares/Types/SharesUpdateRequestVisitorIdentityAsk.php new file mode 100644 index 00000000..e91ff165 --- /dev/null +++ b/src/Shares/Types/SharesUpdateRequestVisitorIdentityAsk.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/Shares/Types/SharesUpdateRequestVisitorIdentityFieldsDisplayName.php b/src/Shares/Types/SharesUpdateRequestVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..17b22031 --- /dev/null +++ b/src/Shares/Types/SharesUpdateRequestVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ +limit = $values['limit'] ?? null; + $this->cursor = $values['cursor'] ?? null; + } +} diff --git a/src/Shares/Visitors/VisitorsClient.php b/src/Shares/Visitors/VisitorsClient.php new file mode 100644 index 00000000..cb5f32d0 --- /dev/null +++ b/src/Shares/Visitors/VisitorsClient.php @@ -0,0 +1,170 @@ +, + * } $options @phpstan-ignore-next-line Property is used in endpoint methods via HttpEndpointGenerator + */ + private array $options; + + /** + * @var RawClient $client + */ + private RawClient $client; + + /** + * @param RawClient $client + * @param ?array{ + * baseUrl?: string, + * client?: ClientInterface, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * } $options + */ + public function __construct( + RawClient $client, + ?array $options = null, + ) { + $this->client = $client; + $this->options = $options ?? []; + } + + /** + * An archived link's visitors are listed too. + * + * Example: + * ```php + * $client->shares->visitors->list( + * 'tenantId', + * 'shareId', + * new ListVisitorsRequest([]), + * ); + * ``` + * + * @param string $tenantId + * @param string $shareId + * @param ListVisitorsRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?SharesVisitorsList200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function list(string $tenantId, string $shareId, ListVisitorsRequest $request = new ListVisitorsRequest(), ?array $options = null): ?SharesVisitorsList200Response + { + $options = array_merge($this->options, $options ?? []); + $query = []; + if ($request->limit != null) { + $query['limit'] = $request->limit; + } + if ($request->cursor != null) { + $query['cursor'] = $request->cursor; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/shares/{$shareId}/visitors", + method: HttpMethod::GET, + query: $query, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return SharesVisitorsList200Response::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(), + ); + } + + /** + * Their handle brings them back as a new visitor, who is asked again. Deleting a visitor already deleted changes nothing. + * + * Example: + * ```php + * $client->shares->visitors->delete( + * 'tenantId', + * 'shareId', + * 'visitorId', + * ); + * ``` + * + * @param string $tenantId + * @param string $shareId + * @param string $visitorId + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function delete(string $tenantId, string $shareId, string $visitorId, ?array $options = null): void + { + $options = array_merge($this->options, $options ?? []); + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/tenants/{$tenantId}/shares/{$shareId}/visitors/{$visitorId}", + method: HttpMethod::DELETE, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + return; + } + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } +} diff --git a/src/Types/AdminErrorPayloadError.php b/src/Types/AdminErrorPayloadError.php index 1ecb36e6..174e5beb 100644 --- a/src/Types/AdminErrorPayloadError.php +++ b/src/Types/AdminErrorPayloadError.php @@ -4,6 +4,7 @@ use CloudPDF\Core\Json\JsonSerializableType; use CloudPDF\Core\Json\JsonProperty; +use CloudPDF\Core\Types\ArrayType; class AdminErrorPayloadError extends JsonSerializableType { @@ -19,10 +20,17 @@ class AdminErrorPayloadError extends JsonSerializableType #[JsonProperty('message')] public string $message; + /** + * @var ?array $details + */ + #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] + public ?array $details; + /** * @param array{ * code: string, * message: string, + * details?: ?array, * } $values */ public function __construct( @@ -30,6 +38,7 @@ public function __construct( ) { $this->code = $values['code']; $this->message = $values['message']; + $this->details = $values['details'] ?? null; } /** diff --git a/src/Types/DocDownloadLink200Response.php b/src/Types/DocDownloadLink200Response.php new file mode 100644 index 00000000..96342163 --- /dev/null +++ b/src/Types/DocDownloadLink200Response.php @@ -0,0 +1,42 @@ +url = $values['url']; + $this->expiresAt = $values['expiresAt']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocumentsLayersList200Response.php b/src/Types/DocumentsLayersList200Response.php new file mode 100644 index 00000000..adca9763 --- /dev/null +++ b/src/Types/DocumentsLayersList200Response.php @@ -0,0 +1,43 @@ + $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 new file mode 100644 index 00000000..b5362c90 --- /dev/null +++ b/src/Types/DocumentsLayersList200ResponseLayersItem.php @@ -0,0 +1,90 @@ +docId = $values['docId']; + $this->layerName = $values['layerName']; + $this->shareId = $values['shareId'] ?? 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/EngineErrorPayloadCode.php b/src/Types/EngineErrorPayloadCode.php index 97c6b507..e7f831f1 100644 --- a/src/Types/EngineErrorPayloadCode.php +++ b/src/Types/EngineErrorPayloadCode.php @@ -33,4 +33,6 @@ enum EngineErrorPayloadCode: string case ChangeConflict = "ChangeConflict"; case UndoUnavailable = "UndoUnavailable"; case IdempotencyKeyReused = "IdempotencyKeyReused"; + case LayerDeleted = "LayerDeleted"; + case VisitorIdentityRequired = "VisitorIdentityRequired"; } diff --git a/src/Types/SharesArchive200Response.php b/src/Types/SharesArchive200Response.php new file mode 100644 index 00000000..2b56f3dd --- /dev/null +++ b/src/Types/SharesArchive200Response.php @@ -0,0 +1,34 @@ +share = $values['share']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/SharesArchive200ResponseShare.php b/src/Types/SharesArchive200ResponseShare.php new file mode 100644 index 00000000..17151a16 --- /dev/null +++ b/src/Types/SharesArchive200ResponseShare.php @@ -0,0 +1,187 @@ + $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 ?SharesArchive200ResponseShareVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesArchive200ResponseShareVisitorIdentity $visitorIdentity; + + /** + * @var array $scope + */ + #[JsonProperty('scope'), ArrayType(['string'])] + public array $scope; + + /** + * @var ?array $origins + */ + #[JsonProperty('origins'), ArrayType(['string'])] + public ?array $origins; + + /** + * @var bool $passwordProtected + */ + #[JsonProperty('passwordProtected')] + public bool $passwordProtected; + + /** + * @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, + * passwordProtected: bool, + * sessionTtlSeconds: float, + * disabled: bool, + * exchangeCount: float, + * createdBy: string, + * createdAt: float, + * updatedAt: float, + * layerName?: ?string, + * visitorIdleSeconds?: ?float, + * visitorIdentity?: ?SharesArchive200ResponseShareVisitorIdentity, + * 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->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; + $this->scope = $values['scope']; + $this->origins = $values['origins'] ?? null; + $this->passwordProtected = $values['passwordProtected']; + $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/SharesArchive200ResponseShareLayerMode.php b/src/Types/SharesArchive200ResponseShareLayerMode.php new file mode 100644 index 00000000..300c16f5 --- /dev/null +++ b/src/Types/SharesArchive200ResponseShareLayerMode.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: SharesArchive200ResponseShareVisitorIdentityFields, + * 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/SharesArchive200ResponseShareVisitorIdentityAsk.php b/src/Types/SharesArchive200ResponseShareVisitorIdentityAsk.php new file mode 100644 index 00000000..7ec9cf52 --- /dev/null +++ b/src/Types/SharesArchive200ResponseShareVisitorIdentityAsk.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/SharesArchive200ResponseShareVisitorIdentityFieldsDisplayName.php b/src/Types/SharesArchive200ResponseShareVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..0564d0c3 --- /dev/null +++ b/src/Types/SharesArchive200ResponseShareVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName */ #[JsonProperty('layerName')] - public string $layerName; + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?float $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?float $visitorIdleSeconds; + + /** + * @var ?SharesCreate200ResponseShareVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesCreate200ResponseShareVisitorIdentity $visitorIdentity; /** * @var array $scope @@ -62,6 +86,12 @@ class SharesCreate200ResponseShare extends JsonSerializableType #[JsonProperty('disabled')] public bool $disabled; + /** + * @var ?float $archivedAt + */ + #[JsonProperty('archivedAt')] + public ?float $archivedAt; + /** * @var ?float $expiresAt */ @@ -103,7 +133,8 @@ class SharesCreate200ResponseShare extends JsonSerializableType * id: string, * tenantId: string, * docId: string, - * layerName: string, + * layerMode: value-of, + * keepVisitorLayers: bool, * scope: array, * passwordProtected: bool, * sessionTtlSeconds: float, @@ -112,7 +143,11 @@ class SharesCreate200ResponseShare extends JsonSerializableType * createdBy: string, * createdAt: float, * updatedAt: float, + * layerName?: ?string, + * visitorIdleSeconds?: ?float, + * visitorIdentity?: ?SharesCreate200ResponseShareVisitorIdentity, * origins?: ?array, + * archivedAt?: ?float, * expiresAt?: ?float, * lastExchangedAt?: ?float, * } $values @@ -123,12 +158,17 @@ public function __construct( $this->id = $values['id']; $this->tenantId = $values['tenantId']; $this->docId = $values['docId']; - $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope']; $this->origins = $values['origins'] ?? null; $this->passwordProtected = $values['passwordProtected']; $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; diff --git a/src/Types/SharesCreate200ResponseShareLayerMode.php b/src/Types/SharesCreate200ResponseShareLayerMode.php new file mode 100644 index 00000000..5489269a --- /dev/null +++ b/src/Types/SharesCreate200ResponseShareLayerMode.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: SharesCreate200ResponseShareVisitorIdentityFields, + * 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/SharesCreate200ResponseShareVisitorIdentityAsk.php b/src/Types/SharesCreate200ResponseShareVisitorIdentityAsk.php new file mode 100644 index 00000000..182096b1 --- /dev/null +++ b/src/Types/SharesCreate200ResponseShareVisitorIdentityAsk.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/SharesCreate200ResponseShareVisitorIdentityFieldsDisplayName.php b/src/Types/SharesCreate200ResponseShareVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..f9f11659 --- /dev/null +++ b/src/Types/SharesCreate200ResponseShareVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var SharesExchange200ResponseVisitor $visitor + */ + #[JsonProperty('visitor')] + public SharesExchange200ResponseVisitor $visitor; + /** * @var float $expiresAt */ @@ -36,6 +48,8 @@ class SharesExchange200Response extends JsonSerializableType * token: string, * docId: string, * layerName: string, + * layerMode: value-of, + * visitor: SharesExchange200ResponseVisitor, * expiresAt: float, * } $values */ @@ -45,6 +59,8 @@ public function __construct( $this->token = $values['token']; $this->docId = $values['docId']; $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->visitor = $values['visitor']; $this->expiresAt = $values['expiresAt']; } diff --git a/src/Types/SharesExchange200ResponseLayerMode.php b/src/Types/SharesExchange200ResponseLayerMode.php new file mode 100644 index 00000000..93481944 --- /dev/null +++ b/src/Types/SharesExchange200ResponseLayerMode.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/SharesExchange200ResponseVisitorIdentityRequest.php b/src/Types/SharesExchange200ResponseVisitorIdentityRequest.php new file mode 100644 index 00000000..6e9ff574 --- /dev/null +++ b/src/Types/SharesExchange200ResponseVisitorIdentityRequest.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: SharesExchange200ResponseVisitorIdentityRequestFields, + * 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/SharesExchange200ResponseVisitorIdentityRequestFields.php b/src/Types/SharesExchange200ResponseVisitorIdentityRequestFields.php new file mode 100644 index 00000000..da180e44 --- /dev/null +++ b/src/Types/SharesExchange200ResponseVisitorIdentityRequestFields.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/SharesExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php b/src/Types/SharesExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php new file mode 100644 index 00000000..1ed64e07 --- /dev/null +++ b/src/Types/SharesExchange200ResponseVisitorIdentityRequestFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName */ #[JsonProperty('layerName')] - public string $layerName; + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?float $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?float $visitorIdleSeconds; + + /** + * @var ?SharesGet200ResponseShareVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesGet200ResponseShareVisitorIdentity $visitorIdentity; /** * @var array $scope @@ -62,6 +86,12 @@ class SharesGet200ResponseShare extends JsonSerializableType #[JsonProperty('disabled')] public bool $disabled; + /** + * @var ?float $archivedAt + */ + #[JsonProperty('archivedAt')] + public ?float $archivedAt; + /** * @var ?float $expiresAt */ @@ -103,7 +133,8 @@ class SharesGet200ResponseShare extends JsonSerializableType * id: string, * tenantId: string, * docId: string, - * layerName: string, + * layerMode: value-of, + * keepVisitorLayers: bool, * scope: array, * passwordProtected: bool, * sessionTtlSeconds: float, @@ -112,7 +143,11 @@ class SharesGet200ResponseShare extends JsonSerializableType * createdBy: string, * createdAt: float, * updatedAt: float, + * layerName?: ?string, + * visitorIdleSeconds?: ?float, + * visitorIdentity?: ?SharesGet200ResponseShareVisitorIdentity, * origins?: ?array, + * archivedAt?: ?float, * expiresAt?: ?float, * lastExchangedAt?: ?float, * } $values @@ -123,12 +158,17 @@ public function __construct( $this->id = $values['id']; $this->tenantId = $values['tenantId']; $this->docId = $values['docId']; - $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope']; $this->origins = $values['origins'] ?? null; $this->passwordProtected = $values['passwordProtected']; $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; diff --git a/src/Types/SharesGet200ResponseShareLayerMode.php b/src/Types/SharesGet200ResponseShareLayerMode.php new file mode 100644 index 00000000..b650620d --- /dev/null +++ b/src/Types/SharesGet200ResponseShareLayerMode.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: SharesGet200ResponseShareVisitorIdentityFields, + * 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/SharesGet200ResponseShareVisitorIdentityAsk.php b/src/Types/SharesGet200ResponseShareVisitorIdentityAsk.php new file mode 100644 index 00000000..c89f49d9 --- /dev/null +++ b/src/Types/SharesGet200ResponseShareVisitorIdentityAsk.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/SharesGet200ResponseShareVisitorIdentityFieldsDisplayName.php b/src/Types/SharesGet200ResponseShareVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..998fc84c --- /dev/null +++ b/src/Types/SharesGet200ResponseShareVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName */ #[JsonProperty('layerName')] - public string $layerName; + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?float $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?float $visitorIdleSeconds; + + /** + * @var ?SharesList200ResponseSharesItemVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesList200ResponseSharesItemVisitorIdentity $visitorIdentity; /** * @var array $scope @@ -62,6 +86,12 @@ class SharesList200ResponseSharesItem extends JsonSerializableType #[JsonProperty('disabled')] public bool $disabled; + /** + * @var ?float $archivedAt + */ + #[JsonProperty('archivedAt')] + public ?float $archivedAt; + /** * @var ?float $expiresAt */ @@ -103,7 +133,8 @@ class SharesList200ResponseSharesItem extends JsonSerializableType * id: string, * tenantId: string, * docId: string, - * layerName: string, + * layerMode: value-of, + * keepVisitorLayers: bool, * scope: array, * passwordProtected: bool, * sessionTtlSeconds: float, @@ -112,7 +143,11 @@ class SharesList200ResponseSharesItem extends JsonSerializableType * createdBy: string, * createdAt: float, * updatedAt: float, + * layerName?: ?string, + * visitorIdleSeconds?: ?float, + * visitorIdentity?: ?SharesList200ResponseSharesItemVisitorIdentity, * origins?: ?array, + * archivedAt?: ?float, * expiresAt?: ?float, * lastExchangedAt?: ?float, * } $values @@ -123,12 +158,17 @@ public function __construct( $this->id = $values['id']; $this->tenantId = $values['tenantId']; $this->docId = $values['docId']; - $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope']; $this->origins = $values['origins'] ?? null; $this->passwordProtected = $values['passwordProtected']; $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; diff --git a/src/Types/SharesList200ResponseSharesItemLayerMode.php b/src/Types/SharesList200ResponseSharesItemLayerMode.php new file mode 100644 index 00000000..56ecc79f --- /dev/null +++ b/src/Types/SharesList200ResponseSharesItemLayerMode.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: SharesList200ResponseSharesItemVisitorIdentityFields, + * 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/SharesList200ResponseSharesItemVisitorIdentityAsk.php b/src/Types/SharesList200ResponseSharesItemVisitorIdentityAsk.php new file mode 100644 index 00000000..f4db6708 --- /dev/null +++ b/src/Types/SharesList200ResponseSharesItemVisitorIdentityAsk.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/SharesList200ResponseSharesItemVisitorIdentityFieldsDisplayName.php b/src/Types/SharesList200ResponseSharesItemVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..e7835df5 --- /dev/null +++ b/src/Types/SharesList200ResponseSharesItemVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $layerMode + */ + #[JsonProperty('layerMode')] + public string $layerMode; + + /** + * @var ?string $layerName */ #[JsonProperty('layerName')] - public string $layerName; + public ?string $layerName; + + /** + * @var bool $keepVisitorLayers + */ + #[JsonProperty('keepVisitorLayers')] + public bool $keepVisitorLayers; + + /** + * @var ?float $visitorIdleSeconds + */ + #[JsonProperty('visitorIdleSeconds')] + public ?float $visitorIdleSeconds; + + /** + * @var ?SharesUpdate200ResponseShareVisitorIdentity $visitorIdentity + */ + #[JsonProperty('visitorIdentity')] + public ?SharesUpdate200ResponseShareVisitorIdentity $visitorIdentity; /** * @var array $scope @@ -62,6 +86,12 @@ class SharesUpdate200ResponseShare extends JsonSerializableType #[JsonProperty('disabled')] public bool $disabled; + /** + * @var ?float $archivedAt + */ + #[JsonProperty('archivedAt')] + public ?float $archivedAt; + /** * @var ?float $expiresAt */ @@ -103,7 +133,8 @@ class SharesUpdate200ResponseShare extends JsonSerializableType * id: string, * tenantId: string, * docId: string, - * layerName: string, + * layerMode: value-of, + * keepVisitorLayers: bool, * scope: array, * passwordProtected: bool, * sessionTtlSeconds: float, @@ -112,7 +143,11 @@ class SharesUpdate200ResponseShare extends JsonSerializableType * createdBy: string, * createdAt: float, * updatedAt: float, + * layerName?: ?string, + * visitorIdleSeconds?: ?float, + * visitorIdentity?: ?SharesUpdate200ResponseShareVisitorIdentity, * origins?: ?array, + * archivedAt?: ?float, * expiresAt?: ?float, * lastExchangedAt?: ?float, * } $values @@ -123,12 +158,17 @@ public function __construct( $this->id = $values['id']; $this->tenantId = $values['tenantId']; $this->docId = $values['docId']; - $this->layerName = $values['layerName']; + $this->layerMode = $values['layerMode']; + $this->layerName = $values['layerName'] ?? null; + $this->keepVisitorLayers = $values['keepVisitorLayers']; + $this->visitorIdleSeconds = $values['visitorIdleSeconds'] ?? null; + $this->visitorIdentity = $values['visitorIdentity'] ?? null; $this->scope = $values['scope']; $this->origins = $values['origins'] ?? null; $this->passwordProtected = $values['passwordProtected']; $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; diff --git a/src/Types/SharesUpdate200ResponseShareLayerMode.php b/src/Types/SharesUpdate200ResponseShareLayerMode.php new file mode 100644 index 00000000..19902ff0 --- /dev/null +++ b/src/Types/SharesUpdate200ResponseShareLayerMode.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: SharesUpdate200ResponseShareVisitorIdentityFields, + * 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/SharesUpdate200ResponseShareVisitorIdentityAsk.php b/src/Types/SharesUpdate200ResponseShareVisitorIdentityAsk.php new file mode 100644 index 00000000..a63e26fa --- /dev/null +++ b/src/Types/SharesUpdate200ResponseShareVisitorIdentityAsk.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/SharesUpdate200ResponseShareVisitorIdentityFieldsDisplayName.php b/src/Types/SharesUpdate200ResponseShareVisitorIdentityFieldsDisplayName.php new file mode 100644 index 00000000..dff235ec --- /dev/null +++ b/src/Types/SharesUpdate200ResponseShareVisitorIdentityFieldsDisplayName.php @@ -0,0 +1,9 @@ + $visitors + */ + #[JsonProperty('visitors'), ArrayType([SharesVisitorsList200ResponseVisitorsItem::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/SharesVisitorsList200ResponseVisitorsItem.php b/src/Types/SharesVisitorsList200ResponseVisitorsItem.php new file mode 100644 index 00000000..54ea336e --- /dev/null +++ b/src/Types/SharesVisitorsList200ResponseVisitorsItem.php @@ -0,0 +1,82 @@ +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/SharesVisitorsList200ResponseVisitorsItemAnswers.php b/src/Types/SharesVisitorsList200ResponseVisitorsItemAnswers.php new file mode 100644 index 00000000..5e02dea0 --- /dev/null +++ b/src/Types/SharesVisitorsList200ResponseVisitorsItemAnswers.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/SharesVisitorsList200ResponseVisitorsItemLayer.php b/src/Types/SharesVisitorsList200ResponseVisitorsItemLayer.php new file mode 100644 index 00000000..172f1a52 --- /dev/null +++ b/src/Types/SharesVisitorsList200ResponseVisitorsItemLayer.php @@ -0,0 +1,42 @@ +layerName = $values['layerName']; + $this->storageSizeBytes = $values['storageSizeBytes'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +}