From 152983d5440a855911bffe10200a2353051afaee Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 4 Jan 2024 07:36:41 -0800 Subject: [PATCH] chore: migrate samples to new surface (#6931) PiperOrigin-RevId: 595432418 Source-Link: https://github.com/googleapis/googleapis/commit/4795a4575949fcbbb26bd00327540fcd9b1c9de9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/743615e580bab1815edba43a02c561face631c5f Copy-Tag: eyJwIjoiRGVidWdnZXIvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiRGlhbG9nZmxvdy8uT3dsQm90LnlhbWwiLCJoIjoiNzQzNjE1ZTU4MGJhYjE4MTVlZGJhNDNhMDJjNTYxZmFjZTYzMWM1ZiJ9 Copy-Tag: eyJwIjoiRGxwLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiRG1zLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiRG9jdW1lbnRBaS8uT3dsQm90LnlhbWwiLCJoIjoiNzQzNjE1ZTU4MGJhYjE4MTVlZGJhNDNhMDJjNTYxZmFjZTYzMWM1ZiJ9 Copy-Tag: eyJwIjoiRXZlbnRhcmMvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiRmlsZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiRmlyZXN0b3JlLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiRnVuY3Rpb25zLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiSWFtQ3JlZGVudGlhbHMvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiSWFwLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiSW90Ly5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiS21zLy5Pd2xCb3QueWFtbCIsImgiOiI3NDM2MTVlNTgwYmFiMTgxNWVkYmE0M2EwMmM1NjFmYWNlNjMxYzVmIn0= Copy-Tag: eyJwIjoiTG9nZ2luZy8uT3dsQm90LnlhbWwiLCJoIjoiNzQzNjE1ZTU4MGJhYjE4MTVlZGJhNDNhMDJjNTYxZmFjZTYzMWM1ZiJ9 Copy-Tag: eyJwIjoiTWFuYWdlZElkZW50aXRpZXMvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiTWVtY2FjaGUvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiTW9uaXRvcmluZy8uT3dsQm90LnlhbWwiLCJoIjoiNzQzNjE1ZTU4MGJhYjE4MTVlZGJhNDNhMDJjNTYxZmFjZTYzMWM1ZiJ9 Copy-Tag: eyJwIjoiTmV0d29ya0Nvbm5lY3Rpdml0eS8uT3dsQm90LnlhbWwiLCJoIjoiNzQzNjE1ZTU4MGJhYjE4MTVlZGJhNDNhMDJjNTYxZmFjZTYzMWM1ZiJ9 Copy-Tag: eyJwIjoiTmV0d29ya01hbmFnZW1lbnQvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== Copy-Tag: eyJwIjoiT3JjaGVzdHJhdGlvbkFpcmZsb3cvLk93bEJvdC55YW1sIiwiaCI6Ijc0MzYxNWU1ODBiYWIxODE1ZWRiYTQzYTAyYzU2MWZhY2U2MzFjNWYifQ== --- .../copy_log_entries.php | 10 ++- .../ConfigServiceV2Client/create_bucket.php | 11 +++- .../create_bucket_async.php | 11 +++- .../create_exclusion.php | 10 ++- .../V2/ConfigServiceV2Client/create_link.php | 11 +++- .../V2/ConfigServiceV2Client/create_sink.php | 10 ++- .../V2/ConfigServiceV2Client/create_view.php | 11 +++- .../ConfigServiceV2Client/delete_bucket.php | 9 ++- .../delete_exclusion.php | 9 ++- .../V2/ConfigServiceV2Client/delete_link.php | 9 ++- .../V2/ConfigServiceV2Client/delete_sink.php | 9 ++- .../V2/ConfigServiceV2Client/delete_view.php | 9 ++- .../V2/ConfigServiceV2Client/get_bucket.php | 9 ++- .../get_cmek_settings.php | 8 ++- .../ConfigServiceV2Client/get_exclusion.php | 9 ++- samples/V2/ConfigServiceV2Client/get_link.php | 9 ++- .../V2/ConfigServiceV2Client/get_settings.php | 9 ++- samples/V2/ConfigServiceV2Client/get_sink.php | 9 ++- samples/V2/ConfigServiceV2Client/get_view.php | 9 ++- .../V2/ConfigServiceV2Client/list_buckets.php | 9 ++- .../ConfigServiceV2Client/list_exclusions.php | 9 ++- .../V2/ConfigServiceV2Client/list_links.php | 9 ++- .../V2/ConfigServiceV2Client/list_sinks.php | 9 ++- .../V2/ConfigServiceV2Client/list_views.php | 9 ++- .../ConfigServiceV2Client/undelete_bucket.php | 9 ++- .../ConfigServiceV2Client/update_bucket.php | 11 +++- .../update_bucket_async.php | 11 +++- .../update_cmek_settings.php | 8 ++- .../update_exclusion.php | 11 +++- .../ConfigServiceV2Client/update_settings.php | 10 ++- .../V2/ConfigServiceV2Client/update_sink.php | 10 ++- .../V2/ConfigServiceV2Client/update_view.php | 10 ++- .../V2/LoggingServiceV2Client/delete_log.php | 9 ++- .../list_log_entries.php | 9 ++- .../V2/LoggingServiceV2Client/list_logs.php | 9 ++- .../list_monitored_resource_descriptors.php | 8 ++- .../tail_log_entries.php | 4 +- .../write_log_entries.php | 9 ++- .../create_log_metric.php | 10 ++- .../delete_log_metric.php | 9 ++- .../MetricsServiceV2Client/get_log_metric.php | 9 ++- .../list_log_metrics.php | 9 ++- .../update_log_metric.php | 10 ++- src/V2/Client/ConfigServiceV2Client.php | 64 +++++++++++++++++++ src/V2/Client/LoggingServiceV2Client.php | 12 ++++ src/V2/Client/MetricsServiceV2Client.php | 10 +++ 46 files changed, 385 insertions(+), 102 deletions(-) diff --git a/samples/V2/ConfigServiceV2Client/copy_log_entries.php b/samples/V2/ConfigServiceV2Client/copy_log_entries.php index 6f3d8ac..86ce66c 100644 --- a/samples/V2/ConfigServiceV2Client/copy_log_entries.php +++ b/samples/V2/ConfigServiceV2Client/copy_log_entries.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_CopyLogEntries_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CopyLogEntriesRequest; use Google\Cloud\Logging\V2\CopyLogEntriesResponse; use Google\Rpc\Status; @@ -44,10 +45,15 @@ function copy_log_entries_sample(string $name, string $destination): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new CopyLogEntriesRequest()) + ->setName($name) + ->setDestination($destination); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $configServiceV2Client->copyLogEntries($name, $destination); + $response = $configServiceV2Client->copyLogEntries($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/samples/V2/ConfigServiceV2Client/create_bucket.php b/samples/V2/ConfigServiceV2Client/create_bucket.php index c971f86..38b4679 100644 --- a/samples/V2/ConfigServiceV2Client/create_bucket.php +++ b/samples/V2/ConfigServiceV2Client/create_bucket.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateBucket_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateBucketRequest; use Google\Cloud\Logging\V2\LogBucket; /** @@ -48,13 +49,17 @@ function create_bucket_sample(string $formattedParent, string $bucketId): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bucket = new LogBucket(); + $request = (new CreateBucketRequest()) + ->setParent($formattedParent) + ->setBucketId($bucketId) + ->setBucket($bucket); // Call the API and handle any network failures. try { /** @var LogBucket $response */ - $response = $configServiceV2Client->createBucket($formattedParent, $bucketId, $bucket); + $response = $configServiceV2Client->createBucket($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/create_bucket_async.php b/samples/V2/ConfigServiceV2Client/create_bucket_async.php index 16ed755..0f2340e 100644 --- a/samples/V2/ConfigServiceV2Client/create_bucket_async.php +++ b/samples/V2/ConfigServiceV2Client/create_bucket_async.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateBucketAsync_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateBucketRequest; use Google\Cloud\Logging\V2\LogBucket; use Google\Rpc\Status; @@ -51,13 +52,17 @@ function create_bucket_async_sample(string $formattedParent, string $bucketId): // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bucket = new LogBucket(); + $request = (new CreateBucketRequest()) + ->setParent($formattedParent) + ->setBucketId($bucketId) + ->setBucket($bucket); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $configServiceV2Client->createBucketAsync($formattedParent, $bucketId, $bucket); + $response = $configServiceV2Client->createBucketAsync($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/samples/V2/ConfigServiceV2Client/create_exclusion.php b/samples/V2/ConfigServiceV2Client/create_exclusion.php index 6d72cda..379de71 100644 --- a/samples/V2/ConfigServiceV2Client/create_exclusion.php +++ b/samples/V2/ConfigServiceV2Client/create_exclusion.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateExclusion_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateExclusionRequest; use Google\Cloud\Logging\V2\LogExclusion; /** @@ -67,15 +68,18 @@ function create_exclusion_sample( // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $exclusion = (new LogExclusion()) ->setName($exclusionName) ->setFilter($exclusionFilter); + $request = (new CreateExclusionRequest()) + ->setParent($formattedParent) + ->setExclusion($exclusion); // Call the API and handle any network failures. try { /** @var LogExclusion $response */ - $response = $configServiceV2Client->createExclusion($formattedParent, $exclusion); + $response = $configServiceV2Client->createExclusion($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/create_link.php b/samples/V2/ConfigServiceV2Client/create_link.php index 5a07608..9979034 100644 --- a/samples/V2/ConfigServiceV2Client/create_link.php +++ b/samples/V2/ConfigServiceV2Client/create_link.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateLink_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateLinkRequest; use Google\Cloud\Logging\V2\Link; use Google\Rpc\Status; @@ -50,13 +51,17 @@ function create_link_sample(string $formattedParent, string $linkId): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $link = new Link(); + $request = (new CreateLinkRequest()) + ->setParent($formattedParent) + ->setLink($link) + ->setLinkId($linkId); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $configServiceV2Client->createLink($formattedParent, $link, $linkId); + $response = $configServiceV2Client->createLink($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/samples/V2/ConfigServiceV2Client/create_sink.php b/samples/V2/ConfigServiceV2Client/create_sink.php index 2843f70..93793d3 100644 --- a/samples/V2/ConfigServiceV2Client/create_sink.php +++ b/samples/V2/ConfigServiceV2Client/create_sink.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateSink_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateSinkRequest; use Google\Cloud\Logging\V2\LogSink; /** @@ -71,15 +72,18 @@ function create_sink_sample( // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sink = (new LogSink()) ->setName($sinkName) ->setDestination($sinkDestination); + $request = (new CreateSinkRequest()) + ->setParent($formattedParent) + ->setSink($sink); // Call the API and handle any network failures. try { /** @var LogSink $response */ - $response = $configServiceV2Client->createSink($formattedParent, $sink); + $response = $configServiceV2Client->createSink($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/create_view.php b/samples/V2/ConfigServiceV2Client/create_view.php index f9bd516..9baf851 100644 --- a/samples/V2/ConfigServiceV2Client/create_view.php +++ b/samples/V2/ConfigServiceV2Client/create_view.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_CreateView_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\CreateViewRequest; use Google\Cloud\Logging\V2\LogView; /** @@ -47,13 +48,17 @@ function create_view_sample(string $parent, string $viewId): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $view = new LogView(); + $request = (new CreateViewRequest()) + ->setParent($parent) + ->setViewId($viewId) + ->setView($view); // Call the API and handle any network failures. try { /** @var LogView $response */ - $response = $configServiceV2Client->createView($parent, $viewId, $view); + $response = $configServiceV2Client->createView($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/delete_bucket.php b/samples/V2/ConfigServiceV2Client/delete_bucket.php index cef3af7..94aad84 100644 --- a/samples/V2/ConfigServiceV2Client/delete_bucket.php +++ b/samples/V2/ConfigServiceV2Client/delete_bucket.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_DeleteBucket_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\DeleteBucketRequest; /** * Deletes a log bucket. @@ -50,9 +51,13 @@ function delete_bucket_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new DeleteBucketRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $configServiceV2Client->deleteBucket($formattedName); + $configServiceV2Client->deleteBucket($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/delete_exclusion.php b/samples/V2/ConfigServiceV2Client/delete_exclusion.php index 715a9d3..e0f1d0b 100644 --- a/samples/V2/ConfigServiceV2Client/delete_exclusion.php +++ b/samples/V2/ConfigServiceV2Client/delete_exclusion.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_DeleteExclusion_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\DeleteExclusionRequest; /** * Deletes an exclusion in the _Default sink. @@ -46,9 +47,13 @@ function delete_exclusion_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new DeleteExclusionRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $configServiceV2Client->deleteExclusion($formattedName); + $configServiceV2Client->deleteExclusion($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/delete_link.php b/samples/V2/ConfigServiceV2Client/delete_link.php index e38a0f9..093a1e4 100644 --- a/samples/V2/ConfigServiceV2Client/delete_link.php +++ b/samples/V2/ConfigServiceV2Client/delete_link.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_DeleteLink_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\DeleteLinkRequest; use Google\Rpc\Status; /** @@ -45,10 +46,14 @@ function delete_link_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new DeleteLinkRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $configServiceV2Client->deleteLink($formattedName); + $response = $configServiceV2Client->deleteLink($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/samples/V2/ConfigServiceV2Client/delete_sink.php b/samples/V2/ConfigServiceV2Client/delete_sink.php index 315d324..bbf8229 100644 --- a/samples/V2/ConfigServiceV2Client/delete_sink.php +++ b/samples/V2/ConfigServiceV2Client/delete_sink.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_DeleteSink_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\DeleteSinkRequest; /** * Deletes a sink. If the sink has a unique `writer_identity`, then that @@ -48,9 +49,13 @@ function delete_sink_sample(string $formattedSinkName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new DeleteSinkRequest()) + ->setSinkName($formattedSinkName); + // Call the API and handle any network failures. try { - $configServiceV2Client->deleteSink($formattedSinkName); + $configServiceV2Client->deleteSink($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/delete_view.php b/samples/V2/ConfigServiceV2Client/delete_view.php index c10b054..89e2fe4 100644 --- a/samples/V2/ConfigServiceV2Client/delete_view.php +++ b/samples/V2/ConfigServiceV2Client/delete_view.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_DeleteView_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\DeleteViewRequest; /** * Deletes a view on a log bucket. @@ -46,9 +47,13 @@ function delete_view_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new DeleteViewRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $configServiceV2Client->deleteView($formattedName); + $configServiceV2Client->deleteView($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_bucket.php b/samples/V2/ConfigServiceV2Client/get_bucket.php index cb29177..8f560bc 100644 --- a/samples/V2/ConfigServiceV2Client/get_bucket.php +++ b/samples/V2/ConfigServiceV2Client/get_bucket.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetBucket_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetBucketRequest; use Google\Cloud\Logging\V2\LogBucket; /** @@ -47,10 +48,14 @@ function get_bucket_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetBucketRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var LogBucket $response */ - $response = $configServiceV2Client->getBucket($formattedName); + $response = $configServiceV2Client->getBucket($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_cmek_settings.php b/samples/V2/ConfigServiceV2Client/get_cmek_settings.php index 3a59564..0fbf303 100644 --- a/samples/V2/ConfigServiceV2Client/get_cmek_settings.php +++ b/samples/V2/ConfigServiceV2Client/get_cmek_settings.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_GetCmekSettings_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\CmekSettings; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetCmekSettingsRequest; /** * Gets the Logging CMEK settings for the given resource. @@ -50,10 +51,13 @@ function get_cmek_settings_sample(): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = new GetCmekSettingsRequest(); + // Call the API and handle any network failures. try { /** @var CmekSettings $response */ - $response = $configServiceV2Client->getCmekSettings(); + $response = $configServiceV2Client->getCmekSettings($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_exclusion.php b/samples/V2/ConfigServiceV2Client/get_exclusion.php index abb0d6b..144569e 100644 --- a/samples/V2/ConfigServiceV2Client/get_exclusion.php +++ b/samples/V2/ConfigServiceV2Client/get_exclusion.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetExclusion_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetExclusionRequest; use Google\Cloud\Logging\V2\LogExclusion; /** @@ -47,10 +48,14 @@ function get_exclusion_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetExclusionRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var LogExclusion $response */ - $response = $configServiceV2Client->getExclusion($formattedName); + $response = $configServiceV2Client->getExclusion($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_link.php b/samples/V2/ConfigServiceV2Client/get_link.php index d0ab833..14a30b5 100644 --- a/samples/V2/ConfigServiceV2Client/get_link.php +++ b/samples/V2/ConfigServiceV2Client/get_link.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetLink_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetLinkRequest; use Google\Cloud\Logging\V2\Link; /** @@ -43,10 +44,14 @@ function get_link_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetLinkRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Link $response */ - $response = $configServiceV2Client->getLink($formattedName); + $response = $configServiceV2Client->getLink($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_settings.php b/samples/V2/ConfigServiceV2Client/get_settings.php index 0bd2ff6..2af0cdd 100644 --- a/samples/V2/ConfigServiceV2Client/get_settings.php +++ b/samples/V2/ConfigServiceV2Client/get_settings.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetSettings_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetSettingsRequest; use Google\Cloud\Logging\V2\Settings; /** @@ -61,10 +62,14 @@ function get_settings_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetSettingsRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var Settings $response */ - $response = $configServiceV2Client->getSettings($formattedName); + $response = $configServiceV2Client->getSettings($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_sink.php b/samples/V2/ConfigServiceV2Client/get_sink.php index a9a96d8..ffdf3b8 100644 --- a/samples/V2/ConfigServiceV2Client/get_sink.php +++ b/samples/V2/ConfigServiceV2Client/get_sink.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetSink_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetSinkRequest; use Google\Cloud\Logging\V2\LogSink; /** @@ -47,10 +48,14 @@ function get_sink_sample(string $formattedSinkName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetSinkRequest()) + ->setSinkName($formattedSinkName); + // Call the API and handle any network failures. try { /** @var LogSink $response */ - $response = $configServiceV2Client->getSink($formattedSinkName); + $response = $configServiceV2Client->getSink($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/get_view.php b/samples/V2/ConfigServiceV2Client/get_view.php index ae3cbe7..00e8e15 100644 --- a/samples/V2/ConfigServiceV2Client/get_view.php +++ b/samples/V2/ConfigServiceV2Client/get_view.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_GetView_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\GetViewRequest; use Google\Cloud\Logging\V2\LogView; /** @@ -44,10 +45,14 @@ function get_view_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new GetViewRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { /** @var LogView $response */ - $response = $configServiceV2Client->getView($formattedName); + $response = $configServiceV2Client->getView($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/list_buckets.php b/samples/V2/ConfigServiceV2Client/list_buckets.php index e2cd223..31a9edb 100644 --- a/samples/V2/ConfigServiceV2Client/list_buckets.php +++ b/samples/V2/ConfigServiceV2Client/list_buckets.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_ListBuckets_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\ListBucketsRequest; use Google\Cloud\Logging\V2\LogBucket; /** @@ -48,10 +49,14 @@ function list_buckets_sample(string $formattedParent): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new ListBucketsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $configServiceV2Client->listBuckets($formattedParent); + $response = $configServiceV2Client->listBuckets($request); /** @var LogBucket $element */ foreach ($response as $element) { diff --git a/samples/V2/ConfigServiceV2Client/list_exclusions.php b/samples/V2/ConfigServiceV2Client/list_exclusions.php index a27b65e..79d7c82 100644 --- a/samples/V2/ConfigServiceV2Client/list_exclusions.php +++ b/samples/V2/ConfigServiceV2Client/list_exclusions.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_ListExclusions_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\ListExclusionsRequest; use Google\Cloud\Logging\V2\LogExclusion; /** @@ -44,10 +45,14 @@ function list_exclusions_sample(string $formattedParent): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new ListExclusionsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $configServiceV2Client->listExclusions($formattedParent); + $response = $configServiceV2Client->listExclusions($request); /** @var LogExclusion $element */ foreach ($response as $element) { diff --git a/samples/V2/ConfigServiceV2Client/list_links.php b/samples/V2/ConfigServiceV2Client/list_links.php index 481251d..3cdebf9 100644 --- a/samples/V2/ConfigServiceV2Client/list_links.php +++ b/samples/V2/ConfigServiceV2Client/list_links.php @@ -25,8 +25,9 @@ // [START logging_v2_generated_ConfigServiceV2_ListLinks_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\Link; +use Google\Cloud\Logging\V2\ListLinksRequest; /** * Lists links. @@ -44,10 +45,14 @@ function list_links_sample(string $formattedParent): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new ListLinksRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $configServiceV2Client->listLinks($formattedParent); + $response = $configServiceV2Client->listLinks($request); /** @var Link $element */ foreach ($response as $element) { diff --git a/samples/V2/ConfigServiceV2Client/list_sinks.php b/samples/V2/ConfigServiceV2Client/list_sinks.php index 9cca12d..f17845e 100644 --- a/samples/V2/ConfigServiceV2Client/list_sinks.php +++ b/samples/V2/ConfigServiceV2Client/list_sinks.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_ListSinks_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\ListSinksRequest; use Google\Cloud\Logging\V2\LogSink; /** @@ -44,10 +45,14 @@ function list_sinks_sample(string $formattedParent): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new ListSinksRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $configServiceV2Client->listSinks($formattedParent); + $response = $configServiceV2Client->listSinks($request); /** @var LogSink $element */ foreach ($response as $element) { diff --git a/samples/V2/ConfigServiceV2Client/list_views.php b/samples/V2/ConfigServiceV2Client/list_views.php index d50346a..eb1adf3 100644 --- a/samples/V2/ConfigServiceV2Client/list_views.php +++ b/samples/V2/ConfigServiceV2Client/list_views.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_ConfigServiceV2_ListViews_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\ListViewsRequest; use Google\Cloud\Logging\V2\LogView; /** @@ -40,10 +41,14 @@ function list_views_sample(string $parent): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new ListViewsRequest()) + ->setParent($parent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $configServiceV2Client->listViews($parent); + $response = $configServiceV2Client->listViews($request); /** @var LogView $element */ foreach ($response as $element) { diff --git a/samples/V2/ConfigServiceV2Client/undelete_bucket.php b/samples/V2/ConfigServiceV2Client/undelete_bucket.php index 434f5ff..d2f652b 100644 --- a/samples/V2/ConfigServiceV2Client/undelete_bucket.php +++ b/samples/V2/ConfigServiceV2Client/undelete_bucket.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_ConfigServiceV2_UndeleteBucket_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\UndeleteBucketRequest; /** * Undeletes a log bucket. A bucket that has been deleted can be undeleted @@ -47,9 +48,13 @@ function undelete_bucket_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = (new UndeleteBucketRequest()) + ->setName($formattedName); + // Call the API and handle any network failures. try { - $configServiceV2Client->undeleteBucket($formattedName); + $configServiceV2Client->undeleteBucket($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_bucket.php b/samples/V2/ConfigServiceV2Client/update_bucket.php index 19453d6..73cc081 100644 --- a/samples/V2/ConfigServiceV2Client/update_bucket.php +++ b/samples/V2/ConfigServiceV2Client/update_bucket.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateBucket_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\LogBucket; +use Google\Cloud\Logging\V2\UpdateBucketRequest; use Google\Protobuf\FieldMask; /** @@ -53,14 +54,18 @@ function update_bucket_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bucket = new LogBucket(); $updateMask = new FieldMask(); + $request = (new UpdateBucketRequest()) + ->setName($formattedName) + ->setBucket($bucket) + ->setUpdateMask($updateMask); // Call the API and handle any network failures. try { /** @var LogBucket $response */ - $response = $configServiceV2Client->updateBucket($formattedName, $bucket, $updateMask); + $response = $configServiceV2Client->updateBucket($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_bucket_async.php b/samples/V2/ConfigServiceV2Client/update_bucket_async.php index 54aacc0..e2b3b4e 100644 --- a/samples/V2/ConfigServiceV2Client/update_bucket_async.php +++ b/samples/V2/ConfigServiceV2Client/update_bucket_async.php @@ -25,8 +25,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateBucketAsync_sync] use Google\ApiCore\ApiException; use Google\ApiCore\OperationResponse; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\LogBucket; +use Google\Cloud\Logging\V2\UpdateBucketRequest; use Google\Protobuf\FieldMask; use Google\Rpc\Status; @@ -55,14 +56,18 @@ function update_bucket_async_sample(string $formattedName): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $bucket = new LogBucket(); $updateMask = new FieldMask(); + $request = (new UpdateBucketRequest()) + ->setName($formattedName) + ->setBucket($bucket) + ->setUpdateMask($updateMask); // Call the API and handle any network failures. try { /** @var OperationResponse $response */ - $response = $configServiceV2Client->updateBucketAsync($formattedName, $bucket, $updateMask); + $response = $configServiceV2Client->updateBucketAsync($request); $response->pollUntilComplete(); if ($response->operationSucceeded()) { diff --git a/samples/V2/ConfigServiceV2Client/update_cmek_settings.php b/samples/V2/ConfigServiceV2Client/update_cmek_settings.php index 616c79d..d066b30 100644 --- a/samples/V2/ConfigServiceV2Client/update_cmek_settings.php +++ b/samples/V2/ConfigServiceV2Client/update_cmek_settings.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateCmekSettings_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\CmekSettings; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\UpdateCmekSettingsRequest; /** * Updates the Log Router CMEK settings for the given resource. @@ -55,10 +56,13 @@ function update_cmek_settings_sample(): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); + // Prepare the request message. + $request = new UpdateCmekSettingsRequest(); + // Call the API and handle any network failures. try { /** @var CmekSettings $response */ - $response = $configServiceV2Client->updateCmekSettings(); + $response = $configServiceV2Client->updateCmekSettings($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_exclusion.php b/samples/V2/ConfigServiceV2Client/update_exclusion.php index ba14369..b140246 100644 --- a/samples/V2/ConfigServiceV2Client/update_exclusion.php +++ b/samples/V2/ConfigServiceV2Client/update_exclusion.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateExclusion_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\LogExclusion; +use Google\Cloud\Logging\V2\UpdateExclusionRequest; use Google\Protobuf\FieldMask; /** @@ -66,16 +67,20 @@ function update_exclusion_sample( // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $exclusion = (new LogExclusion()) ->setName($exclusionName) ->setFilter($exclusionFilter); $updateMask = new FieldMask(); + $request = (new UpdateExclusionRequest()) + ->setName($formattedName) + ->setExclusion($exclusion) + ->setUpdateMask($updateMask); // Call the API and handle any network failures. try { /** @var LogExclusion $response */ - $response = $configServiceV2Client->updateExclusion($formattedName, $exclusion, $updateMask); + $response = $configServiceV2Client->updateExclusion($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_settings.php b/samples/V2/ConfigServiceV2Client/update_settings.php index 69f8366..152b5fc 100644 --- a/samples/V2/ConfigServiceV2Client/update_settings.php +++ b/samples/V2/ConfigServiceV2Client/update_settings.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateSettings_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\Settings; +use Google\Cloud\Logging\V2\UpdateSettingsRequest; /** * Updates the Log Router settings for the given resource. @@ -62,13 +63,16 @@ function update_settings_sample(string $name): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $settings = new Settings(); + $request = (new UpdateSettingsRequest()) + ->setName($name) + ->setSettings($settings); // Call the API and handle any network failures. try { /** @var Settings $response */ - $response = $configServiceV2Client->updateSettings($name, $settings); + $response = $configServiceV2Client->updateSettings($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_sink.php b/samples/V2/ConfigServiceV2Client/update_sink.php index f750e8e..20d3352 100644 --- a/samples/V2/ConfigServiceV2Client/update_sink.php +++ b/samples/V2/ConfigServiceV2Client/update_sink.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateSink_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\LogSink; +use Google\Cloud\Logging\V2\UpdateSinkRequest; /** * Updates a sink. This method replaces the following fields in the existing @@ -72,15 +73,18 @@ function update_sink_sample( // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $sink = (new LogSink()) ->setName($sinkName) ->setDestination($sinkDestination); + $request = (new UpdateSinkRequest()) + ->setSinkName($formattedSinkName) + ->setSink($sink); // Call the API and handle any network failures. try { /** @var LogSink $response */ - $response = $configServiceV2Client->updateSink($formattedSinkName, $sink); + $response = $configServiceV2Client->updateSink($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/ConfigServiceV2Client/update_view.php b/samples/V2/ConfigServiceV2Client/update_view.php index 9903a63..c08f95e 100644 --- a/samples/V2/ConfigServiceV2Client/update_view.php +++ b/samples/V2/ConfigServiceV2Client/update_view.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_ConfigServiceV2_UpdateView_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\ConfigServiceV2Client; +use Google\Cloud\Logging\V2\Client\ConfigServiceV2Client; use Google\Cloud\Logging\V2\LogView; +use Google\Cloud\Logging\V2\UpdateViewRequest; /** * Updates a view on a log bucket. This method replaces the following fields @@ -47,13 +48,16 @@ function update_view_sample(string $name): void // Create a client. $configServiceV2Client = new ConfigServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $view = new LogView(); + $request = (new UpdateViewRequest()) + ->setName($name) + ->setView($view); // Call the API and handle any network failures. try { /** @var LogView $response */ - $response = $configServiceV2Client->updateView($name, $view); + $response = $configServiceV2Client->updateView($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/LoggingServiceV2Client/delete_log.php b/samples/V2/LoggingServiceV2Client/delete_log.php index f31e2ea..333cc98 100644 --- a/samples/V2/LoggingServiceV2Client/delete_log.php +++ b/samples/V2/LoggingServiceV2Client/delete_log.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_LoggingServiceV2_DeleteLog_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\DeleteLogRequest; /** * Deletes all the log entries in a log for the _Default Log Bucket. The log @@ -52,9 +53,13 @@ function delete_log_sample(string $formattedLogName): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); + // Prepare the request message. + $request = (new DeleteLogRequest()) + ->setLogName($formattedLogName); + // Call the API and handle any network failures. try { - $loggingServiceV2Client->deleteLog($formattedLogName); + $loggingServiceV2Client->deleteLog($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/LoggingServiceV2Client/list_log_entries.php b/samples/V2/LoggingServiceV2Client/list_log_entries.php index 7980ec2..d2e1a4e 100644 --- a/samples/V2/LoggingServiceV2Client/list_log_entries.php +++ b/samples/V2/LoggingServiceV2Client/list_log_entries.php @@ -25,8 +25,9 @@ // [START logging_v2_generated_LoggingServiceV2_ListLogEntries_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\ListLogEntriesRequest; use Google\Cloud\Logging\V2\LogEntry; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; /** * Lists log entries. Use this method to retrieve log entries that originated @@ -58,13 +59,15 @@ function list_log_entries_sample(string $formattedResourceNamesElement): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $formattedResourceNames = [$formattedResourceNamesElement,]; + $request = (new ListLogEntriesRequest()) + ->setResourceNames($formattedResourceNames); // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $loggingServiceV2Client->listLogEntries($formattedResourceNames); + $response = $loggingServiceV2Client->listLogEntries($request); /** @var LogEntry $element */ foreach ($response as $element) { diff --git a/samples/V2/LoggingServiceV2Client/list_logs.php b/samples/V2/LoggingServiceV2Client/list_logs.php index 277a1b5..0bbdf50 100644 --- a/samples/V2/LoggingServiceV2Client/list_logs.php +++ b/samples/V2/LoggingServiceV2Client/list_logs.php @@ -25,7 +25,8 @@ // [START logging_v2_generated_LoggingServiceV2_ListLogs_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\ListLogsRequest; /** * Lists the logs in projects, organizations, folders, or billing accounts. @@ -44,10 +45,14 @@ function list_logs_sample(string $formattedParent): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); + // Prepare the request message. + $request = (new ListLogsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $loggingServiceV2Client->listLogs($formattedParent); + $response = $loggingServiceV2Client->listLogs($request); /** @var string $element */ foreach ($response as $element) { diff --git a/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php b/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php index 1c3044f..7a86f6f 100644 --- a/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php +++ b/samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php @@ -26,7 +26,8 @@ use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; use Google\Api\MonitoredResourceDescriptor; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\ListMonitoredResourceDescriptorsRequest; /** * Lists the descriptors for monitored resource types used by Logging. @@ -42,10 +43,13 @@ function list_monitored_resource_descriptors_sample(): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); + // Prepare the request message. + $request = new ListMonitoredResourceDescriptorsRequest(); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $loggingServiceV2Client->listMonitoredResourceDescriptors(); + $response = $loggingServiceV2Client->listMonitoredResourceDescriptors($request); /** @var MonitoredResourceDescriptor $element */ foreach ($response as $element) { diff --git a/samples/V2/LoggingServiceV2Client/tail_log_entries.php b/samples/V2/LoggingServiceV2Client/tail_log_entries.php index 12bbfcc..86b5a2a 100644 --- a/samples/V2/LoggingServiceV2Client/tail_log_entries.php +++ b/samples/V2/LoggingServiceV2Client/tail_log_entries.php @@ -25,7 +25,7 @@ // [START logging_v2_generated_LoggingServiceV2_TailLogEntries_sync] use Google\ApiCore\ApiException; use Google\ApiCore\BidiStream; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; use Google\Cloud\Logging\V2\TailLogEntriesRequest; use Google\Cloud\Logging\V2\TailLogEntriesResponse; @@ -52,7 +52,7 @@ function tail_log_entries_sample(string $resourceNamesElement): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $resourceNames = [$resourceNamesElement,]; $request = (new TailLogEntriesRequest()) ->setResourceNames($resourceNames); diff --git a/samples/V2/LoggingServiceV2Client/write_log_entries.php b/samples/V2/LoggingServiceV2Client/write_log_entries.php index 5188358..89af306 100644 --- a/samples/V2/LoggingServiceV2Client/write_log_entries.php +++ b/samples/V2/LoggingServiceV2Client/write_log_entries.php @@ -25,8 +25,9 @@ // [START logging_v2_generated_LoggingServiceV2_WriteLogEntries_sync] use Google\ApiCore\ApiException; use Google\Api\MonitoredResource; +use Google\Cloud\Logging\V2\Client\LoggingServiceV2Client; use Google\Cloud\Logging\V2\LogEntry; -use Google\Cloud\Logging\V2\LoggingServiceV2Client; +use Google\Cloud\Logging\V2\WriteLogEntriesRequest; use Google\Cloud\Logging\V2\WriteLogEntriesResponse; /** @@ -67,17 +68,19 @@ function write_log_entries_sample(string $entriesLogName): void // Create a client. $loggingServiceV2Client = new LoggingServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $entriesResource = new MonitoredResource(); $logEntry = (new LogEntry()) ->setLogName($entriesLogName) ->setResource($entriesResource); $entries = [$logEntry,]; + $request = (new WriteLogEntriesRequest()) + ->setEntries($entries); // Call the API and handle any network failures. try { /** @var WriteLogEntriesResponse $response */ - $response = $loggingServiceV2Client->writeLogEntries($entries); + $response = $loggingServiceV2Client->writeLogEntries($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/MetricsServiceV2Client/create_log_metric.php b/samples/V2/MetricsServiceV2Client/create_log_metric.php index b68d569..0396fd1 100644 --- a/samples/V2/MetricsServiceV2Client/create_log_metric.php +++ b/samples/V2/MetricsServiceV2Client/create_log_metric.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_MetricsServiceV2_CreateLogMetric_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Logging\V2\Client\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\CreateLogMetricRequest; use Google\Cloud\Logging\V2\LogMetric; -use Google\Cloud\Logging\V2\MetricsServiceV2Client; /** * Creates a logs-based metric. @@ -65,15 +66,18 @@ function create_log_metric_sample( // Create a client. $metricsServiceV2Client = new MetricsServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $metric = (new LogMetric()) ->setName($metricName) ->setFilter($metricFilter); + $request = (new CreateLogMetricRequest()) + ->setParent($formattedParent) + ->setMetric($metric); // Call the API and handle any network failures. try { /** @var LogMetric $response */ - $response = $metricsServiceV2Client->createLogMetric($formattedParent, $metric); + $response = $metricsServiceV2Client->createLogMetric($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/MetricsServiceV2Client/delete_log_metric.php b/samples/V2/MetricsServiceV2Client/delete_log_metric.php index 5e9ee16..6acbe48 100644 --- a/samples/V2/MetricsServiceV2Client/delete_log_metric.php +++ b/samples/V2/MetricsServiceV2Client/delete_log_metric.php @@ -24,7 +24,8 @@ // [START logging_v2_generated_MetricsServiceV2_DeleteLogMetric_sync] use Google\ApiCore\ApiException; -use Google\Cloud\Logging\V2\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\Client\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\DeleteLogMetricRequest; /** * Deletes a logs-based metric. @@ -39,9 +40,13 @@ function delete_log_metric_sample(string $formattedMetricName): void // Create a client. $metricsServiceV2Client = new MetricsServiceV2Client(); + // Prepare the request message. + $request = (new DeleteLogMetricRequest()) + ->setMetricName($formattedMetricName); + // Call the API and handle any network failures. try { - $metricsServiceV2Client->deleteLogMetric($formattedMetricName); + $metricsServiceV2Client->deleteLogMetric($request); printf('Call completed successfully.' . PHP_EOL); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/MetricsServiceV2Client/get_log_metric.php b/samples/V2/MetricsServiceV2Client/get_log_metric.php index 302f110..f436349 100644 --- a/samples/V2/MetricsServiceV2Client/get_log_metric.php +++ b/samples/V2/MetricsServiceV2Client/get_log_metric.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_MetricsServiceV2_GetLogMetric_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Logging\V2\Client\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\GetLogMetricRequest; use Google\Cloud\Logging\V2\LogMetric; -use Google\Cloud\Logging\V2\MetricsServiceV2Client; /** * Gets a logs-based metric. @@ -40,10 +41,14 @@ function get_log_metric_sample(string $formattedMetricName): void // Create a client. $metricsServiceV2Client = new MetricsServiceV2Client(); + // Prepare the request message. + $request = (new GetLogMetricRequest()) + ->setMetricName($formattedMetricName); + // Call the API and handle any network failures. try { /** @var LogMetric $response */ - $response = $metricsServiceV2Client->getLogMetric($formattedMetricName); + $response = $metricsServiceV2Client->getLogMetric($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/samples/V2/MetricsServiceV2Client/list_log_metrics.php b/samples/V2/MetricsServiceV2Client/list_log_metrics.php index 20d45ce..bc387b9 100644 --- a/samples/V2/MetricsServiceV2Client/list_log_metrics.php +++ b/samples/V2/MetricsServiceV2Client/list_log_metrics.php @@ -25,8 +25,9 @@ // [START logging_v2_generated_MetricsServiceV2_ListLogMetrics_sync] use Google\ApiCore\ApiException; use Google\ApiCore\PagedListResponse; +use Google\Cloud\Logging\V2\Client\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\ListLogMetricsRequest; use Google\Cloud\Logging\V2\LogMetric; -use Google\Cloud\Logging\V2\MetricsServiceV2Client; /** * Lists logs-based metrics. @@ -41,10 +42,14 @@ function list_log_metrics_sample(string $formattedParent): void // Create a client. $metricsServiceV2Client = new MetricsServiceV2Client(); + // Prepare the request message. + $request = (new ListLogMetricsRequest()) + ->setParent($formattedParent); + // Call the API and handle any network failures. try { /** @var PagedListResponse $response */ - $response = $metricsServiceV2Client->listLogMetrics($formattedParent); + $response = $metricsServiceV2Client->listLogMetrics($request); /** @var LogMetric $element */ foreach ($response as $element) { diff --git a/samples/V2/MetricsServiceV2Client/update_log_metric.php b/samples/V2/MetricsServiceV2Client/update_log_metric.php index a507db8..13a674a 100644 --- a/samples/V2/MetricsServiceV2Client/update_log_metric.php +++ b/samples/V2/MetricsServiceV2Client/update_log_metric.php @@ -24,8 +24,9 @@ // [START logging_v2_generated_MetricsServiceV2_UpdateLogMetric_sync] use Google\ApiCore\ApiException; +use Google\Cloud\Logging\V2\Client\MetricsServiceV2Client; use Google\Cloud\Logging\V2\LogMetric; -use Google\Cloud\Logging\V2\MetricsServiceV2Client; +use Google\Cloud\Logging\V2\UpdateLogMetricRequest; /** * Creates or updates a logs-based metric. @@ -67,15 +68,18 @@ function update_log_metric_sample( // Create a client. $metricsServiceV2Client = new MetricsServiceV2Client(); - // Prepare any non-scalar elements to be passed along with the request. + // Prepare the request message. $metric = (new LogMetric()) ->setName($metricName) ->setFilter($metricFilter); + $request = (new UpdateLogMetricRequest()) + ->setMetricName($formattedMetricName) + ->setMetric($metric); // Call the API and handle any network failures. try { /** @var LogMetric $response */ - $response = $metricsServiceV2Client->updateLogMetric($formattedMetricName, $metric); + $response = $metricsServiceV2Client->updateLogMetric($request); printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); } catch (ApiException $ex) { printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); diff --git a/src/V2/Client/ConfigServiceV2Client.php b/src/V2/Client/ConfigServiceV2Client.php index 3133b52..9e2cf87 100644 --- a/src/V2/Client/ConfigServiceV2Client.php +++ b/src/V2/Client/ConfigServiceV2Client.php @@ -1097,6 +1097,8 @@ public function __call($method, $args) * * The async variant is {@see ConfigServiceV2Client::copyLogEntriesAsync()} . * + * @example samples/V2/ConfigServiceV2Client/copy_log_entries.php + * * @param CopyLogEntriesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1122,6 +1124,8 @@ public function copyLogEntries(CopyLogEntriesRequest $request, array $callOption * * The async variant is {@see ConfigServiceV2Client::createBucketAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_bucket.php + * * @param CreateBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1148,6 +1152,8 @@ public function createBucket(CreateBucketRequest $request, array $callOptions = * * The async variant is {@see ConfigServiceV2Client::createBucketAsyncAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_bucket_async.php + * * @param CreateBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1174,6 +1180,8 @@ public function createBucketAsync(CreateBucketRequest $request, array $callOptio * * The async variant is {@see ConfigServiceV2Client::createExclusionAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_exclusion.php + * * @param CreateExclusionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1200,6 +1208,8 @@ public function createExclusion(CreateExclusionRequest $request, array $callOpti * * The async variant is {@see ConfigServiceV2Client::createLinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_link.php + * * @param CreateLinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1227,6 +1237,8 @@ public function createLink(CreateLinkRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::createSinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_sink.php + * * @param CreateSinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1252,6 +1264,8 @@ public function createSink(CreateSinkRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::createViewAsync()} . * + * @example samples/V2/ConfigServiceV2Client/create_view.php + * * @param CreateViewRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1280,6 +1294,8 @@ public function createView(CreateViewRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::deleteBucketAsync()} . * + * @example samples/V2/ConfigServiceV2Client/delete_bucket.php + * * @param DeleteBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1302,6 +1318,8 @@ public function deleteBucket(DeleteBucketRequest $request, array $callOptions = * * The async variant is {@see ConfigServiceV2Client::deleteExclusionAsync()} . * + * @example samples/V2/ConfigServiceV2Client/delete_exclusion.php + * * @param DeleteExclusionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1325,6 +1343,8 @@ public function deleteExclusion(DeleteExclusionRequest $request, array $callOpti * * The async variant is {@see ConfigServiceV2Client::deleteLinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/delete_link.php + * * @param DeleteLinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1350,6 +1370,8 @@ public function deleteLink(DeleteLinkRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::deleteSinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/delete_sink.php + * * @param DeleteSinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1375,6 +1397,8 @@ public function deleteSink(DeleteSinkRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::deleteViewAsync()} . * + * @example samples/V2/ConfigServiceV2Client/delete_view.php + * * @param DeleteViewRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1397,6 +1421,8 @@ public function deleteView(DeleteViewRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::getBucketAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_bucket.php + * * @param GetBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1430,6 +1456,8 @@ public function getBucket(GetBucketRequest $request, array $callOptions = []): L * * The async variant is {@see ConfigServiceV2Client::getCmekSettingsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_cmek_settings.php + * * @param GetCmekSettingsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1454,6 +1482,8 @@ public function getCmekSettings(GetCmekSettingsRequest $request, array $callOpti * * The async variant is {@see ConfigServiceV2Client::getExclusionAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_exclusion.php + * * @param GetExclusionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1478,6 +1508,8 @@ public function getExclusion(GetExclusionRequest $request, array $callOptions = * * The async variant is {@see ConfigServiceV2Client::getLinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_link.php + * * @param GetLinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1511,6 +1543,8 @@ public function getLink(GetLinkRequest $request, array $callOptions = []): Link * * The async variant is {@see ConfigServiceV2Client::getSettingsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_settings.php + * * @param GetSettingsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1535,6 +1569,8 @@ public function getSettings(GetSettingsRequest $request, array $callOptions = [] * * The async variant is {@see ConfigServiceV2Client::getSinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_sink.php + * * @param GetSinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1559,6 +1595,8 @@ public function getSink(GetSinkRequest $request, array $callOptions = []): LogSi * * The async variant is {@see ConfigServiceV2Client::getViewAsync()} . * + * @example samples/V2/ConfigServiceV2Client/get_view.php + * * @param GetViewRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1583,6 +1621,8 @@ public function getView(GetViewRequest $request, array $callOptions = []): LogVi * * The async variant is {@see ConfigServiceV2Client::listBucketsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/list_buckets.php + * * @param ListBucketsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1607,6 +1647,8 @@ public function listBuckets(ListBucketsRequest $request, array $callOptions = [] * * The async variant is {@see ConfigServiceV2Client::listExclusionsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/list_exclusions.php + * * @param ListExclusionsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1631,6 +1673,8 @@ public function listExclusions(ListExclusionsRequest $request, array $callOption * * The async variant is {@see ConfigServiceV2Client::listLinksAsync()} . * + * @example samples/V2/ConfigServiceV2Client/list_links.php + * * @param ListLinksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1655,6 +1699,8 @@ public function listLinks(ListLinksRequest $request, array $callOptions = []): P * * The async variant is {@see ConfigServiceV2Client::listSinksAsync()} . * + * @example samples/V2/ConfigServiceV2Client/list_sinks.php + * * @param ListSinksRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1679,6 +1725,8 @@ public function listSinks(ListSinksRequest $request, array $callOptions = []): P * * The async variant is {@see ConfigServiceV2Client::listViewsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/list_views.php + * * @param ListViewsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1704,6 +1752,8 @@ public function listViews(ListViewsRequest $request, array $callOptions = []): P * * The async variant is {@see ConfigServiceV2Client::undeleteBucketAsync()} . * + * @example samples/V2/ConfigServiceV2Client/undelete_bucket.php + * * @param UndeleteBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1731,6 +1781,8 @@ public function undeleteBucket(UndeleteBucketRequest $request, array $callOption * * The async variant is {@see ConfigServiceV2Client::updateBucketAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_bucket.php + * * @param UpdateBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1760,6 +1812,8 @@ public function updateBucket(UpdateBucketRequest $request, array $callOptions = * * The async variant is {@see ConfigServiceV2Client::updateBucketAsyncAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_bucket_async.php + * * @param UpdateBucketRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1798,6 +1852,8 @@ public function updateBucketAsync(UpdateBucketRequest $request, array $callOptio * * The async variant is {@see ConfigServiceV2Client::updateCmekSettingsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_cmek_settings.php + * * @param UpdateCmekSettingsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1823,6 +1879,8 @@ public function updateCmekSettings(UpdateCmekSettingsRequest $request, array $ca * * The async variant is {@see ConfigServiceV2Client::updateExclusionAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_exclusion.php + * * @param UpdateExclusionRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1862,6 +1920,8 @@ public function updateExclusion(UpdateExclusionRequest $request, array $callOpti * * The async variant is {@see ConfigServiceV2Client::updateSettingsAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_settings.php + * * @param UpdateSettingsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1890,6 +1950,8 @@ public function updateSettings(UpdateSettingsRequest $request, array $callOption * * The async variant is {@see ConfigServiceV2Client::updateSinkAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_sink.php + * * @param UpdateSinkRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -1918,6 +1980,8 @@ public function updateSink(UpdateSinkRequest $request, array $callOptions = []): * * The async variant is {@see ConfigServiceV2Client::updateViewAsync()} . * + * @example samples/V2/ConfigServiceV2Client/update_view.php + * * @param UpdateViewRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/src/V2/Client/LoggingServiceV2Client.php b/src/V2/Client/LoggingServiceV2Client.php index 713f52a..ecb9a20 100644 --- a/src/V2/Client/LoggingServiceV2Client.php +++ b/src/V2/Client/LoggingServiceV2Client.php @@ -367,6 +367,8 @@ public function __call($method, $args) * * The async variant is {@see LoggingServiceV2Client::deleteLogAsync()} . * + * @example samples/V2/LoggingServiceV2Client/delete_log.php + * * @param DeleteLogRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -392,6 +394,8 @@ public function deleteLog(DeleteLogRequest $request, array $callOptions = []): v * * The async variant is {@see LoggingServiceV2Client::listLogEntriesAsync()} . * + * @example samples/V2/LoggingServiceV2Client/list_log_entries.php + * * @param ListLogEntriesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -417,6 +421,8 @@ public function listLogEntries(ListLogEntriesRequest $request, array $callOption * * The async variant is {@see LoggingServiceV2Client::listLogsAsync()} . * + * @example samples/V2/LoggingServiceV2Client/list_logs.php + * * @param ListLogsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -442,6 +448,8 @@ public function listLogs(ListLogsRequest $request, array $callOptions = []): Pag * The async variant is * {@see LoggingServiceV2Client::listMonitoredResourceDescriptorsAsync()} . * + * @example samples/V2/LoggingServiceV2Client/list_monitored_resource_descriptors.php + * * @param ListMonitoredResourceDescriptorsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -465,6 +473,8 @@ public function listMonitoredResourceDescriptors(ListMonitoredResourceDescriptor * Streaming read of log entries as they are ingested. Until the stream is * terminated, it will continue reading logs. * + * @example samples/V2/LoggingServiceV2Client/tail_log_entries.php + * * @param array $callOptions { * Optional. * @@ -492,6 +502,8 @@ public function tailLogEntries(array $callOptions = []): BidiStream * * The async variant is {@see LoggingServiceV2Client::writeLogEntriesAsync()} . * + * @example samples/V2/LoggingServiceV2Client/write_log_entries.php + * * @param WriteLogEntriesRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. diff --git a/src/V2/Client/MetricsServiceV2Client.php b/src/V2/Client/MetricsServiceV2Client.php index 8da4f7a..fda16a0 100644 --- a/src/V2/Client/MetricsServiceV2Client.php +++ b/src/V2/Client/MetricsServiceV2Client.php @@ -243,6 +243,8 @@ public function __call($method, $args) * * The async variant is {@see MetricsServiceV2Client::createLogMetricAsync()} . * + * @example samples/V2/MetricsServiceV2Client/create_log_metric.php + * * @param CreateLogMetricRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -267,6 +269,8 @@ public function createLogMetric(CreateLogMetricRequest $request, array $callOpti * * The async variant is {@see MetricsServiceV2Client::deleteLogMetricAsync()} . * + * @example samples/V2/MetricsServiceV2Client/delete_log_metric.php + * * @param DeleteLogMetricRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -289,6 +293,8 @@ public function deleteLogMetric(DeleteLogMetricRequest $request, array $callOpti * * The async variant is {@see MetricsServiceV2Client::getLogMetricAsync()} . * + * @example samples/V2/MetricsServiceV2Client/get_log_metric.php + * * @param GetLogMetricRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -313,6 +319,8 @@ public function getLogMetric(GetLogMetricRequest $request, array $callOptions = * * The async variant is {@see MetricsServiceV2Client::listLogMetricsAsync()} . * + * @example samples/V2/MetricsServiceV2Client/list_log_metrics.php + * * @param ListLogMetricsRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional. @@ -337,6 +345,8 @@ public function listLogMetrics(ListLogMetricsRequest $request, array $callOption * * The async variant is {@see MetricsServiceV2Client::updateLogMetricAsync()} . * + * @example samples/V2/MetricsServiceV2Client/update_log_metric.php + * * @param UpdateLogMetricRequest $request A request to house fields associated with the call. * @param array $callOptions { * Optional.