Skip to content

Commit 457db98

Browse files
feat: [Dataform] add folders and teamFolders related changes to v1 (#9043)
* feat: add folders and teamFolders related changes to v1 docs: A comment for field `force` in message `.google.cloud.dataform.v1.DeleteRepositoryRequest` is changed PiperOrigin-RevId: 888723444 Source-Link: googleapis/googleapis@29214fa Source-Link: googleapis/googleapis-gen@5125e3f Copy-Tag: eyJwIjoiRGF0YWZvcm0vLk93bEJvdC55YW1sIiwiaCI6IjUxMjVlM2ZlYWY3NmVhNjY4MTBjMGM1ZjU5NjA3ZjIxYjBhYWJhNzYifQ== * 🦉 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 6408d67 commit 457db98

80 files changed

Lines changed: 11767 additions & 1030 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.

Dataform/metadata/V1/Dataform.php

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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_v1_generated_Dataform_CancelOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\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_v1_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_v1_generated_Dataform_CreateFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\CreateFolderRequest;
29+
use Google\Cloud\Dataform\V1\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_v1_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_v1_generated_Dataform_CreateTeamFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\CreateTeamFolderRequest;
29+
use Google\Cloud\Dataform\V1\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_v1_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_v1_generated_Dataform_DeleteFolder_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\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_v1_generated_Dataform_DeleteFolder_sync]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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_v1_generated_Dataform_DeleteFolderTree_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Dataform\V1\Client\DataformClient;
29+
use Google\Cloud\Dataform\V1\DeleteFolderTreeRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes a Folder with its contents (Folders, Repositories, Workspaces,
34+
* ReleaseConfigs, and WorkflowConfigs).
35+
*
36+
* @param string $formattedName The Folder's name.
37+
* Format: projects/{project}/locations/{location}/folders/{folder}
38+
* Please see {@see DataformClient::folderName()} for help formatting this field.
39+
*/
40+
function delete_folder_tree_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$dataformClient = new DataformClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteFolderTreeRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $dataformClient->deleteFolderTree($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
printf('Operation completed successfully.' . PHP_EOL);
57+
} else {
58+
/** @var Status $error */
59+
$error = $response->getError();
60+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
61+
}
62+
} catch (ApiException $ex) {
63+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
64+
}
65+
}
66+
67+
/**
68+
* Helper to execute the sample.
69+
*
70+
* This sample has been automatically generated and should be regarded as a code
71+
* template only. It will require modifications to work:
72+
* - It may require correct/in-range values for request initialization.
73+
* - It may require specifying regional endpoints when creating the service client,
74+
* please see the apiEndpoint client configuration option for more details.
75+
*/
76+
function callSample(): void
77+
{
78+
$formattedName = DataformClient::folderName('[PROJECT]', '[LOCATION]', '[FOLDER]');
79+
80+
delete_folder_tree_sample($formattedName);
81+
}
82+
// [END dataform_v1_generated_Dataform_DeleteFolderTree_sync]

0 commit comments

Comments
 (0)