Skip to content

Commit

Permalink
feat: add new client surface to preview clients (#6202)
Browse files Browse the repository at this point in the history
chore: update the gapic generator to 1.7.4
PiperOrigin-RevId: 530731364
Source-Link: googleapis/googleapis@cbddac7
Source-Link: googleapis/googleapis-gen@539cbcf
Copy-Tag: eyJwIjoiQXBpS2V5cy8uT3dsQm90LnlhbWwiLCJoIjoiNTM5Y2JjZjRiNDFlODg2ZDUyYTNlMmQ4MmFiOWZkYzQ0NmJhMGUwNCJ9
Copy-Tag: eyJwIjoiQXBpZ2VlUmVnaXN0cnkvLk93bEJvdC55YW1sIiwiaCI6IjUzOWNiY2Y0YjQxZTg4NmQ1MmEzZTJkODJhYjlmZGM0NDZiYTBlMDQifQ==
Copy-Tag: eyJwIjoiQmFyZU1ldGFsU29sdXRpb24vLk93bEJvdC55YW1sIiwiaCI6IjUzOWNiY2Y0YjQxZTg4NmQ1MmEzZTJkODJhYjlmZGM0NDZiYTBlMDQifQ==
Copy-Tag: eyJwIjoiQmF0Y2gvLk93bEJvdC55YW1sIiwiaCI6IjUzOWNiY2Y0YjQxZTg4NmQ1MmEzZTJkODJhYjlmZGM0NDZiYTBlMDQifQ==
Copy-Tag: eyJwIjoiQmV5b25kQ29ycEFwcENvbm5lY3Rpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI1MzljYmNmNGI0MWU4ODZkNTJhM2UyZDgyYWI5ZmRjNDQ2YmEwZTA0In0=
Copy-Tag: eyJwIjoiQmV5b25kQ29ycEFwcENvbm5lY3RvcnMvLk93bEJvdC55YW1sIiwiaCI6IjUzOWNiY2Y0YjQxZTg4NmQ1MmEzZTJkODJhYjlmZGM0NDZiYTBlMDQifQ==
Copy-Tag: eyJwIjoiQmV5b25kQ29ycEFwcEdhdGV3YXlzLy5Pd2xCb3QueWFtbCIsImgiOiI1MzljYmNmNGI0MWU4ODZkNTJhM2UyZDgyYWI5ZmRjNDQ2YmEwZTA0In0=
Copy-Tag: eyJwIjoiQmV5b25kQ29ycENsaWVudENvbm5lY3Rv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OiI1MzljYmNmNGI0MWU4ODZkNTJhM2UyZDgyYWI5ZmRjNDQ2YmEwZTA0In0=
Copy-Tag: eyJwIjoiRGF0YUNhdGFsb2dMaW5lYWdlLy5Pd2xCb3QueWFtbCIsImgiOiI1MzljYmNmNGI0MWU4ODZkNTJhM2UyZDgyYWI5ZmRjNDQ2YmEwZTA0In0=
Copy-Tag: eyJwIjoiRGF0YUZ1c2lvbi8uT3dsQm90LnlhbWwiLCJoIjoiNTM5Y2JjZjRiNDFlODg2ZDUyYTNlMmQ4MmFiOWZkYzQ0NmJhMGUwNCJ9
Copy-Tag: eyJwIjoiRGF0YUxhYmVsaW5nLy5Pd2xCb3QueWFtbCIsImgiOiI1MzljYmNmNGI0MWU4ODZkNTJhM2UyZDgyYWI5ZmRjNDQ2YmEwZTA0In0=
Copy-Tag: eyJwIjoiRGF0YWZsb3cvLk93bEJvdC55YW1sIiwiaCI6IjUzOWNiY2Y0YjQxZTg4NmQ1MmEzZTJkODJhYjlmZGM0NDZiYTBlMDQifQ==
  • Loading branch information
gcf-owl-bot[bot] authored May 12, 2023
1 parent a301ea0 commit 5aa94b8
Show file tree
Hide file tree
Showing 633 changed files with 54,719 additions and 841 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
40 changes: 40 additions & 0 deletions ApiKeys/src/V2/Client/ApiKeysClient.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* Generated by gapic-generator-php from the file
* https://github.com/googleapis/googleapis/blob/master/google/api/apikeys/v2/apikeys.proto
* Updates to the above are reflected here through a refresh process.
*/

namespace Google\Cloud\ApiKeys\V2\Client;

use Google\Cloud\ApiKeys\V2\Client\BaseClient\ApiKeysBaseClient;

/**
* {@inheritdoc}
*
* This class is currently experimental and may be subject to changes.
*
* @experimental
*/
final class ApiKeysClient extends ApiKeysBaseClient
{
// This class is intentionally empty, and is intended to hold manual additions to
// the generated {@see ApiKeysBaseClient} class.
}
Loading

0 comments on commit 5aa94b8

Please sign in to comment.