Skip to content

Commit a5aba26

Browse files
feat: [StorageBatchOperations] add QUEUED state to Storage Batch Operations API (#8922)
* feat: add QUEUED state to Storage Batch Operations API feat: add bucket operations feat: add `is_multi_bucket_job` output field added to StorageBatchOperations Job PiperOrigin-RevId: 869283881 Source-Link: googleapis/googleapis@fb371ad Source-Link: googleapis/googleapis-gen@d2299fb Copy-Tag: eyJwIjoiU3RvcmFnZUJhdGNoT3BlcmF0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiZDIyOTlmYjMxNThmZDg1YWU3YTUwYzNhMmRjZjM4MjU0MGE1NWExMiJ9 * 🦉 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 d10e6ec commit a5aba26

18 files changed

Lines changed: 1683 additions & 6 deletions

StorageBatchOperations/metadata/V1/StorageBatchOperations.php

Lines changed: 23 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\StorageBatchOperations\V1\BucketOperation;
28+
use Google\Cloud\StorageBatchOperations\V1\Client\StorageBatchOperationsClient;
29+
use Google\Cloud\StorageBatchOperations\V1\GetBucketOperationRequest;
30+
31+
/**
32+
* Gets a BucketOperation.
33+
*
34+
* @param string $formattedName `name` of the bucket operation to retrieve.
35+
* Format:
36+
* projects/{project_id}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation_id}. Please see
37+
* {@see StorageBatchOperationsClient::bucketOperationName()} for help formatting this field.
38+
*/
39+
function get_bucket_operation_sample(string $formattedName): void
40+
{
41+
// Create a client.
42+
$storageBatchOperationsClient = new StorageBatchOperationsClient();
43+
44+
// Prepare the request message.
45+
$request = (new GetBucketOperationRequest())
46+
->setName($formattedName);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var BucketOperation $response */
51+
$response = $storageBatchOperationsClient->getBucketOperation($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+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedName = StorageBatchOperationsClient::bucketOperationName(
70+
'[PROJECT]',
71+
'[LOCATION]',
72+
'[JOB]',
73+
'[BUCKET_OPERATION]'
74+
);
75+
76+
get_bucket_operation_sample($formattedName);
77+
}
78+
// [END storagebatchoperations_v1_generated_StorageBatchOperations_GetBucketOperation_sync]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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 storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\StorageBatchOperations\V1\BucketOperation;
29+
use Google\Cloud\StorageBatchOperations\V1\Client\StorageBatchOperationsClient;
30+
use Google\Cloud\StorageBatchOperations\V1\ListBucketOperationsRequest;
31+
32+
/**
33+
* Lists BucketOperations in a given project and job.
34+
*
35+
* @param string $formattedParent Format: projects/{project_id}/locations/global/jobs/{job_id}. Please see
36+
* {@see StorageBatchOperationsClient::jobName()} for help formatting this field.
37+
*/
38+
function list_bucket_operations_sample(string $formattedParent): void
39+
{
40+
// Create a client.
41+
$storageBatchOperationsClient = new StorageBatchOperationsClient();
42+
43+
// Prepare the request message.
44+
$request = (new ListBucketOperationsRequest())
45+
->setParent($formattedParent);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var PagedListResponse $response */
50+
$response = $storageBatchOperationsClient->listBucketOperations($request);
51+
52+
/** @var BucketOperation $element */
53+
foreach ($response as $element) {
54+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
55+
}
56+
} catch (ApiException $ex) {
57+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
58+
}
59+
}
60+
61+
/**
62+
* Helper to execute the sample.
63+
*
64+
* This sample has been automatically generated and should be regarded as a code
65+
* template only. It will require modifications to work:
66+
* - It may require correct/in-range values for request initialization.
67+
* - It may require specifying regional endpoints when creating the service client,
68+
* please see the apiEndpoint client configuration option for more details.
69+
*/
70+
function callSample(): void
71+
{
72+
$formattedParent = StorageBatchOperationsClient::jobName('[PROJECT]', '[LOCATION]', '[JOB]');
73+
74+
list_bucket_operations_sample($formattedParent);
75+
}
76+
// [END storagebatchoperations_v1_generated_StorageBatchOperations_ListBucketOperations_sync]

0 commit comments

Comments
 (0)