Skip to content

Commit

Permalink
feat: Add Secret Version Delayed Destroy changes for client libraries (
Browse files Browse the repository at this point in the history
…#7250)

docs: Users can now enable secret version delayed destruction
PiperOrigin-RevId: 626820938
Source-Link: googleapis/googleapis@0345704
Source-Link: googleapis/googleapis-gen@2532a56
Copy-Tag: eyJwIjoiU2VjcmV0TWFuYWdlci8uT3dsQm90LnlhbWwiLCJoIjoiMjUzMmE1NjdlYTQ3NDljNWY1ZTFjMGJiN2EzZjcxMGIwNjI3OTM5MCJ9
Co-authored-by: Ajumal <ajumalpa@google.com>
  • Loading branch information
gcf-owl-bot[bot] and ajupazhamayil committed Apr 26, 2024
1 parent 5cd4215 commit 6744443
Show file tree
Hide file tree
Showing 35 changed files with 883 additions and 190 deletions.
Binary file modified SecretManager/metadata/V1/Resources.php
Binary file not shown.
50 changes: 24 additions & 26 deletions SecretManager/metadata/V1/Service.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
*
* @param string $formattedName The resource name of the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format
* `projects/&#42;/secrets/&#42;/versions/*`.
* `projects/&#42;/secrets/&#42;/versions/*` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/*`.
*
* `projects/&#42;/secrets/&#42;/versions/latest` is an alias to the most recently
* created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Please see
* `projects/&#42;/secrets/&#42;/versions/latest` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/latest` is an alias to the most
* recently created
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Please see
* {@see SecretManagerServiceClient::secretVersionName()} for help formatting this field.
*/
function access_secret_version_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @param string $formattedParent The resource name of the
* [Secret][google.cloud.secretmanager.v1.Secret] to associate with the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format
* `projects/&#42;/secrets/*`. Please see
* `projects/&#42;/secrets/*` or `projects/&#42;/locations/&#42;/secrets/*`. Please see
* {@see SecretManagerServiceClient::secretName()} for help formatting this field.
*/
function add_secret_version_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
use Google\ApiCore\ApiException;
use Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient;
use Google\Cloud\SecretManager\V1\CreateSecretRequest;
use Google\Cloud\SecretManager\V1\Replication;
use Google\Cloud\SecretManager\V1\Secret;

/**
* Creates a new [Secret][google.cloud.secretmanager.v1.Secret] containing no
* [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
*
* @param string $formattedParent The resource name of the project to associate with the
* [Secret][google.cloud.secretmanager.v1.Secret], in the format `projects/*`. Please see
* [Secret][google.cloud.secretmanager.v1.Secret], in the format `projects/*`
* or `projects/&#42;/locations/*`. Please see
* {@see SecretManagerServiceClient::projectName()} for help formatting this field.
* @param string $secretId This must be unique within the project.
*
Expand All @@ -48,9 +48,7 @@ function create_secret_sample(string $formattedParent, string $secretId): void
$secretManagerServiceClient = new SecretManagerServiceClient();

// Prepare the request message.
$secretReplication = new Replication();
$secret = (new Secret())
->setReplication($secretReplication);
$secret = new Secret();
$request = (new CreateSecretRequest())
->setParent($formattedParent)
->setSecretId($secretId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
*
* @param string $formattedName The resource name of the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to destroy in
* the format `projects/&#42;/secrets/&#42;/versions/*`. Please see
* the format `projects/&#42;/secrets/&#42;/versions/*` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/*`. Please see
* {@see SecretManagerServiceClient::secretVersionName()} for help formatting this field.
*/
function destroy_secret_version_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
*
* @param string $formattedName The resource name of the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to disable in
* the format `projects/&#42;/secrets/&#42;/versions/*`. Please see
* the format `projects/&#42;/secrets/&#42;/versions/*` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/*`. Please see
* {@see SecretManagerServiceClient::secretVersionName()} for help formatting this field.
*/
function disable_secret_version_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
*
* @param string $formattedName The resource name of the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] to enable in
* the format `projects/&#42;/secrets/&#42;/versions/*`. Please see
* the format `projects/&#42;/secrets/&#42;/versions/*` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/*`. Please see
* {@see SecretManagerServiceClient::secretVersionName()} for help formatting this field.
*/
function enable_secret_version_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @param string $formattedName The resource name of the
* [Secret][google.cloud.secretmanager.v1.Secret], in the format
* `projects/&#42;/secrets/*`. Please see
* `projects/&#42;/secrets/*` or `projects/&#42;/locations/&#42;/secrets/*`. Please see
* {@see SecretManagerServiceClient::secretName()} for help formatting this field.
*/
function get_secret_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
*
* @param string $formattedName The resource name of the
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format
* `projects/&#42;/secrets/&#42;/versions/*`.
* `projects/&#42;/secrets/&#42;/versions/*` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/*`.
*
* `projects/&#42;/secrets/&#42;/versions/latest` is an alias to the most recently
* created [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Please see
* `projects/&#42;/secrets/&#42;/versions/latest` or
* `projects/&#42;/locations/&#42;/secrets/&#42;/versions/latest` is an alias to the most
* recently created
* [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Please see
* {@see SecretManagerServiceClient::secretVersionName()} for help formatting this field.
*/
function get_secret_version_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* @param string $formattedParent The resource name of the
* [Secret][google.cloud.secretmanager.v1.Secret] associated with the
* [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] to list, in
* the format `projects/&#42;/secrets/*`. Please see
* the format `projects/&#42;/secrets/*` or `projects/&#42;/locations/&#42;/secrets/*`. Please see
* {@see SecretManagerServiceClient::secretName()} for help formatting this field.
*/
function list_secret_versions_sample(string $formattedParent): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
* Lists [Secrets][google.cloud.secretmanager.v1.Secret].
*
* @param string $formattedParent The resource name of the project associated with the
* [Secrets][google.cloud.secretmanager.v1.Secret], in the format
* `projects/*`. Please see
* {@see SecretManagerServiceClient::projectName()} for help formatting this field.
* [Secrets][google.cloud.secretmanager.v1.Secret], in the format `projects/*`
* or `projects/&#42;/locations/*`
* Please see {@see SecretManagerServiceClient::projectName()} for help formatting this field.
*/
function list_secrets_sample(string $formattedParent): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
// [START secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient;
use Google\Cloud\SecretManager\V1\Replication;
use Google\Cloud\SecretManager\V1\Secret;
use Google\Cloud\SecretManager\V1\UpdateSecretRequest;
use Google\Protobuf\FieldMask;
Expand All @@ -46,9 +45,7 @@ function update_secret_sample(): void
$secretManagerServiceClient = new SecretManagerServiceClient();

// Prepare the request message.
$secretReplication = new Replication();
$secret = (new Secret())
->setReplication($secretReplication);
$secret = new Secret();
$updateMask = new FieldMask();
$request = (new UpdateSecretRequest())
->setSecret($secret)
Expand Down
Loading

0 comments on commit 6744443

Please sign in to comment.