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

Represents the state of a replica of a shared dataset.

It includes the geographic location of the replica and
system-computed, output-only fields indicating its replication state and
whether it is the primary replica.

Generated from protobuf message `google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica`

## Namespace

Google \\ Cloud \\ BigQuery \\ AnalyticsHub \\ V1 \\ Listing \\ BigQueryDatasetSource

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ location` | `string` Output only. The geographic location where the replica resides. See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations) for supported locations. Eg. "us-central1". |
| `↳ replica_state` | `int` Output only. Assigned by Analytics Hub based on real BigQuery replication state. |
| `↳ primary_state` | `int` Output only. Indicates that this replica is the primary replica. |

### getLocation

Output only. The geographic location where the replica resides. See
[BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
for supported locations. Eg. "us-central1".

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

### setLocation

Output only. The geographic location where the replica resides. See
[BigQuery locations](https://cloud.google.com/bigquery/docs/locations)
for supported locations. Eg. "us-central1".

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

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

### getReplicaState

Output only. Assigned by Analytics Hub based on real BigQuery
replication state.

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

### setReplicaState

Output only. Assigned by Analytics Hub based on real BigQuery
replication state.

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

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

### getPrimaryState

Output only. Indicates that this replica is the primary replica.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### hasPrimaryState

### clearPrimaryState

### setPrimaryState

Output only. Indicates that this replica is the primary replica.

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

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