From c89960fad3c8f1d48ed5c5c1b3f67da44e4f5da7 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 28 Jan 2025 00:16:40 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.476.2 --- .speakeasy/gen.lock | 27 ++++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 ++--- README.md | 59 ++++++----------- RELEASES.md | 12 +++- USAGE.md | 14 ++--- .../Operations/ArchiveNamespaceRequest.md | 9 +++ .../Operations/ArchiveNamespaceRequestBody.md | 10 +++ .../Operations/ArchiveNamespaceResponse.md | 10 +++ docs/Models/Shared/NamespaceT.md | 1 + docs/sdks/artifacts/README.md | 54 ++++++++++++++++ src/Artifacts.php | 63 +++++++++++++++++++ .../Operations/ArchiveNamespaceRequest.php | 38 +++++++++++ .../ArchiveNamespaceRequestBody.php | 30 +++++++++ .../Operations/ArchiveNamespaceResponse.php | 46 ++++++++++++++ src/Models/Shared/NamespaceT.php | 12 +++- src/SDKConfiguration.php | 6 +- src/Utils/UnionHandler.php | 25 +++++++- 18 files changed, 360 insertions(+), 72 deletions(-) create mode 100644 docs/Models/Operations/ArchiveNamespaceRequest.md create mode 100644 docs/Models/Operations/ArchiveNamespaceRequestBody.md create mode 100644 docs/Models/Operations/ArchiveNamespaceResponse.md create mode 100644 src/Models/Operations/ArchiveNamespaceRequest.php create mode 100644 src/Models/Operations/ArchiveNamespaceRequestBody.php create mode 100644 src/Models/Operations/ArchiveNamespaceResponse.php diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 067081a..049cfc0 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,20 @@ lockVersion: 2.0.0 id: db1bb4da-054f-485f-8c6e-d42db3f1da90 management: - docChecksum: 8e0ff093baf67c9e2001a9f810f355de + docChecksum: af467caf61bea274c32dd872e84f602e docVersion: 0.4.0 - speakeasyVersion: 1.470.1 - generationVersion: 2.493.34 - releaseVersion: 0.47.6 - configChecksum: e33657152519b98a43d4ee989637ec18 + speakeasyVersion: 1.476.2 + generationVersion: 2.495.1 + releaseVersion: 0.48.0 + configChecksum: 5c19f838aa948a74fb271f1bf9e035a8 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.9 + constsAndDefaults: 0.2.0 + core: 3.7.10 deprecations: 2.81.1 globalSecurity: 2.81.7 globalServerURLs: 2.82.1 @@ -31,6 +32,9 @@ generatedFiles: - docs/Models/Errorors/Error.md - docs/Models/Operations/ActivateSubscriptionNamespaceRequest.md - docs/Models/Operations/ActivateSubscriptionNamespaceResponse.md + - docs/Models/Operations/ArchiveNamespaceRequest.md + - docs/Models/Operations/ArchiveNamespaceRequestBody.md + - docs/Models/Operations/ArchiveNamespaceResponse.md - docs/Models/Operations/CheckGithubAccessRequest.md - docs/Models/Operations/CheckGithubAccessResponse.md - docs/Models/Operations/CreateFreeTrialResponse.md @@ -264,6 +268,9 @@ generatedFiles: - src/Models/Errorors/SDKException.php - src/Models/Operations/ActivateSubscriptionNamespaceRequest.php - src/Models/Operations/ActivateSubscriptionNamespaceResponse.php + - src/Models/Operations/ArchiveNamespaceRequest.php + - src/Models/Operations/ArchiveNamespaceRequestBody.php + - src/Models/Operations/ArchiveNamespaceResponse.php - src/Models/Operations/CheckGithubAccessRequest.php - src/Models/Operations/CheckGithubAccessResponse.php - src/Models/Operations/CreateFreeTrialResponse.php @@ -1071,5 +1078,13 @@ examples: application/json: [{"created_at": "2024-01-24T23:49:11.608Z", "execution_id": "", "id": "", "interaction_type": "LINT", "local_started_at": "2023-03-09T07:00:10.489Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] 5XX: application/json: {"message": "", "status_code": 238575} + archiveNamespace: + speakeasy-default-archive-namespace: + parameters: + path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 334009} examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8d8903a..8b7ecba 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false php: - version: 0.47.6 + version: 0.48.0 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 50d5c48..e317abc 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.470.1 +speakeasyVersion: 1.476.2 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:faaba1071b8211089170d62216fb0528db5d373993977552eb0b20727dfc34fd - sourceBlobDigest: sha256:fdce65fc06375b5ac8b51a49e68853e76ba820d057de83e9d0c608a25af78b7d + sourceRevisionDigest: sha256:460508c20e2184e27dc8a8f2e11a01d48c65d209f8db7063fb88585fb598ae5c + sourceBlobDigest: sha256:c06cc83921f8f24dfc098c977539857c3b7ff65302887ea14acb0fe3d5b17c62 tags: - latest - - speakeasy-sdk-regen-1737591343 + - speakeasy-sdk-regen-1738023358 - 0.4.0 targets: php-target: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:faaba1071b8211089170d62216fb0528db5d373993977552eb0b20727dfc34fd - sourceBlobDigest: sha256:fdce65fc06375b5ac8b51a49e68853e76ba820d057de83e9d0c608a25af78b7d + sourceRevisionDigest: sha256:460508c20e2184e27dc8a8f2e11a01d48c65d209f8db7063fb88585fb598ae5c + sourceBlobDigest: sha256:c06cc83921f8f24dfc098c977539857c3b7ff65302887ea14acb0fe3d5b17c62 codeSamplesNamespace: my-source-php-code-samples - codeSamplesRevisionDigest: sha256:2e7ad8921f68c8fc8e7187ce1f9155aba3871b47342dd3441264a97b7a5fba16 + codeSamplesRevisionDigest: sha256:b449aa1d4d889c5d97d335df0a49840e2ad44fd602a04b8d5bb7c5c346463fb0 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index f8ad81b..10f5307 100755 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ 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() @@ -83,18 +84,11 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ) ->build(); -$request = new Shared\RemoteSource( - inputs: [ - new Shared\RemoteDocument( - registryUrl: 'https://productive-swine.net', - ), - ], - output: new Shared\RemoteDocument( - registryUrl: 'https://spiteful-apricot.info', - ), +$request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', ); -$response = $sdk->artifacts->createRemoteSource( +$response = $sdk->artifacts->setArchived( request: $request ); @@ -112,6 +106,7 @@ if ($response->statusCode === 200) { ### [artifacts](docs/sdks/artifacts/README.md) +* [setArchived](docs/sdks/artifacts/README.md#setarchived) - Set whether a namespace is archived * [createRemoteSource](docs/sdks/artifacts/README.md#createremotesource) - Configure a new remote source * [getBlob](docs/sdks/artifacts/README.md#getblob) - Get blob for a particular digest * [getManifest](docs/sdks/artifacts/README.md#getmanifest) - Get manifest for a particular reference @@ -351,7 +346,7 @@ By default an API error will raise a `Errorors\SDKException` exception, which ha | `$rawResponse` | *?\Psr\Http\Message\ResponseInterface* | The raw HTTP response | | `$body` | *string* | The response content | -When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `createRemoteSource` method throws the following exceptions: +When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `setArchived` method throws the following exceptions: | Error Type | Status Code | Content Type | | --------------------- | ----------- | ---------------- | @@ -366,6 +361,7 @@ 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() @@ -377,18 +373,11 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ->build(); try { - $request = new Shared\RemoteSource( - inputs: [ - new Shared\RemoteDocument( - registryUrl: 'https://productive-swine.net', - ), - ], - output: new Shared\RemoteDocument( - registryUrl: 'https://spiteful-apricot.info', - ), + $request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', ); - $response = $sdk->artifacts->createRemoteSource( + $response = $sdk->artifacts->setArchived( request: $request ); @@ -424,6 +413,7 @@ 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() @@ -435,18 +425,11 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ) ->build(); -$request = new Shared\RemoteSource( - inputs: [ - new Shared\RemoteDocument( - registryUrl: 'https://productive-swine.net', - ), - ], - output: new Shared\RemoteDocument( - registryUrl: 'https://spiteful-apricot.info', - ), +$request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', ); -$response = $sdk->artifacts->createRemoteSource( +$response = $sdk->artifacts->setArchived( request: $request ); @@ -464,6 +447,7 @@ 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() @@ -475,18 +459,11 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ) ->build(); -$request = new Shared\RemoteSource( - inputs: [ - new Shared\RemoteDocument( - registryUrl: 'https://productive-swine.net', - ), - ], - output: new Shared\RemoteDocument( - registryUrl: 'https://spiteful-apricot.info', - ), +$request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', ); -$response = $sdk->artifacts->createRemoteSource( +$response = $sdk->artifacts->setArchived( request: $request ); diff --git a/RELEASES.md b/RELEASES.md index 725fbec..105c326 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1614,4 +1614,14 @@ Based on: ### Generated - [php v0.47.6] . ### Releases -- [Composer v0.47.6] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.6 - . \ No newline at end of file +- [Composer v0.47.6] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.47.6 - . + +## 2025-01-28 00:15:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.476.2 (2.495.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.48.0] . +### Releases +- [Composer v0.48.0] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.48.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index ddf01a1..9c2425e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -5,6 +5,7 @@ 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() @@ -15,18 +16,11 @@ $sdk = SpeakeasyClientSDK\SDK::builder() ) ->build(); -$request = new Shared\RemoteSource( - inputs: [ - new Shared\RemoteDocument( - registryUrl: 'https://productive-swine.net', - ), - ], - output: new Shared\RemoteDocument( - registryUrl: 'https://spiteful-apricot.info', - ), +$request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', ); -$response = $sdk->artifacts->createRemoteSource( +$response = $sdk->artifacts->setArchived( request: $request ); diff --git a/docs/Models/Operations/ArchiveNamespaceRequest.md b/docs/Models/Operations/ArchiveNamespaceRequest.md new file mode 100644 index 0000000..7940949 --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceRequest.md @@ -0,0 +1,9 @@ +# ArchiveNamespaceRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `namespaceName` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [?Operations\ArchiveNamespaceRequestBody](../../Models/Operations/ArchiveNamespaceRequestBody.md) | :heavy_minus_sign: | Archived status | \ No newline at end of file diff --git a/docs/Models/Operations/ArchiveNamespaceRequestBody.md b/docs/Models/Operations/ArchiveNamespaceRequestBody.md new file mode 100644 index 0000000..31dd557 --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceRequestBody.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceRequestBody + +Archived status + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `archived` | *?bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/ArchiveNamespaceResponse.md b/docs/Models/Operations/ArchiveNamespaceResponse.md new file mode 100644 index 0000000..962f430 --- /dev/null +++ b/docs/Models/Operations/ArchiveNamespaceResponse.md @@ -0,0 +1,10 @@ +# ArchiveNamespaceResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `statusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `rawResponse` | [\Psr\Http\Message\ResponseInterface](https://www.php-fig.org/psr/psr-7/#33-psrhttpmessageresponseinterface) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/Models/Shared/NamespaceT.md b/docs/Models/Shared/NamespaceT.md index c12127a..41f6db0 100644 --- a/docs/Models/Shared/NamespaceT.md +++ b/docs/Models/Shared/NamespaceT.md @@ -11,6 +11,7 @@ A namespace contains many revisions. | `id` | *string* | :heavy_check_mark: | {organization_slug}/{workspace_slug}/{namespace_name} | | `name` | *string* | :heavy_check_mark: | A human-readable name for the namespace. | | `updatedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `archivedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_minus_sign: | N/A | | `compositeSpecMetadata` | [?Shared\CompositeSpecMetadata](../../Models/Shared/CompositeSpecMetadata.md) | :heavy_minus_sign: | N/A | | `latestRevisionMetadata` | [?Shared\RevisionContentsMetadata](../../Models/Shared/RevisionContentsMetadata.md) | :heavy_minus_sign: | N/A | | `public` | *?bool* | :heavy_minus_sign: | Indicates whether the namespace is publicly accessible | \ No newline at end of file diff --git a/docs/sdks/artifacts/README.md b/docs/sdks/artifacts/README.md index ccdde31..d2d29a1 100644 --- a/docs/sdks/artifacts/README.md +++ b/docs/sdks/artifacts/README.md @@ -7,6 +7,7 @@ REST APIs for working with Registry artifacts ### Available Operations +* [setArchived](#setarchived) - Set whether a namespace is archived * [createRemoteSource](#createremotesource) - Configure a new remote source * [getBlob](#getblob) - Get blob for a particular digest * [getManifest](#getmanifest) - Get manifest for a particular reference @@ -18,6 +19,59 @@ REST APIs for working with Registry artifacts * [preflight](#preflight) - Get access token for communicating with OCI distribution endpoints * [setVisibility](#setvisibility) - Set visibility of a namespace with an existing metadata entry +## setArchived + +Set whether a namespace is archived + +### 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: '', + ) + ) + ->build(); + +$request = new Operations\ArchiveNamespaceRequest( + namespaceName: '', +); + +$response = $sdk->artifacts->setArchived( + request: $request +); + +if ($response->statusCode === 200) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `$request` | [Operations\ArchiveNamespaceRequest](../../Models/Operations/ArchiveNamespaceRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\ArchiveNamespaceResponse](../../Models/Operations/ArchiveNamespaceResponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| Errorors\Error | 4XX | application/json | +| Errorors\SDKException | 5XX | \*/\* | + ## createRemoteSource Configure a new remote source diff --git a/src/Artifacts.php b/src/Artifacts.php index 4698e1f..a8958f1 100644 --- a/src/Artifacts.php +++ b/src/Artifacts.php @@ -45,6 +45,69 @@ public function getUrl(string $baseUrl, array $urlVariables): string return Utils\Utils::templateUrl($baseUrl, $urlVariables); } + /** + * Set whether a namespace is archived + * + * @param Operations\ArchiveNamespaceRequest $request + * @return Operations\ArchiveNamespaceResponse + * @throws \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException + */ + public function setArchived(Operations\ArchiveNamespaceRequest $request, ?Options $options = null): Operations\ArchiveNamespaceResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/artifacts/namespaces/{namespace_name}/archive', Operations\ArchiveNamespaceRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; + $httpOptions = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $httpOptions = array_merge_recursive($httpOptions, $body); + } + $httpOptions['headers']['Accept'] = 'application/json'; + $httpOptions['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + $hookContext = new HookContext('archiveNamespace', null, $this->sdkConfiguration->securitySource); + $httpRequest = $this->sdkConfiguration->hooks->beforeRequest(new Hooks\BeforeRequestContext($hookContext), $httpRequest); + $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) { + $httpResponse = $this->sdkConfiguration->hooks->afterSuccess(new Hooks\AfterSuccessContext($hookContext), $httpResponse); + + return new Operations\ArchiveNamespaceResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $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); + } + } + /** * Configure a new remote source * diff --git a/src/Models/Operations/ArchiveNamespaceRequest.php b/src/Models/Operations/ArchiveNamespaceRequest.php new file mode 100644 index 0000000..1ef7b83 --- /dev/null +++ b/src/Models/Operations/ArchiveNamespaceRequest.php @@ -0,0 +1,38 @@ +namespaceName = $namespaceName; + $this->requestBody = $requestBody; + } +} \ No newline at end of file diff --git a/src/Models/Operations/ArchiveNamespaceRequestBody.php b/src/Models/Operations/ArchiveNamespaceRequestBody.php new file mode 100644 index 0000000..146d402 --- /dev/null +++ b/src/Models/Operations/ArchiveNamespaceRequestBody.php @@ -0,0 +1,30 @@ +archived = $archived; + } +} \ No newline at end of file diff --git a/src/Models/Operations/ArchiveNamespaceResponse.php b/src/Models/Operations/ArchiveNamespaceResponse.php new file mode 100644 index 0000000..a55994f --- /dev/null +++ b/src/Models/Operations/ArchiveNamespaceResponse.php @@ -0,0 +1,46 @@ +contentType = $contentType; + $this->statusCode = $statusCode; + $this->rawResponse = $rawResponse; + } +} \ No newline at end of file diff --git a/src/Models/Shared/NamespaceT.php b/src/Models/Shared/NamespaceT.php index 259ec9e..78740ae 100644 --- a/src/Models/Shared/NamespaceT.php +++ b/src/Models/Shared/NamespaceT.php @@ -42,6 +42,14 @@ class NamespaceT #[\Speakeasy\Serializer\Annotation\SerializedName('updated_at')] public \DateTime $updatedAt; + /** + * + * @var ?\DateTime $archivedAt + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('archived_at')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?\DateTime $archivedAt = null; + /** * * @var ?CompositeSpecMetadata $compositeSpecMetadata @@ -74,16 +82,18 @@ class NamespaceT * @param string $id * @param string $name * @param \DateTime $updatedAt + * @param ?\DateTime $archivedAt * @param ?CompositeSpecMetadata $compositeSpecMetadata * @param ?RevisionContentsMetadata $latestRevisionMetadata * @param ?bool $public */ - public function __construct(\DateTime $createdAt, string $id, string $name, \DateTime $updatedAt, ?CompositeSpecMetadata $compositeSpecMetadata = null, ?RevisionContentsMetadata $latestRevisionMetadata = null, ?bool $public = null) + public function __construct(\DateTime $createdAt, string $id, string $name, \DateTime $updatedAt, ?\DateTime $archivedAt = null, ?CompositeSpecMetadata $compositeSpecMetadata = null, ?RevisionContentsMetadata $latestRevisionMetadata = null, ?bool $public = null) { $this->createdAt = $createdAt; $this->id = $id; $this->name = $name; $this->updatedAt = $updatedAt; + $this->archivedAt = $archivedAt; $this->compositeSpecMetadata = $compositeSpecMetadata; $this->latestRevisionMetadata = $latestRevisionMetadata; $this->public = $public; diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 8d2cedd..e733899 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.6'; + public string $sdkVersion = '0.48.0'; - public string $genVersion = '2.493.34'; + public string $genVersion = '2.495.1'; - public string $userAgent = 'speakeasy-sdk/php 0.47.6 2.493.34 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; + public string $userAgent = 'speakeasy-sdk/php 0.48.0 2.495.1 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; /** @var array>> */ public ?array $globals = [ 'parameters' => [], diff --git a/src/Utils/UnionHandler.php b/src/Utils/UnionHandler.php index 10c47b5..18d0213 100644 --- a/src/Utils/UnionHandler.php +++ b/src/Utils/UnionHandler.php @@ -152,8 +152,7 @@ public function deserializeUnion(DeserializationVisitorInterface $visitor, mixed $typeToTry = $possibleType['name']; if ($typeToTry === 'array') { - $typeNames = array_map(fn ($t) => $t['name'], $possibleType['params']); - $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + $typeToTry = $this->resolveArrayTypes($possibleType); } if ($typeToTry === 'enum') { $typeToTry = $possibleType['params'][0]['name']; @@ -315,4 +314,26 @@ private function reorderTypes(array $type): array return $type; } + + + /** + * @param array $possibleType + * @return string + */ + private function resolveArrayTypes(array $possibleType): string + { + $typeNames = []; + foreach ($possibleType['params'] as $param) { + + if ($param['name'] === 'union') { + $innerTypes = array_map(fn ($t) => $t['name'], $param['params']); + $typeNames[] = $typeToTry = implode('|', $innerTypes); + } else { + $typeNames[] = $param['name']; + } + } + $typeToTry = 'array<'.implode(', ', $typeNames).'>'; + + return $typeToTry; + } }