# Google Cloud BigQuery Analytics Hub V1 Client - Class AnalyticsHubServiceClient (1.5.1)

1.5.1 (latest) 1.5.0 1.4.1 1.3.0 1.2.1 1.1.0 1.0.4 0.5.3 0.4.0 0.3.2 0.2.2 0.1.6 Reference documentation and code samples for the Google Cloud BigQuery Analytics Hub V1 Client class AnalyticsHubServiceClient.

Service Description: The `AnalyticsHubService` API facilitates data sharing within and across
organizations. It allows data providers to publish listings that reference
shared datasets. With Analytics Hub, users can discover and search for
listings that they have access to. Subscribers can view and subscribe to
listings. When you subscribe to a listing, Analytics Hub creates a linked
dataset in your project.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To
assist with these names, this class includes a format method for each type of
name, and additionally a parseName method to extract the individual identifiers
contained within formatted names that are returned by the API.

## Namespace

Google \\ Cloud \\ BigQuery \\ AnalyticsHub \\ V1 \\ Client

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `options` | `array|https://docs.cloud.google.com/php/docs/reference/gax/latest/Options.ClientOptions.html` Optional. Options for configuring the service API wrapper. |
| `↳ apiEndpoint` | `string` The address of the API remote host. May optionally include the port, formatted as " |
| `↳ credentials` | `https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html|https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html` This option should only be used with a pre-constructed [Google\\Auth\\FetchAuthTokenInterface](https://docs.cloud.google.com/php/docs/reference/auth/latest/FetchAuthTokenInterface.html) or [Google\\ApiCore\\CredentialsWrapper](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html) object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. **Important** : If you are providing a path to a credentials file, or a decoded credentials file as a PHP array, this usage is now DEPRECATED. Providing an unvalidated credential configuration to Google APIs can compromise the security of your systems and data. It is recommended to create the credentials explicitly `use Google\Auth\Credentials\ServiceAccountCredentials; use Google\Cloud\BigQuery\AnalyticsHub\V1\AnalyticsHubServiceClient; $creds = new ServiceAccountCredentials($scopes, $json); $options = new AnalyticsHubServiceClient(['credentials' => $creds]);` <https://cloud.google.com/docs/authentication/external/externally-sourced-credentials> |
| `↳ credentialsConfig` | `array` Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see [Google\\ApiCore\\CredentialsWrapper::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/CredentialsWrapper.html#_Google_ApiCore_CredentialsWrapper__build__) . |
| `↳ disableRetries` | `bool` Determines whether or not retries defined by the client configuration should be disabled. Defaults to `false`. |
| `↳ clientConfig` | `string|array` Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
| `↳ transport` | `string|https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html` The transport used for executing network requests. May be either the string `rest` or `grpc`. Defaults to `grpc` if gRPC support is detected on the system. *Advanced usage* : Additionally, it is possible to pass in an already instantiated [Google\\ApiCore\\Transport\\TransportInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.TransportInterface.html) object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored. |
| `↳ transportConfig` | `array` Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = \[ 'grpc' =\> \[...\], 'rest' =\> \[...\], \]; See the [Google\\ApiCore\\Transport\\GrpcTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport.html#_Google_ApiCore_Transport_GrpcTransport__build__) and [Google\\ApiCore\\Transport\\RestTransport::build()](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.RestTransport.html#_Google_ApiCore_Transport_RestTransport__build__) methods for the supported options. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
| `↳ logger` | `false|Psr\Log\LoggerInterface` A PSR-3 compliant logger. If set to false, logging is disabled, ignoring the 'GOOGLE_SDK_PHP_LOGGING' environment flag |
| `↳ universeDomain` | `string` The service domain for the client. Defaults to 'googleapis.com'. |

### approveQueryTemplate

Approves a query template.

The async variant is
[AnalyticsHubServiceClient::approveQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__approveQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ApproveQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ApproveQueryTemplateRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;

    /**
     * @param string $formattedName 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.
     */
    function approve_query_template_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ApproveQueryTemplateRequest())
            ->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);
    }

### createDataExchange

Creates a new data exchange.

The async variant is [AnalyticsHubServiceClient::createDataExchangeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__createDataExchangeAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateDataExchangeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateDataExchangeRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;

    /**
     * @param string $formattedParent         The parent resource path of the data exchange.
     *                                        e.g. `projects/myproject/locations/us`. Please see
     *                                        {@see AnalyticsHubServiceClient::locationName()} for help formatting this field.
     * @param string $dataExchangeId          The ID of the data exchange.
     *                                        Must contain only Unicode letters, numbers (0-9), underscores (_).
     *                                        Max length: 100 bytes.
     * @param string $dataExchangeDisplayName Human-readable display name of the data exchange. The display
     *                                        name must contain only Unicode letters, numbers (0-9), underscores (_),
     *                                        dashes (-), spaces ( ), ampersands (&) and must not start or end with
     *                                        spaces. Default value is an empty string. Max length: 63 bytes.
     */
    function create_data_exchange_sample(
        string $formattedParent,
        string $dataExchangeId,
        string $dataExchangeDisplayName
    ): void {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $dataExchange = (new DataExchange())
            ->setDisplayName($dataExchangeDisplayName);
        $request = (new CreateDataExchangeRequest())
            ->setParent($formattedParent)
            ->setDataExchangeId($dataExchangeId)
            ->setDataExchange($dataExchange);

        // Call the API and handle any network failures.
        try {
            /** @var DataExchange $response */
            $response = $analyticsHubServiceClient->createDataExchange($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::locationName('[PROJECT]', '[LOCATION]');
        $dataExchangeId = '[DATA_EXCHANGE_ID]';
        $dataExchangeDisplayName = '[DISPLAY_NAME]';

        create_data_exchange_sample($formattedParent, $dataExchangeId, $dataExchangeDisplayName);
    }

### createListing

Creates a new listing.

The async variant is [AnalyticsHubServiceClient::createListingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__createListingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateListingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateListingRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;

    /**
     * @param string $formattedParent    The parent resource path of the listing.
     *                                   e.g. `projects/myproject/locations/us/dataExchanges/123`. Please see
     *                                   {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
     * @param string $listingId          The ID of the listing to create.
     *                                   Must contain only Unicode letters, numbers (0-9), underscores (_).
     *                                   Max length: 100 bytes.
     * @param string $listingDisplayName Human-readable display name of the listing. 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.
     */
    function create_listing_sample(
        string $formattedParent,
        string $listingId,
        string $listingDisplayName
    ): void {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $listing = (new Listing())
            ->setDisplayName($listingDisplayName);
        $request = (new CreateListingRequest())
            ->setParent($formattedParent)
            ->setListingId($listingId)
            ->setListing($listing);

        // Call the API and handle any network failures.
        try {
            /** @var Listing $response */
            $response = $analyticsHubServiceClient->createListing($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]'
        );
        $listingId = '[LISTING_ID]';
        $listingDisplayName = '[DISPLAY_NAME]';

        create_listing_sample($formattedParent, $listingId, $listingDisplayName);
    }

### createQueryTemplate

Creates a new QueryTemplate

The async variant is
[AnalyticsHubServiceClient::createQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__createQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\CreateQueryTemplateRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;

    /**
     * @param string $formattedParent          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 string $queryTemplateId          The ID of the QueryTemplate to create.
     *                                         Must contain only Unicode letters, numbers (0-9), underscores (_).
     *                                         Max length: 100 bytes.
     * @param string $queryTemplateDisplayName 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.
     */
    function create_query_template_sample(
        string $formattedParent,
        string $queryTemplateId,
        string $queryTemplateDisplayName
    ): void {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $queryTemplate = (new QueryTemplate())
            ->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);
    }

### deleteDataExchange

Deletes an existing data exchange.

The async variant is [AnalyticsHubServiceClient::deleteDataExchangeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__deleteDataExchangeAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteDataExchangeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteDataExchangeRequest;

    /**
     * @param string $formattedName The full name of the data exchange resource that you want to
     *                              delete. For example, `projects/myproject/locations/us/dataExchanges/123`. Please see
     *                              {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
     */
    function delete_data_exchange_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            $analyticsHubServiceClient->deleteDataExchange($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::dataExchangeName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]'
        );

        delete_data_exchange_sample($formattedName);
    }

### deleteListing

Deletes a listing.

The async variant is [AnalyticsHubServiceClient::deleteListingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__deleteListingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteListingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteListingRequest;

    /**
     * @param string $formattedName Resource name of the listing to delete.
     *                              e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`. Please see
     *                              {@see AnalyticsHubServiceClient::listingName()} for help formatting this field.
     */
    function delete_listing_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            $analyticsHubServiceClient->deleteListing($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::listingName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]',
            '[LISTING]'
        );

        delete_listing_sample($formattedName);
    }

### deleteQueryTemplate

Deletes a query template.

The async variant is
[AnalyticsHubServiceClient::deleteQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__deleteQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteQueryTemplateRequest;

    /**
     * @param string $formattedName 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.
     */
    function delete_query_template_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new DeleteQueryTemplateRequest())
            ->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);
    }

### deleteSubscription

Deletes a subscription.

The async variant is [AnalyticsHubServiceClient::deleteSubscriptionAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__deleteSubscriptionAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteSubscriptionRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<null>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DeleteSubscriptionRequest;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Resource name of the subscription to delete.
     *                              e.g. projects/123/locations/us/subscriptions/456
     *                              Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field.
     */
    function delete_subscription_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $analyticsHubServiceClient->deleteSubscription($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                printf('Operation completed successfully.' . PHP_EOL);
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->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::subscriptionName(
            '[PROJECT]',
            '[LOCATION]',
            '[SUBSCRIPTION]'
        );

        delete_subscription_sample($formattedName);
    }

### getDataExchange

Gets the details of a data exchange.

The async variant is [AnalyticsHubServiceClient::getDataExchangeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__getDataExchangeAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetDataExchangeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\GetDataExchangeRequest;

    /**
     * @param string $formattedName The resource name of the data exchange.
     *                              e.g. `projects/myproject/locations/us/dataExchanges/123`. Please see
     *                              {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
     */
    function get_data_exchange_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var DataExchange $response */
            $response = $analyticsHubServiceClient->getDataExchange($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::dataExchangeName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]'
        );

        get_data_exchange_sample($formattedName);
    }

### getIamPolicy

Gets the IAM policy.

The async variant is [AnalyticsHubServiceClient::getIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__getIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\Iam\V1\GetIamPolicyRequest;
    use Google\Cloud\Iam\V1\Policy;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being requested.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function get_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new GetIamPolicyRequest())
            ->setResource($resource);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $analyticsHubServiceClient->getIamPolicy($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
    {
        $resource = '[RESOURCE]';

        get_iam_policy_sample($resource);
    }

### getListing

Gets the details of a listing.

The async variant is [AnalyticsHubServiceClient::getListingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__getListingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetListingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\GetListingRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;

    /**
     * @param string $formattedName The resource name of the listing.
     *                              e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`. Please see
     *                              {@see AnalyticsHubServiceClient::listingName()} for help formatting this field.
     */
    function get_listing_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Listing $response */
            $response = $analyticsHubServiceClient->getListing($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::listingName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]',
            '[LISTING]'
        );

        get_listing_sample($formattedName);
    }

### getQueryTemplate

Gets a QueryTemplate

The async variant is [AnalyticsHubServiceClient::getQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__getQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\GetQueryTemplateRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;

    /**
     * @param string $formattedName 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.
     */
    function get_query_template_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new GetQueryTemplateRequest())
            ->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);
    }

### getSubscription

Gets the details of a Subscription.

The async variant is [AnalyticsHubServiceClient::getSubscriptionAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__getSubscriptionAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetSubscriptionRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\GetSubscriptionRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;

    /**
     * @param string $formattedName Resource name of the subscription.
     *                              e.g. projects/123/locations/us/subscriptions/456
     *                              Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field.
     */
    function get_subscription_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var Subscription $response */
            $response = $analyticsHubServiceClient->getSubscription($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::subscriptionName(
            '[PROJECT]',
            '[LOCATION]',
            '[SUBSCRIPTION]'
        );

        get_subscription_sample($formattedName);
    }

### listDataExchanges

Lists all data exchanges in a given project and location.

The async variant is [AnalyticsHubServiceClient::listDataExchangesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listDataExchangesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListDataExchangesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListDataExchangesRequest;

    /**
     * @param string $formattedParent The parent resource path of the data exchanges.
     *                                e.g. `projects/myproject/locations/us`. Please see
     *                                {@see AnalyticsHubServiceClient::locationName()} for help formatting this field.
     */
    function list_data_exchanges_sample(string $formattedParent): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListDataExchangesRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $analyticsHubServiceClient->listDataExchanges($request);

            /** @var DataExchange $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::locationName('[PROJECT]', '[LOCATION]');

        list_data_exchanges_sample($formattedParent);
    }

### listListings

Lists all listings in a given project and location.

The async variant is [AnalyticsHubServiceClient::listListingsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listListingsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListListingsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListListingsRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;

    /**
     * @param string $formattedParent The parent resource path of the listing.
     *                                e.g. `projects/myproject/locations/us/dataExchanges/123`. Please see
     *                                {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
     */
    function list_listings_sample(string $formattedParent): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListListingsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $analyticsHubServiceClient->listListings($request);

            /** @var Listing $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_listings_sample($formattedParent);
    }

### listOrgDataExchanges

Lists all data exchanges from projects in a given organization and
location.

The async variant is
[AnalyticsHubServiceClient::listOrgDataExchangesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listOrgDataExchangesAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListOrgDataExchangesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListOrgDataExchangesRequest;

    /**
     * @param string $organization The organization resource path of the projects containing
     *                             DataExchanges. e.g. `organizations/myorg/locations/us`.
     */
    function list_org_data_exchanges_sample(string $organization): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListOrgDataExchangesRequest())
            ->setOrganization($organization);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $analyticsHubServiceClient->listOrgDataExchanges($request);

            /** @var DataExchange $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
    {
        $organization = '[ORGANIZATION]';

        list_org_data_exchanges_sample($organization);
    }

### listQueryTemplates

Lists all QueryTemplates in a given project and location.

The async variant is [AnalyticsHubServiceClient::listQueryTemplatesAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listQueryTemplatesAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListQueryTemplatesRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListQueryTemplatesRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;

    /**
     * @param string $formattedParent 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.
     */
    function list_query_templates_sample(string $formattedParent): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListQueryTemplatesRequest())
            ->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);
    }

### listSharedResourceSubscriptions

Lists all subscriptions on a given Data Exchange or Listing.

The async variant is
[AnalyticsHubServiceClient::listSharedResourceSubscriptionsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listSharedResourceSubscriptionsAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListSharedResourceSubscriptionsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSharedResourceSubscriptionsRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;

    /**
     * @param string $resource Resource name of the requested target. This resource may be
     *                         either a Listing or a DataExchange. e.g.
     *                         projects/123/locations/us/dataExchanges/456 OR e.g.
     *                         projects/123/locations/us/dataExchanges/456/listings/789
     */
    function list_shared_resource_subscriptions_sample(string $resource): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListSharedResourceSubscriptionsRequest())
            ->setResource($resource);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $analyticsHubServiceClient->listSharedResourceSubscriptions($request);

            /** @var Subscription $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
    {
        $resource = '[RESOURCE]';

        list_shared_resource_subscriptions_sample($resource);
    }

### listSubscriptions

Lists all subscriptions in a given project and location.

The async variant is [AnalyticsHubServiceClient::listSubscriptionsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__listSubscriptionsAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListSubscriptionsRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\PagedListResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\ListSubscriptionsRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Subscription;

    /**
     * @param string $formattedParent The parent resource path of the subscription.
     *                                e.g. projects/myproject/locations/us
     *                                Please see {@see AnalyticsHubServiceClient::locationName()} for help formatting this field.
     */
    function list_subscriptions_sample(string $formattedParent): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new ListSubscriptionsRequest())
            ->setParent($formattedParent);

        // Call the API and handle any network failures.
        try {
            /** @var PagedListResponse $response */
            $response = $analyticsHubServiceClient->listSubscriptions($request);

            /** @var Subscription $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::locationName('[PROJECT]', '[LOCATION]');

        list_subscriptions_sample($formattedParent);
    }

### refreshSubscription

Refreshes a Subscription to a Data Exchange. A Data Exchange can become
stale when a publisher adds or removes data. This is a long-running
operation as it may create many linked datasets.

The async variant is
[AnalyticsHubServiceClient::refreshSubscriptionAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__refreshSubscriptionAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RefreshSubscriptionRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RefreshSubscriptionResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\RefreshSubscriptionResponse;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName Resource name of the Subscription to refresh.
     *                              e.g. `projects/subscriberproject/locations/us/subscriptions/123`
     *                              Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field.
     */
    function refresh_subscription_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $analyticsHubServiceClient->refreshSubscription($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                /** @var RefreshSubscriptionResponse $result */
                $result = $response->getResult();
                printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->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::subscriptionName(
            '[PROJECT]',
            '[LOCATION]',
            '[SUBSCRIPTION]'
        );

        refresh_subscription_sample($formattedName);
    }

### revokeSubscription

Revokes a given subscription.

The async variant is [AnalyticsHubServiceClient::revokeSubscriptionAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__revokeSubscriptionAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RevokeSubscriptionRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RevokeSubscriptionResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\RevokeSubscriptionResponse;

    /**
     * @param string $formattedName Resource name of the subscription to revoke.
     *                              e.g. projects/123/locations/us/subscriptions/456
     *                              Please see {@see AnalyticsHubServiceClient::subscriptionName()} for help formatting this field.
     */
    function revoke_subscription_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var RevokeSubscriptionResponse $response */
            $response = $analyticsHubServiceClient->revokeSubscription($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::subscriptionName(
            '[PROJECT]',
            '[LOCATION]',
            '[SUBSCRIPTION]'
        );

        revoke_subscription_sample($formattedName);
    }

### setIamPolicy

Sets the IAM policy.

The async variant is [AnalyticsHubServiceClient::setIamPolicyAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__setIamPolicyAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\Iam\V1\Policy;
    use Google\Cloud\Iam\V1\SetIamPolicyRequest;

    /**
     * @param string $resource REQUIRED: The resource for which the policy is being specified.
     *                         See the operation documentation for the appropriate value for this field.
     */
    function set_iam_policy_sample(string $resource): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $policy = new Policy();
        $request = (new SetIamPolicyRequest())
            ->setResource($resource)
            ->setPolicy($policy);

        // Call the API and handle any network failures.
        try {
            /** @var Policy $response */
            $response = $analyticsHubServiceClient->setIamPolicy($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
    {
        $resource = '[RESOURCE]';

        set_iam_policy_sample($resource);
    }

### submitQueryTemplate

Submits a query template for approval.

The async variant is
[AnalyticsHubServiceClient::submitQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__submitQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubmitQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\SubmitQueryTemplateRequest;

    /**
     * @param string $formattedName 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.
     */
    function submit_query_template_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new SubmitQueryTemplateRequest())
            ->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);
    }

### subscribeDataExchange

Creates a Subscription to a Data Clean Room. This is a
long-running operation as it will create one or more linked datasets.

Throws a Bad Request error if the Data Exchange does not contain any
listings.

The async variant is
[AnalyticsHubServiceClient::subscribeDataExchangeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__subscribeDataExchangeAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeDataExchangeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeDataExchangeResponse>` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\ApiCore\OperationResponse;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeDataExchangeResponse;
    use Google\Rpc\Status;

    /**
     * @param string $formattedName        Resource name of the Data Exchange.
     *                                     e.g. `projects/publisherproject/locations/us/dataExchanges/123`
     *                                     Please see {@see AnalyticsHubServiceClient::dataExchangeName()} for help formatting this field.
     * @param string $formattedDestination The parent resource path of the Subscription.
     *                                     e.g. `projects/subscriberproject/locations/us`
     *                                     Please see {@see AnalyticsHubServiceClient::locationName()} for help formatting this field.
     * @param string $subscription         Name of the subscription to create.
     *                                     e.g. `subscription1`
     */
    function subscribe_data_exchange_sample(
        string $formattedName,
        string $formattedDestination,
        string $subscription
    ): void {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $request = (new SubscribeDataExchangeRequest())
            ->setName($formattedName)
            ->setDestination($formattedDestination)
            ->setSubscription($subscription);

        // Call the API and handle any network failures.
        try {
            /** @var OperationResponse $response */
            $response = $analyticsHubServiceClient->subscribeDataExchange($request);
            $response->pollUntilComplete();

            if ($response->operationSucceeded()) {
                /** @var SubscribeDataExchangeResponse $result */
                $result = $response->getResult();
                printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
            } else {
                /** @var Status $error */
                $error = $response->getError();
                printf('Operation failed with error data: %s' . PHP_EOL, $error->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::dataExchangeName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]'
        );
        $formattedDestination = AnalyticsHubServiceClient::locationName('[PROJECT]', '[LOCATION]');
        $subscription = '[SUBSCRIPTION]';

        subscribe_data_exchange_sample($formattedName, $formattedDestination, $subscription);
    }

### subscribeListing

Subscribes to a listing.

Currently, with Analytics Hub, you can create listings that
reference only BigQuery datasets.
Upon subscription to a listing for a BigQuery dataset, Analytics Hub
creates a linked dataset in the subscriber's project.

The async variant is [AnalyticsHubServiceClient::subscribeListingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__subscribeListingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeListingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeListingResponse` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingRequest;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\SubscribeListingResponse;

    /**
     * @param string $formattedName Resource name of the listing that you want to subscribe to.
     *                              e.g. `projects/myproject/locations/us/dataExchanges/123/listings/456`. Please see
     *                              {@see AnalyticsHubServiceClient::listingName()} for help formatting this field.
     */
    function subscribe_listing_sample(string $formattedName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

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

        // Call the API and handle any network failures.
        try {
            /** @var SubscribeListingResponse $response */
            $response = $analyticsHubServiceClient->subscribeListing($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::listingName(
            '[PROJECT]',
            '[LOCATION]',
            '[DATA_EXCHANGE]',
            '[LISTING]'
        );

        subscribe_listing_sample($formattedName);
    }

### testIamPermissions

Returns the permissions that a caller has.

The async variant is [AnalyticsHubServiceClient::testIamPermissionsAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__testIamPermissionsAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\Iam\V1\TestIamPermissionsRequest;
    use Google\Cloud\Iam\V1\TestIamPermissionsResponse;

    /**
     * @param string $resource           REQUIRED: The resource for which the policy detail is being requested.
     *                                   See the operation documentation for the appropriate value for this field.
     * @param string $permissionsElement The set of permissions to check for the `resource`. Permissions with
     *                                   wildcards (such as '*' or 'storage.*') are not allowed. For more
     *                                   information see
     *                                   [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
     */
    function test_iam_permissions_sample(string $resource, string $permissionsElement): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $permissions = [$permissionsElement,];
        $request = (new TestIamPermissionsRequest())
            ->setResource($resource)
            ->setPermissions($permissions);

        // Call the API and handle any network failures.
        try {
            /** @var TestIamPermissionsResponse $response */
            $response = $analyticsHubServiceClient->testIamPermissions($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
    {
        $resource = '[RESOURCE]';
        $permissionsElement = '[PERMISSIONS]';

        test_iam_permissions_sample($resource, $permissionsElement);
    }

### updateDataExchange

Updates an existing data exchange.

The async variant is [AnalyticsHubServiceClient::updateDataExchangeAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__updateDataExchangeAsync__)
.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateDataExchangeRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\DataExchange;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateDataExchangeRequest;
    use Google\Protobuf\FieldMask;

    /**
     * @param string $dataExchangeDisplayName Human-readable display name of the data exchange. The display
     *                                        name must contain only Unicode letters, numbers (0-9), underscores (_),
     *                                        dashes (-), spaces ( ), ampersands (&) and must not start or end with
     *                                        spaces. Default value is an empty string. Max length: 63 bytes.
     */
    function update_data_exchange_sample(string $dataExchangeDisplayName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $dataExchange = (new DataExchange())
            ->setDisplayName($dataExchangeDisplayName);
        $request = (new UpdateDataExchangeRequest())
            ->setUpdateMask($updateMask)
            ->setDataExchange($dataExchange);

        // Call the API and handle any network failures.
        try {
            /** @var DataExchange $response */
            $response = $analyticsHubServiceClient->updateDataExchange($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
    {
        $dataExchangeDisplayName = '[DISPLAY_NAME]';

        update_data_exchange_sample($dataExchangeDisplayName);
    }

### updateListing

Updates an existing listing.

The async variant is [AnalyticsHubServiceClient::updateListingAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__updateListingAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateListingRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Listing;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateListingRequest;
    use Google\Protobuf\FieldMask;

    /**
     * @param string $listingDisplayName Human-readable display name of the listing. 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.
     */
    function update_listing_sample(string $listingDisplayName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $updateMask = new FieldMask();
        $listing = (new Listing())
            ->setDisplayName($listingDisplayName);
        $request = (new UpdateListingRequest())
            ->setUpdateMask($updateMask)
            ->setListing($listing);

        // Call the API and handle any network failures.
        try {
            /** @var Listing $response */
            $response = $analyticsHubServiceClient->updateListing($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
    {
        $listingDisplayName = '[DISPLAY_NAME]';

        update_listing_sample($listingDisplayName);
    }

### updateQueryTemplate

Updates an existing QueryTemplate

The async variant is
[AnalyticsHubServiceClient::updateQueryTemplateAsync()](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Client.AnalyticsHubServiceClient#_Google_Cloud_BigQuery_AnalyticsHub_V1_Client_AnalyticsHubServiceClient__updateQueryTemplateAsync__) .

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateQueryTemplateRequest` A request to house fields associated with the call. |
| `callOptions` | `array` Optional. |
| `↳ retrySettings` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html|array` Retry settings to use for this call. Can be a [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) object, or an associative array of retry settings parameters. See the documentation on [Google\\ApiCore\\RetrySettings](https://docs.cloud.google.com/php/docs/reference/gax/latest/RetrySettings.html) for example usage. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate` |   |

**Example**

    use Google\ApiCore\ApiException;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\Client\AnalyticsHubServiceClient;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\QueryTemplate;
    use Google\Cloud\BigQuery\AnalyticsHub\V1\UpdateQueryTemplateRequest;

    /**
     * @param string $queryTemplateDisplayName 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.
     */
    function update_query_template_sample(string $queryTemplateDisplayName): void
    {
        // Create a client.
        $analyticsHubServiceClient = new AnalyticsHubServiceClient();

        // Prepare the request message.
        $queryTemplate = (new QueryTemplate())
            ->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);
    }

### approveQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ApproveQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate>` |   |

### createDataExchangeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateDataExchangeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange>` |   |

### createListingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateListingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing>` |   |

### createQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.CreateQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate>` |   |

### deleteDataExchangeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteDataExchangeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteListingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteListingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<void>` |   |

### deleteSubscriptionAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DeleteSubscriptionRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### getDataExchangeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetDataExchangeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange>` |   |

### getIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.GetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### getListingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetListingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing>` |   |

### getQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate>` |   |

### getSubscriptionAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.GetSubscriptionRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription>` |   |

### listDataExchangesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListDataExchangesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listListingsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListListingsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listOrgDataExchangesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListOrgDataExchangesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listQueryTemplatesAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListQueryTemplatesRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listSharedResourceSubscriptionsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListSharedResourceSubscriptionsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### listSubscriptionsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.ListSubscriptionsRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/PagedListResponse.html>` |   |

### refreshSubscriptionAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RefreshSubscriptionRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### revokeSubscriptionAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RevokeSubscriptionRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.RevokeSubscriptionResponse>` |   |

### setIamPolicyAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.SetIamPolicyRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.Policy.html>` |   |

### submitQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubmitQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate>` |   |

### subscribeDataExchangeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeDataExchangeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html>` |   |

### subscribeListingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeListingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SubscribeListingResponse>` |   |

### testIamPermissionsAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsRequest.html` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Cloud.Iam.V1.TestIamPermissionsResponse.html>` |   |

### updateDataExchangeAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateDataExchangeRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DataExchange>` |   |

### updateListingAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateListingRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Listing>` |   |

### updateQueryTemplateAsync

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.UpdateQueryTemplateRequest` |
| `optionalArgs` | `array` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-GuzzleHttp.Promise.Promise.html<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.QueryTemplate>` |   |

### getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\LongRunning\Client\OperationsClient` |   |

### resumeOperation

Resume an existing long running operation that was previously started by a long
running API method. If $methodName is not provided, or does not match a long
running API method, then the operation can still be resumed, but the
OperationResponse object will not deserialize the final response.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `operationName` | `string` The name of the long running operation |
| `methodName` | `string` The name of the method used to start the operation |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/OperationResponse.html` |   |

### static::dataExchangeName

Formats a string containing the fully-qualified path to represent a
data_exchange resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `dataExchange` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted data_exchange resource. |

### static::datasetName

Formats a string containing the fully-qualified path to represent a dataset
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `dataset` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted dataset resource. |

### static::listingName

Formats a string containing the fully-qualified path to represent a listing
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `dataExchange` | `string` |
| `listing` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted listing resource. |

### static::locationName

Formats a string containing the fully-qualified path to represent a location
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted location resource. |

### static::managedServiceName

Formats a string containing the fully-qualified path to represent a
managed_service resource.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `service` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted managed_service resource. |

### static::queryTemplateName

Formats a string containing the fully-qualified path to represent a
query_template resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `dataExchange` | `string` |
| `queryTemplate` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted query_template resource. |

### static::routineName

Formats a string containing the fully-qualified path to represent a routine
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `dataset` | `string` |
| `routine` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted routine resource. |

### static::subscriptionName

Formats a string containing the fully-qualified path to represent a subscription
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `location` | `string` |
| `subscription` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted subscription resource. |

### static::tableName

Formats a string containing the fully-qualified path to represent a table
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `dataset` | `string` |
| `table` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted table resource. |

### static::topicName

Formats a string containing the fully-qualified path to represent a topic
resource.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `project` | `string` |
| `topic` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` | The formatted topic resource. |

### static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported:
Template: Pattern

- 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}
- topic: projects/{project}/topics/{topic}

The optional $template argument can be supplied to specify a particular pattern,
and must match one of the templates listed above. If no $template argument is
provided, or if the $template argument does not match one of the templates
listed, then parseName will check each of the supported templates, and return
the first match.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `formattedName` | `string` The formatted name string |
| `template` | `?string` Optional name of template to match |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` | An associative array from name component IDs to component values. |