diff --git a/.fern/metadata.json b/.fern/metadata.json index 2ffff18..0142cef 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -3,14 +3,15 @@ "generatorName": "fernapi/fern-php-sdk", "generatorVersion": "2.18.1", "generatorConfig": { - "namespace": "Cloudpdf", - "packageName": "cloudpdf/cloudpdf", + "namespace": "CloudPDF", + "clientName": "CloudPDFClient", + "packageName": "cloudpdf/sdk", "composerJson": { "license": "Apache-2.0", "homepage": "https://www.cloudpdf.com" } }, - "originGitCommit": "232d5e0240d5673a73c9ea7c7ae9e7b937fdd5b3", + "originGitCommit": "a0adb9e77ef16feaef2358d71b247b4f5a98fd23", "originGitCommitIsDirty": false, "invokedBy": "ci", "requestedVersion": "3.0.0-alpha.1", diff --git a/.github/workflows/sdk-ci.yml b/.github/workflows/sdk-ci.yml index a6ffe54..6f2d05d 100644 --- a/.github/workflows/sdk-ci.yml +++ b/.github/workflows/sdk-ci.yml @@ -20,3 +20,10 @@ jobs: tools: composer - run: find src -type f -name '*.php' -print0 | xargs -0 -P 4 -n1 php -l >/dev/null - run: composer validate --no-check-publish --no-interaction + - name: Verify packaged autoloading + run: | + php_package_test="$(mktemp -d)" + tar --exclude=.git --exclude=vendor -cf - . | tar -xf - -C "$php_package_test" + cd "$php_package_test" + composer dump-autoload --no-dev --no-interaction --optimize --strict-psr --quiet + php -r "require 'vendor/autoload.php'; \$base = new CloudPDF\Exceptions\CloudPDFException('test'); \$api = new CloudPDF\Exceptions\CloudPDFApiException('test', 500, null); if (!(\$base instanceof Exception) || !(\$api instanceof CloudPDF\Exceptions\CloudPDFException)) { throw new RuntimeException('CloudPDF exception autoload verification failed'); }" diff --git a/README.md b/README.md index ec3b22b..4e61267 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# Cloudpdf PHP Library +# CloudPDF PHP SDK [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=Cloudpdf%2FPHP) -[![php shield](https://img.shields.io/badge/php-packagist-pink)](https://packagist.org/packages/cloudpdf/cloudpdf) +[![php shield](https://img.shields.io/badge/php-packagist-pink)](https://packagist.org/packages/cloudpdf/sdk) -The Cloudpdf PHP library provides convenient access to the Cloudpdf APIs from PHP. +The official PHP SDK for the CloudPDF API. ## Table of Contents @@ -24,7 +24,7 @@ This SDK requires PHP ^8.1. ## Installation ```sh -composer require cloudpdf/cloudpdf +composer require cloudpdf/sdk ``` ## Usage @@ -36,10 +36,10 @@ Instantiate and use the client with the following: namespace Example; -use Cloudpdf\CloudpdfClient; -use Cloudpdf\Tenants\Requests\TenantsCreateRequest; +use CloudPDF\CloudPDFClient; +use CloudPDF\Tenants\Requests\TenantsCreateRequest; -$client = new CloudpdfClient( +$client = new CloudPDFClient( token: '', ); $client->tenants->create( @@ -55,12 +55,12 @@ $client->tenants->create( When the API returns a non-success status code (4xx or 5xx response), an exception will be thrown. ```php -use Cloudpdf\Exceptions\CloudpdfApiException; -use Cloudpdf\Exceptions\CloudpdfException; +use CloudPDF\Exceptions\CloudPDFApiException; +use CloudPDF\Exceptions\CloudPDFException; try { $response = $client->tenants->create(...); -} catch (CloudpdfApiException $e) { +} catch (CloudPDFApiException $e) { echo 'API Exception occurred: ' . $e->getMessage() . "\n"; echo 'Status Code: ' . $e->getCode() . "\n"; echo 'Response Body: ' . $e->getBody() . "\n"; @@ -77,7 +77,7 @@ By default, if no client is provided, the SDK will use `php-http/discovery` to f However, you can pass your own client that adheres to `ClientInterface`: ```php -use Cloudpdf\CloudpdfClient; +use CloudPDF\CloudPDFClient; // Pass any PSR-18 compatible HTTP client implementation. // For example, using Guzzle: @@ -85,7 +85,7 @@ $customClient = new \GuzzleHttp\Client([ 'timeout' => 5.0, ]); -$client = new CloudpdfClient(options: [ +$client = new CloudPDFClient(options: [ 'client' => $customClient ]); @@ -93,7 +93,7 @@ $client = new CloudpdfClient(options: [ // $customClient = (new \Symfony\Component\HttpClient\Psr18Client()) // ->withOptions(['timeout' => 5.0]); // -// $client = new CloudpdfClient(options: [ +// $client = new CloudPDFClient(options: [ // 'client' => $customClient // ]); ``` diff --git a/cloudpdf-generation.json b/cloudpdf-generation.json index 6d84c9f..4723ed5 100644 --- a/cloudpdf-generation.json +++ b/cloudpdf-generation.json @@ -6,7 +6,7 @@ "repository": "embedpdf/embed-pdf-viewer", "openapi": "cloudpdf/contract/openapi.json", "openapiSha256": "6858ce7912e9063d8fb171ade95fc473db01c5971a3af241a612dda79cc05100", - "gitCommit": "232d5e0240d5673a73c9ea7c7ae9e7b937fdd5b3", + "gitCommit": "a0adb9e77ef16feaef2358d71b247b4f5a98fd23", "gitCommitIsDirty": false }, "fern": { diff --git a/composer.json b/composer.json index 82b4ebf..d882b7a 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "cloudpdf/cloudpdf", + "name": "cloudpdf/sdk", "version": "3.0.0-alpha.1", - "description": "Cloudpdf PHP Library", + "description": "CloudPDF PHP Library", "keywords": [ "cloudpdf", "api", @@ -27,12 +27,12 @@ }, "autoload": { "psr-4": { - "Cloudpdf\\": "src/" + "CloudPDF\\": "src/" } }, "autoload-dev": { "psr-4": { - "Cloudpdf\\Tests\\": "tests/" + "CloudPDF\\Tests\\": "tests/" } }, "scripts": { diff --git a/src/CloudpdfClient.php b/src/CloudPDFClient.php similarity index 85% rename from src/CloudpdfClient.php rename to src/CloudPDFClient.php index 3383b6e..09695ca 100644 --- a/src/CloudpdfClient.php +++ b/src/CloudPDFClient.php @@ -1,16 +1,16 @@ "Bearer $token", 'X-Fern-Language' => 'PHP', - 'X-Fern-SDK-Name' => 'Cloudpdf', + 'X-Fern-SDK-Name' => 'CloudPDF', 'X-Fern-SDK-Version' => '3.0.0-alpha.1', - 'User-Agent' => 'cloudpdf/cloudpdf/3.0.0-alpha.1', + 'User-Agent' => 'cloudpdf/sdk/3.0.0-alpha.1', ]; $this->options = $options ?? []; diff --git a/src/Core/Client/BaseApiRequest.php b/src/Core/Client/BaseApiRequest.php index 76c0315..6fbf75c 100644 --- a/src/Core/Client/BaseApiRequest.php +++ b/src/Core/Client/BaseApiRequest.php @@ -1,6 +1,6 @@ , * } $options * @return ?DeploymentLicenseStatusResponse - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function licenseStatus(?array $options = null): ?DeploymentLicenseStatusResponse { @@ -87,11 +87,11 @@ public function licenseStatus(?array $options = null): ?DeploymentLicenseStatusR return DeploymentLicenseStatusResponse::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Annotations/AnnotationsClient.php b/src/Doc/Annotations/AnnotationsClient.php index b58a1ef..eb54ef5 100644 --- a/src/Doc/Annotations/AnnotationsClient.php +++ b/src/Doc/Annotations/AnnotationsClient.php @@ -1,23 +1,23 @@ , * } $options * @return ?DocAnnotationsList200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function list(string $docId, string $layerName, int $pon, ListAnnotationsRequest $request = new ListAnnotationsRequest(), ?array $options = null): ?DocAnnotationsList200Response { @@ -108,11 +108,11 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations return DocAnnotationsList200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -149,8 +149,8 @@ public function list(string $docId, string $layerName, int $pon, ListAnnotations * bodyProperties?: array, * } $options * @return ?DocAnnotationsCreate200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function create(string $docId, string $layerName, int $pon, CreateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsCreate200Response { @@ -179,11 +179,11 @@ public function create(string $docId, string $layerName, int $pon, CreateAnnotat return DocAnnotationsCreate200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -216,8 +216,8 @@ public function create(string $docId, string $layerName, int $pon, CreateAnnotat * bodyProperties?: array, * } $options * @return ?DocAnnotationsDelete200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function delete(string $docId, string $layerName, int $pon, string $annotKey, DeleteAnnotationsRequest $request = new DeleteAnnotationsRequest(), ?array $options = null): ?DocAnnotationsDelete200Response { @@ -245,11 +245,11 @@ public function delete(string $docId, string $layerName, int $pon, string $annot return DocAnnotationsDelete200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -286,8 +286,8 @@ public function delete(string $docId, string $layerName, int $pon, string $annot * bodyProperties?: array, * } $options * @return ?DocAnnotationsUpdate200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function update(string $docId, string $layerName, int $pon, string $annotKey, UpdateAnnotationsRequest $request, ?array $options = null): ?DocAnnotationsUpdate200Response { @@ -316,11 +316,11 @@ public function update(string $docId, string $layerName, int $pon, string $annot return DocAnnotationsUpdate200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php b/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php index 9a42f74..ba1a2f6 100644 --- a/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php +++ b/src/Doc/Annotations/Requests/CreateAnnotationsRequest.php @@ -1,8 +1,8 @@ , * } $options * @return ?DocHead200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest(), ?array $options = null): ?DocHead200Response { @@ -139,11 +139,11 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest return DocHead200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -172,8 +172,8 @@ public function head(string $docId, HeadDocRequest $request = new HeadDocRequest * bodyProperties?: array, * } $options * @return string - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function download(string $docId, string $layerName, DownloadDocRequest $request = new DownloadDocRequest(), ?array $options = null): string { @@ -197,9 +197,9 @@ public function download(string $docId, string $layerName, DownloadDocRequest $r return $response->getBody()->getContents(); } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -228,8 +228,8 @@ public function download(string $docId, string $layerName, DownloadDocRequest $r * bodyProperties?: array, * } $options * @return ?DocManifest200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function manifest(string $docId, string $layerName, ManifestDocRequest $request = new ManifestDocRequest(), ?array $options = null): ?DocManifest200Response { @@ -257,11 +257,11 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r return DocManifest200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -294,8 +294,8 @@ public function manifest(string $docId, string $layerName, ManifestDocRequest $r * bodyProperties?: array, * } $options * @return string - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function render(string $docId, string $layerName, int $pon, RenderDocRequest $request = new RenderDocRequest(), ?array $options = null): string { @@ -319,9 +319,9 @@ public function render(string $docId, string $layerName, int $pon, RenderDocRequ return $response->getBody()->getContents(); } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -352,8 +352,8 @@ public function render(string $docId, string $layerName, int $pon, RenderDocRequ * bodyProperties?: array, * } $options * @return ?DocText200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function text(string $docId, string $layerName, int $pon, TextDocRequest $request = new TextDocRequest(), ?array $options = null): ?DocText200Response { @@ -381,11 +381,11 @@ public function text(string $docId, string $layerName, int $pon, TextDocRequest return DocText200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Forms/FormsClient.php b/src/Doc/Forms/FormsClient.php index c709455..9f21849 100644 --- a/src/Doc/Forms/FormsClient.php +++ b/src/Doc/Forms/FormsClient.php @@ -1,24 +1,24 @@ , * } $options * @return ?DocFormsGet200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function get(string $docId, string $layerName, GetFormsRequest $request = new GetFormsRequest(), ?array $options = null): ?DocFormsGet200Response { @@ -107,11 +107,11 @@ public function get(string $docId, string $layerName, GetFormsRequest $request = return DocFormsGet200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -140,8 +140,8 @@ public function get(string $docId, string $layerName, GetFormsRequest $request = * bodyProperties?: array, * } $options * @return string - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function exportData(string $docId, string $layerName, ExportDataFormsRequest $request = new ExportDataFormsRequest(), ?array $options = null): string { @@ -170,9 +170,9 @@ public function exportData(string $docId, string $layerName, ExportDataFormsRequ return $response->getBody()->getContents(); } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -205,8 +205,8 @@ public function exportData(string $docId, string $layerName, ExportDataFormsRequ * bodyProperties?: array, * } $options * @return ?DocFormsImportData200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function importData(string $docId, string $layerName, ImportDataFormsRequest $request, ?array $options = null): ?DocFormsImportData200Response { @@ -235,11 +235,11 @@ public function importData(string $docId, string $layerName, ImportDataFormsRequ return DocFormsImportData200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -270,8 +270,8 @@ public function importData(string $docId, string $layerName, ImportDataFormsRequ * bodyProperties?: array, * } $options * @return ?DocFormsReset200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function reset(string $docId, string $layerName, string $fieldKey, ResetFormsRequest $request = new ResetFormsRequest(), ?array $options = null): ?DocFormsReset200Response { @@ -299,11 +299,11 @@ public function reset(string $docId, string $layerName, string $fieldKey, ResetF return DocFormsReset200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -338,8 +338,8 @@ public function reset(string $docId, string $layerName, string $fieldKey, ResetF * bodyProperties?: array, * } $options * @return ?DocFormsSetValue200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function setValue(string $docId, string $layerName, string $fieldKey, SetValueFormsRequest $request, ?array $options = null): ?DocFormsSetValue200Response { @@ -368,11 +368,11 @@ public function setValue(string $docId, string $layerName, string $fieldKey, Set return DocFormsSetValue200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Forms/Requests/ExportDataFormsRequest.php b/src/Doc/Forms/Requests/ExportDataFormsRequest.php index 17aee61..6acb60d 100644 --- a/src/Doc/Forms/Requests/ExportDataFormsRequest.php +++ b/src/Doc/Forms/Requests/ExportDataFormsRequest.php @@ -1,9 +1,9 @@ , * } $options * @return ?DocMetadataGet200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function get(string $docId, string $layerName, GetMetadataRequest $request = new GetMetadataRequest(), ?array $options = null): ?DocMetadataGet200Response { @@ -100,11 +100,11 @@ public function get(string $docId, string $layerName, GetMetadataRequest $reques return DocMetadataGet200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Metadata/Requests/GetMetadataRequest.php b/src/Doc/Metadata/Requests/GetMetadataRequest.php index 0c4ea91..4f27f73 100644 --- a/src/Doc/Metadata/Requests/GetMetadataRequest.php +++ b/src/Doc/Metadata/Requests/GetMetadataRequest.php @@ -1,8 +1,8 @@ , * } $options * @return ?DocPagesDelete200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function delete(string $docId, string $layerName, DeletePagesRequest $request, ?array $options = null): ?DocPagesDelete200Response { @@ -111,11 +111,11 @@ public function delete(string $docId, string $layerName, DeletePagesRequest $req return DocPagesDelete200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -148,8 +148,8 @@ public function delete(string $docId, string $layerName, DeletePagesRequest $req * bodyProperties?: array, * } $options * @return ?DocPagesFlatten200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function flatten(string $docId, string $layerName, FlattenPagesRequest $request, ?array $options = null): ?DocPagesFlatten200Response { @@ -178,11 +178,11 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r return DocPagesFlatten200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -215,8 +215,8 @@ public function flatten(string $docId, string $layerName, FlattenPagesRequest $r * bodyProperties?: array, * } $options * @return ?DocPagesMove200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function move(string $docId, string $layerName, MovePagesRequest $request, ?array $options = null): ?DocPagesMove200Response { @@ -245,11 +245,11 @@ public function move(string $docId, string $layerName, MovePagesRequest $request return DocPagesMove200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -282,8 +282,8 @@ public function move(string $docId, string $layerName, MovePagesRequest $request * bodyProperties?: array, * } $options * @return ?DocPagesRotate200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function rotate(string $docId, string $layerName, RotatePagesRequest $request, ?array $options = null): ?DocPagesRotate200Response { @@ -312,11 +312,11 @@ public function rotate(string $docId, string $layerName, RotatePagesRequest $req return DocPagesRotate200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Pages/Requests/DeletePagesRequest.php b/src/Doc/Pages/Requests/DeletePagesRequest.php index 8408913..183c37c 100644 --- a/src/Doc/Pages/Requests/DeletePagesRequest.php +++ b/src/Doc/Pages/Requests/DeletePagesRequest.php @@ -1,8 +1,8 @@ , * } $options * @return ?DocRedactionsApply200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function apply(string $docId, string $layerName, ApplyRedactionsRequest $request, ?array $options = null): ?DocRedactionsApply200Response { @@ -105,11 +105,11 @@ public function apply(string $docId, string $layerName, ApplyRedactionsRequest $ return DocRedactionsApply200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php b/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php index db93f40..637d1f1 100644 --- a/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php +++ b/src/Doc/Redactions/Requests/ApplyRedactionsRequest.php @@ -1,8 +1,8 @@ , * } $options * @return ?DocumentsList200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function list(string $tenantId, ListDocumentsRequest $request = new ListDocumentsRequest(), ?array $options = null): ?DocumentsList200Response { @@ -110,11 +110,11 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD return DocumentsList200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -141,8 +141,8 @@ public function list(string $tenantId, ListDocumentsRequest $request = new ListD * bodyProperties?: array, * } $options * @return ?DocumentsGet200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function get(string $tenantId, string $id, ?array $options = null): ?DocumentsGet200Response { @@ -165,11 +165,11 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu return DocumentsGet200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -195,8 +195,8 @@ public function get(string $tenantId, string $id, ?array $options = null): ?Docu * queryParameters?: array, * bodyProperties?: array, * } $options - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function delete(string $tenantId, string $id, ?array $options = null): void { @@ -215,9 +215,9 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo return; } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -248,8 +248,8 @@ public function delete(string $tenantId, string $id, ?array $options = null): vo * bodyProperties?: array, * } $options * @return ?DocumentsCommit200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function commit(string $tenantId, string $id, DocumentsCommitRequest $request, ?array $options = null): ?DocumentsCommit200Response { @@ -273,11 +273,11 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req return DocumentsCommit200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -304,8 +304,8 @@ public function commit(string $tenantId, string $id, DocumentsCommitRequest $req * bodyProperties?: array, * } $options * @return string - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function download(string $tenantId, string $id, ?array $options = null): string { @@ -324,9 +324,9 @@ public function download(string $tenantId, string $id, ?array $options = null): return $response->getBody()->getContents(); } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -353,8 +353,8 @@ public function download(string $tenantId, string $id, ?array $options = null): * bodyProperties?: array, * } $options * @return string - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function thumbnail(string $tenantId, string $id, ?array $options = null): string { @@ -373,9 +373,9 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): return $response->getBody()->getContents(); } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -394,8 +394,8 @@ public function thumbnail(string $tenantId, string $id, ?array $options = null): * bodyProperties?: array, * } $options * @return ?DocumentsUploadDirect200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function uploadDirect(string $tenantId, string $id, ?array $options = null): ?DocumentsUploadDirect200Response { @@ -418,11 +418,11 @@ public function uploadDirect(string $tenantId, string $id, ?array $options = nul return DocumentsUploadDirect200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -452,8 +452,8 @@ public function uploadDirect(string $tenantId, string $id, ?array $options = nul * bodyProperties?: array, * } $options * @return ?DocumentsInit200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function init(string $tenantId, DocumentsInitRequest $request, ?array $options = null): ?DocumentsInit200Response { @@ -477,11 +477,11 @@ public function init(string $tenantId, DocumentsInitRequest $request, ?array $op return DocumentsInit200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Documents/Requests/DocumentsCommitRequest.php b/src/Documents/Requests/DocumentsCommitRequest.php index 0a4e074..d235057 100644 --- a/src/Documents/Requests/DocumentsCommitRequest.php +++ b/src/Documents/Requests/DocumentsCommitRequest.php @@ -1,9 +1,9 @@ , * } $options * @return ?TenantsList200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?array $options = null): ?TenantsList200Response { @@ -102,11 +102,11 @@ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?ar return TenantsList200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -133,8 +133,8 @@ public function list(ListTenantsRequest $request = new ListTenantsRequest(), ?ar * bodyProperties?: array, * } $options * @return ?TenantsCreate200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function create(TenantsCreateRequest $request, ?array $options = null): ?TenantsCreate200Response { @@ -158,11 +158,11 @@ public function create(TenantsCreateRequest $request, ?array $options = null): ? return TenantsCreate200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -187,8 +187,8 @@ public function create(TenantsCreateRequest $request, ?array $options = null): ? * bodyProperties?: array, * } $options * @return ?TenantsGet200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function get(string $tenantId, ?array $options = null): ?TenantsGet200Response { @@ -211,11 +211,11 @@ public function get(string $tenantId, ?array $options = null): ?TenantsGet200Res return TenantsGet200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -241,8 +241,8 @@ public function get(string $tenantId, ?array $options = null): ?TenantsGet200Res * queryParameters?: array, * bodyProperties?: array, * } $options - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function delete(string $tenantId, ?array $options = null): void { @@ -261,9 +261,9 @@ public function delete(string $tenantId, ?array $options = null): void return; } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Tokens/Requests/IssueTokensRequest.php b/src/Tokens/Requests/IssueTokensRequest.php index 4a433ea..027e29d 100644 --- a/src/Tokens/Requests/IssueTokensRequest.php +++ b/src/Tokens/Requests/IssueTokensRequest.php @@ -1,9 +1,9 @@ , * } $options * @return ?TokensIssue200Response - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function issue(string $tenantId, IssueTokensRequest $request, ?array $options = null): ?TokensIssue200Response { @@ -106,11 +106,11 @@ public function issue(string $tenantId, IssueTokensRequest $request, ?array $opt return TokensIssue200Response::fromJson($json); } } catch (JsonException $e) { - throw new CloudpdfException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $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 CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), @@ -140,8 +140,8 @@ public function issue(string $tenantId, IssueTokensRequest $request, ?array $opt * queryParameters?: array, * bodyProperties?: array, * } $options - * @throws CloudpdfException - * @throws CloudpdfApiException + * @throws CloudPDFException + * @throws CloudPDFApiException */ public function revoke(string $tenantId, string $jti, TokensRevokeRequest $request = new TokensRevokeRequest(), ?array $options = null): void { @@ -161,9 +161,9 @@ public function revoke(string $tenantId, string $jti, TokensRevokeRequest $reque return; } } catch (ClientExceptionInterface $e) { - throw new CloudpdfException(message: $e->getMessage(), previous: $e); + throw new CloudPDFException(message: $e->getMessage(), previous: $e); } - throw new CloudpdfApiException( + throw new CloudPDFApiException( message: 'API request failed', statusCode: $statusCode, body: $response->getBody()->getContents(), diff --git a/src/Types/AdminErrorPayload.php b/src/Types/AdminErrorPayload.php index b0d7b00..e643225 100644 --- a/src/Types/AdminErrorPayload.php +++ b/src/Types/AdminErrorPayload.php @@ -1,9 +1,9 @@