diff --git a/BigQueryAnalyticsHub/metadata/V1/Analyticshub.php b/BigQueryAnalyticsHub/metadata/V1/Analyticshub.php
index b0be7b0036fe..b2ee5fe11d1f 100644
Binary files a/BigQueryAnalyticsHub/metadata/V1/Analyticshub.php and b/BigQueryAnalyticsHub/metadata/V1/Analyticshub.php differ
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/approve_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/approve_query_template.php
new file mode 100644
index 000000000000..35f5557c4bc3
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/approve_query_template.php
@@ -0,0 +1,78 @@
+setName($formattedName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var QueryTemplate $response */
+ $response = $analyticsHubServiceClient->approveQueryTemplate($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 = AnalyticsHubServiceClient::queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+
+ approve_query_template_sample($formattedName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_ApproveQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/create_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/create_query_template.php
new file mode 100644
index 000000000000..99c3cc9c0032
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/create_query_template.php
@@ -0,0 +1,93 @@
+setDisplayName($queryTemplateDisplayName);
+ $request = (new CreateQueryTemplateRequest())
+ ->setParent($formattedParent)
+ ->setQueryTemplateId($queryTemplateId)
+ ->setQueryTemplate($queryTemplate);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var QueryTemplate $response */
+ $response = $analyticsHubServiceClient->createQueryTemplate($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
+{
+ $formattedParent = AnalyticsHubServiceClient::dataExchangeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]'
+ );
+ $queryTemplateId = '[QUERY_TEMPLATE_ID]';
+ $queryTemplateDisplayName = '[DISPLAY_NAME]';
+
+ create_query_template_sample($formattedParent, $queryTemplateId, $queryTemplateDisplayName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_CreateQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/delete_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/delete_query_template.php
new file mode 100644
index 000000000000..370c4b0e9c13
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/delete_query_template.php
@@ -0,0 +1,76 @@
+setName($formattedName);
+
+ // Call the API and handle any network failures.
+ try {
+ $analyticsHubServiceClient->deleteQueryTemplate($request);
+ printf('Call completed successfully.' . PHP_EOL);
+ } 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 = AnalyticsHubServiceClient::queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+
+ delete_query_template_sample($formattedName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_DeleteQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/get_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/get_query_template.php
new file mode 100644
index 000000000000..dcb30e275507
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/get_query_template.php
@@ -0,0 +1,78 @@
+setName($formattedName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var QueryTemplate $response */
+ $response = $analyticsHubServiceClient->getQueryTemplate($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 = AnalyticsHubServiceClient::queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+
+ get_query_template_sample($formattedName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_GetQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/list_query_templates.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/list_query_templates.php
new file mode 100644
index 000000000000..6b26b29f3cbf
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/list_query_templates.php
@@ -0,0 +1,81 @@
+setParent($formattedParent);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var PagedListResponse $response */
+ $response = $analyticsHubServiceClient->listQueryTemplates($request);
+
+ /** @var QueryTemplate $element */
+ foreach ($response as $element) {
+ printf('Element data: %s' . PHP_EOL, $element->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
+{
+ $formattedParent = AnalyticsHubServiceClient::dataExchangeName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]'
+ );
+
+ list_query_templates_sample($formattedParent);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_ListQueryTemplates_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/submit_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/submit_query_template.php
new file mode 100644
index 000000000000..8acb86f178a1
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/submit_query_template.php
@@ -0,0 +1,78 @@
+setName($formattedName);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var QueryTemplate $response */
+ $response = $analyticsHubServiceClient->submitQueryTemplate($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 = AnalyticsHubServiceClient::queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+
+ submit_query_template_sample($formattedName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_SubmitQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/update_query_template.php b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/update_query_template.php
new file mode 100644
index 000000000000..5f8d9bf7f59c
--- /dev/null
+++ b/BigQueryAnalyticsHub/samples/V1/AnalyticsHubServiceClient/update_query_template.php
@@ -0,0 +1,75 @@
+setDisplayName($queryTemplateDisplayName);
+ $request = (new UpdateQueryTemplateRequest())
+ ->setQueryTemplate($queryTemplate);
+
+ // Call the API and handle any network failures.
+ try {
+ /** @var QueryTemplate $response */
+ $response = $analyticsHubServiceClient->updateQueryTemplate($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
+{
+ $queryTemplateDisplayName = '[DISPLAY_NAME]';
+
+ update_query_template_sample($queryTemplateDisplayName);
+}
+// [END analyticshub_v1_generated_AnalyticsHubService_UpdateQueryTemplate_sync]
diff --git a/BigQueryAnalyticsHub/src/V1/ApproveQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/ApproveQueryTemplateRequest.php
new file mode 100644
index 000000000000..95246d9c26da
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/ApproveQueryTemplateRequest.php
@@ -0,0 +1,91 @@
+google.cloud.bigquery.analyticshub.v1.ApproveQueryTemplateRequest
+ */
+class ApproveQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $name = '';
+
+ /**
+ * @param string $name Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
+ * {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ApproveQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(string $name): self
+ {
+ return (new self())
+ ->setName($name);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/Client/AnalyticsHubServiceClient.php b/BigQueryAnalyticsHub/src/V1/Client/AnalyticsHubServiceClient.php
index b5db0ba70b26..c11cdb30cad3 100644
--- a/BigQueryAnalyticsHub/src/V1/Client/AnalyticsHubServiceClient.php
+++ b/BigQueryAnalyticsHub/src/V1/Client/AnalyticsHubServiceClient.php
@@ -34,30 +34,38 @@
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
use Google\Auth\FetchAuthTokenInterface;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\ApproveQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\GetQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListListingsRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionResponse;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\SubmitQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;
use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateQueryTemplateRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
@@ -84,28 +92,35 @@
* name, and additionally a parseName method to extract the individual identifiers
* contained within formatted names that are returned by the API.
*
+ * @method PromiseInterface approveQueryTemplateAsync(ApproveQueryTemplateRequest $request, array $optionalArgs = [])
* @method PromiseInterface createDataExchangeAsync(CreateDataExchangeRequest $request, array $optionalArgs = [])
* @method PromiseInterface createListingAsync(CreateListingRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface createQueryTemplateAsync(CreateQueryTemplateRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteDataExchangeAsync(DeleteDataExchangeRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteListingAsync(DeleteListingRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface deleteQueryTemplateAsync(DeleteQueryTemplateRequest $request, array $optionalArgs = [])
* @method PromiseInterface deleteSubscriptionAsync(DeleteSubscriptionRequest $request, array $optionalArgs = [])
* @method PromiseInterface getDataExchangeAsync(GetDataExchangeRequest $request, array $optionalArgs = [])
* @method PromiseInterface getIamPolicyAsync(GetIamPolicyRequest $request, array $optionalArgs = [])
* @method PromiseInterface getListingAsync(GetListingRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface getQueryTemplateAsync(GetQueryTemplateRequest $request, array $optionalArgs = [])
* @method PromiseInterface getSubscriptionAsync(GetSubscriptionRequest $request, array $optionalArgs = [])
* @method PromiseInterface listDataExchangesAsync(ListDataExchangesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listListingsAsync(ListListingsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listOrgDataExchangesAsync(ListOrgDataExchangesRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface listQueryTemplatesAsync(ListQueryTemplatesRequest $request, array $optionalArgs = [])
* @method PromiseInterface listSharedResourceSubscriptionsAsync(ListSharedResourceSubscriptionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface listSubscriptionsAsync(ListSubscriptionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface refreshSubscriptionAsync(RefreshSubscriptionRequest $request, array $optionalArgs = [])
* @method PromiseInterface revokeSubscriptionAsync(RevokeSubscriptionRequest $request, array $optionalArgs = [])
* @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface submitQueryTemplateAsync(SubmitQueryTemplateRequest $request, array $optionalArgs = [])
* @method PromiseInterface subscribeDataExchangeAsync(SubscribeDataExchangeRequest $request, array $optionalArgs = [])
* @method PromiseInterface subscribeListingAsync(SubscribeListingRequest $request, array $optionalArgs = [])
* @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateDataExchangeAsync(UpdateDataExchangeRequest $request, array $optionalArgs = [])
* @method PromiseInterface updateListingAsync(UpdateListingRequest $request, array $optionalArgs = [])
+ * @method PromiseInterface updateQueryTemplateAsync(UpdateQueryTemplateRequest $request, array $optionalArgs = [])
*/
final class AnalyticsHubServiceClient
{
@@ -297,6 +312,31 @@ public static function managedServiceName(string $service): string
]);
}
+ /**
+ * Formats a string containing the fully-qualified path to represent a
+ * query_template resource.
+ *
+ * @param string $project
+ * @param string $location
+ * @param string $dataExchange
+ * @param string $queryTemplate
+ *
+ * @return string The formatted query_template resource.
+ */
+ public static function queryTemplateName(
+ string $project,
+ string $location,
+ string $dataExchange,
+ string $queryTemplate
+ ): string {
+ return self::getPathTemplate('queryTemplate')->render([
+ 'project' => $project,
+ 'location' => $location,
+ 'data_exchange' => $dataExchange,
+ 'query_template' => $queryTemplate,
+ ]);
+ }
+
/**
* Formats a string containing the fully-qualified path to represent a routine
* resource.
@@ -380,6 +420,7 @@ public static function topicName(string $project, string $topic): string
* - listing: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}
* - location: projects/{project}/locations/{location}
* - managedService: services/{service}
+ * - queryTemplate: projects/{project}/locations/{location}/dataExchanges/{data_exchange}/queryTemplates/{query_template}
* - routine: projects/{project}/datasets/{dataset}/routines/{routine}
* - subscription: projects/{project}/locations/{location}/subscriptions/{subscription}
* - table: projects/{project}/datasets/{dataset}/tables/{table}
@@ -484,6 +525,33 @@ public function __call($method, $args)
return call_user_func_array([$this, 'startAsyncCall'], $args);
}
+ /**
+ * Approves a query template.
+ *
+ * The async variant is
+ * {@see AnalyticsHubServiceClient::approveQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/approve_query_template.php
+ *
+ * @param ApproveQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return QueryTemplate
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function approveQueryTemplate(ApproveQueryTemplateRequest $request, array $callOptions = []): QueryTemplate
+ {
+ return $this->startApiCall('ApproveQueryTemplate', $request, $callOptions)->wait();
+ }
+
/**
* Creates a new data exchange.
*
@@ -537,6 +605,33 @@ public function createListing(CreateListingRequest $request, array $callOptions
return $this->startApiCall('CreateListing', $request, $callOptions)->wait();
}
+ /**
+ * Creates a new QueryTemplate
+ *
+ * The async variant is
+ * {@see AnalyticsHubServiceClient::createQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/create_query_template.php
+ *
+ * @param CreateQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return QueryTemplate
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function createQueryTemplate(CreateQueryTemplateRequest $request, array $callOptions = []): QueryTemplate
+ {
+ return $this->startApiCall('CreateQueryTemplate', $request, $callOptions)->wait();
+ }
+
/**
* Deletes an existing data exchange.
*
@@ -586,6 +681,31 @@ public function deleteListing(DeleteListingRequest $request, array $callOptions
$this->startApiCall('DeleteListing', $request, $callOptions)->wait();
}
+ /**
+ * Deletes a query template.
+ *
+ * The async variant is
+ * {@see AnalyticsHubServiceClient::deleteQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/delete_query_template.php
+ *
+ * @param DeleteQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function deleteQueryTemplate(DeleteQueryTemplateRequest $request, array $callOptions = []): void
+ {
+ $this->startApiCall('DeleteQueryTemplate', $request, $callOptions)->wait();
+ }
+
/**
* Deletes a subscription.
*
@@ -691,6 +811,32 @@ public function getListing(GetListingRequest $request, array $callOptions = []):
return $this->startApiCall('GetListing', $request, $callOptions)->wait();
}
+ /**
+ * Gets a QueryTemplate
+ *
+ * The async variant is {@see AnalyticsHubServiceClient::getQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/get_query_template.php
+ *
+ * @param GetQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return QueryTemplate
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function getQueryTemplate(GetQueryTemplateRequest $request, array $callOptions = []): QueryTemplate
+ {
+ return $this->startApiCall('GetQueryTemplate', $request, $callOptions)->wait();
+ }
+
/**
* Gets the details of a Subscription.
*
@@ -800,6 +946,33 @@ public function listOrgDataExchanges(
return $this->startApiCall('ListOrgDataExchanges', $request, $callOptions);
}
+ /**
+ * Lists all QueryTemplates in a given project and location.
+ *
+ * The async variant is {@see AnalyticsHubServiceClient::listQueryTemplatesAsync()}
+ * .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/list_query_templates.php
+ *
+ * @param ListQueryTemplatesRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return PagedListResponse
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function listQueryTemplates(ListQueryTemplatesRequest $request, array $callOptions = []): PagedListResponse
+ {
+ return $this->startApiCall('ListQueryTemplates', $request, $callOptions);
+ }
+
/**
* Lists all subscriptions on a given Data Exchange or Listing.
*
@@ -940,6 +1113,33 @@ public function setIamPolicy(SetIamPolicyRequest $request, array $callOptions =
return $this->startApiCall('SetIamPolicy', $request, $callOptions)->wait();
}
+ /**
+ * Submits a query template for approval.
+ *
+ * The async variant is
+ * {@see AnalyticsHubServiceClient::submitQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/submit_query_template.php
+ *
+ * @param SubmitQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return QueryTemplate
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function submitQueryTemplate(SubmitQueryTemplateRequest $request, array $callOptions = []): QueryTemplate
+ {
+ return $this->startApiCall('SubmitQueryTemplate', $request, $callOptions)->wait();
+ }
+
/**
* Creates a Subscription to a Data Clean Room. This is a
* long-running operation as it will create one or more linked datasets.
@@ -1086,4 +1286,31 @@ public function updateListing(UpdateListingRequest $request, array $callOptions
{
return $this->startApiCall('UpdateListing', $request, $callOptions)->wait();
}
+
+ /**
+ * Updates an existing QueryTemplate
+ *
+ * The async variant is
+ * {@see AnalyticsHubServiceClient::updateQueryTemplateAsync()} .
+ *
+ * @example samples/V1/AnalyticsHubServiceClient/update_query_template.php
+ *
+ * @param UpdateQueryTemplateRequest $request A request to house fields associated with the call.
+ * @param array $callOptions {
+ * Optional.
+ *
+ * @type RetrySettings|array $retrySettings
+ * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
+ * associative array of retry settings parameters. See the documentation on
+ * {@see RetrySettings} for example usage.
+ * }
+ *
+ * @return QueryTemplate
+ *
+ * @throws ApiException Thrown if the API call fails.
+ */
+ public function updateQueryTemplate(UpdateQueryTemplateRequest $request, array $callOptions = []): QueryTemplate
+ {
+ return $this->startApiCall('UpdateQueryTemplate', $request, $callOptions)->wait();
+ }
}
diff --git a/BigQueryAnalyticsHub/src/V1/CreateQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/CreateQueryTemplateRequest.php
new file mode 100644
index 000000000000..bd940624c3de
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/CreateQueryTemplateRequest.php
@@ -0,0 +1,183 @@
+google.cloud.bigquery.analyticshub.v1.CreateQueryTemplateRequest
+ */
+class CreateQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $parent = '';
+ /**
+ * Required. The ID of the QueryTemplate to create.
+ * Must contain only Unicode letters, numbers (0-9), underscores (_).
+ * Max length: 100 bytes.
+ *
+ * Generated from protobuf field string query_template_id = 2 [(.google.api.field_behavior) = REQUIRED];
+ */
+ protected $query_template_id = '';
+ /**
+ * Required. The QueryTemplate to create.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 3 [(.google.api.field_behavior) = REQUIRED];
+ */
+ protected $query_template = null;
+
+ /**
+ * @param string $parent Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`. Please see
+ * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
+ * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $queryTemplate Required. The QueryTemplate to create.
+ * @param string $queryTemplateId Required. The ID of the QueryTemplate to create.
+ * Must contain only Unicode letters, numbers (0-9), underscores (_).
+ * Max length: 100 bytes.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\CreateQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(string $parent, \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $queryTemplate, string $queryTemplateId): self
+ {
+ return (new self())
+ ->setParent($parent)
+ ->setQueryTemplate($queryTemplate)
+ ->setQueryTemplateId($queryTemplateId);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $parent
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
+ * @type string $query_template_id
+ * Required. The ID of the QueryTemplate to create.
+ * Must contain only Unicode letters, numbers (0-9), underscores (_).
+ * Max length: 100 bytes.
+ * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $query_template
+ * Required. The QueryTemplate to create.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myQueryTemplate`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setParent($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->parent = $var;
+
+ return $this;
+ }
+
+ /**
+ * Required. The ID of the QueryTemplate to create.
+ * Must contain only Unicode letters, numbers (0-9), underscores (_).
+ * Max length: 100 bytes.
+ *
+ * Generated from protobuf field string query_template_id = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @return string
+ */
+ public function getQueryTemplateId()
+ {
+ return $this->query_template_id;
+ }
+
+ /**
+ * Required. The ID of the QueryTemplate to create.
+ * Must contain only Unicode letters, numbers (0-9), underscores (_).
+ * Max length: 100 bytes.
+ *
+ * Generated from protobuf field string query_template_id = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @param string $var
+ * @return $this
+ */
+ public function setQueryTemplateId($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->query_template_id = $var;
+
+ return $this;
+ }
+
+ /**
+ * Required. The QueryTemplate to create.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 3 [(.google.api.field_behavior) = REQUIRED];
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate|null
+ */
+ public function getQueryTemplate()
+ {
+ return $this->query_template;
+ }
+
+ public function hasQueryTemplate()
+ {
+ return isset($this->query_template);
+ }
+
+ public function clearQueryTemplate()
+ {
+ unset($this->query_template);
+ }
+
+ /**
+ * Required. The QueryTemplate to create.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 3 [(.google.api.field_behavior) = REQUIRED];
+ * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $var
+ * @return $this
+ */
+ public function setQueryTemplate($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate::class);
+ $this->query_template = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/DeleteQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/DeleteQueryTemplateRequest.php
new file mode 100644
index 000000000000..e74088aea06c
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/DeleteQueryTemplateRequest.php
@@ -0,0 +1,91 @@
+google.cloud.bigquery.analyticshub.v1.DeleteQueryTemplateRequest
+ */
+class DeleteQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $name = '';
+
+ /**
+ * @param string $name Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
+ * {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(string $name): self
+ {
+ return (new self())
+ ->setName($name);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/DestinationDataset.php b/BigQueryAnalyticsHub/src/V1/DestinationDataset.php
index 05c16ab5c7e9..f42bcfff0f20 100644
--- a/BigQueryAnalyticsHub/src/V1/DestinationDataset.php
+++ b/BigQueryAnalyticsHub/src/V1/DestinationDataset.php
@@ -51,6 +51,14 @@ class DestinationDataset extends \Google\Protobuf\Internal\Message
* Generated from protobuf field string location = 5 [(.google.api.field_behavior) = REQUIRED];
*/
protected $location = '';
+ /**
+ * Optional. The geographic locations where the dataset should be replicated.
+ * See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations.
+ *
+ * Generated from protobuf field repeated string replica_locations = 6 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ private $replica_locations;
/**
* Constructor.
@@ -74,6 +82,10 @@ class DestinationDataset extends \Google\Protobuf\Internal\Message
* Required. The geographic location where the dataset should reside. See
* https://cloud.google.com/bigquery/docs/locations for supported
* locations.
+ * @type array|\Google\Protobuf\Internal\RepeatedField $replica_locations
+ * Optional. The geographic locations where the dataset should be replicated.
+ * See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations.
* }
*/
public function __construct($data = NULL) {
@@ -307,5 +319,35 @@ public function setLocation($var)
return $this;
}
+ /**
+ * Optional. The geographic locations where the dataset should be replicated.
+ * See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations.
+ *
+ * Generated from protobuf field repeated string replica_locations = 6 [(.google.api.field_behavior) = OPTIONAL];
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getReplicaLocations()
+ {
+ return $this->replica_locations;
+ }
+
+ /**
+ * Optional. The geographic locations where the dataset should be replicated.
+ * See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations.
+ *
+ * Generated from protobuf field repeated string replica_locations = 6 [(.google.api.field_behavior) = OPTIONAL];
+ * @param array|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setReplicaLocations($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+ $this->replica_locations = $arr;
+
+ return $this;
+ }
+
}
diff --git a/BigQueryAnalyticsHub/src/V1/GetQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/GetQueryTemplateRequest.php
new file mode 100644
index 000000000000..9471753a043e
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/GetQueryTemplateRequest.php
@@ -0,0 +1,91 @@
+google.cloud.bigquery.analyticshub.v1.GetQueryTemplateRequest
+ */
+class GetQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $name = '';
+
+ /**
+ * @param string $name Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
+ * {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\GetQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(string $name): self
+ {
+ return (new self())
+ ->setName($name);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesRequest.php b/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesRequest.php
new file mode 100644
index 000000000000..0313161041d0
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesRequest.php
@@ -0,0 +1,162 @@
+google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesRequest
+ */
+class ListQueryTemplatesRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The parent resource path of the QueryTemplates.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $parent = '';
+ /**
+ * Optional. The maximum number of results to return in a single response
+ * page. Leverage the page tokens to iterate through the entire collection.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $page_size = 0;
+ /**
+ * Optional. Page token, returned by a previous call, to request the next page
+ * of results.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $page_token = '';
+
+ /**
+ * @param string $parent Required. The parent resource path of the QueryTemplates.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123`. Please see
+ * {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesRequest
+ *
+ * @experimental
+ */
+ public static function build(string $parent): self
+ {
+ return (new self())
+ ->setParent($parent);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $parent
+ * Required. The parent resource path of the QueryTemplates.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123`.
+ * @type int $page_size
+ * Optional. The maximum number of results to return in a single response
+ * page. Leverage the page tokens to iterate through the entire collection.
+ * @type string $page_token
+ * Optional. Page token, returned by a previous call, to request the next page
+ * of results.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplates.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Required. The parent resource path of the QueryTemplates.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123`.
+ *
+ * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setParent($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->parent = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. The maximum number of results to return in a single response
+ * page. Leverage the page tokens to iterate through the entire collection.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @return int
+ */
+ public function getPageSize()
+ {
+ return $this->page_size;
+ }
+
+ /**
+ * Optional. The maximum number of results to return in a single response
+ * page. Leverage the page tokens to iterate through the entire collection.
+ *
+ * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @param int $var
+ * @return $this
+ */
+ public function setPageSize($var)
+ {
+ GPBUtil::checkInt32($var);
+ $this->page_size = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Page token, returned by a previous call, to request the next page
+ * of results.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getPageToken()
+ {
+ return $this->page_token;
+ }
+
+ /**
+ * Optional. Page token, returned by a previous call, to request the next page
+ * of results.
+ *
+ * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setPageToken($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->page_token = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesResponse.php b/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesResponse.php
new file mode 100644
index 000000000000..b519fa601322
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/ListQueryTemplatesResponse.php
@@ -0,0 +1,101 @@
+google.cloud.bigquery.analyticshub.v1.ListQueryTemplatesResponse
+ */
+class ListQueryTemplatesResponse extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * The list of QueryTemplates.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_templates = 1;
+ */
+ private $query_templates;
+ /**
+ * A token to request the next page of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ */
+ protected $next_page_token = '';
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate>|\Google\Protobuf\Internal\RepeatedField $query_templates
+ * The list of QueryTemplates.
+ * @type string $next_page_token
+ * A token to request the next page of results.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * The list of QueryTemplates.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_templates = 1;
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getQueryTemplates()
+ {
+ return $this->query_templates;
+ }
+
+ /**
+ * The list of QueryTemplates.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_templates = 1;
+ * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate>|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setQueryTemplates($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate::class);
+ $this->query_templates = $arr;
+
+ return $this;
+ }
+
+ /**
+ * A token to request the next page of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ * @return string
+ */
+ public function getNextPageToken()
+ {
+ return $this->next_page_token;
+ }
+
+ /**
+ * A token to request the next page of results.
+ *
+ * Generated from protobuf field string next_page_token = 2;
+ * @param string $var
+ * @return $this
+ */
+ public function setNextPageToken($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->next_page_token = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/Listing.php b/BigQueryAnalyticsHub/src/V1/Listing.php
index d553072f5585..e83f6d2112b0 100644
--- a/BigQueryAnalyticsHub/src/V1/Listing.php
+++ b/BigQueryAnalyticsHub/src/V1/Listing.php
@@ -79,7 +79,7 @@ class Listing extends \Google\Protobuf\Internal\Message
*/
protected $data_provider = null;
/**
- * Optional. Categories of the listing. Up to two categories are allowed.
+ * Optional. Categories of the listing. Up to five categories are allowed.
*
* Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL];
*/
@@ -180,7 +180,7 @@ class Listing extends \Google\Protobuf\Internal\Message
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\DataProvider $data_provider
* Optional. Details of the data provider who owns the source data.
* @type array|\Google\Protobuf\Internal\RepeatedField $categories
- * Optional. Categories of the listing. Up to two categories are allowed.
+ * Optional. Categories of the listing. Up to five categories are allowed.
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Publisher $publisher
* Optional. Details of the publisher who owns the listing and who can share
* the source data.
@@ -516,7 +516,7 @@ public function setDataProvider($var)
}
/**
- * Optional. Categories of the listing. Up to two categories are allowed.
+ * Optional. Categories of the listing. Up to five categories are allowed.
*
* Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL];
* @return \Google\Protobuf\Internal\RepeatedField
@@ -527,7 +527,7 @@ public function getCategories()
}
/**
- * Optional. Categories of the listing. Up to two categories are allowed.
+ * Optional. Categories of the listing. Up to five categories are allowed.
*
* Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.Category categories = 10 [(.google.api.field_behavior) = OPTIONAL];
* @param array|\Google\Protobuf\Internal\RepeatedField $var
diff --git a/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource.php b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource.php
index 0fdcbd6d120c..6ffd53613760 100644
--- a/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource.php
+++ b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource.php
@@ -42,6 +42,22 @@ class BigQueryDatasetSource extends \Google\Protobuf\Internal\Message
* Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.RestrictedExportPolicy restricted_export_policy = 3 [(.google.api.field_behavior) = OPTIONAL];
*/
protected $restricted_export_policy = null;
+ /**
+ * Optional. A list of regions where the publisher has created shared
+ * dataset replicas.
+ *
+ * Generated from protobuf field repeated string replica_locations = 5 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ private $replica_locations;
+ /**
+ * Output only. Server-owned effective state of replicas.
+ * Contains both primary and secondary replicas.
+ * Each replica includes a system-computed (output-only) state and primary
+ * designation.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica effective_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ private $effective_replicas;
/**
* Constructor.
@@ -58,6 +74,14 @@ class BigQueryDatasetSource extends \Google\Protobuf\Internal\Message
* @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\RestrictedExportPolicy $restricted_export_policy
* Optional. If set, restricted export policy will be propagated and
* enforced on the linked dataset.
+ * @type array|\Google\Protobuf\Internal\RepeatedField $replica_locations
+ * Optional. A list of regions where the publisher has created shared
+ * dataset replicas.
+ * @type array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica>|\Google\Protobuf\Internal\RepeatedField $effective_replicas
+ * Output only. Server-owned effective state of replicas.
+ * Contains both primary and secondary replicas.
+ * Each replica includes a system-computed (output-only) state and primary
+ * designation.
* }
*/
public function __construct($data = NULL) {
@@ -159,6 +183,66 @@ public function setRestrictedExportPolicy($var)
return $this;
}
+ /**
+ * Optional. A list of regions where the publisher has created shared
+ * dataset replicas.
+ *
+ * Generated from protobuf field repeated string replica_locations = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getReplicaLocations()
+ {
+ return $this->replica_locations;
+ }
+
+ /**
+ * Optional. A list of regions where the publisher has created shared
+ * dataset replicas.
+ *
+ * Generated from protobuf field repeated string replica_locations = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @param array|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setReplicaLocations($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
+ $this->replica_locations = $arr;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Server-owned effective state of replicas.
+ * Contains both primary and secondary replicas.
+ * Each replica includes a system-computed (output-only) state and primary
+ * designation.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica effective_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Internal\RepeatedField
+ */
+ public function getEffectiveReplicas()
+ {
+ return $this->effective_replicas;
+ }
+
+ /**
+ * Output only. Server-owned effective state of replicas.
+ * Contains both primary and secondary replicas.
+ * Each replica includes a system-computed (output-only) state and primary
+ * designation.
+ *
+ * Generated from protobuf field repeated .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica effective_replicas = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param array<\Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica>|\Google\Protobuf\Internal\RepeatedField $var
+ * @return $this
+ */
+ public function setEffectiveReplicas($var)
+ {
+ $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica::class);
+ $this->effective_replicas = $arr;
+
+ return $this;
+ }
+
}
diff --git a/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica.php b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica.php
new file mode 100644
index 000000000000..26111735691b
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica.php
@@ -0,0 +1,161 @@
+google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica
+ */
+class Replica extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Output only. The geographic location where the replica resides. See
+ * [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations. Eg. "us-central1".
+ *
+ * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $location = '';
+ /**
+ * Output only. Assigned by Analytics Hub based on real BigQuery
+ * replication state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState replica_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $replica_state = 0;
+ /**
+ * Output only. Indicates that this replica is the primary replica.
+ *
+ * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $primary_state = null;
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $location
+ * Output only. The geographic location where the replica resides. See
+ * [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations. Eg. "us-central1".
+ * @type int $replica_state
+ * Output only. Assigned by Analytics Hub based on real BigQuery
+ * replication state.
+ * @type int $primary_state
+ * Output only. Indicates that this replica is the primary replica.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Output only. The geographic location where the replica resides. See
+ * [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations. Eg. "us-central1".
+ *
+ * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getLocation()
+ {
+ return $this->location;
+ }
+
+ /**
+ * Output only. The geographic location where the replica resides. See
+ * [BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
+ * for supported locations. Eg. "us-central1".
+ *
+ * Generated from protobuf field string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setLocation($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->location = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Assigned by Analytics Hub based on real BigQuery
+ * replication state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState replica_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return int
+ */
+ public function getReplicaState()
+ {
+ return $this->replica_state;
+ }
+
+ /**
+ * Output only. Assigned by Analytics Hub based on real BigQuery
+ * replication state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState replica_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param int $var
+ * @return $this
+ */
+ public function setReplicaState($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica\ReplicaState::class);
+ $this->replica_state = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Indicates that this replica is the primary replica.
+ *
+ * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return int
+ */
+ public function getPrimaryState()
+ {
+ return isset($this->primary_state) ? $this->primary_state : 0;
+ }
+
+ public function hasPrimaryState()
+ {
+ return isset($this->primary_state);
+ }
+
+ public function clearPrimaryState()
+ {
+ unset($this->primary_state);
+ }
+
+ /**
+ * Output only. Indicates that this replica is the primary replica.
+ *
+ * Generated from protobuf field optional .google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState primary_state = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param int $var
+ * @return $this
+ */
+ public function setPrimaryState($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica\PrimaryState::class);
+ $this->primary_state = $var;
+
+ return $this;
+ }
+
+}
+
+
diff --git a/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/PrimaryState.php b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/PrimaryState.php
new file mode 100644
index 000000000000..7beaead4a16d
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/PrimaryState.php
@@ -0,0 +1,55 @@
+google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.PrimaryState
+ */
+class PrimaryState
+{
+ /**
+ * Default value. This value is unused.
+ *
+ * Generated from protobuf enum PRIMARY_STATE_UNSPECIFIED = 0;
+ */
+ const PRIMARY_STATE_UNSPECIFIED = 0;
+ /**
+ * The replica is the primary replica.
+ *
+ * Generated from protobuf enum PRIMARY_REPLICA = 1;
+ */
+ const PRIMARY_REPLICA = 1;
+
+ private static $valueToName = [
+ self::PRIMARY_STATE_UNSPECIFIED => 'PRIMARY_STATE_UNSPECIFIED',
+ self::PRIMARY_REPLICA => 'PRIMARY_REPLICA',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
+
diff --git a/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/ReplicaState.php b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/ReplicaState.php
new file mode 100644
index 000000000000..a40980cfe714
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/Listing/BigQueryDatasetSource/Replica/ReplicaState.php
@@ -0,0 +1,63 @@
+google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState
+ */
+class ReplicaState
+{
+ /**
+ * Default value. This value is unused.
+ *
+ * Generated from protobuf enum REPLICA_STATE_UNSPECIFIED = 0;
+ */
+ const REPLICA_STATE_UNSPECIFIED = 0;
+ /**
+ * The replica is backfilled and ready to use.
+ *
+ * Generated from protobuf enum READY_TO_USE = 1;
+ */
+ const READY_TO_USE = 1;
+ /**
+ * The replica is unavailable, does not exist, or has not been
+ * backfilled yet.
+ *
+ * Generated from protobuf enum UNAVAILABLE = 2;
+ */
+ const UNAVAILABLE = 2;
+
+ private static $valueToName = [
+ self::REPLICA_STATE_UNSPECIFIED => 'REPLICA_STATE_UNSPECIFIED',
+ self::READY_TO_USE => 'READY_TO_USE',
+ self::UNAVAILABLE => 'UNAVAILABLE',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
+
diff --git a/BigQueryAnalyticsHub/src/V1/Listing/Category.php b/BigQueryAnalyticsHub/src/V1/Listing/Category.php
index 0df8b986c75a..9610201e05cd 100644
--- a/BigQueryAnalyticsHub/src/V1/Listing/Category.php
+++ b/BigQueryAnalyticsHub/src/V1/Listing/Category.php
@@ -93,6 +93,10 @@ class Category
* Generated from protobuf enum CATEGORY_TRAVEL_AND_TOURISM = 19;
*/
const CATEGORY_TRAVEL_AND_TOURISM = 19;
+ /**
+ * Generated from protobuf enum CATEGORY_GOOGLE_EARTH_ENGINE = 20;
+ */
+ const CATEGORY_GOOGLE_EARTH_ENGINE = 20;
private static $valueToName = [
self::CATEGORY_UNSPECIFIED => 'CATEGORY_UNSPECIFIED',
@@ -115,6 +119,7 @@ class Category
self::CATEGORY_SCIENCE_AND_RESEARCH => 'CATEGORY_SCIENCE_AND_RESEARCH',
self::CATEGORY_TRANSPORTATION_AND_LOGISTICS => 'CATEGORY_TRANSPORTATION_AND_LOGISTICS',
self::CATEGORY_TRAVEL_AND_TOURISM => 'CATEGORY_TRAVEL_AND_TOURISM',
+ self::CATEGORY_GOOGLE_EARTH_ENGINE => 'CATEGORY_GOOGLE_EARTH_ENGINE',
];
public static function name($value)
diff --git a/BigQueryAnalyticsHub/src/V1/QueryTemplate.php b/BigQueryAnalyticsHub/src/V1/QueryTemplate.php
new file mode 100644
index 000000000000..854d75721b92
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/QueryTemplate.php
@@ -0,0 +1,444 @@
+google.cloud.bigquery.analyticshub.v1.QueryTemplate
+ */
+class QueryTemplate extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Output only. The resource name of the QueryTemplate.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $name = '';
+ /**
+ * Required. Human-readable display name of the QueryTemplate. The display
+ * name must contain only Unicode letters, numbers (0-9), underscores (_),
+ * dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
+ * Default value is an empty string. Max length: 63 bytes.
+ *
+ * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
+ */
+ protected $display_name = '';
+ /**
+ * Optional. Short description of the QueryTemplate. The description must not
+ * contain Unicode non-characters and C0 and C1 control codes except tabs
+ * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
+ * value is an empty string. Max length: 2000 bytes.
+ *
+ * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $description = '';
+ /**
+ * Optional. Will be deprecated.
+ * Email or URL of the primary point of contact of the QueryTemplate.
+ * Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string proposer = 4 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $proposer = '';
+ /**
+ * Optional. Email or URL of the primary point of contact of the
+ * QueryTemplate. Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string primary_contact = 10 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $primary_contact = '';
+ /**
+ * Optional. Documentation describing the QueryTemplate.
+ *
+ * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $documentation = '';
+ /**
+ * Output only. The QueryTemplate lifecycle state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $state = 0;
+ /**
+ * Optional. The routine associated with the QueryTemplate.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine routine = 7 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $routine = null;
+ /**
+ * Output only. Timestamp when the QueryTemplate was created.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $create_time = null;
+ /**
+ * Output only. Timestamp when the QueryTemplate was last modified.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ */
+ protected $update_time = null;
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Output only. The resource name of the QueryTemplate.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
+ * @type string $display_name
+ * Required. Human-readable display name of the QueryTemplate. The display
+ * name must contain only Unicode letters, numbers (0-9), underscores (_),
+ * dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
+ * Default value is an empty string. Max length: 63 bytes.
+ * @type string $description
+ * Optional. Short description of the QueryTemplate. The description must not
+ * contain Unicode non-characters and C0 and C1 control codes except tabs
+ * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
+ * value is an empty string. Max length: 2000 bytes.
+ * @type string $proposer
+ * Optional. Will be deprecated.
+ * Email or URL of the primary point of contact of the QueryTemplate.
+ * Max Length: 1000 bytes.
+ * @type string $primary_contact
+ * Optional. Email or URL of the primary point of contact of the
+ * QueryTemplate. Max Length: 1000 bytes.
+ * @type string $documentation
+ * Optional. Documentation describing the QueryTemplate.
+ * @type int $state
+ * Output only. The QueryTemplate lifecycle state.
+ * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\Routine $routine
+ * Optional. The routine associated with the QueryTemplate.
+ * @type \Google\Protobuf\Timestamp $create_time
+ * Output only. Timestamp when the QueryTemplate was created.
+ * @type \Google\Protobuf\Timestamp $update_time
+ * Output only. Timestamp when the QueryTemplate was last modified.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Output only. The resource name of the QueryTemplate.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Output only. The resource name of the QueryTemplate.
+ * e.g. `projects/myproject/locations/us/dataExchanges/123/queryTemplates/456`
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+ /**
+ * Required. Human-readable display name of the QueryTemplate. The display
+ * name must contain only Unicode letters, numbers (0-9), underscores (_),
+ * dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
+ * Default value is an empty string. Max length: 63 bytes.
+ *
+ * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @return string
+ */
+ public function getDisplayName()
+ {
+ return $this->display_name;
+ }
+
+ /**
+ * Required. Human-readable display name of the QueryTemplate. The display
+ * name must contain only Unicode letters, numbers (0-9), underscores (_),
+ * dashes (-), spaces ( ), ampersands (&) and can't start or end with spaces.
+ * Default value is an empty string. Max length: 63 bytes.
+ *
+ * Generated from protobuf field string display_name = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @param string $var
+ * @return $this
+ */
+ public function setDisplayName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->display_name = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Short description of the QueryTemplate. The description must not
+ * contain Unicode non-characters and C0 and C1 control codes except tabs
+ * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
+ * value is an empty string. Max length: 2000 bytes.
+ *
+ * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
+ /**
+ * Optional. Short description of the QueryTemplate. The description must not
+ * contain Unicode non-characters and C0 and C1 control codes except tabs
+ * (HT), new lines (LF), carriage returns (CR), and page breaks (FF). Default
+ * value is an empty string. Max length: 2000 bytes.
+ *
+ * Generated from protobuf field string description = 3 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setDescription($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->description = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Will be deprecated.
+ * Email or URL of the primary point of contact of the QueryTemplate.
+ * Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string proposer = 4 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getProposer()
+ {
+ return $this->proposer;
+ }
+
+ /**
+ * Optional. Will be deprecated.
+ * Email or URL of the primary point of contact of the QueryTemplate.
+ * Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string proposer = 4 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setProposer($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->proposer = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Email or URL of the primary point of contact of the
+ * QueryTemplate. Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string primary_contact = 10 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getPrimaryContact()
+ {
+ return $this->primary_contact;
+ }
+
+ /**
+ * Optional. Email or URL of the primary point of contact of the
+ * QueryTemplate. Max Length: 1000 bytes.
+ *
+ * Generated from protobuf field string primary_contact = 10 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setPrimaryContact($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->primary_contact = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. Documentation describing the QueryTemplate.
+ *
+ * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getDocumentation()
+ {
+ return $this->documentation;
+ }
+
+ /**
+ * Optional. Documentation describing the QueryTemplate.
+ *
+ * Generated from protobuf field string documentation = 5 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setDocumentation($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->documentation = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. The QueryTemplate lifecycle state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return int
+ */
+ public function getState()
+ {
+ return $this->state;
+ }
+
+ /**
+ * Output only. The QueryTemplate lifecycle state.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param int $var
+ * @return $this
+ */
+ public function setState($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate\State::class);
+ $this->state = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. The routine associated with the QueryTemplate.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine routine = 7 [(.google.api.field_behavior) = OPTIONAL];
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\Routine|null
+ */
+ public function getRoutine()
+ {
+ return $this->routine;
+ }
+
+ public function hasRoutine()
+ {
+ return isset($this->routine);
+ }
+
+ public function clearRoutine()
+ {
+ unset($this->routine);
+ }
+
+ /**
+ * Optional. The routine associated with the QueryTemplate.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine routine = 7 [(.google.api.field_behavior) = OPTIONAL];
+ * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\Routine $var
+ * @return $this
+ */
+ public function setRoutine($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Routine::class);
+ $this->routine = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Timestamp when the QueryTemplate was created.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Timestamp|null
+ */
+ public function getCreateTime()
+ {
+ return $this->create_time;
+ }
+
+ public function hasCreateTime()
+ {
+ return isset($this->create_time);
+ }
+
+ public function clearCreateTime()
+ {
+ unset($this->create_time);
+ }
+
+ /**
+ * Output only. Timestamp when the QueryTemplate was created.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param \Google\Protobuf\Timestamp $var
+ * @return $this
+ */
+ public function setCreateTime($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
+ $this->create_time = $var;
+
+ return $this;
+ }
+
+ /**
+ * Output only. Timestamp when the QueryTemplate was last modified.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @return \Google\Protobuf\Timestamp|null
+ */
+ public function getUpdateTime()
+ {
+ return $this->update_time;
+ }
+
+ public function hasUpdateTime()
+ {
+ return isset($this->update_time);
+ }
+
+ public function clearUpdateTime()
+ {
+ unset($this->update_time);
+ }
+
+ /**
+ * Output only. Timestamp when the QueryTemplate was last modified.
+ *
+ * Generated from protobuf field .google.protobuf.Timestamp update_time = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
+ * @param \Google\Protobuf\Timestamp $var
+ * @return $this
+ */
+ public function setUpdateTime($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
+ $this->update_time = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/QueryTemplate/State.php b/BigQueryAnalyticsHub/src/V1/QueryTemplate/State.php
new file mode 100644
index 000000000000..0881df9d621f
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/QueryTemplate/State.php
@@ -0,0 +1,76 @@
+google.cloud.bigquery.analyticshub.v1.QueryTemplate.State
+ */
+class State
+{
+ /**
+ * Default value. This value is unused.
+ *
+ * Generated from protobuf enum STATE_UNSPECIFIED = 0;
+ */
+ const STATE_UNSPECIFIED = 0;
+ /**
+ * The QueryTemplate is in draft state.
+ *
+ * Generated from protobuf enum DRAFTED = 1;
+ */
+ const DRAFTED = 1;
+ /**
+ * The QueryTemplate is in pending state.
+ *
+ * Generated from protobuf enum PENDING = 2;
+ */
+ const PENDING = 2;
+ /**
+ * The QueryTemplate is in deleted state.
+ *
+ * Generated from protobuf enum DELETED = 3;
+ */
+ const DELETED = 3;
+ /**
+ * The QueryTemplate is in approved state.
+ *
+ * Generated from protobuf enum APPROVED = 4;
+ */
+ const APPROVED = 4;
+
+ private static $valueToName = [
+ self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
+ self::DRAFTED => 'DRAFTED',
+ self::PENDING => 'PENDING',
+ self::DELETED => 'DELETED',
+ self::APPROVED => 'APPROVED',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
+
diff --git a/BigQueryAnalyticsHub/src/V1/Routine.php b/BigQueryAnalyticsHub/src/V1/Routine.php
new file mode 100644
index 000000000000..9be944b296b0
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/Routine.php
@@ -0,0 +1,101 @@
+google.cloud.bigquery.analyticshub.v1.Routine
+ */
+class Routine extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The type of routine.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine.RoutineType routine_type = 1 [(.google.api.field_behavior) = REQUIRED];
+ */
+ protected $routine_type = 0;
+ /**
+ * Optional. The definition body of the routine.
+ *
+ * Generated from protobuf field string definition_body = 2 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $definition_body = '';
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type int $routine_type
+ * Required. The type of routine.
+ * @type string $definition_body
+ * Optional. The definition body of the routine.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The type of routine.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine.RoutineType routine_type = 1 [(.google.api.field_behavior) = REQUIRED];
+ * @return int
+ */
+ public function getRoutineType()
+ {
+ return $this->routine_type;
+ }
+
+ /**
+ * Required. The type of routine.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.Routine.RoutineType routine_type = 1 [(.google.api.field_behavior) = REQUIRED];
+ * @param int $var
+ * @return $this
+ */
+ public function setRoutineType($var)
+ {
+ GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\Routine\RoutineType::class);
+ $this->routine_type = $var;
+
+ return $this;
+ }
+
+ /**
+ * Optional. The definition body of the routine.
+ *
+ * Generated from protobuf field string definition_body = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @return string
+ */
+ public function getDefinitionBody()
+ {
+ return $this->definition_body;
+ }
+
+ /**
+ * Optional. The definition body of the routine.
+ *
+ * Generated from protobuf field string definition_body = 2 [(.google.api.field_behavior) = OPTIONAL];
+ * @param string $var
+ * @return $this
+ */
+ public function setDefinitionBody($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->definition_body = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/Routine/RoutineType.php b/BigQueryAnalyticsHub/src/V1/Routine/RoutineType.php
new file mode 100644
index 000000000000..b85c4494b161
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/Routine/RoutineType.php
@@ -0,0 +1,55 @@
+google.cloud.bigquery.analyticshub.v1.Routine.RoutineType
+ */
+class RoutineType
+{
+ /**
+ * Default value.
+ *
+ * Generated from protobuf enum ROUTINE_TYPE_UNSPECIFIED = 0;
+ */
+ const ROUTINE_TYPE_UNSPECIFIED = 0;
+ /**
+ * Non-built-in persistent TVF.
+ *
+ * Generated from protobuf enum TABLE_VALUED_FUNCTION = 1;
+ */
+ const TABLE_VALUED_FUNCTION = 1;
+
+ private static $valueToName = [
+ self::ROUTINE_TYPE_UNSPECIFIED => 'ROUTINE_TYPE_UNSPECIFIED',
+ self::TABLE_VALUED_FUNCTION => 'TABLE_VALUED_FUNCTION',
+ ];
+
+ public static function name($value)
+ {
+ if (!isset(self::$valueToName[$value])) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no name defined for value %s', __CLASS__, $value));
+ }
+ return self::$valueToName[$value];
+ }
+
+
+ public static function value($name)
+ {
+ $const = __CLASS__ . '::' . strtoupper($name);
+ if (!defined($const)) {
+ throw new UnexpectedValueException(sprintf(
+ 'Enum %s has no value defined for name %s', __CLASS__, $name));
+ }
+ return constant($const);
+ }
+}
+
+
diff --git a/BigQueryAnalyticsHub/src/V1/SubmitQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/SubmitQueryTemplateRequest.php
new file mode 100644
index 000000000000..cf78f5e39ac8
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/SubmitQueryTemplateRequest.php
@@ -0,0 +1,91 @@
+google.cloud.bigquery.analyticshub.v1.SubmitQueryTemplateRequest
+ */
+class SubmitQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ */
+ protected $name = '';
+
+ /**
+ * @param string $name Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`. Please see
+ * {@see AnalyticsHubServiceClient::queryTemplateName()} for help formatting this field.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\SubmitQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(string $name): self
+ {
+ return (new self())
+ ->setName($name);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type string $name
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Required. The resource path of the QueryTemplate.
+ * e.g.
+ * `projects/myproject/locations/us/dataExchanges/123/queryTemplates/myqueryTemplate`.
+ *
+ * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {
+ * @param string $var
+ * @return $this
+ */
+ public function setName($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->name = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/UpdateQueryTemplateRequest.php b/BigQueryAnalyticsHub/src/V1/UpdateQueryTemplateRequest.php
new file mode 100644
index 000000000000..4288cad1726c
--- /dev/null
+++ b/BigQueryAnalyticsHub/src/V1/UpdateQueryTemplateRequest.php
@@ -0,0 +1,146 @@
+google.cloud.bigquery.analyticshub.v1.UpdateQueryTemplateRequest
+ */
+class UpdateQueryTemplateRequest extends \Google\Protobuf\Internal\Message
+{
+ /**
+ * Optional. Field mask specifies the fields to update in the query template
+ * resource. The fields specified in the `updateMask` are relative to the
+ * resource and are not a full request.
+ *
+ * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
+ */
+ protected $update_mask = null;
+ /**
+ * Required. The QueryTemplate to update.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 2 [(.google.api.field_behavior) = REQUIRED];
+ */
+ protected $query_template = null;
+
+ /**
+ * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $queryTemplate Required. The QueryTemplate to update.
+ * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask specifies the fields to update in the query template
+ * resource. The fields specified in the `updateMask` are relative to the
+ * resource and are not a full request.
+ *
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateQueryTemplateRequest
+ *
+ * @experimental
+ */
+ public static function build(\Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $queryTemplate, \Google\Protobuf\FieldMask $updateMask): self
+ {
+ return (new self())
+ ->setQueryTemplate($queryTemplate)
+ ->setUpdateMask($updateMask);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param array $data {
+ * Optional. Data for populating the Message object.
+ *
+ * @type \Google\Protobuf\FieldMask $update_mask
+ * Optional. Field mask specifies the fields to update in the query template
+ * resource. The fields specified in the `updateMask` are relative to the
+ * resource and are not a full request.
+ * @type \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $query_template
+ * Required. The QueryTemplate to update.
+ * }
+ */
+ public function __construct($data = NULL) {
+ \GPBMetadata\Google\Cloud\Bigquery\Analyticshub\V1\Analyticshub::initOnce();
+ parent::__construct($data);
+ }
+
+ /**
+ * Optional. Field mask specifies the fields to update in the query template
+ * resource. The fields specified in the `updateMask` are relative to the
+ * resource and are not a full request.
+ *
+ * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
+ * @return \Google\Protobuf\FieldMask|null
+ */
+ public function getUpdateMask()
+ {
+ return $this->update_mask;
+ }
+
+ public function hasUpdateMask()
+ {
+ return isset($this->update_mask);
+ }
+
+ public function clearUpdateMask()
+ {
+ unset($this->update_mask);
+ }
+
+ /**
+ * Optional. Field mask specifies the fields to update in the query template
+ * resource. The fields specified in the `updateMask` are relative to the
+ * resource and are not a full request.
+ *
+ * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL];
+ * @param \Google\Protobuf\FieldMask $var
+ * @return $this
+ */
+ public function setUpdateMask($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
+ $this->update_mask = $var;
+
+ return $this;
+ }
+
+ /**
+ * Required. The QueryTemplate to update.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @return \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate|null
+ */
+ public function getQueryTemplate()
+ {
+ return $this->query_template;
+ }
+
+ public function hasQueryTemplate()
+ {
+ return isset($this->query_template);
+ }
+
+ public function clearQueryTemplate()
+ {
+ unset($this->query_template);
+ }
+
+ /**
+ * Required. The QueryTemplate to update.
+ *
+ * Generated from protobuf field .google.cloud.bigquery.analyticshub.v1.QueryTemplate query_template = 2 [(.google.api.field_behavior) = REQUIRED];
+ * @param \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate $var
+ * @return $this
+ */
+ public function setQueryTemplate($var)
+ {
+ GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate::class);
+ $this->query_template = $var;
+
+ return $this;
+ }
+
+}
+
diff --git a/BigQueryAnalyticsHub/src/V1/gapic_metadata.json b/BigQueryAnalyticsHub/src/V1/gapic_metadata.json
index 29a21346b492..bd6b560e87e9 100644
--- a/BigQueryAnalyticsHub/src/V1/gapic_metadata.json
+++ b/BigQueryAnalyticsHub/src/V1/gapic_metadata.json
@@ -10,6 +10,11 @@
"grpc": {
"libraryClient": "AnalyticsHubServiceGapicClient",
"rpcs": {
+ "ApproveQueryTemplate": {
+ "methods": [
+ "approveQueryTemplate"
+ ]
+ },
"CreateDataExchange": {
"methods": [
"createDataExchange"
@@ -20,6 +25,11 @@
"createListing"
]
},
+ "CreateQueryTemplate": {
+ "methods": [
+ "createQueryTemplate"
+ ]
+ },
"DeleteDataExchange": {
"methods": [
"deleteDataExchange"
@@ -30,6 +40,11 @@
"deleteListing"
]
},
+ "DeleteQueryTemplate": {
+ "methods": [
+ "deleteQueryTemplate"
+ ]
+ },
"DeleteSubscription": {
"methods": [
"deleteSubscription"
@@ -50,6 +65,11 @@
"getListing"
]
},
+ "GetQueryTemplate": {
+ "methods": [
+ "getQueryTemplate"
+ ]
+ },
"GetSubscription": {
"methods": [
"getSubscription"
@@ -70,6 +90,11 @@
"listOrgDataExchanges"
]
},
+ "ListQueryTemplates": {
+ "methods": [
+ "listQueryTemplates"
+ ]
+ },
"ListSharedResourceSubscriptions": {
"methods": [
"listSharedResourceSubscriptions"
@@ -95,6 +120,11 @@
"setIamPolicy"
]
},
+ "SubmitQueryTemplate": {
+ "methods": [
+ "submitQueryTemplate"
+ ]
+ },
"SubscribeDataExchange": {
"methods": [
"subscribeDataExchange"
@@ -119,6 +149,11 @@
"methods": [
"updateListing"
]
+ },
+ "UpdateQueryTemplate": {
+ "methods": [
+ "updateQueryTemplate"
+ ]
}
}
}
diff --git a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_client_config.json b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_client_config.json
index 8847f98d2f28..7c4087de4f5b 100644
--- a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_client_config.json
+++ b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_client_config.json
@@ -29,6 +29,11 @@
}
},
"methods": {
+ "ApproveQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"CreateDataExchange": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -39,6 +44,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
+ "CreateQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"DeleteDataExchange": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -49,6 +59,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
+ "DeleteQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"DeleteSubscription": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -69,6 +84,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
+ "GetQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"GetSubscription": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -89,6 +109,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
+ "ListQueryTemplates": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"ListSharedResourceSubscriptions": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -114,6 +139,11 @@
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
},
+ "SubmitQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
+ },
"SubscribeDataExchange": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
@@ -138,6 +168,11 @@
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
+ },
+ "UpdateQueryTemplate": {
+ "timeout_millis": 60000,
+ "retry_codes_name": "retry_policy_1_codes",
+ "retry_params_name": "retry_policy_1_params"
}
}
}
diff --git a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_descriptor_config.php b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_descriptor_config.php
index a81873afd5d5..8ed0d57a0378 100644
--- a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_descriptor_config.php
+++ b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_descriptor_config.php
@@ -80,6 +80,18 @@
],
],
],
+ 'ApproveQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate',
+ 'headerParams' => [
+ [
+ 'keyName' => 'name',
+ 'fieldAccessors' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'CreateDataExchange' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange',
@@ -104,6 +116,18 @@
],
],
],
+ 'CreateQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate',
+ 'headerParams' => [
+ [
+ 'keyName' => 'parent',
+ 'fieldAccessors' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ ],
'DeleteDataExchange' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Protobuf\GPBEmpty',
@@ -128,6 +152,18 @@
],
],
],
+ 'DeleteQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Protobuf\GPBEmpty',
+ 'headerParams' => [
+ [
+ 'keyName' => 'name',
+ 'fieldAccessors' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'GetDataExchange' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange',
@@ -164,6 +200,18 @@
],
],
],
+ 'GetQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate',
+ 'headerParams' => [
+ [
+ 'keyName' => 'name',
+ 'fieldAccessors' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'GetSubscription' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription',
@@ -236,6 +284,26 @@
],
],
],
+ 'ListQueryTemplates' => [
+ 'pageStreaming' => [
+ 'requestPageTokenGetMethod' => 'getPageToken',
+ 'requestPageTokenSetMethod' => 'setPageToken',
+ 'requestPageSizeGetMethod' => 'getPageSize',
+ 'requestPageSizeSetMethod' => 'setPageSize',
+ 'responsePageTokenGetMethod' => 'getNextPageToken',
+ 'resourcesGetMethod' => 'getQueryTemplates',
+ ],
+ 'callType' => \Google\ApiCore\Call::PAGINATED_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesResponse',
+ 'headerParams' => [
+ [
+ 'keyName' => 'parent',
+ 'fieldAccessors' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ ],
'ListSharedResourceSubscriptions' => [
'pageStreaming' => [
'requestPageTokenGetMethod' => 'getPageToken',
@@ -300,6 +368,18 @@
],
],
],
+ 'SubmitQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate',
+ 'headerParams' => [
+ [
+ 'keyName' => 'name',
+ 'fieldAccessors' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'SubscribeListing' => [
'callType' => \Google\ApiCore\Call::UNARY_CALL,
'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingResponse',
@@ -350,12 +430,26 @@
],
],
],
+ 'UpdateQueryTemplate' => [
+ 'callType' => \Google\ApiCore\Call::UNARY_CALL,
+ 'responseType' => 'Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate',
+ 'headerParams' => [
+ [
+ 'keyName' => 'query_template.name',
+ 'fieldAccessors' => [
+ 'getQueryTemplate',
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'templateMap' => [
'dataExchange' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}',
'dataset' => 'projects/{project}/datasets/{dataset}',
'listing' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}/listings/{listing}',
'location' => 'projects/{project}/locations/{location}',
'managedService' => 'services/{service}',
+ 'queryTemplate' => 'projects/{project}/locations/{location}/dataExchanges/{data_exchange}/queryTemplates/{query_template}',
'routine' => 'projects/{project}/datasets/{dataset}/routines/{routine}',
'subscription' => 'projects/{project}/locations/{location}/subscriptions/{subscription}',
'table' => 'projects/{project}/datasets/{dataset}/tables/{table}',
diff --git a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_rest_client_config.php b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_rest_client_config.php
index 8dba38a5eee3..d712e7fdf2c5 100644
--- a/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_rest_client_config.php
+++ b/BigQueryAnalyticsHub/src/V1/resources/analytics_hub_service_rest_client_config.php
@@ -23,6 +23,18 @@
return [
'interfaces' => [
'google.cloud.bigquery.analyticshub.v1.AnalyticsHubService' => [
+ 'ApproveQueryTemplate' => [
+ 'method' => 'post',
+ 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/queryTemplates/*}:approve',
+ 'body' => '*',
+ 'placeholders' => [
+ 'name' => [
+ 'getters' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'CreateDataExchange' => [
'method' => 'post',
'uriTemplate' => '/v1/{parent=projects/*/locations/*}/dataExchanges',
@@ -53,6 +65,21 @@
'listing_id',
],
],
+ 'CreateQueryTemplate' => [
+ 'method' => 'post',
+ 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataExchanges/*}/queryTemplates',
+ 'body' => 'query_template',
+ 'placeholders' => [
+ 'parent' => [
+ 'getters' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ 'queryParams' => [
+ 'query_template_id',
+ ],
+ ],
'DeleteDataExchange' => [
'method' => 'delete',
'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*}',
@@ -75,6 +102,17 @@
],
],
],
+ 'DeleteQueryTemplate' => [
+ 'method' => 'delete',
+ 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/queryTemplates/*}',
+ 'placeholders' => [
+ 'name' => [
+ 'getters' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'DeleteSubscription' => [
'method' => 'delete',
'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}',
@@ -132,6 +170,17 @@
],
],
],
+ 'GetQueryTemplate' => [
+ 'method' => 'get',
+ 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/queryTemplates/*}',
+ 'placeholders' => [
+ 'name' => [
+ 'getters' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'GetSubscription' => [
'method' => 'get',
'uriTemplate' => '/v1/{name=projects/*/locations/*/subscriptions/*}',
@@ -176,6 +225,17 @@
],
],
],
+ 'ListQueryTemplates' => [
+ 'method' => 'get',
+ 'uriTemplate' => '/v1/{parent=projects/*/locations/*/dataExchanges/*}/queryTemplates',
+ 'placeholders' => [
+ 'parent' => [
+ 'getters' => [
+ 'getParent',
+ ],
+ ],
+ ],
+ ],
'ListSharedResourceSubscriptions' => [
'method' => 'get',
'uriTemplate' => '/v1/{resource=projects/*/locations/*/dataExchanges/*}:listSubscriptions',
@@ -252,6 +312,18 @@
],
],
],
+ 'SubmitQueryTemplate' => [
+ 'method' => 'post',
+ 'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*/queryTemplates/*}:submit',
+ 'body' => '*',
+ 'placeholders' => [
+ 'name' => [
+ 'getters' => [
+ 'getName',
+ ],
+ ],
+ ],
+ ],
'SubscribeDataExchange' => [
'method' => 'post',
'uriTemplate' => '/v1/{name=projects/*/locations/*/dataExchanges/*}:subscribe',
@@ -327,6 +399,19 @@
'update_mask',
],
],
+ 'UpdateQueryTemplate' => [
+ 'method' => 'patch',
+ 'uriTemplate' => '/v1/{query_template.name=projects/*/locations/*/dataExchanges/*/queryTemplates/*}',
+ 'body' => 'query_template',
+ 'placeholders' => [
+ 'query_template.name' => [
+ 'getters' => [
+ 'getQueryTemplate',
+ 'getName',
+ ],
+ ],
+ ],
+ ],
],
],
];
diff --git a/BigQueryAnalyticsHub/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php b/BigQueryAnalyticsHub/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php
index 41af11391bd4..482887b812fa 100644
--- a/BigQueryAnalyticsHub/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php
+++ b/BigQueryAnalyticsHub/tests/Unit/V1/Client/AnalyticsHubServiceClientTest.php
@@ -26,15 +26,19 @@
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\Testing\GeneratedTest;
use Google\ApiCore\Testing\MockTransport;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\ApproveQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\GetQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\GetSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesResponse;
@@ -42,15 +46,19 @@
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListListingsResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesResponse;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionResponse;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\SubmitQueryTemplateRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeResponse;
use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingRequest;
@@ -58,6 +66,7 @@
use Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;
use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateDataExchangeRequest;
use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateListingRequest;
+use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateQueryTemplateRequest;
use Google\Cloud\Iam\V1\GetIamPolicyRequest;
use Google\Cloud\Iam\V1\Policy;
use Google\Cloud\Iam\V1\SetIamPolicyRequest;
@@ -102,6 +111,94 @@ private function createClient(array $options = [])
return new AnalyticsHubServiceClient($options);
}
+ /** @test */
+ public function approveQueryTemplateTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name2 = 'name2-1052831874';
+ $displayName = 'displayName1615086568';
+ $description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
+ $primaryContact = 'primaryContact203339491';
+ $documentation = 'documentation1587405498';
+ $expectedResponse = new QueryTemplate();
+ $expectedResponse->setName($name2);
+ $expectedResponse->setDisplayName($displayName);
+ $expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
+ $expectedResponse->setPrimaryContact($primaryContact);
+ $expectedResponse->setDocumentation($documentation);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new ApproveQueryTemplateRequest())->setName($formattedName);
+ $response = $gapicClient->approveQueryTemplate($request);
+ $this->assertEquals($expectedResponse, $response);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ApproveQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function approveQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new ApproveQueryTemplateRequest())->setName($formattedName);
+ try {
+ $gapicClient->approveQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function createDataExchangeTest()
{
@@ -301,6 +398,102 @@ public function createListingExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function createQueryTemplateTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name = 'name3373707';
+ $displayName = 'displayName1615086568';
+ $description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
+ $primaryContact = 'primaryContact203339491';
+ $documentation = 'documentation1587405498';
+ $expectedResponse = new QueryTemplate();
+ $expectedResponse->setName($name);
+ $expectedResponse->setDisplayName($displayName);
+ $expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
+ $expectedResponse->setPrimaryContact($primaryContact);
+ $expectedResponse->setDocumentation($documentation);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]');
+ $queryTemplateId = 'queryTemplateId-1152440823';
+ $queryTemplate = new QueryTemplate();
+ $queryTemplateDisplayName = 'queryTemplateDisplayName-990303317';
+ $queryTemplate->setDisplayName($queryTemplateDisplayName);
+ $request = (new CreateQueryTemplateRequest())
+ ->setParent($formattedParent)
+ ->setQueryTemplateId($queryTemplateId)
+ ->setQueryTemplate($queryTemplate);
+ $response = $gapicClient->createQueryTemplate($request);
+ $this->assertEquals($expectedResponse, $response);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getParent();
+ $this->assertProtobufEquals($formattedParent, $actualValue);
+ $actualValue = $actualRequestObject->getQueryTemplateId();
+ $this->assertProtobufEquals($queryTemplateId, $actualValue);
+ $actualValue = $actualRequestObject->getQueryTemplate();
+ $this->assertProtobufEquals($queryTemplate, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function createQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]');
+ $queryTemplateId = 'queryTemplateId-1152440823';
+ $queryTemplate = new QueryTemplate();
+ $queryTemplateDisplayName = 'queryTemplateDisplayName-990303317';
+ $queryTemplate->setDisplayName($queryTemplateDisplayName);
+ $request = (new CreateQueryTemplateRequest())
+ ->setParent($formattedParent)
+ ->setQueryTemplateId($queryTemplateId)
+ ->setQueryTemplate($queryTemplate);
+ try {
+ $gapicClient->createQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function deleteDataExchangeTest()
{
@@ -428,6 +621,81 @@ public function deleteListingExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function deleteQueryTemplateTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $expectedResponse = new GPBEmpty();
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new DeleteQueryTemplateRequest())->setName($formattedName);
+ $gapicClient->deleteQueryTemplate($request);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/DeleteQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function deleteQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new DeleteQueryTemplateRequest())->setName($formattedName);
+ try {
+ $gapicClient->deleteQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function deleteSubscriptionTest()
{
@@ -783,6 +1051,94 @@ public function getListingExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function getQueryTemplateTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name2 = 'name2-1052831874';
+ $displayName = 'displayName1615086568';
+ $description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
+ $primaryContact = 'primaryContact203339491';
+ $documentation = 'documentation1587405498';
+ $expectedResponse = new QueryTemplate();
+ $expectedResponse->setName($name2);
+ $expectedResponse->setDisplayName($displayName);
+ $expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
+ $expectedResponse->setPrimaryContact($primaryContact);
+ $expectedResponse->setDocumentation($documentation);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new GetQueryTemplateRequest())->setName($formattedName);
+ $response = $gapicClient->getQueryTemplate($request);
+ $this->assertEquals($expectedResponse, $response);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/GetQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function getQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new GetQueryTemplateRequest())->setName($formattedName);
+ try {
+ $gapicClient->getQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function getSubscriptionTest()
{
@@ -1080,6 +1436,80 @@ public function listOrgDataExchangesExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function listQueryTemplatesTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $nextPageToken = '';
+ $queryTemplatesElement = new QueryTemplate();
+ $queryTemplates = [$queryTemplatesElement];
+ $expectedResponse = new ListQueryTemplatesResponse();
+ $expectedResponse->setNextPageToken($nextPageToken);
+ $expectedResponse->setQueryTemplates($queryTemplates);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]');
+ $request = (new ListQueryTemplatesRequest())->setParent($formattedParent);
+ $response = $gapicClient->listQueryTemplates($request);
+ $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject());
+ $resources = iterator_to_array($response->iterateAllElements());
+ $this->assertSame(1, count($resources));
+ $this->assertEquals($expectedResponse->getQueryTemplates()[0], $resources[0]);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ListQueryTemplates',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getParent();
+ $this->assertProtobufEquals($formattedParent, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function listQueryTemplatesExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedParent = $gapicClient->dataExchangeName('[PROJECT]', '[LOCATION]', '[DATA_EXCHANGE]');
+ $request = (new ListQueryTemplatesRequest())->setParent($formattedParent);
+ try {
+ $gapicClient->listQueryTemplates($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function listSharedResourceSubscriptionsTest()
{
@@ -1490,6 +1920,94 @@ public function setIamPolicyExceptionTest()
$this->assertTrue($transport->isExhausted());
}
+ /** @test */
+ public function submitQueryTemplateTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name2 = 'name2-1052831874';
+ $displayName = 'displayName1615086568';
+ $description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
+ $primaryContact = 'primaryContact203339491';
+ $documentation = 'documentation1587405498';
+ $expectedResponse = new QueryTemplate();
+ $expectedResponse->setName($name2);
+ $expectedResponse->setDisplayName($displayName);
+ $expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
+ $expectedResponse->setPrimaryContact($primaryContact);
+ $expectedResponse->setDocumentation($documentation);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new SubmitQueryTemplateRequest())->setName($formattedName);
+ $response = $gapicClient->submitQueryTemplate($request);
+ $this->assertEquals($expectedResponse, $response);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/SubmitQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function submitQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new SubmitQueryTemplateRequest())->setName($formattedName);
+ try {
+ $gapicClient->submitQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
/** @test */
public function subscribeDataExchangeTest()
{
@@ -1945,7 +2463,7 @@ public function updateListingExceptionTest()
}
/** @test */
- public function createDataExchangeAsyncTest()
+ public function updateQueryTemplateTest()
{
$transport = $this->createTransport();
$gapicClient = $this->createClient([
@@ -1956,47 +2474,119 @@ public function createDataExchangeAsyncTest()
$name = 'name3373707';
$displayName = 'displayName1615086568';
$description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
$primaryContact = 'primaryContact203339491';
$documentation = 'documentation1587405498';
- $listingCount = 1101038700;
- $icon = '121';
- $logLinkedDatasetQueryUserEmail = false;
- $expectedResponse = new DataExchange();
+ $expectedResponse = new QueryTemplate();
$expectedResponse->setName($name);
$expectedResponse->setDisplayName($displayName);
$expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
$expectedResponse->setPrimaryContact($primaryContact);
$expectedResponse->setDocumentation($documentation);
- $expectedResponse->setListingCount($listingCount);
- $expectedResponse->setIcon($icon);
- $expectedResponse->setLogLinkedDatasetQueryUserEmail($logLinkedDatasetQueryUserEmail);
$transport->addResponse($expectedResponse);
// Mock request
- $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]');
- $dataExchangeId = 'dataExchangeId1402219426';
- $dataExchange = new DataExchange();
- $dataExchangeDisplayName = 'dataExchangeDisplayName-1195270080';
- $dataExchange->setDisplayName($dataExchangeDisplayName);
- $request = (new CreateDataExchangeRequest())
- ->setParent($formattedParent)
- ->setDataExchangeId($dataExchangeId)
- ->setDataExchange($dataExchange);
- $response = $gapicClient->createDataExchangeAsync($request)->wait();
+ $queryTemplate = new QueryTemplate();
+ $queryTemplateDisplayName = 'queryTemplateDisplayName-990303317';
+ $queryTemplate->setDisplayName($queryTemplateDisplayName);
+ $request = (new UpdateQueryTemplateRequest())->setQueryTemplate($queryTemplate);
+ $response = $gapicClient->updateQueryTemplate($request);
$this->assertEquals($expectedResponse, $response);
$actualRequests = $transport->popReceivedCalls();
$this->assertSame(1, count($actualRequests));
$actualFuncCall = $actualRequests[0]->getFuncCall();
$actualRequestObject = $actualRequests[0]->getRequestObject();
$this->assertSame(
- '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/CreateDataExchange',
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/UpdateQueryTemplate',
$actualFuncCall
);
- $actualValue = $actualRequestObject->getParent();
- $this->assertProtobufEquals($formattedParent, $actualValue);
- $actualValue = $actualRequestObject->getDataExchangeId();
- $this->assertProtobufEquals($dataExchangeId, $actualValue);
- $actualValue = $actualRequestObject->getDataExchange();
- $this->assertProtobufEquals($dataExchange, $actualValue);
+ $actualValue = $actualRequestObject->getQueryTemplate();
+ $this->assertProtobufEquals($queryTemplate, $actualValue);
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function updateQueryTemplateExceptionTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ $status = new stdClass();
+ $status->code = Code::DATA_LOSS;
+ $status->details = 'internal error';
+ $expectedExceptionMessage = json_encode(
+ [
+ 'message' => 'internal error',
+ 'code' => Code::DATA_LOSS,
+ 'status' => 'DATA_LOSS',
+ 'details' => [],
+ ],
+ JSON_PRETTY_PRINT
+ );
+ $transport->addResponse(null, $status);
+ // Mock request
+ $queryTemplate = new QueryTemplate();
+ $queryTemplateDisplayName = 'queryTemplateDisplayName-990303317';
+ $queryTemplate->setDisplayName($queryTemplateDisplayName);
+ $request = (new UpdateQueryTemplateRequest())->setQueryTemplate($queryTemplate);
+ try {
+ $gapicClient->updateQueryTemplate($request);
+ // If the $gapicClient method call did not throw, fail the test
+ $this->fail('Expected an ApiException, but no exception was thrown.');
+ } catch (ApiException $ex) {
+ $this->assertEquals($status->code, $ex->getCode());
+ $this->assertEquals($expectedExceptionMessage, $ex->getMessage());
+ }
+ // Call popReceivedCalls to ensure the stub is exhausted
+ $transport->popReceivedCalls();
+ $this->assertTrue($transport->isExhausted());
+ }
+
+ /** @test */
+ public function approveQueryTemplateAsyncTest()
+ {
+ $transport = $this->createTransport();
+ $gapicClient = $this->createClient([
+ 'transport' => $transport,
+ ]);
+ $this->assertTrue($transport->isExhausted());
+ // Mock response
+ $name2 = 'name2-1052831874';
+ $displayName = 'displayName1615086568';
+ $description = 'description-1724546052';
+ $proposer = 'proposer-992842892';
+ $primaryContact = 'primaryContact203339491';
+ $documentation = 'documentation1587405498';
+ $expectedResponse = new QueryTemplate();
+ $expectedResponse->setName($name2);
+ $expectedResponse->setDisplayName($displayName);
+ $expectedResponse->setDescription($description);
+ $expectedResponse->setProposer($proposer);
+ $expectedResponse->setPrimaryContact($primaryContact);
+ $expectedResponse->setDocumentation($documentation);
+ $transport->addResponse($expectedResponse);
+ // Mock request
+ $formattedName = $gapicClient->queryTemplateName(
+ '[PROJECT]',
+ '[LOCATION]',
+ '[DATA_EXCHANGE]',
+ '[QUERY_TEMPLATE]'
+ );
+ $request = (new ApproveQueryTemplateRequest())->setName($formattedName);
+ $response = $gapicClient->approveQueryTemplateAsync($request)->wait();
+ $this->assertEquals($expectedResponse, $response);
+ $actualRequests = $transport->popReceivedCalls();
+ $this->assertSame(1, count($actualRequests));
+ $actualFuncCall = $actualRequests[0]->getFuncCall();
+ $actualRequestObject = $actualRequests[0]->getRequestObject();
+ $this->assertSame(
+ '/google.cloud.bigquery.analyticshub.v1.AnalyticsHubService/ApproveQueryTemplate',
+ $actualFuncCall
+ );
+ $actualValue = $actualRequestObject->getName();
+ $this->assertProtobufEquals($formattedName, $actualValue);
$this->assertTrue($transport->isExhausted());
}
}