diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2e26982..f18029f 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: db1bb4da-054f-485f-8c6e-d42db3f1da90 management: - docChecksum: 04169f580d81fde74dfa8c8a3b75a513 + docChecksum: 461c434568ccf922eabedab19a4e0afd docVersion: 0.4.0 - speakeasyVersion: 1.443.0 + speakeasyVersion: 1.445.2 generationVersion: 2.461.4 - releaseVersion: 0.45.8 - configChecksum: 2b21332ef0665786731e770b6ab8a524 + releaseVersion: 0.45.9 + configChecksum: 78308325e31c462e1e151215ebf3f670 repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php.git repoSubDirectory: . installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-php @@ -104,6 +104,7 @@ generatedFiles: - docs/Models/Operations/GetLintingReportSignedUrlSignedAccess.md - docs/Models/Operations/GetManifestRequest.md - docs/Models/Operations/GetManifestResponse.md + - docs/Models/Operations/GetNamespacesRequest.md - docs/Models/Operations/GetNamespacesResponse.md - docs/Models/Operations/GetOrganizationRequest.md - docs/Models/Operations/GetOrganizationResponse.md @@ -186,6 +187,9 @@ generatedFiles: - docs/Models/Operations/Schema.md - docs/Models/Operations/SearchWorkspaceEventsRequest.md - docs/Models/Operations/SearchWorkspaceEventsResponse.md + - docs/Models/Operations/SetVisibilityRequest.md + - docs/Models/Operations/SetVisibilityRequestBody.md + - docs/Models/Operations/SetVisibilityResponse.md - docs/Models/Operations/SuggestItemsResponse.md - docs/Models/Operations/SuggestOpenAPIRegistryRequest.md - docs/Models/Operations/SuggestOpenAPIRegistryResponse.md @@ -403,6 +407,7 @@ generatedFiles: - src/Models/Operations/GetLintingReportSignedUrlSignedAccess.php - src/Models/Operations/GetManifestRequest.php - src/Models/Operations/GetManifestResponse.php + - src/Models/Operations/GetNamespacesRequest.php - src/Models/Operations/GetNamespacesResponse.php - src/Models/Operations/GetOrganizationRequest.php - src/Models/Operations/GetOrganizationResponse.php @@ -485,6 +490,9 @@ generatedFiles: - src/Models/Operations/Schema.php - src/Models/Operations/SearchWorkspaceEventsRequest.php - src/Models/Operations/SearchWorkspaceEventsResponse.php + - src/Models/Operations/SetVisibilityRequest.php + - src/Models/Operations/SetVisibilityRequestBody.php + - src/Models/Operations/SetVisibilityResponse.php - src/Models/Operations/SuggestItemsResponse.php - src/Models/Operations/SuggestOpenAPIRegistryRequest.php - src/Models/Operations/SuggestOpenAPIRegistryResponse.php @@ -1797,3 +1805,11 @@ examples: application/json: {"actions": {"generation_action_configured": false, "publish_action_configured": false}, "app_installed": false, "secrets": {"api_key_configured": true, "publishing_secrets_configured": true}} 4XX: application/json: {"message": "", "status_code": 743106} + setVisibility: + speakeasy-default-set-visibility: + parameters: + path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 651364} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8b43ecf..6ecc344 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,7 +11,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false php: - version: 0.45.8 + version: 0.45.9 clientServerStatusCodesAsErrors: true defaultErrorName: SDKException flattenGlobalSecurity: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index e11be56..ff71e01 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,20 +1,21 @@ -speakeasyVersion: 1.443.0 +speakeasyVersion: 1.445.2 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:e96aac9abaff42f46fffda7dd304bc88b490bebb72c14a2620259d12a571c271 - sourceBlobDigest: sha256:74787f4db92951059d965fb8a8647dac975d1ea2797d3b5337093b347fcddbe5 + sourceRevisionDigest: sha256:995ccdc5ddaf24ea26b9adba5363e6e2216ee81f79216804aead1e2861c04102 + sourceBlobDigest: sha256:0bd677c0a67a5afc9b64d90877bb56e6b6fa17855da26aa1b7357a09e5a8f2ff tags: - latest - - speakeasy-sdk-regen-1732234614 + - speakeasy-sdk-regen-1732580207 + - 0.4.0 targets: php-target: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:e96aac9abaff42f46fffda7dd304bc88b490bebb72c14a2620259d12a571c271 - sourceBlobDigest: sha256:74787f4db92951059d965fb8a8647dac975d1ea2797d3b5337093b347fcddbe5 + sourceRevisionDigest: sha256:995ccdc5ddaf24ea26b9adba5363e6e2216ee81f79216804aead1e2861c04102 + sourceBlobDigest: sha256:0bd677c0a67a5afc9b64d90877bb56e6b6fa17855da26aa1b7357a09e5a8f2ff codeSamplesNamespace: my-source-code-samples - codeSamplesRevisionDigest: sha256:25dd220102f0065acd45c33758587b97d5dc8ce5139640ddb53453dabb7c4318 + codeSamplesRevisionDigest: sha256:34e3ae8bec7b8a602d26f6fc546b08639cdb8715b1f8d6c9dce0918a6c4e42fe workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 704784d..ebe9aaa 100755 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ if ($response->apis !== null) { * [listRemoteSources](docs/sdks/artifacts/README.md#listremotesources) - Get remote sources attached to a particular namespace * [postTags](docs/sdks/artifacts/README.md#posttags) - Add tags to an existing revision * [preflight](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints +* [setVisibility](docs/sdks/artifacts/README.md#setvisibility) - Set visibility of a namespace with an existing metadata entry ### [auth](docs/sdks/auth/README.md) diff --git a/RELEASES.md b/RELEASES.md index 5f68f5c..b30888b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1454,4 +1454,14 @@ Based on: ### Generated - [php v0.45.8] . ### Releases -- [Composer v0.45.8] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.45.8 - . \ No newline at end of file +- [Composer v0.45.8] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.45.8 - . + +## 2024-11-26 00:16:43 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.445.2 (2.461.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [php v0.45.9] . +### Releases +- [Composer v0.45.9] https://packagist.org/packages/speakeasy-api/speakeasy-client-sdk-php#v0.45.9 - . \ No newline at end of file diff --git a/docs/Models/Operations/GetNamespacesRequest.md b/docs/Models/Operations/GetNamespacesRequest.md new file mode 100644 index 0000000..94d5058 --- /dev/null +++ b/docs/Models/Operations/GetNamespacesRequest.md @@ -0,0 +1,8 @@ +# GetNamespacesRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `isComposite` | *?bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SetVisibilityRequest.md b/docs/Models/Operations/SetVisibilityRequest.md new file mode 100644 index 0000000..e6adf6c --- /dev/null +++ b/docs/Models/Operations/SetVisibilityRequest.md @@ -0,0 +1,9 @@ +# SetVisibilityRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `namespaceName` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [?Operations\SetVisibilityRequestBody](../../Models/Operations/SetVisibilityRequestBody.md) | :heavy_minus_sign: | Namespace visibility | \ No newline at end of file diff --git a/docs/Models/Operations/SetVisibilityRequestBody.md b/docs/Models/Operations/SetVisibilityRequestBody.md new file mode 100644 index 0000000..4b636f1 --- /dev/null +++ b/docs/Models/Operations/SetVisibilityRequestBody.md @@ -0,0 +1,10 @@ +# SetVisibilityRequestBody + +Namespace visibility + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `public` | *bool* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/Models/Operations/SetVisibilityResponse.md b/docs/Models/Operations/SetVisibilityResponse.md new file mode 100644 index 0000000..4d5b78c --- /dev/null +++ b/docs/Models/Operations/SetVisibilityResponse.md @@ -0,0 +1,10 @@ +# SetVisibilityResponse + + +## 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 0e6dabd..ec23ded 100644 --- a/docs/Models/Shared/NamespaceT.md +++ b/docs/Models/Shared/NamespaceT.md @@ -10,4 +10,5 @@ A namespace contains many revisions. | `createdAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | | `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 | \ No newline at end of file +| `updatedAt` | [\DateTime](https://www.php.net/manual/en/class.datetime.php) | :heavy_check_mark: | N/A | +| `public` | *?bool* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdks/artifacts/README.md b/docs/sdks/artifacts/README.md index 638269c..59c7b23 100644 --- a/docs/sdks/artifacts/README.md +++ b/docs/sdks/artifacts/README.md @@ -16,6 +16,7 @@ REST APIs for working with Registry artifacts * [listRemoteSources](#listremotesources) - Get remote sources attached to a particular namespace * [postTags](#posttags) - Add tags to an existing revision * [preflight](#preflight) - Get access token for communicating with OCI distribution endpoints +* [setVisibility](#setvisibility) - Set visibility of a namespace with an existing metadata entry ## createRemoteSource @@ -194,6 +195,7 @@ declare(strict_types=1); require 'vendor/autoload.php'; use Speakeasy\SpeakeasyClientSDK; +use Speakeasy\SpeakeasyClientSDK\Models\Operations; use Speakeasy\SpeakeasyClientSDK\Models\Shared; $security = new Shared\Security( @@ -202,10 +204,10 @@ $security = new Shared\Security( $sdk = SpeakeasyClientSDK\SDK::builder()->setSecurity($security)->build(); - +$request = new Operations\GetNamespacesRequest(); $response = $sdk->artifacts->getNamespaces( - + request: $request ); if ($response->getNamespacesResponse !== null) { @@ -213,6 +215,12 @@ if ($response->getNamespacesResponse !== null) { } ``` +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Operations\GetNamespacesRequest](../../Models/Operations/GetNamespacesRequest.md) | :heavy_check_mark: | The request object to use for the request. | + ### Response **[?Operations\GetNamespacesResponse](../../Models/Operations/GetNamespacesResponse.md)** @@ -469,6 +477,57 @@ if ($response->preflightToken !== null) { ### Errors +| Error Type | Status Code | Content Type | +| --------------------- | --------------------- | --------------------- | +| Errorors\Error | 4XX | application/json | +| Errorors\SDKException | 5XX | \*/\* | + +## setVisibility + +Set visibility of a namespace with an existing metadata entry + +### Example Usage + +```php +declare(strict_types=1); + +require 'vendor/autoload.php'; + +use Speakeasy\SpeakeasyClientSDK; +use Speakeasy\SpeakeasyClientSDK\Models\Operations; +use Speakeasy\SpeakeasyClientSDK\Models\Shared; + +$security = new Shared\Security( + apiKey: '', +); + +$sdk = SpeakeasyClientSDK\SDK::builder()->setSecurity($security)->build(); + +$request = new Operations\SetVisibilityRequest( + namespaceName: '', +); + +$response = $sdk->artifacts->setVisibility( + request: $request +); + +if ($response->statusCode === 200) { + // handle response +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `$request` | [Operations\SetVisibilityRequest](../../Models/Operations/SetVisibilityRequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[?Operations\SetVisibilityResponse](../../Models/Operations/SetVisibilityResponse.md)** + +### Errors + | Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | Errorors\Error | 4XX | application/json | diff --git a/src/Artifacts.php b/src/Artifacts.php index 5c9ff00..6dfc1ed 100644 --- a/src/Artifacts.php +++ b/src/Artifacts.php @@ -197,15 +197,20 @@ public function getManifest(Operations\GetManifestRequest $request): Operations\ /** * Each namespace contains many revisions. * + * @param ?Operations\GetNamespacesRequest $request * @return Operations\GetNamespacesResponse * @throws \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException */ - public function getNamespaces(): Operations\GetNamespacesResponse + public function getNamespaces(?Operations\GetNamespacesRequest $request = null): Operations\GetNamespacesResponse { $baseUrl = $this->sdkConfiguration->getServerUrl(); $url = Utils\Utils::generateUrl($baseUrl, '/v1/artifacts/namespaces'); $urlOverride = null; $options = ['http_errors' => false]; + + $qp = Utils\Utils::getQueryParams(Operations\GetNamespacesRequest::class, $request, $urlOverride, $this->sdkConfiguration->globals); + + $options = array_merge_recursive($options, $qp); $options['headers']['Accept'] = 'application/json'; $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; $httpRequest = new \GuzzleHttp\Psr7\Request('GET', $url); @@ -518,4 +523,52 @@ public function preflight(?Shared\PreflightRequest $request = null): Operations\ } } + /** + * Set visibility of a namespace with an existing metadata entry + * + * @param Operations\SetVisibilityRequest $request + * @return Operations\SetVisibilityResponse + * @throws \Speakeasy\SpeakeasyClientSDK\Models\Errorors\SDKException + */ + public function setVisibility(Operations\SetVisibilityRequest $request): Operations\SetVisibilityResponse + { + $baseUrl = $this->sdkConfiguration->getServerUrl(); + $url = Utils\Utils::generateUrl($baseUrl, '/v1/artifacts/namespaces/{namespace_name}/visibility', Operations\SetVisibilityRequest::class, $request, $this->sdkConfiguration->globals); + $urlOverride = null; + $options = ['http_errors' => false]; + $body = Utils\Utils::serializeRequestBody($request, 'requestBody', 'json'); + if ($body !== null) { + $options = array_merge_recursive($options, $body); + } + $options['headers']['Accept'] = 'application/json'; + $options['headers']['user-agent'] = $this->sdkConfiguration->userAgent; + $httpRequest = new \GuzzleHttp\Psr7\Request('POST', $url); + + + $httpResponse = $this->sdkConfiguration->securityClient->send($httpRequest, $options); + $contentType = $httpResponse->getHeader('Content-Type')[0] ?? ''; + + $statusCode = $httpResponse->getStatusCode(); + if ($statusCode >= 200 && $statusCode < 300) { + return new Operations\SetVisibilityResponse( + statusCode: $statusCode, + contentType: $contentType, + rawResponse: $httpResponse + ); + } elseif ($statusCode >= 400 && $statusCode < 500) { + if (Utils\Utils::matchContentType($contentType, 'application/json')) { + $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); + } + } + } \ No newline at end of file diff --git a/src/Models/Operations/GetNamespacesRequest.php b/src/Models/Operations/GetNamespacesRequest.php new file mode 100644 index 0000000..3d93f55 --- /dev/null +++ b/src/Models/Operations/GetNamespacesRequest.php @@ -0,0 +1,28 @@ +isComposite = $isComposite; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SetVisibilityRequest.php b/src/Models/Operations/SetVisibilityRequest.php new file mode 100644 index 0000000..62a5789 --- /dev/null +++ b/src/Models/Operations/SetVisibilityRequest.php @@ -0,0 +1,38 @@ +namespaceName = $namespaceName; + $this->requestBody = $requestBody; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SetVisibilityRequestBody.php b/src/Models/Operations/SetVisibilityRequestBody.php new file mode 100644 index 0000000..90f4b66 --- /dev/null +++ b/src/Models/Operations/SetVisibilityRequestBody.php @@ -0,0 +1,29 @@ +public = $public; + } +} \ No newline at end of file diff --git a/src/Models/Operations/SetVisibilityResponse.php b/src/Models/Operations/SetVisibilityResponse.php new file mode 100644 index 0000000..9d9ca44 --- /dev/null +++ b/src/Models/Operations/SetVisibilityResponse.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 4a56f50..5550311 100644 --- a/src/Models/Shared/NamespaceT.php +++ b/src/Models/Shared/NamespaceT.php @@ -35,6 +35,14 @@ class NamespaceT #[\Speakeasy\Serializer\Annotation\SerializedName('name')] public string $name; + /** + * + * @var ?bool $public + */ + #[\Speakeasy\Serializer\Annotation\SerializedName('public')] + #[\Speakeasy\Serializer\Annotation\SkipWhenNull] + public ?bool $public = null; + /** * * @var \DateTime $updatedAt @@ -47,12 +55,14 @@ class NamespaceT * @param string $id * @param string $name * @param \DateTime $updatedAt + * @param ?bool $public */ - public function __construct(\DateTime $createdAt, string $id, string $name, \DateTime $updatedAt) + public function __construct(\DateTime $createdAt, string $id, string $name, \DateTime $updatedAt, ?bool $public = null) { $this->createdAt = $createdAt; $this->id = $id; $this->name = $name; $this->updatedAt = $updatedAt; + $this->public = $public; } } \ No newline at end of file diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 00d618b..01d28ec 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -27,11 +27,11 @@ class SDKConfiguration public string $openapiDocVersion = '0.4.0'; - public string $sdkVersion = '0.45.8'; + public string $sdkVersion = '0.45.9'; public string $genVersion = '2.461.4'; - public string $userAgent = 'speakeasy-sdk/php 0.45.8 2.461.4 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; + public string $userAgent = 'speakeasy-sdk/php 0.45.9 2.461.4 0.4.0 speakeasy-api/speakeasy-client-sdk-php'; /** @var array>> */ public ?array $globals = [ 'parameters' => [],