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
2 changes: 2 additions & 0 deletions DataCatalogLineage/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
deep-copy-regex:
- source: /google/cloud/datacatalog/lineage/(v1)/.*-php/(.*)
dest: /owl-bot-staging/DataCatalogLineage/$1/$2
- source: /google/cloud/datacatalog/lineage/configmanagement/(v1)/.*-php/(.*)
dest: /owl-bot-staging/DataCatalogLineage/ConfigManagement/$1/$2
api-name: DataCatalogLineage

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 41 additions & 2 deletions DataCatalogLineage/owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,48 @@
src = Path(f"../{php.STAGING_DIR}/DataCatalogLineage").resolve()
dest = Path().resolve()

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

# copy all src including partial veneer classes
#s.move(
# executions_library / 'src',
# 'src/Executions',
# merge=preserve_copyright_year,
#)
## copy proto files to src also
#s.move(
# executions_library / 'proto/src/Google/Cloud/Workflows',
# 'src/',
# merge=preserve_copyright_year,
# excludes=[
# executions_library / "**/*_*.php"
# ]
#)
#s.move(
# executions_library / 'tests/Unit',
# 'tests/Unit/Executions',
# merge=preserve_copyright_year,
#)
## copy GPBMetadata file to metadata
#s.move(executions_library / 'proto/src/GPBMetadata/Google/Cloud/Workflows',
# 'metadata/',
# merge=preserve_copyright_year,
#)
#
## Fix test namespaces
#s.replace(
# 'tests/Unit/Executions/*/*.php',
# r'namespace Google\\Cloud\\Workflows\\Executions\\Tests\\Unit',
# r'namespace Google\\Cloud\\Workflows\\Tests\\Unit\\Executions')
s.move(configmanagement_src / f'src', 'src/ConfigManagement')
s.move(configmanagement_src / f'samples', 'samples/ConfigManagement')
s.move(configmanagement_src / f'tests/Unit', 'tests/Unit/ConfigManagement')
s.move(configmanagement_src / f'proto/src/Google/Cloud/DataCatalog/Lineage', f'src')
s.move(configmanagement_src / f'proto/src/GPBMetadata/Google/Cloud/Datacatalog/Lineage', f'metadata')

# copy over the standard files
php.owlbot_main(src=src, dest=dest)

# format generated clients
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?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 datalineage_v1_generated_ConfigManagementService_GetConfig_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Client\ConfigManagementServiceClient;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Config;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\GetConfigRequest;

/**
* Get the Config for a given resource.
*
* @param string $formattedName REQUIRED: The resource name of the config to be fetched.
* Format:
* `organizations/{organization_id}/locations/global/config`
* `folders/{folder_id}/locations/global/config`
* `projects/{project_id}/locations/global/config`
* `projects/{project_number}/locations/global/config`
* Please see {@see ConfigManagementServiceClient::configName()} for help formatting this field.
*/
function get_config_sample(string $formattedName): void
{
// Create a client.
$configManagementServiceClient = new ConfigManagementServiceClient();

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

// Call the API and handle any network failures.
try {
/** @var Config $response */
$response = $configManagementServiceClient->getConfig($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
{
$formattedName = ConfigManagementServiceClient::configName('[PROJECT]', '[LOCATION]');

get_config_sample($formattedName);
}
// [END datalineage_v1_generated_ConfigManagementService_GetConfig_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?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 datalineage_v1_generated_ConfigManagementService_UpdateConfig_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Client\ConfigManagementServiceClient;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\Config;
use Google\Cloud\DataCatalog\Lineage\ConfigManagement\V1\UpdateConfigRequest;

/**
* Update the Config for a given resource.
*
* 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 update_config_sample(): void
{
// Create a client.
$configManagementServiceClient = new ConfigManagementServiceClient();

// Prepare the request message.
$config = new Config();
$request = (new UpdateConfigRequest())
->setConfig($config);

// Call the API and handle any network failures.
try {
/** @var Config $response */
$response = $configManagementServiceClient->updateConfig($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END datalineage_v1_generated_ConfigManagementService_UpdateConfig_sync]
Loading
Loading