diff --git a/dialogflow/composer.json b/dialogflow/composer.json index d1c953d360..f44241c88d 100644 --- a/dialogflow/composer.json +++ b/dialogflow/composer.json @@ -1,6 +1,6 @@ { "require": { - "google/cloud-dialogflow": "^1.10", + "google/cloud-dialogflow": "^1.11", "symfony/console": "^5.0" }, "autoload": { diff --git a/recaptcha/composer.json b/recaptcha/composer.json index d12a4a5e4c..939b4bae48 100644 --- a/recaptcha/composer.json +++ b/recaptcha/composer.json @@ -1,5 +1,5 @@ { "require": { - "google/cloud-recaptcha-enterprise": "^1.7" + "google/cloud-recaptcha-enterprise": "^1.8" } } diff --git a/secretmanager/composer.json b/secretmanager/composer.json index 7b0e845ee4..c52bc1c5b4 100644 --- a/secretmanager/composer.json +++ b/secretmanager/composer.json @@ -1,5 +1,5 @@ { "require": { - "google/cloud-secret-manager": "^1.0.0" + "google/cloud-secret-manager": "^1.13" } } diff --git a/secretmanager/quickstart.php b/secretmanager/quickstart.php index 0ac760fec8..5fce12f842 100644 --- a/secretmanager/quickstart.php +++ b/secretmanager/quickstart.php @@ -26,10 +26,13 @@ // [START secretmanager_quickstart] // Import the Secret Manager client library. +use Google\Cloud\SecretManager\V1\AccessSecretVersionRequest; +use Google\Cloud\SecretManager\V1\AddSecretVersionRequest; +use Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient; +use Google\Cloud\SecretManager\V1\CreateSecretRequest; use Google\Cloud\SecretManager\V1\Replication; use Google\Cloud\SecretManager\V1\Replication\Automatic; use Google\Cloud\SecretManager\V1\Secret; -use Google\Cloud\SecretManager\V1\SecretManagerServiceClient; use Google\Cloud\SecretManager\V1\SecretPayload; /** Uncomment and populate these variables in your code */ @@ -43,21 +46,28 @@ $parent = $client->projectName($projectId); // Create the parent secret. -$secret = $client->createSecret($parent, $secretId, - new Secret([ +$createSecretRequest = (new CreateSecretRequest()) + ->setParent($parent) + ->setSecretId($secretId) + ->setSecret(new Secret([ 'replication' => new Replication([ 'automatic' => new Automatic(), ]), - ]) -); + ])); +$secret = $client->createSecret($createSecretRequest); // Add the secret version. -$version = $client->addSecretVersion($secret->getName(), new SecretPayload([ +$addSecretVersionRequest = (new AddSecretVersionRequest()) + ->setParent($secret->getName()) + ->setPayload(new SecretPayload([ 'data' => 'hello world', ])); +$version = $client->addSecretVersion($addSecretVersionRequest); // Access the secret version. -$response = $client->accessSecretVersion($version->getName()); +$accessSecretVersionRequest = (new AccessSecretVersionRequest()) + ->setName($version->getName()); +$response = $client->accessSecretVersion($accessSecretVersionRequest); // Print the secret payload. // diff --git a/secretmanager/test/quickstartTest.php b/secretmanager/test/quickstartTest.php index 59c87553cd..611f1169d7 100644 --- a/secretmanager/test/quickstartTest.php +++ b/secretmanager/test/quickstartTest.php @@ -18,7 +18,8 @@ declare(strict_types=1); use Google\ApiCore\ApiException as GaxApiException; -use Google\Cloud\SecretManager\V1\SecretManagerServiceClient; +use Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient; +use Google\Cloud\SecretManager\V1\DeleteSecretRequest; use Google\Cloud\TestUtils\TestTrait; use PHPUnit\Framework\TestCase; @@ -39,7 +40,9 @@ public static function tearDownAfterClass(): void $name = $client->secretName(self::$projectId, self::$secretId); try { - $client->deleteSecret($name); + $deleteSecretRequest = (new DeleteSecretRequest()) + ->setName($name); + $client->deleteSecret($deleteSecretRequest); } catch (GaxApiException $e) { if ($e->getStatus() != 'NOT_FOUND') { throw $e; diff --git a/secretmanager/test/secretmanagerTest.php b/secretmanager/test/secretmanagerTest.php index ba05086a53..48570fe253 100644 --- a/secretmanager/test/secretmanagerTest.php +++ b/secretmanager/test/secretmanagerTest.php @@ -20,10 +20,14 @@ namespace Google\Cloud\Samples\SecretManager; use Google\ApiCore\ApiException as GaxApiException; +use Google\Cloud\SecretManager\V1\AddSecretVersionRequest; +use Google\Cloud\SecretManager\V1\Client\SecretManagerServiceClient; +use Google\Cloud\SecretManager\V1\CreateSecretRequest; +use Google\Cloud\SecretManager\V1\DeleteSecretRequest; +use Google\Cloud\SecretManager\V1\DisableSecretVersionRequest; use Google\Cloud\SecretManager\V1\Replication; use Google\Cloud\SecretManager\V1\Replication\Automatic; use Google\Cloud\SecretManager\V1\Secret; -use Google\Cloud\SecretManager\V1\SecretManagerServiceClient; use Google\Cloud\SecretManager\V1\SecretPayload; use Google\Cloud\SecretManager\V1\SecretVersion; use Google\Cloud\TestUtils\TestTrait; @@ -81,32 +85,41 @@ private static function createSecret(): Secret { $parent = self::$client->projectName(self::$projectId); $secretId = self::randomSecretId(); - - return self::$client->createSecret($parent, $secretId, - new Secret([ + $createSecretRequest = (new CreateSecretRequest()) + ->setParent($parent) + ->setSecretId($secretId) + ->setSecret(new Secret([ 'replication' => new Replication([ 'automatic' => new Automatic(), ]), - ]) - ); + ])); + + return self::$client->createSecret($createSecretRequest); } private static function addSecretVersion(Secret $secret): SecretVersion { - return self::$client->addSecretVersion($secret->getName(), new SecretPayload([ + $addSecretVersionRequest = (new AddSecretVersionRequest()) + ->setParent($secret->getName()) + ->setPayload(new SecretPayload([ 'data' => 'my super secret data', ])); + return self::$client->addSecretVersion($addSecretVersionRequest); } private static function disableSecretVersion(SecretVersion $version): SecretVersion { - return self::$client->disableSecretVersion($version->getName()); + $disableSecretVersionRequest = (new DisableSecretVersionRequest()) + ->setName($version->getName()); + return self::$client->disableSecretVersion($disableSecretVersionRequest); } private static function deleteSecret(string $name) { try { - self::$client->deleteSecret($name); + $deleteSecretRequest = (new DeleteSecretRequest()) + ->setName($name); + self::$client->deleteSecret($deleteSecretRequest); } catch (GaxApiException $e) { if ($e->getStatus() != 'NOT_FOUND') { throw $e;