Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed May 10, 2023
1 parent 9f48436 commit 4e525bc
Show file tree
Hide file tree
Showing 2,237 changed files with 9,226 additions and 249,296 deletions.
10 changes: 7 additions & 3 deletions ApiKeys/samples/V2/ApiKeysClient/create_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
// [START apikeys_v2_generated_ApiKeys_CreateKey_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\CreateKeyRequest;
use Google\Cloud\ApiKeys\V2\Key;
use Google\Rpc\Status;

Expand All @@ -43,13 +44,16 @@ function create_key_sample(string $formattedParent): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare any non-scalar elements to be passed along with the request.
// Prepare the request message.
$key = new Key();
$request = (new CreateKeyRequest())
->setParent($formattedParent)
->setKey($key);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $apiKeysClient->createKey($formattedParent, $key);
$response = $apiKeysClient->createKey($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/delete_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
// [START apikeys_v2_generated_ApiKeys_DeleteKey_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\DeleteKeyRequest;
use Google\Cloud\ApiKeys\V2\Key;
use Google\Rpc\Status;

Expand All @@ -44,10 +45,14 @@ function delete_key_sample(string $formattedName): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new DeleteKeyRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $apiKeysClient->deleteKey($formattedName);
$response = $apiKeysClient->deleteKey($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/get_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

// [START apikeys_v2_generated_ApiKeys_GetKey_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\GetKeyRequest;
use Google\Cloud\ApiKeys\V2\Key;

/**
Expand All @@ -42,10 +43,14 @@ function get_key_sample(string $formattedName): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new GetKeyRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var Key $response */
$response = $apiKeysClient->getKey($formattedName);
$response = $apiKeysClient->getKey($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/get_key_string.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

// [START apikeys_v2_generated_ApiKeys_GetKeyString_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\GetKeyStringRequest;
use Google\Cloud\ApiKeys\V2\GetKeyStringResponse;

/**
Expand All @@ -41,10 +42,14 @@ function get_key_string_sample(string $formattedName): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new GetKeyStringRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var GetKeyStringResponse $response */
$response = $apiKeysClient->getKeyString($formattedName);
$response = $apiKeysClient->getKeyString($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/list_keys.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
// [START apikeys_v2_generated_ApiKeys_ListKeys_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Key;
use Google\Cloud\ApiKeys\V2\ListKeysRequest;

/**
* Lists the API keys owned by a project. The key string of the API key
Expand All @@ -43,10 +44,14 @@ function list_keys_sample(string $formattedParent): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new ListKeysRequest())
->setParent($formattedParent);

// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $apiKeysClient->listKeys($formattedParent);
$response = $apiKeysClient->listKeys($request);

/** @var Key $element */
foreach ($response as $element) {
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/lookup_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

// [START apikeys_v2_generated_ApiKeys_LookupKey_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\LookupKeyRequest;
use Google\Cloud\ApiKeys\V2\LookupKeyResponse;

/**
Expand All @@ -41,10 +42,14 @@ function lookup_key_sample(string $keyString): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new LookupKeyRequest())
->setKeyString($keyString);

// Call the API and handle any network failures.
try {
/** @var LookupKeyResponse $response */
$response = $apiKeysClient->lookupKey($keyString);
$response = $apiKeysClient->lookupKey($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
Expand Down
9 changes: 7 additions & 2 deletions ApiKeys/samples/V2/ApiKeysClient/undelete_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
// [START apikeys_v2_generated_ApiKeys_UndeleteKey_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Key;
use Google\Cloud\ApiKeys\V2\UndeleteKeyRequest;
use Google\Rpc\Status;

/**
Expand All @@ -43,10 +44,14 @@ function undelete_key_sample(string $formattedName): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare the request message.
$request = (new UndeleteKeyRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $apiKeysClient->undeleteKey($formattedName);
$response = $apiKeysClient->undeleteKey($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
Expand Down
9 changes: 6 additions & 3 deletions ApiKeys/samples/V2/ApiKeysClient/update_key.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
// [START apikeys_v2_generated_ApiKeys_UpdateKey_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\ApiKeys\V2\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Client\ApiKeysClient;
use Google\Cloud\ApiKeys\V2\Key;
use Google\Cloud\ApiKeys\V2\UpdateKeyRequest;
use Google\Rpc\Status;

/**
Expand All @@ -47,13 +48,15 @@ function update_key_sample(): void
// Create a client.
$apiKeysClient = new ApiKeysClient();

// Prepare any non-scalar elements to be passed along with the request.
// Prepare the request message.
$key = new Key();
$request = (new UpdateKeyRequest())
->setKey($key);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $apiKeysClient->updateKey($key);
$response = $apiKeysClient->updateKey($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
Expand Down
28 changes: 28 additions & 0 deletions ApiKeys/src/V2/CreateKeyRequest.php

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

14 changes: 14 additions & 0 deletions ApiKeys/src/V2/DeleteKeyRequest.php

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

14 changes: 14 additions & 0 deletions ApiKeys/src/V2/GetKeyRequest.php

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

14 changes: 14 additions & 0 deletions ApiKeys/src/V2/GetKeyStringRequest.php

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

14 changes: 14 additions & 0 deletions ApiKeys/src/V2/ListKeysRequest.php

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

23 changes: 23 additions & 0 deletions ApiKeys/src/V2/UpdateKeyRequest.php

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

Loading

0 comments on commit 4e525bc

Please sign in to comment.