Skip to content

Commit 8517f23

Browse files
authored
feat: add Dataform V1 (#8395)
1 parent cb458d4 commit 8517f23

212 files changed

Lines changed: 34012 additions & 1 deletion

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/.OwlBot.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
deep-copy-regex:
2-
- source: /google/cloud/dataform/(v1beta1)/.*-php/(.*)
2+
- source: /google/cloud/dataform/(v1beta1|v1)/.*-php/(.*)
33
dest: /owl-bot-staging/Dataform/$1/$2
44
api-name: Dataform

Dataform/metadata/V1/Dataform.php

37.4 KB
Binary file not shown.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_CancelWorkflowInvocation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\CancelWorkflowInvocationRequest;
28+
use Google\Cloud\Dataform\V1\CancelWorkflowInvocationResponse;
29+
use Google\Cloud\Dataform\V1\Client\DataformClient;
30+
31+
/**
32+
* Requests cancellation of a running WorkflowInvocation.
33+
*
34+
* @param string $formattedName The workflow invocation resource's name. Please see
35+
* {@see DataformClient::workflowInvocationName()} for help formatting this field.
36+
*/
37+
function cancel_workflow_invocation_sample(string $formattedName): void
38+
{
39+
// Create a client.
40+
$dataformClient = new DataformClient();
41+
42+
// Prepare the request message.
43+
$request = (new CancelWorkflowInvocationRequest())
44+
->setName($formattedName);
45+
46+
// Call the API and handle any network failures.
47+
try {
48+
/** @var CancelWorkflowInvocationResponse $response */
49+
$response = $dataformClient->cancelWorkflowInvocation($request);
50+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
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+
$formattedName = DataformClient::workflowInvocationName(
68+
'[PROJECT]',
69+
'[LOCATION]',
70+
'[REPOSITORY]',
71+
'[WORKFLOW_INVOCATION]'
72+
);
73+
74+
cancel_workflow_invocation_sample($formattedName);
75+
}
76+
// [END dataform_v1_generated_Dataform_CancelWorkflowInvocation_sync]
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_CommitRepositoryChanges_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\CommitAuthor;
29+
use Google\Cloud\Dataform\V1\CommitMetadata;
30+
use Google\Cloud\Dataform\V1\CommitRepositoryChangesRequest;
31+
use Google\Cloud\Dataform\V1\CommitRepositoryChangesResponse;
32+
33+
/**
34+
* Applies a Git commit to a Repository. The Repository must not have a value
35+
* for `git_remote_settings.url`.
36+
*
37+
* @param string $formattedName The repository's name. Please see
38+
* {@see DataformClient::repositoryName()} for help formatting this field.
39+
* @param string $commitMetadataAuthorName The commit author's name.
40+
* @param string $commitMetadataAuthorEmailAddress The commit author's email address.
41+
*/
42+
function commit_repository_changes_sample(
43+
string $formattedName,
44+
string $commitMetadataAuthorName,
45+
string $commitMetadataAuthorEmailAddress
46+
): void {
47+
// Create a client.
48+
$dataformClient = new DataformClient();
49+
50+
// Prepare the request message.
51+
$commitMetadataAuthor = (new CommitAuthor())
52+
->setName($commitMetadataAuthorName)
53+
->setEmailAddress($commitMetadataAuthorEmailAddress);
54+
$commitMetadata = (new CommitMetadata())
55+
->setAuthor($commitMetadataAuthor);
56+
$request = (new CommitRepositoryChangesRequest())
57+
->setName($formattedName)
58+
->setCommitMetadata($commitMetadata);
59+
60+
// Call the API and handle any network failures.
61+
try {
62+
/** @var CommitRepositoryChangesResponse $response */
63+
$response = $dataformClient->commitRepositoryChanges($request);
64+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
65+
} catch (ApiException $ex) {
66+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
67+
}
68+
}
69+
70+
/**
71+
* Helper to execute the sample.
72+
*
73+
* This sample has been automatically generated and should be regarded as a code
74+
* template only. It will require modifications to work:
75+
* - It may require correct/in-range values for request initialization.
76+
* - It may require specifying regional endpoints when creating the service client,
77+
* please see the apiEndpoint client configuration option for more details.
78+
*/
79+
function callSample(): void
80+
{
81+
$formattedName = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
82+
$commitMetadataAuthorName = '[NAME]';
83+
$commitMetadataAuthorEmailAddress = '[EMAIL_ADDRESS]';
84+
85+
commit_repository_changes_sample(
86+
$formattedName,
87+
$commitMetadataAuthorName,
88+
$commitMetadataAuthorEmailAddress
89+
);
90+
}
91+
// [END dataform_v1_generated_Dataform_CommitRepositoryChanges_sync]
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_CommitWorkspaceChanges_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\CommitAuthor;
29+
use Google\Cloud\Dataform\V1\CommitWorkspaceChangesRequest;
30+
use Google\Cloud\Dataform\V1\CommitWorkspaceChangesResponse;
31+
32+
/**
33+
* Applies a Git commit for uncommitted files in a Workspace.
34+
*
35+
* @param string $formattedName The workspace's name. Please see
36+
* {@see DataformClient::workspaceName()} for help formatting this field.
37+
* @param string $authorName The commit author's name.
38+
* @param string $authorEmailAddress The commit author's email address.
39+
*/
40+
function commit_workspace_changes_sample(
41+
string $formattedName,
42+
string $authorName,
43+
string $authorEmailAddress
44+
): void {
45+
// Create a client.
46+
$dataformClient = new DataformClient();
47+
48+
// Prepare the request message.
49+
$author = (new CommitAuthor())
50+
->setName($authorName)
51+
->setEmailAddress($authorEmailAddress);
52+
$request = (new CommitWorkspaceChangesRequest())
53+
->setName($formattedName)
54+
->setAuthor($author);
55+
56+
// Call the API and handle any network failures.
57+
try {
58+
/** @var CommitWorkspaceChangesResponse $response */
59+
$response = $dataformClient->commitWorkspaceChanges($request);
60+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
61+
} catch (ApiException $ex) {
62+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
63+
}
64+
}
65+
66+
/**
67+
* Helper to execute the sample.
68+
*
69+
* This sample has been automatically generated and should be regarded as a code
70+
* template only. It will require modifications to work:
71+
* - It may require correct/in-range values for request initialization.
72+
* - It may require specifying regional endpoints when creating the service client,
73+
* please see the apiEndpoint client configuration option for more details.
74+
*/
75+
function callSample(): void
76+
{
77+
$formattedName = DataformClient::workspaceName(
78+
'[PROJECT]',
79+
'[LOCATION]',
80+
'[REPOSITORY]',
81+
'[WORKSPACE]'
82+
);
83+
$authorName = '[NAME]';
84+
$authorEmailAddress = '[EMAIL_ADDRESS]';
85+
86+
commit_workspace_changes_sample($formattedName, $authorName, $authorEmailAddress);
87+
}
88+
// [END dataform_v1_generated_Dataform_CommitWorkspaceChanges_sync]
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_ComputeRepositoryAccessTokenStatus_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Dataform\V1\Client\DataformClient;
28+
use Google\Cloud\Dataform\V1\ComputeRepositoryAccessTokenStatusRequest;
29+
use Google\Cloud\Dataform\V1\ComputeRepositoryAccessTokenStatusResponse;
30+
31+
/**
32+
* Computes a Repository's Git access token status.
33+
*
34+
* @param string $formattedName The repository's name. Please see
35+
* {@see DataformClient::repositoryName()} for help formatting this field.
36+
*/
37+
function compute_repository_access_token_status_sample(string $formattedName): void
38+
{
39+
// Create a client.
40+
$dataformClient = new DataformClient();
41+
42+
// Prepare the request message.
43+
$request = (new ComputeRepositoryAccessTokenStatusRequest())
44+
->setName($formattedName);
45+
46+
// Call the API and handle any network failures.
47+
try {
48+
/** @var ComputeRepositoryAccessTokenStatusResponse $response */
49+
$response = $dataformClient->computeRepositoryAccessTokenStatus($request);
50+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
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+
$formattedName = DataformClient::repositoryName('[PROJECT]', '[LOCATION]', '[REPOSITORY]');
68+
69+
compute_repository_access_token_status_sample($formattedName);
70+
}
71+
// [END dataform_v1_generated_Dataform_ComputeRepositoryAccessTokenStatus_sync]

0 commit comments

Comments
 (0)