Skip to content

Commit 10e6569

Browse files
feat: [BigQueryAnalyticsHub] You can now configure listings for multiple regions for shared datasets and linked dataset replicas in BigQuery sharing (#8555)
* feat: You can now configure listings for multiple regions for shared datasets and linked dataset replicas in BigQuery sharing docs:Add new category GOOGLE EARTH ENGINE and Increase limit of max Categories per Listing to 5 For more information, see [Create a listing](https://cloud.google.com/bigquery/docs/analytics-hub-manage-listings#create_a_listing). This feature is in [preview](https://cloud.google.com/products#product-launch-stages) PiperOrigin-RevId: 802216997 Source-Link: googleapis/googleapis@b495659 Source-Link: googleapis/googleapis-gen@3209586 Copy-Tag: eyJwIjoiQmlnUXVlcnlBbmFseXRpY3NIdWIvLk93bEJvdC55YW1sIiwiaCI6IjMyMDk1ODY5OTI4ZjQ0YzdmOTBmNzc3NzdhNTkzOThkMjdmOTVhMzMifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 787cad3 commit 10e6569

33 files changed

Lines changed: 3696 additions & 29 deletions
4.2 KB
Binary file not shown.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 analyticshub_v1_generated_AnalyticsHubService_ApproveQueryTemplate_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BigQuery\AnalyticsHub\V1\ApproveQueryTemplateRequest;
28+
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
29+
use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
30+
31+
/**
32+
* Approves a query template.
33+
*
34+
* @param string $formattedName The resource path of the QueryTemplate.
35+
* e.g.
36+
* `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
37+
* {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
38+
*/
39+
function approve_query_template_sample(string $formattedName): void
40+
{
41+
// Create a client.
42+
$analyticsHubServiceClient = new AnalyticsHubServiceClient();
43+
44+
// Prepare the request message.
45+
$request = (new ApproveQueryTemplateRequest())
46+
->setName($formattedName);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var QueryTemplate $response */
51+
$response = $analyticsHubServiceClient->approveQueryTemplate($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedName = AnalyticsHubServiceClient::queryTemplateName(
70+
'[PROJECT]',
71+
'[LOCATION]',
72+
'[DATA_EXCHANGE]',
73+
'[QUERY_TEMPLATE]'
74+
);
75+
76+
approve_query_template_sample($formattedName);
77+
}
78+
// [END analyticshub_v1_generated_AnalyticsHubService_ApproveQueryTemplate_sync]
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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 analyticshub_v1_generated_AnalyticsHubService_CreateQueryTemplate_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
28+
use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateQueryTemplateRequest;
29+
use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
30+
31+
/**
32+
* Creates a new QueryTemplate
33+
*
34+
* @param string $formattedParent The parent resource path of the QueryTemplate.
35+
* e.g.
36+
* `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`. Please see
37+
* {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
38+
* @param string $queryTemplateId The ID of the QueryTemplate to create.
39+
* Must contain only Unicode letters, numbers (0-9), underscores (_).
40+
* Max length: 100 bytes.
41+
* @param string $queryTemplateDisplayName Human-readable display name of the QueryTemplate. The display
42+
* name must contain only Unicode letters, numbers (0-9), underscores (_),
43+
* dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
44+
* Default value is an empty string. Max length: 63 bytes.
45+
*/
46+
function create_query_template_sample(
47+
string $formattedParent,
48+
string $queryTemplateId,
49+
string $queryTemplateDisplayName
50+
): void {
51+
// Create a client.
52+
$analyticsHubServiceClient = new AnalyticsHubServiceClient();
53+
54+
// Prepare the request message.
55+
$queryTemplate = (new QueryTemplate())
56+
->setDisplayName($queryTemplateDisplayName);
57+
$request = (new CreateQueryTemplateRequest())
58+
->setParent($formattedParent)
59+
->setQueryTemplateId($queryTemplateId)
60+
->setQueryTemplate($queryTemplate);
61+
62+
// Call the API and handle any network failures.
63+
try {
64+
/** @var QueryTemplate $response */
65+
$response = $analyticsHubServiceClient->createQueryTemplate($request);
66+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
67+
} catch (ApiException $ex) {
68+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
69+
}
70+
}
71+
72+
/**
73+
* Helper to execute the sample.
74+
*
75+
* This sample has been automatically generated and should be regarded as a code
76+
* template only. It will require modifications to work:
77+
* - It may require correct/in-range values for request initialization.
78+
* - It may require specifying regional endpoints when creating the service client,
79+
* please see the apiEndpoint client configuration option for more details.
80+
*/
81+
function callSample(): void
82+
{
83+
$formattedParent = AnalyticsHubServiceClient::dataExchangeName(
84+
'[PROJECT]',
85+
'[LOCATION]',
86+
'[DATA_EXCHANGE]'
87+
);
88+
$queryTemplateId = '[QUERY_TEMPLATE_ID]';
89+
$queryTemplateDisplayName = '[DISPLAY_NAME]';
90+
91+
create_query_template_sample($formattedParent, $queryTemplateId, $queryTemplateDisplayName);
92+
}
93+
// [END analyticshub_v1_generated_AnalyticsHubService_CreateQueryTemplate_sync]
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 analyticshub_v1_generated_AnalyticsHubService_DeleteQueryTemplate_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
28+
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteQueryTemplateRequest;
29+
30+
/**
31+
* Deletes a query template.
32+
*
33+
* @param string $formattedName The resource path of the QueryTemplate.
34+
* e.g.
35+
* `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
36+
* {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
37+
*/
38+
function delete_query_template_sample(string $formattedName): void
39+
{
40+
// Create a client.
41+
$analyticsHubServiceClient = new AnalyticsHubServiceClient();
42+
43+
// Prepare the request message.
44+
$request = (new DeleteQueryTemplateRequest())
45+
->setName($formattedName);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
$analyticsHubServiceClient->deleteQueryTemplate($request);
50+
printf('Call completed successfully.' . PHP_EOL);
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 = AnalyticsHubServiceClient::queryTemplateName(
68+
'[PROJECT]',
69+
'[LOCATION]',
70+
'[DATA_EXCHANGE]',
71+
'[QUERY_TEMPLATE]'
72+
);
73+
74+
delete_query_template_sample($formattedName);
75+
}
76+
// [END analyticshub_v1_generated_AnalyticsHubService_DeleteQueryTemplate_sync]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 analyticshub_v1_generated_AnalyticsHubService_GetQueryTemplate_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
28+
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetQueryTemplateRequest;
29+
use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
30+
31+
/**
32+
* Gets a QueryTemplate
33+
*
34+
* @param string $formattedName The parent resource path of the QueryTemplate.
35+
* e.g.
36+
* `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
37+
* {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
38+
*/
39+
function get_query_template_sample(string $formattedName): void
40+
{
41+
// Create a client.
42+
$analyticsHubServiceClient = new AnalyticsHubServiceClient();
43+
44+
// Prepare the request message.
45+
$request = (new GetQueryTemplateRequest())
46+
->setName($formattedName);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var QueryTemplate $response */
51+
$response = $analyticsHubServiceClient->getQueryTemplate($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedName = AnalyticsHubServiceClient::queryTemplateName(
70+
'[PROJECT]',
71+
'[LOCATION]',
72+
'[DATA_EXCHANGE]',
73+
'[QUERY_TEMPLATE]'
74+
);
75+
76+
get_query_template_sample($formattedName);
77+
}
78+
// [END analyticshub_v1_generated_AnalyticsHubService_GetQueryTemplate_sync]

0 commit comments

Comments
 (0)