Skip to content

Commit 389027c

Browse files
feat: [Dataform] Update GCP Client Libraries in v1beta1 to support Folders, TeamFolders, and other relevant APIs (#8913)
* feat: Update GCP Client Libraries in v1beta1 to support Folders, TeamFolders, and other relevant APIs The v1beta1 API now includes support for Folders and TeamFolders, allowing users to organize repositories and files hierarchically and manage access controls. New Features: - Added TeamFolder resource and methods: CreateTeamFolder, GetTeamFolder, UpdateTeamFolder, DeleteTeamFolder QueryTeamFolderContents to list folder contents. SearchTeamFolders to search for TeamFolders. - Added Folder resource and methods: CreateFolder, GetFolder, UpdateFolder, DeleteFolder QueryFolderContents to list folder contents. Added MoveFolder to move Folders between TeamFolders, other Folders, or the user root folder. - Added MoveRepository to move Repositories between TeamFolders, Folders, or the user root folder. - Added QueryUserRootContents to list contents of a user's root folder. Repository resource now includes containing_folder and team_folder_name fields to indicate its location within the folder hierarchy. - IAM methods (GetIamPolicy, SetIamPolicy, TestIamPermissions) now support Folder and TeamFolder resources for access control management docs: A comment for field `force` in message `.google.cloud.dataform.v1beta1.DeleteRepositoryRequest` is changed PiperOrigin-RevId: 868182714 Source-Link: googleapis/googleapis@e1c1073 Source-Link: googleapis/googleapis-gen@fcbd8c7 Copy-Tag: eyJwIjoiRGF0YWZvcm0vLk93bEJvdC55YW1sIiwiaCI6ImZjYmQ4YzdlMmU4ODA2ZjM4YTQ0NDIwNWFiMGY5NDU4OGI5NDlkZjIifQ== * 🦉 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 ed9b087 commit 389027c

69 files changed

Lines changed: 9862 additions & 447 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
10.2 KB
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 dataform_v1beta1_generated_Dataform_CancelOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
28+
use Google\LongRunning\CancelOperationRequest;
29+
30+
/**
31+
* Starts asynchronous cancellation on a long-running operation. The server
32+
* makes a best effort to cancel the operation, but success is not
33+
* guaranteed. If the server doesn't support this method, it returns
34+
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
35+
* [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
36+
* other methods to check whether the cancellation succeeded or whether the
37+
* operation completed despite cancellation. On successful cancellation,
38+
* the operation is not deleted; instead, it becomes an operation with
39+
* an [Operation.error][google.longrunning.Operation.error] value with a
40+
* [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
41+
* `Code.CANCELLED`.
42+
*
43+
* @param string $name The name of the operation resource to be cancelled.
44+
*/
45+
function cancel_operation_sample(string $name): void
46+
{
47+
// Create a client.
48+
$dataformClient = new DataformClient();
49+
50+
// Prepare the request message.
51+
$request = (new CancelOperationRequest())
52+
->setName($name);
53+
54+
// Call the API and handle any network failures.
55+
try {
56+
$dataformClient->cancelOperation($request);
57+
printf('Call completed successfully.' . PHP_EOL);
58+
} catch (ApiException $ex) {
59+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
60+
}
61+
}
62+
63+
/**
64+
* Helper to execute the sample.
65+
*
66+
* This sample has been automatically generated and should be regarded as a code
67+
* template only. It will require modifications to work:
68+
* - It may require correct/in-range values for request initialization.
69+
* - It may require specifying regional endpoints when creating the service client,
70+
* please see the apiEndpoint client configuration option for more details.
71+
*/
72+
function callSample(): void
73+
{
74+
$name = '[NAME]';
75+
76+
cancel_operation_sample($name);
77+
}
78+
// [END dataform_v1beta1_generated_Dataform_CancelOperation_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 dataform_v1beta1_generated_Dataform_CreateFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1beta1\CreateFolderRequest;
29+
use Google\Cloud\Dataform\V1beta1\Folder;
30+
31+
/**
32+
* Creates a new Folder in a given project and location.
33+
*
34+
* @param string $formattedParent The location in which to create the Folder. Must be in the format
35+
* `projects/&#42;/locations/*`. Please see
36+
* {@see DataformClient::locationName()} for help formatting this field.
37+
* @param string $folderDisplayName The Folder's user-friendly name.
38+
*/
39+
function create_folder_sample(string $formattedParent, string $folderDisplayName): void
40+
{
41+
// Create a client.
42+
$dataformClient = new DataformClient();
43+
44+
// Prepare the request message.
45+
$folder = (new Folder())
46+
->setDisplayName($folderDisplayName);
47+
$request = (new CreateFolderRequest())
48+
->setParent($formattedParent)
49+
->setFolder($folder);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var Folder $response */
54+
$response = $dataformClient->createFolder($request);
55+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
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 = DataformClient::locationName('[PROJECT]', '[LOCATION]');
73+
$folderDisplayName = '[DISPLAY_NAME]';
74+
75+
create_folder_sample($formattedParent, $folderDisplayName);
76+
}
77+
// [END dataform_v1beta1_generated_Dataform_CreateFolder_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 dataform_v1beta1_generated_Dataform_CreateTeamFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1beta1\CreateTeamFolderRequest;
29+
use Google\Cloud\Dataform\V1beta1\TeamFolder;
30+
31+
/**
32+
* Creates a new TeamFolder in a given project and location.
33+
*
34+
* @param string $formattedParent The location in which to create the TeamFolder. Must be in the
35+
* format `projects/&#42;/locations/*`. Please see
36+
* {@see DataformClient::locationName()} for help formatting this field.
37+
* @param string $teamFolderDisplayName The TeamFolder's user-friendly name.
38+
*/
39+
function create_team_folder_sample(string $formattedParent, string $teamFolderDisplayName): void
40+
{
41+
// Create a client.
42+
$dataformClient = new DataformClient();
43+
44+
// Prepare the request message.
45+
$teamFolder = (new TeamFolder())
46+
->setDisplayName($teamFolderDisplayName);
47+
$request = (new CreateTeamFolderRequest())
48+
->setParent($formattedParent)
49+
->setTeamFolder($teamFolder);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var TeamFolder $response */
54+
$response = $dataformClient->createTeamFolder($request);
55+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
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 = DataformClient::locationName('[PROJECT]', '[LOCATION]');
73+
$teamFolderDisplayName = '[DISPLAY_NAME]';
74+
75+
create_team_folder_sample($formattedParent, $teamFolderDisplayName);
76+
}
77+
// [END dataform_v1beta1_generated_Dataform_CreateTeamFolder_sync]
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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 dataform_v1beta1_generated_Dataform_DeleteFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1beta1\DeleteFolderRequest;
29+
30+
/**
31+
* Deletes a single Folder.
32+
*
33+
* @param string $formattedName The Folder's name. Please see
34+
* {@see DataformClient::folderName()} for help formatting this field.
35+
*/
36+
function delete_folder_sample(string $formattedName): void
37+
{
38+
// Create a client.
39+
$dataformClient = new DataformClient();
40+
41+
// Prepare the request message.
42+
$request = (new DeleteFolderRequest())
43+
->setName($formattedName);
44+
45+
// Call the API and handle any network failures.
46+
try {
47+
$dataformClient->deleteFolder($request);
48+
printf('Call completed successfully.' . PHP_EOL);
49+
} catch (ApiException $ex) {
50+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
51+
}
52+
}
53+
54+
/**
55+
* Helper to execute the sample.
56+
*
57+
* This sample has been automatically generated and should be regarded as a code
58+
* template only. It will require modifications to work:
59+
* - It may require correct/in-range values for request initialization.
60+
* - It may require specifying regional endpoints when creating the service client,
61+
* please see the apiEndpoint client configuration option for more details.
62+
*/
63+
function callSample(): void
64+
{
65+
$formattedName = DataformClient::folderName('[PROJECT]', '[LOCATION]', '[FOLDER]');
66+
67+
delete_folder_sample($formattedName);
68+
}
69+
// [END dataform_v1beta1_generated_Dataform_DeleteFolder_sync]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 dataform_v1beta1_generated_Dataform_DeleteOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1beta1\Client\DataformClient;
28+
use Google\LongRunning\DeleteOperationRequest;
29+
30+
/**
31+
* Deletes a long-running operation. This method indicates that the client is
32+
* no longer interested in the operation result. It does not cancel the
33+
* operation. If the server doesn't support this method, it returns
34+
* `google.rpc.Code.UNIMPLEMENTED`.
35+
*
36+
* @param string $name The name of the operation resource to be deleted.
37+
*/
38+
function delete_operation_sample(string $name): void
39+
{
40+
// Create a client.
41+
$dataformClient = new DataformClient();
42+
43+
// Prepare the request message.
44+
$request = (new DeleteOperationRequest())
45+
->setName($name);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
$dataformClient->deleteOperation($request);
50+
printf('Call completed successfully.' . PHP_EOL);
51+
} catch (ApiException $ex) {
52+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
53+
}
54+
}
55+
56+
/**
57+
* Helper to execute the sample.
58+
*
59+
* This sample has been automatically generated and should be regarded as a code
60+
* template only. It will require modifications to work:
61+
* - It may require correct/in-range values for request initialization.
62+
* - It may require specifying regional endpoints when creating the service client,
63+
* please see the apiEndpoint client configuration option for more details.
64+
*/
65+
function callSample(): void
66+
{
67+
$name = '[NAME]';
68+
69+
delete_operation_sample($name);
70+
}
71+
// [END dataform_v1beta1_generated_Dataform_DeleteOperation_sync]

0 commit comments

Comments
 (0)