Skip to content

Commit

Permalink
docs: minor documentation fixes (#6344)
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 538564373
Source-Link: googleapis/googleapis@477cf96
Source-Link: googleapis/googleapis-gen@51fbcf5
Copy-Tag: eyJwIjoiR2tlQmFja3VwLy5Pd2xCb3QueWFtbCIsImgiOiI1MWZiY2Y1ZjY0ZmQyZjFiOGVlZTdmNDI2ZGE3MTJlOThjYzdkOTYwIn0=
  • Loading branch information
gcf-owl-bot[bot] authored Jun 12, 2023
1 parent 61a5b31 commit 1a7d64f
Show file tree
Hide file tree
Showing 82 changed files with 2,507 additions and 755 deletions.
5 changes: 3 additions & 2 deletions GkeBackup/metadata/V1/Gkebackup.php

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

2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/create_backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* Creates a Backup for the given BackupPlan.
*
* @param string $formattedParent The BackupPlan within which to create the Backup.
* Format: projects/*/locations/*/backupPlans/*
* Format: `projects/*/locations/*/backupPlans/*`
* Please see {@see BackupForGKEClient::backupPlanName()} for help formatting this field.
*/
function create_backup_sample(string $formattedParent): void
Expand Down
11 changes: 5 additions & 6 deletions GkeBackup/samples/V1/BackupForGKEClient/create_backup_plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,13 @@
* Creates a new BackupPlan in a given location.
*
* @param string $formattedParent The location within which to create the BackupPlan.
* Format: projects/*/locations/*
* Format: `projects/*/locations/*`
* Please see {@see BackupForGKEClient::locationName()} for help formatting this field.
* @param string $formattedBackupPlanCluster Immutable. The source cluster from which Backups will be created via
* this BackupPlan.
* Valid formats:
* @param string $formattedBackupPlanCluster Immutable. The source cluster from which Backups will be created
* via this BackupPlan. Valid formats:
*
* - projects/*/locations/*/clusters/*
* - projects/*/zones/*/clusters/*
* - `projects/*/locations/*/clusters/*`
* - `projects/*/zones/*/clusters/*`
* Please see {@see BackupForGKEClient::clusterName()} for help formatting this field.
* @param string $backupPlanId The client-provided short name for the BackupPlan resource.
* This name must:
Expand Down
12 changes: 7 additions & 5 deletions GkeBackup/samples/V1/BackupForGKEClient/create_restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
* Creates a new Restore for the given RestorePlan.
*
* @param string $formattedParent The RestorePlan within which to create the Restore.
* Format: projects/*/locations/*/restorePlans/*
* Format: `projects/*/locations/*/restorePlans/*`
* Please see {@see BackupForGKEClient::restorePlanName()} for help formatting this field.
* @param string $formattedRestoreBackup Immutable. A reference to the [Backup][google.cloud.gkebackup.v1.Backup] used as the source from which this Restore
* will restore. Note that this Backup must be a sub-resource of the
* RestorePlan's [backup_plan][google.cloud.gkebackup.v1.RestorePlan.backup_plan].
* Format: projects/*/locations/*/backupPlans/*/backups/*. Please see
* @param string $formattedRestoreBackup Immutable. A reference to the
* [Backup][google.cloud.gkebackup.v1.Backup] used as the source from which
* this Restore will restore. Note that this Backup must be a sub-resource of
* the RestorePlan's
* [backup_plan][google.cloud.gkebackup.v1.RestorePlan.backup_plan]. Format:
* `projects/*/locations/*/backupPlans/*/backups/*`. Please see
* {@see BackupForGKEClient::backupName()} for help formatting this field.
* @param string $restoreId The client-provided short name for the Restore resource.
* This name must:
Expand Down
20 changes: 10 additions & 10 deletions GkeBackup/samples/V1/BackupForGKEClient/create_restore_plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
* Creates a new RestorePlan in a given location.
*
* @param string $formattedParent The location within which to create the RestorePlan.
* Format: projects/*/locations/*
* Format: `projects/*/locations/*`
* Please see {@see BackupForGKEClient::locationName()} for help formatting this field.
* @param string $formattedRestorePlanBackupPlan Immutable. A reference to the [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may be used as the
* source for Restores created via this RestorePlan.
* Format: projects/*/locations/*/backupPlans/*. Please see
* @param string $formattedRestorePlanBackupPlan Immutable. A reference to the
* [BackupPlan][google.cloud.gkebackup.v1.BackupPlan] from which Backups may
* be used as the source for Restores created via this RestorePlan. Format:
* `projects/*/locations/*/backupPlans/*`. Please see
* {@see BackupForGKEClient::backupPlanName()} for help formatting this field.
* @param string $formattedRestorePlanCluster Immutable. The target cluster into which Restores created via this RestorePlan
* will restore data. NOTE: the cluster's region must be the same as the
* RestorePlan.
* Valid formats:
* @param string $formattedRestorePlanCluster Immutable. The target cluster into which Restores created via
* this RestorePlan will restore data. NOTE: the cluster's region must be the
* same as the RestorePlan. Valid formats:
*
* - projects/*/locations/*/clusters/*
* - projects/*/zones/*/clusters/*
* - `projects/*/locations/*/clusters/*`
* - `projects/*/zones/*/clusters/*`
* Please see {@see BackupForGKEClient::clusterName()} for help formatting this field.
* @param string $restorePlanId The client-provided short name for the RestorePlan resource.
* This name must:
Expand Down
2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/delete_backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Deletes an existing Backup.
*
* @param string $formattedName Name of the Backup resource.
* Format: projects/*/locations/*/backupPlans/*/backups/*
* Format: `projects/*/locations/*/backupPlans/*/backups/*`
* Please see {@see BackupForGKEClient::backupName()} for help formatting this field.
*/
function delete_backup_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Deletes an existing BackupPlan.
*
* @param string $formattedName Fully qualified BackupPlan name.
* Format: projects/*/locations/*/backupPlans/*
* Format: `projects/*/locations/*/backupPlans/*`
* Please see {@see BackupForGKEClient::backupPlanName()} for help formatting this field.
*/
function delete_backup_plan_sample(string $formattedName): void
Expand Down
2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/delete_restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Deletes an existing Restore.
*
* @param string $formattedName Full name of the Restore
* Format: projects/*/locations/*/restorePlans/*/restores/*
* Format: `projects/*/locations/*/restorePlans/*/restores/*`
* Please see {@see BackupForGKEClient::restoreName()} for help formatting this field.
*/
function delete_restore_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Deletes an existing RestorePlan.
*
* @param string $formattedName Fully qualified RestorePlan name.
* Format: projects/*/locations/*/restorePlans/*
* Format: `projects/*/locations/*/restorePlans/*`
* Please see {@see BackupForGKEClient::restorePlanName()} for help formatting this field.
*/
function delete_restore_plan_sample(string $formattedName): void
Expand Down
2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/get_backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieve the details of a single Backup.
*
* @param string $formattedName Full name of the Backup resource.
* Format: projects/*/locations/*/backupPlans/*/backups/*
* Format: `projects/*/locations/*/backupPlans/*/backups/*`
* Please see {@see BackupForGKEClient::backupName()} for help formatting this field.
*/
function get_backup_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieve the details of a single BackupPlan.
*
* @param string $formattedName Fully qualified BackupPlan name.
* Format: projects/*/locations/*/backupPlans/*
* Format: `projects/*/locations/*/backupPlans/*`
* Please see {@see BackupForGKEClient::backupPlanName()} for help formatting this field.
*/
function get_backup_plan_sample(string $formattedName): void
Expand Down
72 changes: 72 additions & 0 deletions GkeBackup/samples/V1/BackupForGKEClient/get_iam_policy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?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
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START gkebackup_v1_generated_BackupForGKE_GetIamPolicy_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\GkeBackup\V1\Client\BackupForGKEClient;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;

/**
* Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
*
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$backupForGKEClient = new BackupForGKEClient();

// Prepare the request message.
$request = (new GetIamPolicyRequest())
->setResource($resource);

// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $backupForGKEClient->getIamPolicy($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$resource = '[RESOURCE]';

get_iam_policy_sample($resource);
}
// [END gkebackup_v1_generated_BackupForGKE_GetIamPolicy_sync]
57 changes: 57 additions & 0 deletions GkeBackup/samples/V1/BackupForGKEClient/get_location.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?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
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START gkebackup_v1_generated_BackupForGKE_GetLocation_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\GkeBackup\V1\Client\BackupForGKEClient;
use Google\Cloud\Location\GetLocationRequest;
use Google\Cloud\Location\Location;

/**
* Gets information about a location.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function get_location_sample(): void
{
// Create a client.
$backupForGKEClient = new BackupForGKEClient();

// Prepare the request message.
$request = new GetLocationRequest();

// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $backupForGKEClient->getLocation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END gkebackup_v1_generated_BackupForGKE_GetLocation_sync]
2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/get_restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieves the details of a single Restore.
*
* @param string $formattedName Name of the restore resource.
* Format: projects/&#42;/locations/&#42;/restorePlans/&#42;/restores/*
* Format: `projects/&#42;/locations/&#42;/restorePlans/&#42;/restores/*`
* Please see {@see BackupForGKEClient::restoreName()} for help formatting this field.
*/
function get_restore_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieve the details of a single RestorePlan.
*
* @param string $formattedName Fully qualified RestorePlan name.
* Format: projects/&#42;/locations/&#42;/restorePlans/*
* Format: `projects/&#42;/locations/&#42;/restorePlans/*`
* Please see {@see BackupForGKEClient::restorePlanName()} for help formatting this field.
*/
function get_restore_plan_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieve the details of a single VolumeBackup.
*
* @param string $formattedName Full name of the VolumeBackup resource.
* Format: projects/&#42;/locations/&#42;/backupPlans/&#42;/backups/&#42;/volumeBackups/*
* Format: `projects/&#42;/locations/&#42;/backupPlans/&#42;/backups/&#42;/volumeBackups/*`
* Please see {@see BackupForGKEClient::volumeBackupName()} for help formatting this field.
*/
function get_volume_backup_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Retrieve the details of a single VolumeRestore.
*
* @param string $formattedName Full name of the VolumeRestore resource.
* Format: projects/&#42;/locations/&#42;/restorePlans/&#42;/restores/&#42;/volumeRestores/*
* Format: `projects/&#42;/locations/&#42;/restorePlans/&#42;/restores/&#42;/volumeRestores/*`
* Please see {@see BackupForGKEClient::volumeRestoreName()} for help formatting this field.
*/
function get_volume_restore_sample(string $formattedName): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Lists BackupPlans in a given location.
*
* @param string $formattedParent The location that contains the BackupPlans to list.
* Format: projects/&#42;/locations/*
* Format: `projects/&#42;/locations/*`
* Please see {@see BackupForGKEClient::locationName()} for help formatting this field.
*/
function list_backup_plans_sample(string $formattedParent): void
Expand Down
2 changes: 1 addition & 1 deletion GkeBackup/samples/V1/BackupForGKEClient/list_backups.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* Lists the Backups for a given BackupPlan.
*
* @param string $formattedParent The BackupPlan that contains the Backups to list.
* Format: projects/&#42;/locations/&#42;/backupPlans/*
* Format: `projects/&#42;/locations/&#42;/backupPlans/*`
* Please see {@see BackupForGKEClient::backupPlanName()} for help formatting this field.
*/
function list_backups_sample(string $formattedParent): void
Expand Down
Loading

0 comments on commit 1a7d64f

Please sign in to comment.