Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.469.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Jan 18, 2025
1 parent ad650b9 commit d6c6eb2
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 379 deletions.
16 changes: 4 additions & 12 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: db1bb4da-054f-485f-8c6e-d42db3f1da90
management:
docChecksum: 37a13cf25882217bb6883efc4407294c
docChecksum: 1766b7749df601fc084985fa6f54c7be
docVersion: 0.4.0
speakeasyVersion: 1.468.9
speakeasyVersion: 1.469.1
generationVersion: 2.493.21
releaseVersion: 0.47.3
configChecksum: bc520ead5512b1ea5ef4febc93e25fec
releaseVersion: 0.47.4
configChecksum: 9cad8f769c8cbe79b614bf09f1cfba00
repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php
Expand Down Expand Up @@ -57,8 +57,6 @@ generatedFiles:
- docs/Models/Operations/GetCodeSamplePreviewAsyncRequest.md
- docs/Models/Operations/GetCodeSamplePreviewAsyncResponse.md
- docs/Models/Operations/GetCodeSamplePreviewAsyncResponseBody.md
- docs/Models/Operations/GetCodeSamplesRequest.md
- docs/Models/Operations/GetCodeSamplesResponse.md
- docs/Models/Operations/GetGitHubActionRequest.md
- docs/Models/Operations/GetGitHubActionResponse.md
- docs/Models/Operations/GetGithubSetupStateRequest.md
Expand Down Expand Up @@ -209,8 +207,6 @@ generatedFiles:
- docs/Models/Shared/Tag.md
- docs/Models/Shared/TargetSDK.md
- docs/Models/Shared/Type.md
- docs/Models/Shared/UsageSnippet.md
- docs/Models/Shared/UsageSnippets.md
- docs/Models/Shared/User.md
- docs/Models/Shared/V2Descriptor.md
- docs/Models/Shared/WorkflowDocument.md
Expand Down Expand Up @@ -292,8 +288,6 @@ generatedFiles:
- src/Models/Operations/GetCodeSamplePreviewAsyncRequest.php
- src/Models/Operations/GetCodeSamplePreviewAsyncResponse.php
- src/Models/Operations/GetCodeSamplePreviewAsyncResponseBody.php
- src/Models/Operations/GetCodeSamplesRequest.php
- src/Models/Operations/GetCodeSamplesResponse.php
- src/Models/Operations/GetGitHubActionRequest.php
- src/Models/Operations/GetGitHubActionResponse.php
- src/Models/Operations/GetGithubSetupStateRequest.php
Expand Down Expand Up @@ -444,8 +438,6 @@ generatedFiles:
- src/Models/Shared/Tag.php
- src/Models/Shared/TargetSDK.php
- src/Models/Shared/Type.php
- src/Models/Shared/UsageSnippet.php
- src/Models/Shared/UsageSnippets.php
- src/Models/Shared/User.php
- src/Models/Shared/V2Descriptor.php
- src/Models/Shared/WorkflowDocument.php
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
php:
version: 0.47.3
version: 0.47.4
additionalDependencies:
autoload: {}
autoload-dev: {}
Expand Down
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.468.9
speakeasyVersion: 1.469.1
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:adff4dce67bbafba451723e766dc2723ad6298ddb813f8814aee4dbcea37e56b
sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3
sourceRevisionDigest: sha256:245c341a08bc09b21b1faa96315a54e1ad8cca93fd683684acd29c790e18bd72
sourceBlobDigest: sha256:89100d40a58b27e5294c921a7c698253b084d037635894f0a7c15ab40e224589
tags:
- latest
- speakeasy-sdk-regen-1737072957
- speakeasy-sdk-regen-1737159308
- 0.4.0
targets:
php-target:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:adff4dce67bbafba451723e766dc2723ad6298ddb813f8814aee4dbcea37e56b
sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3
sourceRevisionDigest: sha256:245c341a08bc09b21b1faa96315a54e1ad8cca93fd683684acd29c790e18bd72
sourceBlobDigest: sha256:89100d40a58b27e5294c921a7c698253b084d037635894f0a7c15ab40e224589
codeSamplesNamespace: my-source-php-code-samples
codeSamplesRevisionDigest: sha256:5b79fed584e76ea62444f318e6948260df6c07fa316d8a719c6db76931e66340
codeSamplesRevisionDigest: sha256:91d4fb828486a3cb9f754ffc9732d6e5b4ffafc9c86290e08ae685fe0c55df69
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ 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

### [events](docs/sdks/events/README.md)

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1584,4 +1584,14 @@ Based on:
### Generated
- [php v0.47.3] .
### Releases
- [Composer v0.47.3] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.3 - .
- [Composer v0.47.3] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.3 - .

## 2025-01-18 00:14:53
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.469.1 (2.493.21) https://github.com/speakeasy-api/speakeasy
### Generated
- [php v0.47.4] .
### Releases
- [Composer v0.47.4] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.4 - .
10 changes: 0 additions & 10 deletions docs/Models/Operations/GetCodeSamplesRequest.md

This file was deleted.

11 changes: 0 additions & 11 deletions docs/Models/Operations/GetCodeSamplesResponse.md

This file was deleted.

10 changes: 0 additions & 10 deletions docs/Models/Shared/UsageSnippet.md

This file was deleted.

8 changes: 0 additions & 8 deletions docs/Models/Shared/UsageSnippets.md

This file was deleted.

60 changes: 1 addition & 59 deletions docs/sdks/codesamples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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

## generateCodeSamplePreview

Expand Down Expand Up @@ -179,61 +178,4 @@ if ($response->twoHundredApplicationJsonBytes !== null) {
| Error Type | Status Code | Content Type |
| ---------------- | ---------------- | ---------------- |
| Errorors\Error | 4XX | application/json |
| Errorors\Error | 5XX | application/json |

## get

Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID.


### Example Usage

```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Speakeasy\SpeakeasyClientSDK;
use Speakeasy\SpeakeasyClientSDK\Models\Operations;
use Speakeasy\SpeakeasyClientSDK\Models\Shared;

$sdk = SpeakeasyClientSDK\SDK::builder()
->setSecurity(
new Shared\Security(
apiKey: '<YOUR_API_KEY_HERE>',
)
)
->build();

$request = new Operations\GetCodeSamplesRequest(
registryUrl: 'https://spec.speakeasy.com/my-org/my-workspace/my-source',
operationIds: [
'getPetById',
],
);

$response = $sdk->codeSamples->get(
request: $request
);

if ($response->usageSnippets !== null) {
// handle response
}
```

### Parameters

| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `$request` | [Operations\GetCodeSamplesRequest](../../Models/Operations/GetCodeSamplesRequest.md) | :heavy_check_mark: | The request object to use for the request. |

### Response

**[?Operations\GetCodeSamplesResponse](../../Models/Operations/GetCodeSamplesResponse.md)**

### Errors

| Error Type | Status Code | Content Type |
| --------------------- | --------------------- | --------------------- |
| Errorors\Error | 4XX | application/json |
| Errorors\SDKException | 5XX | \*/\* |
| Errorors\Error | 5XX | application/json |
74 changes: 0 additions & 74 deletions src/CodeSamples.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,78 +323,4 @@ public function getCodeSamplePreviewAsync(Operations\GetCodeSamplePreviewAsyncRe
}
}

/**
* Retrieve usage snippets
*
* Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID.
*
*
* @param Operations\GetCodeSamplesRequest $request
* @return Operations\GetCodeSamplesResponse
* @throws \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException
*/
public function get(Operations\GetCodeSamplesRequest $request, ?Options $options = null): Operations\GetCodeSamplesResponse
{
$baseUrl = $this->sdkConfiguration->getServerUrl();
$url = Utils\Utils::generateUrl($baseUrl, '/v1/code_sample');
$urlOverride = null;
$httpOptions = ['http_errors' => false];

$qp = Utils\Utils::getQueryParams(Operations\GetCodeSamplesRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals);
$httpOptions['headers']['Accept'] = 'application/json';
$httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent;
$httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url);
$hookContext = new HookContext('getCodeSamples', null, $this->sdkConfiguration->securitySource);
$httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest);
$httpOptions['query'] = Utils\QueryParameters::standardizeQueryParams($httpRequest, $qp);
$httpOptions = Utils\Utils::convertHeadersToOptions($httpRequest, $httpOptions);
$httpRequest = Utils\Utils::removeHeaders($httpRequest);
try {
$httpResponse = $this->sdkConfiguration->client->send($httpRequest, $httpOptions);
} catch (\GuzzleHttp\Exception\GuzzleException $error) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), null, $error);
$httpResponse = $res;
}
$contentType = $httpResponse->getHeader('Content-Type')[0] ?? '';

$statusCode = $httpResponse->getStatusCode();
if ($statusCode >= 400 && $statusCode < 500 || $statusCode >= 500 && $statusCode < 600) {
$res = $this->sdkConfiguration->hooks->afterError(new Hooks\AfterErrorContext($hookContext), $httpResponse, null);
$httpResponse = $res;
}
if ($statusCode >= 200 && $statusCode < 300) {
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\Shared\UsageSnippets', 'json', DeserializationContext::create()->setRequireAllRequiredProperties(true));
$response = new Operations\GetCodeSamplesResponse(
statusCode: $statusCode,
contentType: $contentType,
rawResponse: $httpResponse,
usageSnippets: $obj);

return $response;
} else {
throw new \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException('Unknown content type received', $statusCode, $httpResponse->getBody()->getContents(), $httpResponse);
}
} 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) {
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);
}
}

}
Loading

0 comments on commit d6c6eb2

Please sign in to comment.