Skip to content

Commit fbe2e3f

Browse files
authored
feat(DataCatalogLineage): add configmanagement (#9039)
1 parent d62d86d commit fbe2e3f

19 files changed

Lines changed: 1862 additions & 2 deletions

File tree

DataCatalogLineage/.OwlBot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
deep-copy-regex:
22
- source: /google/cloud/datacatalog/lineage/(v1)/.*-php/(.*)
33
dest: /owl-bot-staging/DataCatalogLineage/$1/$2
4+
- source: /google/cloud/datacatalog/lineage/configmanagement/(v1)/.*-php/(.*)
5+
dest: /owl-bot-staging/DataCatalogLineage/ConfigManagement/$1/$2
46
api-name: DataCatalogLineage

DataCatalogLineage/metadata/Configmanagement/V1/Configmanagement.php

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DataCatalogLineage/owlbot.py

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,48 @@
2727
src = Path(f"../{php.STAGING_DIR}/DataCatalogLineage").resolve()
2828
dest = Path().resolve()
2929

30-
# Added so that we can pass copy_excludes in the owlbot_main() call
31-
_tracked_paths.add(src)
30+
# copy over configmanagement (gapic src, samples, and tests, proto src and metadata)
31+
configmanagement_src = Path(f"../{php.STAGING_DIR}/DataCatalogLineage/ConfigManagement/v1").resolve()
32+
#executions_library = Path(f"../{php.STAGING_DIR}/Workflows/Executions/v1").resolve()
3233

34+
# copy all src including partial veneer classes
35+
#s.move(
36+
# executions_library / 'src',
37+
# 'src/Executions',
38+
# merge=preserve_copyright_year,
39+
#)
40+
## copy proto files to src also
41+
#s.move(
42+
# executions_library / 'proto/src/Google/Cloud/Workflows',
43+
# 'src/',
44+
# merge=preserve_copyright_year,
45+
# excludes=[
46+
# executions_library / "**/*_*.php"
47+
# ]
48+
#)
49+
#s.move(
50+
# executions_library / 'tests/Unit',
51+
# 'tests/Unit/Executions',
52+
# merge=preserve_copyright_year,
53+
#)
54+
## copy GPBMetadata file to metadata
55+
#s.move(executions_library / 'proto/src/GPBMetadata/Google/Cloud/Workflows',
56+
# 'metadata/',
57+
# merge=preserve_copyright_year,
58+
#)
59+
#
60+
## Fix test namespaces
61+
#s.replace(
62+
# 'tests/Unit/Executions/*/*.php',
63+
# r'namespace Google\\Cloud\\Workflows\\Executions\\Tests\\Unit',
64+
# r'namespace Google\\Cloud\\Workflows\\Tests\\Unit\\Executions')
65+
s.move(configmanagement_src / f'src', 'src/ConfigManagement')
66+
s.move(configmanagement_src / f'samples', 'samples/ConfigManagement')
67+
s.move(configmanagement_src / f'tests/Unit', 'tests/Unit/ConfigManagement')
68+
s.move(configmanagement_src / f'proto/src/Google/Cloud/DataCatalog/Lineage', f'src')
69+
s.move(configmanagement_src / f'proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage', f'metadata')
70+
71+
# copy over the standard files
3372
php.owlbot_main(src=src, dest=dest)
3473

3574
# format generated clients
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 datalineage_v1_generated_ConfigManagementService_GetConfig_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Client\ConfigManagementServiceClient;
28+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Config;
29+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\GetConfigRequest;
30+
31+
/**
32+
* Get the Config for a given resource.
33+
*
34+
* @param string $formattedName REQUIRED: The resource name of the config to be fetched.
35+
* Format:
36+
* `organizations/{organization_id}/locations/global/config`
37+
* `folders/{folder_id}/locations/global/config`
38+
* `projects/{project_id}/locations/global/config`
39+
* `projects/{project_number}/locations/global/config`
40+
* Please see {@see ConfigManagementServiceClient::configName()} for help formatting this field.
41+
*/
42+
function get_config_sample(string $formattedName): void
43+
{
44+
// Create a client.
45+
$configManagementServiceClient = new ConfigManagementServiceClient();
46+
47+
// Prepare the request message.
48+
$request = (new GetConfigRequest())
49+
->setName($formattedName);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var Config $response */
54+
$response = $configManagementServiceClient->getConfig($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+
$formattedName = ConfigManagementServiceClient::configName('[PROJECT]', '[LOCATION]');
73+
74+
get_config_sample($formattedName);
75+
}
76+
// [END datalineage_v1_generated_ConfigManagementService_GetConfig_sync]
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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 datalineage_v1_generated_ConfigManagementService_UpdateConfig_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Client\ConfigManagementServiceClient;
28+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Config;
29+
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\UpdateConfigRequest;
30+
31+
/**
32+
* Update the Config for a given resource.
33+
*
34+
* This sample has been automatically generated and should be regarded as a code
35+
* template only. It will require modifications to work:
36+
* - It may require correct/in-range values for request initialization.
37+
* - It may require specifying regional endpoints when creating the service client,
38+
* please see the apiEndpoint client configuration option for more details.
39+
*/
40+
function update_config_sample(): void
41+
{
42+
// Create a client.
43+
$configManagementServiceClient = new ConfigManagementServiceClient();
44+
45+
// Prepare the request message.
46+
$config = new Config();
47+
$request = (new UpdateConfigRequest())
48+
->setConfig($config);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var Config $response */
53+
$response = $configManagementServiceClient->updateConfig($request);
54+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
55+
} catch (ApiException $ex) {
56+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
57+
}
58+
}
59+
// [END datalineage_v1_generated_ConfigManagementService_UpdateConfig_sync]

0 commit comments

Comments
 (0)