2.6.0 (latest) 2.5.4 2.3.1 2.2.1 2.1.5 2.0.0 1.10.4 1.9.0 1.8.0 1.7.1 1.6.0 1.5.0 1.4.1 1.3.2 1.2.12 Reference documentation and code samples for the Google BigQuery Storage V1 Client class WriteStream.

Information about a single stream that gets data inside the storage system.

Generated from protobuf message `google.cloud.bigquery.storage.v1.WriteStream`

## Namespace

Google \\ Cloud \\ BigQuery \\ Storage \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. Name of the stream, in the form `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`. |
| `↳ type` | `int` Immutable. Type of the stream. |
| `↳ create_time` | `Google\Protobuf\Timestamp` Output only. Create time of the stream. For the _default stream, this is the creation_time of the table. |
| `↳ commit_time` | `Google\Protobuf\Timestamp` Output only. Commit time of the stream. If a stream is of `COMMITTED` type, then it will have a commit_time same as `create_time`. If the stream is of `PENDING` type, empty commit_time means it is not committed. |
| `↳ table_schema` | `https://docs.cloud.google.com/php/docs/reference/cloud-bigquery-storage/latest/V1.TableSchema` Output only. The schema of the destination table. It is only returned in `CreateWriteStream` response. Caller should generate data that's compatible with this schema to send in initial `AppendRowsRequest`. The table schema could go out of date during the life time of the stream. |
| `↳ write_mode` | `int` Immutable. Mode of the stream. |
| `↳ location` | `string` Output only. The geographic location where the stream's dataset resides. See <https://cloud.google.com/bigquery/docs/locations> for supported locations. |

### getName

Output only. Name of the stream, in the form
`projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`.

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

### setName

Output only. Name of the stream, in the form
`projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`.

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

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

### getType

Immutable. Type of the stream.

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

### setType

Immutable. Type of the stream.

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

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

### getCreateTime

Output only. Create time of the stream. For the _default stream, this is
the creation_time of the table.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. Create time of the stream. For the _default stream, this is
the creation_time of the table.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getCommitTime

Output only. Commit time of the stream.

If a stream is of `COMMITTED` type, then it will have a commit_time same as
`create_time`. If the stream is of `PENDING` type, empty commit_time
means it is not committed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCommitTime

### clearCommitTime

### setCommitTime

Output only. Commit time of the stream.

If a stream is of `COMMITTED` type, then it will have a commit_time same as
`create_time`. If the stream is of `PENDING` type, empty commit_time
means it is not committed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getTableSchema

Output only. The schema of the destination table. It is only returned in
`CreateWriteStream` response. Caller should generate data that's
compatible with this schema to send in initial `AppendRowsRequest`.

The table schema could go out of date during the life time of the stream.

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

### hasTableSchema

### clearTableSchema

### setTableSchema

Output only. The schema of the destination table. It is only returned in
`CreateWriteStream` response. Caller should generate data that's
compatible with this schema to send in initial `AppendRowsRequest`.

The table schema could go out of date during the life time of the stream.

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

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

### getWriteMode

Immutable. Mode of the stream.

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

### setWriteMode

Immutable. Mode of the stream.

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

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

### getLocation

Output only. The geographic location where the stream's dataset resides.

See <https://cloud.google.com/bigquery/docs/locations> for supported
locations.

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

### setLocation

Output only. The geographic location where the stream's dataset resides.

See <https://cloud.google.com/bigquery/docs/locations> for supported
locations.

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

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