# Google Cloud Channel V1 Client - Class Period (2.4.1)

2.4.1 (latest) 2.4.0 2.3.1 2.2.1 2.1.4 2.0.0 1.9.5 1.8.2 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Channel V1 Client class Period.

Represents period in days/months/years.

Generated from protobuf message `google.cloud.channel.v1.Period`

## Namespace

Google \\ Cloud \\ Channel \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ duration` | `int` Total duration of Period Type defined. |
| `↳ period_type` | `int` Period Type. |

### getDuration

Total duration of Period Type defined.

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

### setDuration

Total duration of Period Type defined.

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

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

### getPeriodType

Period Type.

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

### setPeriodType

Period Type.

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

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