Skip to content

Commit 34a6b14

Browse files
feat: [BackupDr] A new service BackupDrProtectionSummary is added (#8854)
* feat: A new service `BackupDrProtectionSummary` is added feat: A new message `ListResourceBackupConfigsRequest` is added feat: A new message `ListResourceBackupConfigsResponse` is added feat: A new message `ResourceBackupConfig` is added feat: A new resource_definition `backupdr.googleapis.com/ResourceBackupConfig` is added feat: A new message `BackupConfigDetails` is added feat: A new message `PitrSettings` is added feat: A new message `BackupDrTemplateConfig` is added feat: A new message `BackupDrPlanConfig` is added feat: A new message `BackupDrPlanRule` is added feat: A new message `BackupLocation` is added PiperOrigin-RevId: 854009996 Source-Link: googleapis/googleapis@524b2de Source-Link: googleapis/googleapis-gen@89b4811 Copy-Tag: eyJwIjoiQmFja3VwRHIvLk93bEJvdC55YW1sIiwiaCI6Ijg5YjQ4MTFhMjNjZDI5NzYwOTEzMDQxMTNmYjEwZjg3MWFiMDFlM2UifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 206c37d commit 34a6b14

26 files changed

+3724
-0
lines changed
4.26 KB
Binary file not shown.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START backupdr_v1_generated_BackupDrProtectionSummary_GetIamPolicy_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BackupDR\V1\Client\BackupDrProtectionSummaryClient;
28+
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
29+
use Google\Cloud\Iam\V1\Policy;
30+
31+
/**
32+
* Gets the access control policy for a resource. Returns an empty policy
33+
if the resource exists and does not have a policy set.
34+
*
35+
* @param string $resource REQUIRED: The resource for which the policy is being requested.
36+
* See the operation documentation for the appropriate value for this field.
37+
*/
38+
function get_iam_policy_sample(string $resource): void
39+
{
40+
// Create a client.
41+
$backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient();
42+
43+
// Prepare the request message.
44+
$request = (new GetIamPolicyRequest())
45+
->setResource($resource);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var Policy $response */
50+
$response = $backupDrProtectionSummaryClient->getIamPolicy($request);
51+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
52+
} catch (ApiException $ex) {
53+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
54+
}
55+
}
56+
57+
/**
58+
* Helper to execute the sample.
59+
*
60+
* This sample has been automatically generated and should be regarded as a code
61+
* template only. It will require modifications to work:
62+
* - It may require correct/in-range values for request initialization.
63+
* - It may require specifying regional endpoints when creating the service client,
64+
* please see the apiEndpoint client configuration option for more details.
65+
*/
66+
function callSample(): void
67+
{
68+
$resource = '[RESOURCE]';
69+
70+
get_iam_policy_sample($resource);
71+
}
72+
// [END backupdr_v1_generated_BackupDrProtectionSummary_GetIamPolicy_sync]
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START backupdr_v1_generated_BackupDrProtectionSummary_GetLocation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BackupDR\V1\Client\BackupDrProtectionSummaryClient;
28+
use Google\Cloud\Location\GetLocationRequest;
29+
use Google\Cloud\Location\Location;
30+
31+
/**
32+
* Gets information about a location.
33+
*
34+
* This sample has been automatically generated and should be regarded as a code
35+
* template only. It will require modifications to work:
36+
* - It may require correct/in-range values for request initialization.
37+
* - It may require specifying regional endpoints when creating the service client,
38+
* please see the apiEndpoint client configuration option for more details.
39+
*/
40+
function get_location_sample(): void
41+
{
42+
// Create a client.
43+
$backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient();
44+
45+
// Prepare the request message.
46+
$request = new GetLocationRequest();
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var Location $response */
51+
$response = $backupDrProtectionSummaryClient->getLocation($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
// [END backupdr_v1_generated_BackupDrProtectionSummary_GetLocation_sync]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START backupdr_v1_generated_BackupDrProtectionSummary_ListLocations_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\BackupDR\V1\Client\BackupDrProtectionSummaryClient;
29+
use Google\Cloud\Location\ListLocationsRequest;
30+
use Google\Cloud\Location\Location;
31+
32+
/**
33+
* Lists information about the supported locations for this service.
34+
*
35+
* This sample has been automatically generated and should be regarded as a code
36+
* template only. It will require modifications to work:
37+
* - It may require correct/in-range values for request initialization.
38+
* - It may require specifying regional endpoints when creating the service client,
39+
* please see the apiEndpoint client configuration option for more details.
40+
*/
41+
function list_locations_sample(): void
42+
{
43+
// Create a client.
44+
$backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient();
45+
46+
// Prepare the request message.
47+
$request = new ListLocationsRequest();
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var PagedListResponse $response */
52+
$response = $backupDrProtectionSummaryClient->listLocations($request);
53+
54+
/** @var Location $element */
55+
foreach ($response as $element) {
56+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
57+
}
58+
} catch (ApiException $ex) {
59+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
60+
}
61+
}
62+
// [END backupdr_v1_generated_BackupDrProtectionSummary_ListLocations_sync]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\BackupDR\V1\Client\BackupDrProtectionSummaryClient;
29+
use Google\Cloud\BackupDR\V1\ListResourceBackupConfigsRequest;
30+
use Google\Cloud\BackupDR\V1\ResourceBackupConfig;
31+
32+
/**
33+
* Lists ResourceBackupConfigs.
34+
*
35+
* @param string $formattedParent The project and location for which to retrieve resource backup
36+
* configs. Format: 'projects/{project_id}/locations/{location}'. In Google
37+
* Cloud Backup and DR, locations map to Google Cloud regions, for example
38+
* **us-central1**. Please see
39+
* {@see BackupDrProtectionSummaryClient::locationName()} for help formatting this field.
40+
*/
41+
function list_resource_backup_configs_sample(string $formattedParent): void
42+
{
43+
// Create a client.
44+
$backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient();
45+
46+
// Prepare the request message.
47+
$request = (new ListResourceBackupConfigsRequest())
48+
->setParent($formattedParent);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var PagedListResponse $response */
53+
$response = $backupDrProtectionSummaryClient->listResourceBackupConfigs($request);
54+
55+
/** @var ResourceBackupConfig $element */
56+
foreach ($response as $element) {
57+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
58+
}
59+
} catch (ApiException $ex) {
60+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
61+
}
62+
}
63+
64+
/**
65+
* Helper to execute the sample.
66+
*
67+
* This sample has been automatically generated and should be regarded as a code
68+
* template only. It will require modifications to work:
69+
* - It may require correct/in-range values for request initialization.
70+
* - It may require specifying regional endpoints when creating the service client,
71+
* please see the apiEndpoint client configuration option for more details.
72+
*/
73+
function callSample(): void
74+
{
75+
$formattedParent = BackupDrProtectionSummaryClient::locationName('[PROJECT]', '[LOCATION]');
76+
77+
list_resource_backup_configs_sample($formattedParent);
78+
}
79+
// [END backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_sync]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START backupdr_v1_generated_BackupDrProtectionSummary_SetIamPolicy_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BackupDR\V1\Client\BackupDrProtectionSummaryClient;
28+
use Google\Cloud\Iam\V1\Policy;
29+
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
30+
31+
/**
32+
* Sets the access control policy on the specified resource. Replaces
33+
any existing policy.
34+
35+
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
36+
errors.
37+
*
38+
* @param string $resource REQUIRED: The resource for which the policy is being specified.
39+
* See the operation documentation for the appropriate value for this field.
40+
*/
41+
function set_iam_policy_sample(string $resource): void
42+
{
43+
// Create a client.
44+
$backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient();
45+
46+
// Prepare the request message.
47+
$policy = new Policy();
48+
$request = (new SetIamPolicyRequest())
49+
->setResource($resource)
50+
->setPolicy($policy);
51+
52+
// Call the API and handle any network failures.
53+
try {
54+
/** @var Policy $response */
55+
$response = $backupDrProtectionSummaryClient->setIamPolicy($request);
56+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
57+
} catch (ApiException $ex) {
58+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
59+
}
60+
}
61+
62+
/**
63+
* Helper to execute the sample.
64+
*
65+
* This sample has been automatically generated and should be regarded as a code
66+
* template only. It will require modifications to work:
67+
* - It may require correct/in-range values for request initialization.
68+
* - It may require specifying regional endpoints when creating the service client,
69+
* please see the apiEndpoint client configuration option for more details.
70+
*/
71+
function callSample(): void
72+
{
73+
$resource = '[RESOURCE]';
74+
75+
set_iam_policy_sample($resource);
76+
}
77+
// [END backupdr_v1_generated_BackupDrProtectionSummary_SetIamPolicy_sync]

0 commit comments

Comments
 (0)