Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [BigQueryAnalyticsHub] support selective sharing on data clean room Listings #7156

Merged
merged 2 commits into from
Mar 27, 2024
Merged
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
Binary file modified BigQueryAnalyticsHub/metadata/V1/Analyticshub.php
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,25 @@ public static function subscriptionName(string $project, string $location, strin
]);
}

/**
* Formats a string containing the fully-qualified path to represent a table
* resource.
*
* @param string $project
* @param string $dataset
* @param string $table
*
* @return string The formatted table resource.
*/
public static function tableName(string $project, string $dataset, string $table): string
{
return self::getPathTemplate('table')->render([
'project' => $project,
'dataset' => $dataset,
'table' => $table,
]);
}

/**
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
Expand All @@ -288,6 +307,7 @@ public static function subscriptionName(string $project, string $location, strin
* - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}
* - location: projects/{project}/locations/{location}
* - subscription: projects/{project}/locations/{location}/subscriptions/{subscription}
* - table: projects/{project}/datasets/{dataset}/tables/{table}
*
* The optional $template argument can be supplied to specify a particular pattern,
* and must match one of the templates listed above. If no $template argument is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ class AnalyticsHubServiceGapicClient

private static $subscriptionNameTemplate;

private static $tableNameTemplate;

private static $pathTemplateMap;

private $operationsClient;
Expand Down Expand Up @@ -231,6 +233,17 @@ private static function getSubscriptionNameTemplate()
return self::$subscriptionNameTemplate;
}

private static function getTableNameTemplate()
{
if (self::$tableNameTemplate == null) {
self::$tableNameTemplate = new PathTemplate(
'projects/{project}/datasets/{dataset}/tables/{table}'
);
}

return self::$tableNameTemplate;
}

private static function getPathTemplateMap()
{
if (self::$pathTemplateMap == null) {
Expand All @@ -240,6 +253,7 @@ private static function getPathTemplateMap()
'listing' => self::getListingNameTemplate(),
'location' => self::getLocationNameTemplate(),
'subscription' => self::getSubscriptionNameTemplate(),
'table' => self::getTableNameTemplate(),
];
}

Expand Down Expand Up @@ -343,6 +357,25 @@ public static function subscriptionName($project, $location, $subscription)
]);
}

/**
* Formats a string containing the fully-qualified path to represent a table
* resource.
*
* @param string $project
* @param string $dataset
* @param string $table
*
* @return string The formatted table resource.
*/
public static function tableName($project, $dataset, $table)
{
return self::getTableNameTemplate()->render([
'project' => $project,
'dataset' => $dataset,
'table' => $table,
]);
}

/**
* Parses a formatted name string and returns an associative array of the components in the name.
* The following name formats are supported:
Expand All @@ -352,6 +385,7 @@ public static function subscriptionName($project, $location, $subscription)
* - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}
* - location: projects/{project}/locations/{location}
* - subscription: projects/{project}/locations/{location}/subscriptions/{subscription}
* - table: projects/{project}/datasets/{dataset}/tables/{table}
*
* The optional $template argument can be supplied to specify a particular pattern,
* and must match one of the templates listed above. If no $template argument is
Expand Down
42 changes: 42 additions & 0 deletions BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource.php

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

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

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

Loading
Loading