From ad650b96e37f327e3b2bd0b5a0029ba392a2bce2 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 17 Jan 2025 00:16:42 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.468.9 --- .speakeasy/gen.lock | 69 +++++++++++++++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 ++-- README.md | 2 +- RELEASES.md | 12 +++- .../Operations/GetCodeSamplesRequest.md | 10 +-- docs/sdks/codesamples/README.md | 19 +++-- src/Auth.php | 4 +- src/CodeSamples.php | 44 ++++++++++-- .../Operations/GetCodeSamplesRequest.php | 6 +- src/Reports.php | 12 +++- src/SDKConfiguration.php | 6 +- src/ShortURLs.php | 4 +- src/Suggest.php | 16 +++-- 14 files changed, 173 insertions(+), 47 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 66665b1..abf3e00 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: db1bb4da-054f-485f-8c6e-d42db3f1da90 management: - docChecksum: 53c59e9888ffa48d7fef9b0017efc602 + docChecksum: 37a13cf25882217bb6883efc4407294c docVersion: 0.4.0 - speakeasyVersion: 1.468.6 - generationVersion: 2.493.13 - releaseVersion: 0.47.2 - configChecksum: b81af1be2975a7ed902d5e1c9aaa461a + speakeasyVersion: 1.468.9 + generationVersion: 2.493.21 + releaseVersion: 0.47.3 + configChecksum: bc520ead5512b1ea5ef4febc93e25fec repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php.git repoSubDirectory: . installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php published: true features: php: - core: 3.7.8 + core: 3.7.9 deprecations: 2.81.1 globalSecurity: 2.81.7 globalServerURLs: 2.82.1 @@ -1636,6 +1636,8 @@ examples: application/x-yaml: "0xfA011e0be4" 4XX: application/json: {"message": "", "status_code": 396101} + 5XX: + application/json: {"message": "", "status_code": 569513} generateCodeSamplePreviewAsync: speakeasy-default-generate-code-sample-preview-async: requestBody: @@ -1645,6 +1647,8 @@ examples: application/json: {"job_id": "", "status": "pending"} 4XX: application/json: {"message": "", "status_code": 394086} + 5XX: + application/json: {"message": "", "status_code": 933708} getCodeSamplePreviewAsync: speakeasy-default-get-code-sample-preview-async: parameters: @@ -1658,6 +1662,8 @@ examples: application/json: {"status": "running"} 4XX: application/json: {"message": "", "status_code": 462062} + 5XX: + application/json: {"message": "", "status_code": 91014} getGithubSetupState: speakeasy-default-get-github-setup-state: parameters: @@ -1706,6 +1712,57 @@ examples: application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} 4XX: application/json: {"message": "", "status_code": 458049} + "": + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPetById"] + responses: + 2XX: + application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} + 4XX: + application/json: {"message": "", "status_code": 558834} + python: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPetById"] + languages: ["python"] + responses: + 2XX: + application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} + 4XX: + application/json: {"message": "", "status_code": 521235} + typescript: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPetById"] + languages: ["typescript"] + responses: + 2XX: + application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}, {"code": "", "language": "", "operationId": ""}]} + 4XX: + application/json: {"message": "", "status_code": 458049} + java: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPetById"] + languages: ["java"] + responses: + 2XX: + application/json: {"snippets": [{"code": "", "language": "", "operationId": ""}]} + 4XX: + application/json: {"message": "", "status_code": 262795} + default: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPetById"] + responses: + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "operationId": "getPetById"}]} setWorkspaceFeatureFlags: speakeasy-default-set-workspace-feature-flags: requestBody: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 78c8cad..e0d8dc5 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false php: - version: 0.47.2 + version: 0.47.3 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 6ff959c..b6912d3 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.468.6 +speakeasyVersion: 1.468.9 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:0bed0fb50674ac92adc1637baf302244d5e30b5edde4527faabca2215228aefb - sourceBlobDigest: sha256:c4bc148bd2df6e1b53fee2228938cbb11d43111425e73c01ba58df9ba77bd4a0 + sourceRevisionDigest: sha256:adff4dce67bbafba451723e766dc2723ad6298ddb813f8814aee4dbcea37e56b + sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3 tags: - latest - - speakeasy-sdk-regen-1736900148 + - speakeasy-sdk-regen-1737072957 - 0.4.0 targets: php-target: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:0bed0fb50674ac92adc1637baf302244d5e30b5edde4527faabca2215228aefb - sourceBlobDigest: sha256:c4bc148bd2df6e1b53fee2228938cbb11d43111425e73c01ba58df9ba77bd4a0 + sourceRevisionDigest: sha256:adff4dce67bbafba451723e766dc2723ad6298ddb813f8814aee4dbcea37e56b + sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3 codeSamplesNamespace: my-source-php-code-samples - codeSamplesRevisionDigest: sha256:845564bdcbf2bc8d0291bbc903268b977cc2cbcc2b5a1fc05e00e63baa7274eb + codeSamplesRevisionDigest: sha256:5b79fed584e76ea62444f318e6948260df6c07fa316d8a719c6db76931e66340 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2957bfb..752444e 100755 --- a/README.md +++ b/README.md @@ -135,7 +135,7 @@ if ($response->statusCode === 200) { * [generateCodeSamplePreview](docs/sdks/codesamples/README.md#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. * [generateCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. * [getCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. -* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets from document stored in the registry +* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets ### [events](docs/sdks/events/README.md) diff --git a/RELEASES.md b/RELEASES.md index 3d01ce8..b16cf19 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1574,4 +1574,14 @@ Based on: ### Generated - [php v0.47.2] . ### Releases -- [Composer v0.47.2] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.2 - . \ No newline at end of file +- [Composer v0.47.2] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.2 - . + +## 2025-01-17 00:15:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.468.9 (2.493.21) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.47.3] . +### Releases +- [Composer v0.47.3] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.3 - . \ No newline at end of file diff --git a/docs/Models/Operations/GetCodeSamplesRequest.md b/docs/Models/Operations/GetCodeSamplesRequest.md index 103c542..8008380 100644 --- a/docs/Models/Operations/GetCodeSamplesRequest.md +++ b/docs/Models/Operations/GetCodeSamplesRequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `registryUrl` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source | -| `languages` | array<*string*> | :heavy_minus_sign: | N/A | -| `operationIds` | array<*string*> | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `registryUrl` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. | https://spec.speakeasy.com/my-org/my-workspace/my-source | +| `languages` | array<*string*> | :heavy_minus_sign: | The languages to retrieve snippets for. | | +| `operationIds` | array<*string*> | :heavy_minus_sign: | The operation IDs to retrieve snippets for. | getPetById | \ No newline at end of file diff --git a/docs/sdks/codesamples/README.md b/docs/sdks/codesamples/README.md index 79cea69..bfafe4a 100644 --- a/docs/sdks/codesamples/README.md +++ b/docs/sdks/codesamples/README.md @@ -10,7 +10,7 @@ REST APIs for retrieving Code Samples * [generateCodeSamplePreview](#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. * [generateCodeSamplePreviewAsync](#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. * [getCodeSamplePreviewAsync](#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. -* [get](#get) - Retrieve usage snippets from document stored in the registry +* [get](#get) - Retrieve usage snippets ## generateCodeSamplePreview @@ -67,7 +67,8 @@ if ($response->twoHundredApplicationJsonBytes !== null) { | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| Errorors\Error | 4XX, 5XX | application/json | +| Errorors\Error | 4XX | application/json | +| Errorors\Error | 5XX | application/json | ## generateCodeSamplePreviewAsync @@ -124,7 +125,8 @@ if ($response->object !== null) { | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| Errorors\Error | 4XX, 5XX | application/json | +| Errorors\Error | 4XX | application/json | +| Errorors\Error | 5XX | application/json | ## getCodeSamplePreviewAsync @@ -176,11 +178,13 @@ if ($response->twoHundredApplicationJsonBytes !== null) { | Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | -| Errorors\Error | 4XX, 5XX | application/json | +| Errorors\Error | 4XX | application/json | +| Errorors\Error | 5XX | application/json | ## get -Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. +Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. + ### Example Usage @@ -202,7 +206,10 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ->build(); $request = new Operations\GetCodeSamplesRequest( - registryUrl: 'https://normal-making.name', + registryUrl: 'https://spec.speakeasy.com/my-org/my-workspace/my-source', + operationIds: [ + 'getPetById', + ], ); $response = $sdk->codeSamples->get( diff --git a/src/Auth.php b/src/Auth.php index 45d7926..e9a1a56 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -266,7 +266,9 @@ public function getAccess(?Operations\GetWorkspaceAccessRequest $request = null, } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/CodeSamples.php b/src/CodeSamples.php index 8adc207..d33bc38 100644 --- a/src/CodeSamples.php +++ b/src/CodeSamples.php @@ -109,7 +109,18 @@ public function generateCodeSamplePreview(Shared\CodeSampleSchemaInput $request, } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Speakeasy\SpeakeasyClientSDK\Models\Errorors\Error', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif ($statusCode >= 500 && $statusCode < 600) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -182,7 +193,18 @@ public function generateCodeSamplePreviewAsync(Shared\CodeSampleSchemaInput $req } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Speakeasy\SpeakeasyClientSDK\Models\Errorors\Error', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif ($statusCode >= 500 && $statusCode < 600) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -274,7 +296,18 @@ public function getCodeSamplePreviewAsync(Operations\GetCodeSamplePreviewAsyncRe } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + $serializer = Utils\JSON::createSerializer(); + $responseData = (string) $httpResponse->getBody(); + $obj = $serializer->deserialize($responseData, '\Speakeasy\SpeakeasyClientSDK\Models\Errorors\Error', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true)); + throw $obj->toException(); + } else { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } + } elseif ($statusCode >= 500 && $statusCode < 600) { if (Utils\Utils::matchContentType($contentType, 'application/json')) { $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); @@ -291,9 +324,10 @@ public function getCodeSamplePreviewAsync(Operations\GetCodeSamplePreviewAsyncRe } /** - * Retrieve usage snippets from document stored in the registry + * Retrieve usage snippets + * + * Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. * - * Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID. * * @param Operations\GetCodeSamplesRequest $request * @return Operations\GetCodeSamplesResponse diff --git a/src/Models/Operations/GetCodeSamplesRequest.php b/src/Models/Operations/GetCodeSamplesRequest.php index c843eb6..4a5844c 100644 --- a/src/Models/Operations/GetCodeSamplesRequest.php +++ b/src/Models/Operations/GetCodeSamplesRequest.php @@ -12,7 +12,7 @@ class GetCodeSamplesRequest { /** - * The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source + * The registry URL from which to retrieve the snippets. * * @var string $registryUrl */ @@ -20,7 +20,7 @@ class GetCodeSamplesRequest public string $registryUrl; /** - * $languages + * The languages to retrieve snippets for. * * @var ?array $languages */ @@ -28,7 +28,7 @@ class GetCodeSamplesRequest public ?array $languages = null; /** - * $operationIds + * The operation IDs to retrieve snippets for. * * @var ?array $operationIds */ diff --git a/src/Reports.php b/src/Reports.php index f495964..c1c34c4 100644 --- a/src/Reports.php +++ b/src/Reports.php @@ -94,7 +94,9 @@ public function getChangesReportSignedUrl(Operations\GetChangesReportSignedUrlRe } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -151,7 +153,9 @@ public function getLintingReportSignedUrl(Operations\GetLintingReportSignedUrlRe } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -213,7 +217,9 @@ public function uploadReport(Operations\UploadReportRequestBody $request, ?Optio } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 565c29d..b699566 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -26,11 +26,11 @@ class SDKConfiguration public string $openapiDocVersion = '0.4.0'; - public string $sdkVersion = '0.47.2'; + public string $sdkVersion = '0.47.3'; - public string $genVersion = '2.493.13'; + public string $genVersion = '2.493.21'; - public string $userAgent = 'speakeasy-sdk/php 0.47.2 2.493.13 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; + public string $userAgent = 'speakeasy-sdk/php 0.47.3 2.493.21 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; /** @var array>> */ public ?array $globals = [ 'parameters' => [], diff --git a/src/ShortURLs.php b/src/ShortURLs.php index d435c73..41ee600 100644 --- a/src/ShortURLs.php +++ b/src/ShortURLs.php @@ -99,7 +99,9 @@ public function create(Operations\CreateRequestBody $request, ?Options $options } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); diff --git a/src/Suggest.php b/src/Suggest.php index c63aad6..b8763df 100644 --- a/src/Suggest.php +++ b/src/Suggest.php @@ -103,7 +103,9 @@ public function suggest(Operations\SuggestRequest $request, ?Options $options = } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -165,7 +167,9 @@ public function suggestItems(Shared\SuggestItemsRequestBody $request, ?Options $ } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -230,7 +234,9 @@ public function suggestOpenAPI(Operations\SuggestOpenAPIRequest $request, ?Optio } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); @@ -294,7 +300,9 @@ public function suggestOpenAPIRegistry(Operations\SuggestOpenAPIRegistryRequest } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } - } elseif ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) { + } elseif ($statusCode >= 400 && $statusCode < 500) { + throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); + } elseif ($statusCode >= 500 && $statusCode < 600) { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('API error occurred', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse); } else { throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown status code received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);