diff --git a/.fern/metadata.json b/.fern/metadata.json index 7682e22..d54cb86 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,10 +11,10 @@ "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "5f2d480665034420df58c19fd1328b0823104e0f", + "originGitCommit": "b7dddfba5011349a40db7878b5cbc8685b2d42cf", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "3.0.0-alpha.13", + "requestedVersion": "3.0.0-alpha.14", "ciProvider": "github", - "sdkVersion": "3.0.0-alpha.13" + "sdkVersion": "3.0.0-alpha.14" } \ No newline at end of file diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index bdede2b..1f6e41b 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -1,12 +1,12 @@ { "language": "php", - "canonicalVersion": "3.0.0-next.13", - "sdkVersion": "3.0.0-alpha.13", + "canonicalVersion": "3.0.0-next.14", + "sdkVersion": "3.0.0-alpha.14", "source": { "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", - "openapiSha256": "a472da9c7aed5db7f2b6b1f67f1b6268a9407afe9e7cf879ac04b878b4fc9dc7", - "gitCommit": "5f2d480665034420df58c19fd1328b0823104e0f", + "openapiSha256": "188ea071e3534971638ee3d1fb1f19c77f36e04b2a783f5eefdbe67326527ea6", + "gitCommit": "b7dddfba5011349a40db7878b5cbc8685b2d42cf", "gitCommitIsDirty": false }, "fern": { diff --git a/reference.md b/reference.md index 3c05bd4..ec412db 100644 --- a/reference.md +++ b/reference.md @@ -2946,6 +2946,152 @@ $client->doc->metadata->get( ## Doc Pages +
$client->doc->pages->setScale($docId, $layerName, $pon, $request) -> ?DocPagesSetScale200Response +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->setScale( + 'docId', + 'layerName', + 1, + new DocPagesSetScaleRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+ +
+
+ +**$measure:** `?DocPagesSetScaleRequestMeasure` + +
+
+
+
+ + +
+
+
+ +
$client->doc->pages->viewports($docId, $layerName, $pon, $request) -> ?array +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```php +$client->doc->pages->viewports( + 'docId', + 'layerName', + 1, + new ViewportsPagesRequest([]), +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**$docId:** `string` + +
+
+ +
+
+ +**$layerName:** `string` + +
+
+ +
+
+ +**$pon:** `int` + +
+
+ +
+
+ +**$documentPassword:** `?string` — Base64-encoded password for an encrypted document. Valid only with the API token (403 anywhere else). An encrypted document answers 422 DocPasswordRequired when the header is absent. Viewer doc JWTs use the SDK password-session flow instead. + +
+
+
+
+ + +
+
+
+
$client->doc->pages->delete($docId, $layerName, $request) -> ?DocPagesDelete200Response
diff --git a/src/CloudPDFClient.php b/src/CloudPDFClient.php index 9b0d869..787813c 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.13', - 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.13', + 'X-Fern-SDK-Version' => '3.0.0-alpha.14', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.14', ]; if ($token != null) { $defaultHeaders['Authorization'] = "Bearer $token"; diff --git a/src/Doc/Pages/PagesClient.php b/src/Doc/Pages/PagesClient.php index 1b674a4..f4c24f9 100644 --- a/src/Doc/Pages/PagesClient.php +++ b/src/Doc/Pages/PagesClient.php @@ -4,14 +4,19 @@ use Psr\Http\Client\ClientInterface; use CloudPDF\Core\Client\RawClient; -use CloudPDF\Doc\Pages\Requests\DeletePagesRequest; -use CloudPDF\Types\DocPagesDelete200Response; +use CloudPDF\Doc\Pages\Requests\DocPagesSetScaleRequest; +use CloudPDF\Types\DocPagesSetScale200Response; use CloudPDF\Exceptions\CloudPDFException; use CloudPDF\Exceptions\CloudPDFApiException; use CloudPDF\Core\Json\JsonApiRequest; use CloudPDF\Core\Client\HttpMethod; use JsonException; use Psr\Http\Client\ClientExceptionInterface; +use CloudPDF\Doc\Pages\Requests\ViewportsPagesRequest; +use CloudPDF\Types\DocPagesViewports200ResponseItem; +use CloudPDF\Core\Json\JsonDecoder; +use CloudPDF\Doc\Pages\Requests\DeletePagesRequest; +use CloudPDF\Types\DocPagesDelete200Response; use CloudPDF\Doc\Pages\Requests\ExtractPagesRequest; use CloudPDF\Doc\Pages\Requests\FlattenPagesRequest; use CloudPDF\Types\DocPagesFlatten200Response; @@ -66,6 +71,135 @@ public function __construct( $this->options = $options ?? []; } + /** + * Example: + * ```php + * $client->doc->pages->setScale( + * 'docId', + * 'layerName', + * 1, + * new DocPagesSetScaleRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param DocPagesSetScaleRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?DocPagesSetScale200Response + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function setScale(string $docId, string $layerName, int $pon, DocPagesSetScaleRequest $request, ?array $options = null): ?DocPagesSetScale200Response + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pon}/scale", + method: HttpMethod::PUT, + headers: $headers, + body: $request, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return DocPagesSetScale200Response::fromJson($json); + } + } catch (JsonException $e) { + throw new CloudPDFException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e); + } catch (ClientExceptionInterface $e) { + throw new CloudPDFException(message: $e->getMessage(), previous: $e); + } + throw new CloudPDFApiException( + message: 'API request failed', + statusCode: $statusCode, + body: $response->getBody()->getContents(), + ); + } + + /** + * Example: + * ```php + * $client->doc->pages->viewports( + * 'docId', + * 'layerName', + * 1, + * new ViewportsPagesRequest([]), + * ); + * ``` + * + * @param string $docId + * @param string $layerName + * @param int $pon + * @param ViewportsPagesRequest $request + * @param ?array{ + * baseUrl?: string, + * maxRetries?: int, + * timeout?: float, + * headers?: array, + * queryParameters?: array, + * bodyProperties?: array, + * } $options + * @return ?array + * @throws CloudPDFException + * @throws CloudPDFApiException + */ + public function viewports(string $docId, string $layerName, int $pon, ViewportsPagesRequest $request = new ViewportsPagesRequest(), ?array $options = null): ?array + { + $options = array_merge($this->options, $options ?? []); + $headers = []; + if ($request->documentPassword != null) { + $headers['X-Document-Password'] = $request->documentPassword; + } + try { + $response = $this->client->sendRequest( + new JsonApiRequest( + baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? '', + path: "v1/docs/{$docId}/layers/{$layerName}/pages/{$pon}/viewports", + method: HttpMethod::GET, + headers: $headers, + ), + $options, + ); + $statusCode = $response->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 400) { + $json = $response->getBody()->getContents(); + if (empty($json)) { + return null; + } + return JsonDecoder::decodeArray($json, [DocPagesViewports200ResponseItem::class]); // @phpstan-ignore-line + } + } 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/Pages/Requests/DocPagesSetScaleRequest.php b/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php new file mode 100644 index 0000000..6324fcd --- /dev/null +++ b/src/Doc/Pages/Requests/DocPagesSetScaleRequest.php @@ -0,0 +1,34 @@ +documentPassword = $values['documentPassword'] ?? null; + $this->measure = $values['measure'] ?? null; + } +} diff --git a/src/Doc/Pages/Requests/ViewportsPagesRequest.php b/src/Doc/Pages/Requests/ViewportsPagesRequest.php new file mode 100644 index 0000000..18ca1cd --- /dev/null +++ b/src/Doc/Pages/Requests/ViewportsPagesRequest.php @@ -0,0 +1,24 @@ +documentPassword = $values['documentPassword'] ?? null; + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasure.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasure.php new file mode 100644 index 0000000..e459c66 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasure.php @@ -0,0 +1,107 @@ + $subtype + */ + #[JsonProperty('subtype')] + public string $subtype; + + /** + * @var ?string $ratio + */ + #[JsonProperty('ratio')] + public ?string $ratio; + + /** + * @var array $x + */ + #[JsonProperty('x'), ArrayType([DocPagesSetScaleRequestMeasureXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocPagesSetScaleRequestMeasureYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocPagesSetScaleRequestMeasureDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocPagesSetScaleRequestMeasureAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocPagesSetScaleRequestMeasureAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocPagesSetScaleRequestMeasureSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocPagesSetScaleRequestMeasureOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocPagesSetScaleRequestMeasureOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * subtype: value-of, + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocPagesSetScaleRequestMeasureOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->subtype = $values['subtype']; + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItem.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItem.php new file mode 100644 index 0000000..de44678 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItemFraction.php new file mode 100644 index 0000000..061f8e6 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAreaItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAreaItemFraction.php new file mode 100644 index 0000000..1e48ed7 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureDistanceItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureDistanceItemFraction.php new file mode 100644 index 0000000..f467e79 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItem.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItem.php new file mode 100644 index 0000000..59de8ac --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItemFraction.php new file mode 100644 index 0000000..b76a349 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureXItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureXItemFraction.php new file mode 100644 index 0000000..4192fc1 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion: float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion']; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureYItemFraction.php b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureYItemFraction.php new file mode 100644 index 0000000..0d0ac83 --- /dev/null +++ b/src/Doc/Pages/Types/DocPagesSetScaleRequestMeasureYItemFraction.php @@ -0,0 +1,11 @@ + $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure $measure; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemLineCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineCaption $caption; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemLineLeader $leader + */ + #[JsonProperty('leader')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineLeader $leader; + /** * @var DocAnnotationsList200ResponseAnnotationsItemLineRef $ref */ @@ -199,6 +223,10 @@ class DocAnnotationsList200ResponseAnnotationsItemLine extends JsonSerializableT * borderStyle: value-of, * linePoints: DocAnnotationsList200ResponseAnnotationsItemLineLinePoints, * lineEndings: DocAnnotationsList200ResponseAnnotationsItemLineLineEndings, + * intent?: ?value-of, + * measure?: ?DocAnnotationsList200ResponseAnnotationsItemLineMeasure, + * caption?: ?DocAnnotationsList200ResponseAnnotationsItemLineCaption, + * leader?: ?DocAnnotationsList200ResponseAnnotationsItemLineLeader, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +248,10 @@ class DocAnnotationsList200ResponseAnnotationsItemLine extends JsonSerializableT public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->leader = $values['leader'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaption.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaption.php new file mode 100644 index 0000000..2a1e1e1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaption.php @@ -0,0 +1,50 @@ + $position + */ + #[JsonProperty('position')] + public ?string $position; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset $offset + */ + #[JsonProperty('offset')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset $offset; + + /** + * @param array{ + * enabled: bool, + * position?: ?value-of, + * offset?: ?DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enabled = $values['enabled']; + $this->position = $values['position'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php new file mode 100644 index 0000000..4216bf1 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionOffset.php @@ -0,0 +1,42 @@ +along = $values['along']; + $this->perpendicular = $values['perpendicular']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php new file mode 100644 index 0000000..2d2ec26 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineCaptionPosition.php @@ -0,0 +1,9 @@ +length = $values['length']; + $this->extension = $values['extension'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php new file mode 100644 index 0000000..0fd35a3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasure.php @@ -0,0 +1,241 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl $rl + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure + */ + public static function rl(DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemLineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo $geo + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure + */ + public static function geo(DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemLineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown $unknown + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasure + */ + public static function unknown(DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemLineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemLineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl + */ + public function asRl(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo + */ + public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown + */ + public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemLineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php new file mode 100644 index 0000000..932ef14 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php new file mode 100644 index 0000000..f965447 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php new file mode 100644 index 0000000..8deefe8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..fd1629b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..8ba8fa6 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..bdc78c7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php new file mode 100644 index 0000000..d7e51b2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..a1cec06 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php new file mode 100644 index 0000000..9edbad0 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php new file mode 100644 index 0000000..806c9a4 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemLineMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php index c6dc448..04b8b58 100644 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygon.php @@ -10,6 +10,24 @@ class DocAnnotationsList200ResponseAnnotationsItemPolygon extends JsonSerializableType { + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure $measure; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption $caption; + /** * @var DocAnnotationsList200ResponseAnnotationsItemPolygonRef $ref */ @@ -198,6 +216,9 @@ class DocAnnotationsList200ResponseAnnotationsItemPolygon extends JsonSerializab * strokeWidth: float, * borderStyle: value-of, * vertices: array, + * intent?: ?value-of, + * measure?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure, + * caption?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonCaption, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +241,9 @@ class DocAnnotationsList200ResponseAnnotationsItemPolygon extends JsonSerializab public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaption.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaption.php new file mode 100644 index 0000000..6970201 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaption.php @@ -0,0 +1,42 @@ +enabled = $values['enabled']; + $this->center = $values['center'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php new file mode 100644 index 0000000..7e8dfa8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonCaptionCenter.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php new file mode 100644 index 0000000..2255da8 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonIntent.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl $rl + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + */ + public static function rl(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo $geo + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + */ + public static function geo(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown $unknown + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + */ + public static function unknown(DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolygonMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl + */ + public function asRl(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo + */ + public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown + */ + public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php new file mode 100644 index 0000000..96ccfb3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php new file mode 100644 index 0000000..4444537 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php new file mode 100644 index 0000000..d2de2de --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..8821925 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..97fe83b --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..9fe4c81 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php new file mode 100644 index 0000000..30ba57a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..78d16fe --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php new file mode 100644 index 0000000..7c80862 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php new file mode 100644 index 0000000..eae52e9 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolygonMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php index 08eeb63..4505a75 100644 --- a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolyline.php @@ -10,6 +10,24 @@ class DocAnnotationsList200ResponseAnnotationsItemPolyline extends JsonSerializableType { + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure $measure; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption $caption; + /** * @var DocAnnotationsList200ResponseAnnotationsItemPolylineRef $ref */ @@ -199,6 +217,9 @@ class DocAnnotationsList200ResponseAnnotationsItemPolyline extends JsonSerializa * borderStyle: value-of, * vertices: array, * lineEndings: DocAnnotationsList200ResponseAnnotationsItemPolylineLineEndings, + * intent?: ?value-of, + * measure?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure, + * caption?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineCaption, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +241,9 @@ class DocAnnotationsList200ResponseAnnotationsItemPolyline extends JsonSerializa public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaption.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaption.php new file mode 100644 index 0000000..9dbbe06 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaption.php @@ -0,0 +1,42 @@ +enabled = $values['enabled']; + $this->center = $values['center'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php new file mode 100644 index 0000000..86adeaa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineCaptionCenter.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php new file mode 100644 index 0000000..c38a84a --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineIntent.php @@ -0,0 +1,8 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl $rl + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + */ + public static function rl(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl $rl): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo $geo + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + */ + public static function geo(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo $geo): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown $unknown + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + */ + public static function unknown(DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown $unknown): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure + { + return new DocAnnotationsList200ResponseAnnotationsItemPolylineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl + */ + public function asRl(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo + */ + public function asGeo(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown + */ + public function asUnknown(): DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php new file mode 100644 index 0000000..ce1ed7e --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php new file mode 100644 index 0000000..c08a425 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php new file mode 100644 index 0000000..b18c8fa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..785aa9d --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..29efc87 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..a092fa7 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php new file mode 100644 index 0000000..a4b8dc2 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..5ae69aa --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php new file mode 100644 index 0000000..b8a82e5 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php new file mode 100644 index 0000000..d6e5db3 --- /dev/null +++ b/src/Types/DocAnnotationsList200ResponseAnnotationsItemPolylineMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine.php index 3a8e67d..1bda229 100644 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine.php +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine.php @@ -10,6 +10,30 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine extends JsonSerializableType { + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure $measure; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption $caption; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader $leader + */ + #[JsonProperty('leader')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader $leader; + /** * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineRef $ref */ @@ -199,6 +223,10 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine extends JsonS * borderStyle: value-of, * linePoints: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLinePoints, * lineEndings: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLineEndings, + * intent?: ?value-of, + * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure, + * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption, + * leader?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineLeader, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +248,10 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLine extends JsonS public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; + $this->leader = $values['leader'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption.php new file mode 100644 index 0000000..ce00d72 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaption.php @@ -0,0 +1,50 @@ + $position + */ + #[JsonProperty('position')] + public ?string $position; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset $offset + */ + #[JsonProperty('offset')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset $offset; + + /** + * @param array{ + * enabled: bool, + * position?: ?value-of, + * offset?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset, + * } $values + */ + public function __construct( + array $values, + ) { + $this->enabled = $values['enabled']; + $this->position = $values['position'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php new file mode 100644 index 0000000..5c23530 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionOffset.php @@ -0,0 +1,42 @@ +along = $values['along']; + $this->perpendicular = $values['perpendicular']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php new file mode 100644 index 0000000..f650368 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineCaptionPosition.php @@ -0,0 +1,9 @@ +length = $values['length']; + $this->extension = $values['extension'] ?? null; + $this->offset = $values['offset'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php new file mode 100644 index 0000000..0ba7320 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure.php @@ -0,0 +1,241 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl $rl + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + */ + public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo $geo + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + */ + public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown $unknown + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + */ + public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl + */ + public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo + */ + public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown + */ + public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php new file mode 100644 index 0000000..1044d97 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php new file mode 100644 index 0000000..a18d31f --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php new file mode 100644 index 0000000..6919c41 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..df72cbf --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..4737ef3 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..de965a3 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php new file mode 100644 index 0000000..775955b --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..98e13f1 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php new file mode 100644 index 0000000..3ef837a --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php new file mode 100644 index 0000000..43893de --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemLineMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php index 7ee6ff2..7781432 100644 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon.php @@ -10,6 +10,24 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon extends JsonSerializableType { + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure $measure; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption $caption; + /** * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonRef $ref */ @@ -198,6 +216,9 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon extends Js * strokeWidth: float, * borderStyle: value-of, * vertices: array, + * intent?: ?value-of, + * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure, + * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +241,9 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygon extends Js public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption.php new file mode 100644 index 0000000..2b8ffdd --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaption.php @@ -0,0 +1,42 @@ +enabled = $values['enabled']; + $this->center = $values['center'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php new file mode 100644 index 0000000..4adca55 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonCaptionCenter.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php new file mode 100644 index 0000000..d23d2d0 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonIntent.php @@ -0,0 +1,9 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl $rl + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + */ + public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo $geo + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + */ + public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown $unknown + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + */ + public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl + */ + public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo + */ + public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown + */ + public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php new file mode 100644 index 0000000..b578103 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php new file mode 100644 index 0000000..9ba914c --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php new file mode 100644 index 0000000..2882139 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..a047a69 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..c3fca31 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..c2b7e1c --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php new file mode 100644 index 0000000..f5fb501 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..b83a8e8 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php new file mode 100644 index 0000000..f270de1 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php new file mode 100644 index 0000000..6342737 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolygonMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php index e5313f6..8b2423b 100644 --- a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline.php @@ -10,6 +10,24 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline extends JsonSerializableType { + /** + * @var ?value-of $intent + */ + #[JsonProperty('intent')] + public ?string $intent; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure $measure + */ + #[JsonProperty('measure')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure $measure; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption $caption + */ + #[JsonProperty('caption')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption $caption; + /** * @var DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineRef $ref */ @@ -199,6 +217,9 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline extends J * borderStyle: value-of, * vertices: array, * lineEndings: DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineLineEndings, + * intent?: ?value-of, + * measure?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure, + * caption?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption, * nm?: ?string, * contents?: ?string, * subject?: ?string, @@ -220,6 +241,9 @@ class DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolyline extends J public function __construct( array $values, ) { + $this->intent = $values['intent'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->caption = $values['caption'] ?? null; $this->ref = $values['ref']; $this->pageObjectNumber = $values['pageObjectNumber']; $this->index = $values['index']; diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption.php new file mode 100644 index 0000000..c0956b0 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaption.php @@ -0,0 +1,42 @@ +enabled = $values['enabled']; + $this->center = $values['center'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php new file mode 100644 index 0000000..a57350c --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineCaptionCenter.php @@ -0,0 +1,42 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php new file mode 100644 index 0000000..b9a444b --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineIntent.php @@ -0,0 +1,8 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl $rl + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + */ + public static function rl(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl $rl): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo $geo + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + */ + public static function geo(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo $geo): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown $unknown + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + */ + public static function unknown(DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown $unknown): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure + { + return new DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl + */ + public function asRl(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo + */ + public function asGeo(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown + */ + public function asUnknown(): DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown + { + if (!($this->value instanceof DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php new file mode 100644 index 0000000..011e374 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php new file mode 100644 index 0000000..201fdaa --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php new file mode 100644 index 0000000..916af42 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..bd72a12 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..2e54682 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..f9bedb0 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php new file mode 100644 index 0000000..00433fc --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..5cdca48 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php new file mode 100644 index 0000000..564dbc8 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php new file mode 100644 index 0000000..119af21 --- /dev/null +++ b/src/Types/DocAnnotationsListAll200ResponsePagesItemAnnotationsItemPolylineMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200Response.php b/src/Types/DocPagesSetScale200Response.php new file mode 100644 index 0000000..c9235fe --- /dev/null +++ b/src/Types/DocPagesSetScale200Response.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->meta = $values['meta']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMeta.php b/src/Types/DocPagesSetScale200ResponseMeta.php new file mode 100644 index 0000000..ab5ff2f --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMeta.php @@ -0,0 +1,43 @@ + $affectedPages + */ + #[JsonProperty('affectedPages'), ArrayType([DocPagesSetScale200ResponseMetaAffectedPagesItem::class])] + public array $affectedPages; + + /** + * @var ?DocPagesSetScale200ResponseMetaCacheDelta $cacheDelta + */ + #[JsonProperty('cacheDelta')] + public ?DocPagesSetScale200ResponseMetaCacheDelta $cacheDelta; + + /** + * @param array{ + * affectedPages: array, + * cacheDelta?: ?DocPagesSetScale200ResponseMetaCacheDelta, + * } $values + */ + public function __construct( + array $values, + ) { + $this->affectedPages = $values['affectedPages']; + $this->cacheDelta = $values['cacheDelta'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php new file mode 100644 index 0000000..18d2940 --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItem.php @@ -0,0 +1,50 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->revision = $values['revision']; + $this->weakAnnotationState = $values['weakAnnotationState']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php new file mode 100644 index 0000000..937adc1 --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemRevision.php @@ -0,0 +1,50 @@ +docSessionId = $values['docSessionId']; + $this->pageObjectNumber = $values['pageObjectNumber']; + $this->generation = $values['generation']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php new file mode 100644 index 0000000..8c6f7da --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState.php @@ -0,0 +1,196 @@ +kind = $values['kind']; + $this->value = $values['value']; + } + + /** + * @param DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown + * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState + */ + public static function unknown(DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown $unknown): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState + { + return new DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState([ + 'kind' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @param DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known + * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState + */ + public static function known(DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown $known): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState + { + return new DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationState([ + 'kind' => 'known', + 'value' => $known, + ]); + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown'; + } + + /** + * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown + */ + public function asUnknown(): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown + { + if (!($this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown && $this->kind === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isKnown(): bool + { + return $this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known'; + } + + /** + * @return DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown + */ + public function asKnown(): DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown + { + if (!($this->value instanceof DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown && $this->kind === 'known')) { + throw new Exception( + "Expected known; got " . $this->kind . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['kind'] = $this->kind; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->kind) { + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'known': + $value = $this->asKnown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('kind', $data)) { + throw new Exception( + "JSON data is missing property 'kind'", + ); + } + $kind = $data['kind']; + if (!(is_string($kind))) { + throw new Exception( + "Expected property 'kind' in JSON data to be string, instead received " . get_debug_type($data['kind']), + ); + } + + $args['kind'] = $kind; + switch ($kind) { + case 'unknown': + $args['value'] = DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown::jsonDeserialize($data); + break; + case 'known': + $args['value'] = DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['kind'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php new file mode 100644 index 0000000..6be3a54 --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateKnown.php @@ -0,0 +1,34 @@ +hasAnyWeakAnnotations = $values['hasAnyWeakAnnotations']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php new file mode 100644 index 0000000..7eb1e7e --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaAffectedPagesItemWeakAnnotationStateUnknown.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php new file mode 100644 index 0000000..325af92 --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaCacheDelta.php @@ -0,0 +1,75 @@ + $pages + */ + #[JsonProperty('pages'), ArrayType([DocPagesSetScale200ResponseMetaCacheDeltaPagesItem::class])] + public array $pages; + + /** + * @param array{ + * previousDocVersion: int, + * docVersion: int, + * pages: array, + * annotationsVersion?: ?int, + * layerVersion?: ?int, + * working?: ?bool, + * } $values + */ + public function __construct( + array $values, + ) { + $this->previousDocVersion = $values['previousDocVersion']; + $this->docVersion = $values['docVersion']; + $this->annotationsVersion = $values['annotationsVersion'] ?? null; + $this->layerVersion = $values['layerVersion'] ?? null; + $this->working = $values['working'] ?? null; + $this->pages = $values['pages']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php new file mode 100644 index 0000000..35670df --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItem.php @@ -0,0 +1,42 @@ +pageObjectNumber = $values['pageObjectNumber']; + $this->cache = $values['cache']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php new file mode 100644 index 0000000..61c24d6 --- /dev/null +++ b/src/Types/DocPagesSetScale200ResponseMetaCacheDeltaPagesItemCache.php @@ -0,0 +1,42 @@ +contentVersion = $values['contentVersion']; + $this->annotationVersion = $values['annotationVersion']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale400Response.php b/src/Types/DocPagesSetScale400Response.php new file mode 100644 index 0000000..3dfc2ff --- /dev/null +++ b/src/Types/DocPagesSetScale400Response.php @@ -0,0 +1,59 @@ + $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var value-of $code + */ + #[JsonProperty('code')] + public string $code; + + /** + * @var string $message + */ + #[JsonProperty('message')] + public string $message; + + /** + * @var ?array $details + */ + #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] + public ?array $details; + + /** + * @param array{ + * name: value-of, + * code: value-of, + * message: string, + * details?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->code = $values['code']; + $this->message = $values['message']; + $this->details = $values['details'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale400ResponseCode.php b/src/Types/DocPagesSetScale400ResponseCode.php new file mode 100644 index 0000000..3a66f38 --- /dev/null +++ b/src/Types/DocPagesSetScale400ResponseCode.php @@ -0,0 +1,32 @@ + $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var value-of $code + */ + #[JsonProperty('code')] + public string $code; + + /** + * @var string $message + */ + #[JsonProperty('message')] + public string $message; + + /** + * @var ?array $details + */ + #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] + public ?array $details; + + /** + * @param array{ + * name: value-of, + * code: value-of, + * message: string, + * details?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->code = $values['code']; + $this->message = $values['message']; + $this->details = $values['details'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesSetScale404ResponseCode.php b/src/Types/DocPagesSetScale404ResponseCode.php new file mode 100644 index 0000000..0da3e39 --- /dev/null +++ b/src/Types/DocPagesSetScale404ResponseCode.php @@ -0,0 +1,32 @@ +bbox = $values['bbox']; + $this->name = $values['name'] ?? null; + $this->measure = $values['measure'] ?? null; + $this->owned = $values['owned']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemBbox.php b/src/Types/DocPagesViewports200ResponseItemBbox.php new file mode 100644 index 0000000..cf08b5e --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemBbox.php @@ -0,0 +1,58 @@ +left = $values['left']; + $this->bottom = $values['bottom']; + $this->right = $values['right']; + $this->top = $values['top']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasure.php b/src/Types/DocPagesViewports200ResponseItemMeasure.php new file mode 100644 index 0000000..8b3c3d4 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasure.php @@ -0,0 +1,241 @@ +subtype = $values['subtype']; + $this->value = $values['value']; + } + + /** + * @param DocPagesViewports200ResponseItemMeasureRl $rl + * @return DocPagesViewports200ResponseItemMeasure + */ + public static function rl(DocPagesViewports200ResponseItemMeasureRl $rl): DocPagesViewports200ResponseItemMeasure + { + return new DocPagesViewports200ResponseItemMeasure([ + 'subtype' => 'RL', + 'value' => $rl, + ]); + } + + /** + * @param DocPagesViewports200ResponseItemMeasureGeo $geo + * @return DocPagesViewports200ResponseItemMeasure + */ + public static function geo(DocPagesViewports200ResponseItemMeasureGeo $geo): DocPagesViewports200ResponseItemMeasure + { + return new DocPagesViewports200ResponseItemMeasure([ + 'subtype' => 'GEO', + 'value' => $geo, + ]); + } + + /** + * @param DocPagesViewports200ResponseItemMeasureUnknown $unknown + * @return DocPagesViewports200ResponseItemMeasure + */ + public static function unknown(DocPagesViewports200ResponseItemMeasureUnknown $unknown): DocPagesViewports200ResponseItemMeasure + { + return new DocPagesViewports200ResponseItemMeasure([ + 'subtype' => 'unknown', + 'value' => $unknown, + ]); + } + + /** + * @return bool + */ + public function isRl(): bool + { + return $this->value instanceof DocPagesViewports200ResponseItemMeasureRl && $this->subtype === 'RL'; + } + + /** + * @return DocPagesViewports200ResponseItemMeasureRl + */ + public function asRl(): DocPagesViewports200ResponseItemMeasureRl + { + if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureRl && $this->subtype === 'RL')) { + throw new Exception( + "Expected RL; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isGeo(): bool + { + return $this->value instanceof DocPagesViewports200ResponseItemMeasureGeo && $this->subtype === 'GEO'; + } + + /** + * @return DocPagesViewports200ResponseItemMeasureGeo + */ + public function asGeo(): DocPagesViewports200ResponseItemMeasureGeo + { + if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureGeo && $this->subtype === 'GEO')) { + throw new Exception( + "Expected GEO; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return bool + */ + public function isUnknown(): bool + { + return $this->value instanceof DocPagesViewports200ResponseItemMeasureUnknown && $this->subtype === 'unknown'; + } + + /** + * @return DocPagesViewports200ResponseItemMeasureUnknown + */ + public function asUnknown(): DocPagesViewports200ResponseItemMeasureUnknown + { + if (!($this->value instanceof DocPagesViewports200ResponseItemMeasureUnknown && $this->subtype === 'unknown')) { + throw new Exception( + "Expected unknown; got " . $this->subtype . " with value of type " . get_debug_type($this->value), + ); + } + + return $this->value; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } + + /** + * @return array + */ + public function jsonSerialize(): array + { + $result = []; + $result['subtype'] = $this->subtype; + + $base = parent::jsonSerialize(); + $result = array_merge($base, $result); + + switch ($this->subtype) { + case 'RL': + $value = $this->asRl()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'GEO': + $value = $this->asGeo()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case 'unknown': + $value = $this->asUnknown()->jsonSerialize(); + $result = array_merge($value, $result); + break; + case '_unknown': + default: + if (is_null($this->value)) { + break; + } + if ($this->value instanceof JsonSerializableType) { + $value = $this->value->jsonSerialize(); + $result = array_merge($value, $result); + } elseif (is_array($this->value)) { + $result = array_merge($this->value, $result); + } + } + + return $result; + } + + /** + * @param array $data + */ + public static function jsonDeserialize(array $data): static + { + $args = []; + if (!array_key_exists('subtype', $data)) { + throw new Exception( + "JSON data is missing property 'subtype'", + ); + } + $subtype = $data['subtype']; + if (!(is_string($subtype))) { + throw new Exception( + "Expected property 'subtype' in JSON data to be string, instead received " . get_debug_type($data['subtype']), + ); + } + + $args['subtype'] = $subtype; + switch ($subtype) { + case 'RL': + $args['value'] = DocPagesViewports200ResponseItemMeasureRl::jsonDeserialize($data); + break; + case 'GEO': + $args['value'] = DocPagesViewports200ResponseItemMeasureGeo::jsonDeserialize($data); + break; + case 'unknown': + $args['value'] = DocPagesViewports200ResponseItemMeasureUnknown::jsonDeserialize($data); + break; + case '_unknown': + default: + $args['subtype'] = '_unknown'; + $args['value'] = $data; + } + + // @phpstan-ignore-next-line + return new static($args); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php b/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php new file mode 100644 index 0000000..59b2d2b --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureGeo.php @@ -0,0 +1,26 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRl.php b/src/Types/DocPagesViewports200ResponseItemMeasureRl.php new file mode 100644 index 0000000..f51fb9d --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRl.php @@ -0,0 +1,99 @@ + $x + */ + #[JsonProperty('x'), ArrayType([DocPagesViewports200ResponseItemMeasureRlXItem::class])] + public array $x; + + /** + * @var ?array $y + */ + #[JsonProperty('y'), ArrayType([DocPagesViewports200ResponseItemMeasureRlYItem::class])] + public ?array $y; + + /** + * @var array $distance + */ + #[JsonProperty('distance'), ArrayType([DocPagesViewports200ResponseItemMeasureRlDistanceItem::class])] + public array $distance; + + /** + * @var array $area + */ + #[JsonProperty('area'), ArrayType([DocPagesViewports200ResponseItemMeasureRlAreaItem::class])] + public array $area; + + /** + * @var ?array $angle + */ + #[JsonProperty('angle'), ArrayType([DocPagesViewports200ResponseItemMeasureRlAngleItem::class])] + public ?array $angle; + + /** + * @var ?array $slope + */ + #[JsonProperty('slope'), ArrayType([DocPagesViewports200ResponseItemMeasureRlSlopeItem::class])] + public ?array $slope; + + /** + * @var ?DocPagesViewports200ResponseItemMeasureRlOrigin $origin + */ + #[JsonProperty('origin')] + public ?DocPagesViewports200ResponseItemMeasureRlOrigin $origin; + + /** + * @var ?float $cyx + */ + #[JsonProperty('cyx')] + public ?float $cyx; + + /** + * @param array{ + * x: array, + * distance: array, + * area: array, + * ratio?: ?string, + * y?: ?array, + * angle?: ?array, + * slope?: ?array, + * origin?: ?DocPagesViewports200ResponseItemMeasureRlOrigin, + * cyx?: ?float, + * } $values + */ + public function __construct( + array $values, + ) { + $this->ratio = $values['ratio'] ?? null; + $this->x = $values['x']; + $this->y = $values['y'] ?? null; + $this->distance = $values['distance']; + $this->area = $values['area']; + $this->angle = $values['angle'] ?? null; + $this->slope = $values['slope'] ?? null; + $this->origin = $values['origin'] ?? null; + $this->cyx = $values['cyx'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItem.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItem.php new file mode 100644 index 0000000..859bf51 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php new file mode 100644 index 0000000..800408b --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlAngleItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php new file mode 100644 index 0000000..b3abf68 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlAreaItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php new file mode 100644 index 0000000..96ac245 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlDistanceItemFraction.php @@ -0,0 +1,11 @@ +x = $values['x']; + $this->y = $values['y']; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php new file mode 100644 index 0000000..475d9eb --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItem.php @@ -0,0 +1,106 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php new file mode 100644 index 0000000..bc34633 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlSlopeItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php new file mode 100644 index 0000000..50468df --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlXItemFraction.php @@ -0,0 +1,11 @@ + $fraction + */ + #[JsonProperty('fraction')] + public ?string $fraction; + + /** + * @var ?int $precision + */ + #[JsonProperty('precision')] + public ?int $precision; + + /** + * @var ?bool $fixed + */ + #[JsonProperty('fixed')] + public ?bool $fixed; + + /** + * @var ?string $thousands + */ + #[JsonProperty('thousands')] + public ?string $thousands; + + /** + * @var ?string $decimal + */ + #[JsonProperty('decimal')] + public ?string $decimal; + + /** + * @var ?string $prefixSpacing + */ + #[JsonProperty('prefixSpacing')] + public ?string $prefixSpacing; + + /** + * @var ?string $suffixSpacing + */ + #[JsonProperty('suffixSpacing')] + public ?string $suffixSpacing; + + /** + * @var ?value-of $labelPosition + */ + #[JsonProperty('labelPosition')] + public ?string $labelPosition; + + /** + * @param array{ + * unit: string, + * conversion?: ?float, + * fraction?: ?value-of, + * precision?: ?int, + * fixed?: ?bool, + * thousands?: ?string, + * decimal?: ?string, + * prefixSpacing?: ?string, + * suffixSpacing?: ?string, + * labelPosition?: ?value-of, + * } $values + */ + public function __construct( + array $values, + ) { + $this->unit = $values['unit']; + $this->conversion = $values['conversion'] ?? null; + $this->fraction = $values['fraction'] ?? null; + $this->precision = $values['precision'] ?? null; + $this->fixed = $values['fixed'] ?? null; + $this->thousands = $values['thousands'] ?? null; + $this->decimal = $values['decimal'] ?? null; + $this->prefixSpacing = $values['prefixSpacing'] ?? null; + $this->suffixSpacing = $values['suffixSpacing'] ?? null; + $this->labelPosition = $values['labelPosition'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php b/src/Types/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php new file mode 100644 index 0000000..9335b57 --- /dev/null +++ b/src/Types/DocPagesViewports200ResponseItemMeasureRlYItemFraction.php @@ -0,0 +1,11 @@ +toJson(); + } +} diff --git a/src/Types/DocPagesViewports404Response.php b/src/Types/DocPagesViewports404Response.php new file mode 100644 index 0000000..100d384 --- /dev/null +++ b/src/Types/DocPagesViewports404Response.php @@ -0,0 +1,59 @@ + $name + */ + #[JsonProperty('name')] + public string $name; + + /** + * @var value-of $code + */ + #[JsonProperty('code')] + public string $code; + + /** + * @var string $message + */ + #[JsonProperty('message')] + public string $message; + + /** + * @var ?array $details + */ + #[JsonProperty('details'), ArrayType(['string' => 'mixed'])] + public ?array $details; + + /** + * @param array{ + * name: value-of, + * code: value-of, + * message: string, + * details?: ?array, + * } $values + */ + public function __construct( + array $values, + ) { + $this->name = $values['name']; + $this->code = $values['code']; + $this->message = $values['message']; + $this->details = $values['details'] ?? null; + } + + /** + * @return string + */ + public function __toString(): string + { + return $this->toJson(); + } +} diff --git a/src/Types/DocPagesViewports404ResponseCode.php b/src/Types/DocPagesViewports404ResponseCode.php new file mode 100644 index 0000000..23f06ce --- /dev/null +++ b/src/Types/DocPagesViewports404ResponseCode.php @@ -0,0 +1,32 @@ +