# Google Cloud Video Live Stream V1 Client - Class Distribution (1.4.0)

1.4.0 (latest) 1.3.2 1.2.1 1.1.3 1.0.0 0.7.5 0.6.2 0.5.0 0.4.2 0.3.2 0.2.6 Reference documentation and code samples for the Google Cloud Video Live Stream V1 Client class Distribution.

Distribution configuration.

Generated from protobuf message `google.cloud.video.livestream.v1.Distribution`

## Namespace

Google \\ Cloud \\ Video \\ LiveStream \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ key` | `string` Required. A unique key for this distribution. The key must be 1-63 characters in length. The key must begin and end with a letter (regardless of case) or a number, but can contain dashes or underscores in between. |
| `↳ distribution_stream` | `string` Required. `DistributionStream` [key](https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.DistributionStream#_Google_Cloud_Video_LiveStream_V1_DistributionStream__getKey__)s that should appear in this distribution output. - For SRT protocol, only `ts` distribution streams can be specified. - For RTMP protocol, only `flv` distribution streams can be specified. |
| `↳ state` | `int` Output only. State of the distribution. |
| `↳ error` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` Output only. Only present when the `state` is `ERROR`. The reason for the error state of the distribution. |
| `↳ srt_push` | `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.SrtPushOutputEndpoint` Output endpoint using SRT_PUSH. |
| `↳ rtmp_push` | `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.RtmpPushOutputEndpoint` Output endpoint using RTMP_PUSH. |

### getKey

Required. A unique key for this distribution. The key must be 1-63
characters in length. The key must begin and end with a letter (regardless
of case) or a number, but can contain dashes or underscores in between.

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

### setKey

Required. A unique key for this distribution. The key must be 1-63
characters in length. The key must begin and end with a letter (regardless
of case) or a number, but can contain dashes or underscores in between.

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

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

### getDistributionStream

Required. `DistributionStream`
[key](https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.DistributionStream#_Google_Cloud_Video_LiveStream_V1_DistributionStream__getKey__)s that should
appear in this distribution output.

- For SRT protocol, only `ts` distribution streams can be specified.
- For RTMP protocol, only `flv` distribution streams can be specified.

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

### setDistributionStream

Required. `DistributionStream`
[key](https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.DistributionStream#_Google_Cloud_Video_LiveStream_V1_DistributionStream__getKey__)s that should
appear in this distribution output.

- For SRT protocol, only `ts` distribution streams can be specified.
- For RTMP protocol, only `flv` distribution streams can be specified.

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

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

### getState

Output only. State of the distribution.

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

### setState

Output only. State of the distribution.

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

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

### getError

Output only. Only present when the `state` is `ERROR`. The reason for the
error state of the distribution.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html|null` |   |

### hasError

### clearError

### setError

Output only. Only present when the `state` is `ERROR`. The reason for the
error state of the distribution.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html` |

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

### getSrtPush

Output endpoint using SRT_PUSH.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.SrtPushOutputEndpoint|null` |   |

### hasSrtPush

### setSrtPush

Output endpoint using SRT_PUSH.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.SrtPushOutputEndpoint` |

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

### getRtmpPush

Output endpoint using RTMP_PUSH.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.RtmpPushOutputEndpoint|null` |   |

### hasRtmpPush

### setRtmpPush

Output endpoint using RTMP_PUSH.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-video-live-stream/latest/V1.RtmpPushOutputEndpoint` |

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

### getEndpoint

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