Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dataform/metadata/V1/Dataform.php

Large diffs are not rendered by default.

78 changes: 78 additions & 0 deletions Dataform/samples/V1/DataformClient/cancel_operation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/*
* Copyright 2026 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 dataform_v1_generated_Dataform_CancelOperation_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1\Client\DataformClient;
use Google\LongRunning\CancelOperationRequest;

/**
* Starts asynchronous cancellation on a long-running operation. The server
* makes a best effort to cancel the operation, but success is not
* guaranteed. If the server doesn't support this method, it returns
* `google.rpc.Code.UNIMPLEMENTED`. Clients can use
* [Operations.GetOperation][google.longrunning.Operations.GetOperation] or
* other methods to check whether the cancellation succeeded or whether the
* operation completed despite cancellation. On successful cancellation,
* the operation is not deleted; instead, it becomes an operation with
* an [Operation.error][google.longrunning.Operation.error] value with a
* [google.rpc.Status.code][google.rpc.Status.code] of `1`, corresponding to
* `Code.CANCELLED`.
*
* @param string $name The name of the operation resource to be cancelled.
*/
function cancel_operation_sample(string $name): void
{
// Create a client.
$dataformClient = new DataformClient();

// Prepare the request message.
$request = (new CancelOperationRequest())
->setName($name);

// Call the API and handle any network failures.
try {
$dataformClient->cancelOperation($request);
printf('Call completed successfully.' . PHP_EOL);
} 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
{
$name = '[NAME]';

cancel_operation_sample($name);
}
// [END dataform_v1_generated_Dataform_CancelOperation_sync]
77 changes: 77 additions & 0 deletions Dataform/samples/V1/DataformClient/create_folder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2026 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 dataform_v1_generated_Dataform_CreateFolder_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1\Client\DataformClient;
use Google\Cloud\Dataform\V1\CreateFolderRequest;
use Google\Cloud\Dataform\V1\Folder;

/**
* Creates a new Folder in a given project and location.
*
* @param string $formattedParent The location in which to create the Folder. Must be in the format
* `projects/&#42;/locations/*`. Please see
* {@see DataformClient::locationName()} for help formatting this field.
* @param string $folderDisplayName The Folder's user-friendly name.
*/
function create_folder_sample(string $formattedParent, string $folderDisplayName): void
{
// Create a client.
$dataformClient = new DataformClient();

// Prepare the request message.
$folder = (new Folder())
->setDisplayName($folderDisplayName);
$request = (new CreateFolderRequest())
->setParent($formattedParent)
->setFolder($folder);

// Call the API and handle any network failures.
try {
/** @var Folder $response */
$response = $dataformClient->createFolder($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
{
$formattedParent = DataformClient::locationName('[PROJECT]', '[LOCATION]');
$folderDisplayName = '[DISPLAY_NAME]';

create_folder_sample($formattedParent, $folderDisplayName);
}
// [END dataform_v1_generated_Dataform_CreateFolder_sync]
77 changes: 77 additions & 0 deletions Dataform/samples/V1/DataformClient/create_team_folder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php
/*
* Copyright 2026 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 dataform_v1_generated_Dataform_CreateTeamFolder_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1\Client\DataformClient;
use Google\Cloud\Dataform\V1\CreateTeamFolderRequest;
use Google\Cloud\Dataform\V1\TeamFolder;

/**
* Creates a new TeamFolder in a given project and location.
*
* @param string $formattedParent The location in which to create the TeamFolder. Must be in the
* format `projects/&#42;/locations/*`. Please see
* {@see DataformClient::locationName()} for help formatting this field.
* @param string $teamFolderDisplayName The TeamFolder's user-friendly name.
*/
function create_team_folder_sample(string $formattedParent, string $teamFolderDisplayName): void
{
// Create a client.
$dataformClient = new DataformClient();

// Prepare the request message.
$teamFolder = (new TeamFolder())
->setDisplayName($teamFolderDisplayName);
$request = (new CreateTeamFolderRequest())
->setParent($formattedParent)
->setTeamFolder($teamFolder);

// Call the API and handle any network failures.
try {
/** @var TeamFolder $response */
$response = $dataformClient->createTeamFolder($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
{
$formattedParent = DataformClient::locationName('[PROJECT]', '[LOCATION]');
$teamFolderDisplayName = '[DISPLAY_NAME]';

create_team_folder_sample($formattedParent, $teamFolderDisplayName);
}
// [END dataform_v1_generated_Dataform_CreateTeamFolder_sync]
69 changes: 69 additions & 0 deletions Dataform/samples/V1/DataformClient/delete_folder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2026 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 dataform_v1_generated_Dataform_DeleteFolder_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataform\V1\Client\DataformClient;
use Google\Cloud\Dataform\V1\DeleteFolderRequest;

/**
* Deletes a single Folder.
*
* @param string $formattedName The Folder's name. Please see
* {@see DataformClient::folderName()} for help formatting this field.
*/
function delete_folder_sample(string $formattedName): void
{
// Create a client.
$dataformClient = new DataformClient();

// Prepare the request message.
$request = (new DeleteFolderRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
$dataformClient->deleteFolder($request);
printf('Call completed successfully.' . PHP_EOL);
} 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
{
$formattedName = DataformClient::folderName('[PROJECT]', '[LOCATION]', '[FOLDER]');

delete_folder_sample($formattedName);
}
// [END dataform_v1_generated_Dataform_DeleteFolder_sync]
82 changes: 82 additions & 0 deletions Dataform/samples/V1/DataformClient/delete_folder_tree.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?php
/*
* Copyright 2026 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 dataform_v1_generated_Dataform_DeleteFolderTree_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Dataform\V1\Client\DataformClient;
use Google\Cloud\Dataform\V1\DeleteFolderTreeRequest;
use Google\Rpc\Status;

/**
* Deletes a Folder with its contents (Folders, Repositories, Workspaces,
* ReleaseConfigs, and WorkflowConfigs).
*
* @param string $formattedName The Folder's name.
* Format: projects/{project}/locations/{location}/folders/{folder}
* Please see {@see DataformClient::folderName()} for help formatting this field.
*/
function delete_folder_tree_sample(string $formattedName): void
{
// Create a client.
$dataformClient = new DataformClient();

// Prepare the request message.
$request = (new DeleteFolderTreeRequest())
->setName($formattedName);

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $dataformClient->deleteFolderTree($request);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->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
{
$formattedName = DataformClient::folderName('[PROJECT]', '[LOCATION]', '[FOLDER]');

delete_folder_tree_sample($formattedName);
}
// [END dataform_v1_generated_Dataform_DeleteFolderTree_sync]
Loading
Loading