# Google Cloud BigQuery Analytics Hub V1 Client - Class Subscription (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 Subscription.

A subscription represents a subscribers' access to a particular set of
published data. It contains references to associated listings,
data exchanges, and linked datasets.

Generated from protobuf message `google.cloud.bigquery.analyticshub.v1.Subscription`

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ listing` | `string` Output only. Resource name of the source Listing. e.g. projects/123/locations/us/dataExchanges/456/listings/789 |
| `↳ data_exchange` | `string` Output only. Resource name of the source Data Exchange. e.g. projects/123/locations/us/dataExchanges/456 |
| `↳ name` | `string` Output only. The resource name of the subscription. e.g. `projects/myproject/locations/us/subscriptions/123`. |
| `↳ creation_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Timestamp when the subscription was created. |
| `↳ last_modify_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Timestamp when the subscription was last modified. |
| `↳ organization_id` | `string` Output only. Organization of the project this subscription belongs to. |
| `↳ organization_display_name` | `string` Output only. Display name of the project of this subscription. |
| `↳ state` | `int` Output only. Current state of the subscription. |
| `↳ linked_dataset_map` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Output only. Map of listing resource names to associated linked resource, e.g. projects/123/locations/us/dataExchanges/456/listings/789 -\> projects/123/datasets/my_dataset For listing-level subscriptions, this is a map of size 1. Only contains values if state == STATE_ACTIVE. |
| `↳ subscriber_contact` | `string` Output only. Email of the subscriber. |
| `↳ linked_resources` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.LinkedResource>` Output only. Linked resources created in the subscription. Only contains values if state = STATE_ACTIVE. |
| `↳ resource_type` | `int` Output only. Listing shared asset type. |
| `↳ commercial_info` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.CommercialInfo` Output only. This is set if this is a commercial subscription i.e. if this subscription was created from subscribing to a commercial listing. |
| `↳ log_linked_dataset_query_user_email` | `bool` Output only. By default, false. If true, the Subscriber agreed to the email sharing mandate that is enabled for DataExchange/Listing. |
| `↳ destination_dataset` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DestinationDataset` Optional. BigQuery destination dataset to create for the subscriber. |

### getListing

Output only. Resource name of the source Listing.

e.g. projects/123/locations/us/dataExchanges/456/listings/789

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasListing

### setListing

Output only. Resource name of the source Listing.

e.g. projects/123/locations/us/dataExchanges/456/listings/789

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDataExchange

Output only. Resource name of the source Data Exchange.

e.g. projects/123/locations/us/dataExchanges/456

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasDataExchange

### setDataExchange

Output only. Resource name of the source Data Exchange.

e.g. projects/123/locations/us/dataExchanges/456

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getName

Output only. The resource name of the subscription.

e.g. `projects/myproject/locations/us/subscriptions/123`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Output only. The resource name of the subscription.

e.g. `projects/myproject/locations/us/subscriptions/123`.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreationTime

Output only. Timestamp when the subscription was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreationTime

### clearCreationTime

### setCreationTime

Output only. Timestamp when the subscription was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLastModifyTime

Output only. Timestamp when the subscription was last modified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasLastModifyTime

### clearLastModifyTime

### setLastModifyTime

Output only. Timestamp when the subscription was last modified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOrganizationId

Output only. Organization of the project this subscription belongs to.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setOrganizationId

Output only. Organization of the project this subscription belongs to.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOrganizationDisplayName

Output only. Display name of the project of this subscription.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setOrganizationDisplayName

Output only. Display name of the project of this subscription.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getState

Output only. Current state of the subscription.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.State). |

### setState

Output only. Current state of the subscription.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.State). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLinkedDatasetMap

Output only. Map of listing resource names to associated linked resource,
e.g. projects/123/locations/us/dataExchanges/456/listings/789
-\>
projects/123/datasets/my_dataset
For listing-level subscriptions, this is a map of size 1.

Only contains values if state == STATE_ACTIVE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLinkedDatasetMap

Output only. Map of listing resource names to associated linked resource,
e.g. projects/123/locations/us/dataExchanges/456/listings/789
-\>
projects/123/datasets/my_dataset
For listing-level subscriptions, this is a map of size 1.

Only contains values if state == STATE_ACTIVE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSubscriberContact

Output only. Email of the subscriber.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSubscriberContact

Output only. Email of the subscriber.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLinkedResources

Output only. Linked resources created in the subscription. Only contains
values if state = STATE_ACTIVE.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.LinkedResource>` |   |

### setLinkedResources

Output only. Linked resources created in the subscription. Only contains
values if state = STATE_ACTIVE.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.LinkedResource>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceType

Output only. Listing shared asset type.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [SharedResourceType](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SharedResourceType). |

### setResourceType

Output only. Listing shared asset type.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [SharedResourceType](https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.SharedResourceType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCommercialInfo

Output only. This is set if this is a commercial subscription i.e. if this
subscription was created from subscribing to a commercial listing.

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

### hasCommercialInfo

### clearCommercialInfo

### setCommercialInfo

Output only. This is set if this is a commercial subscription i.e. if this
subscription was created from subscribing to a commercial listing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.Subscription.CommercialInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLogLinkedDatasetQueryUserEmail

Output only. By default, false.

If true, the Subscriber agreed to the email sharing mandate
that is enabled for DataExchange/Listing.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasLogLinkedDatasetQueryUserEmail

### clearLogLinkedDatasetQueryUserEmail

### setLogLinkedDatasetQueryUserEmail

Output only. By default, false.

If true, the Subscriber agreed to the email sharing mandate
that is enabled for DataExchange/Listing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDestinationDataset

Optional. BigQuery destination dataset to create for the subscriber.

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

### hasDestinationDataset

### clearDestinationDataset

### setDestinationDataset

Optional. BigQuery destination dataset to create for the subscriber.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-analyticshub/latest/V1.DestinationDataset` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceName

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |