# Google Cloud Redis V1 Client - Class MaintenancePolicy (2.2.3)

2.2.3 (latest) 2.2.2 2.1.6 2.0.0 1.9.5 1.8.4 1.7.0 1.6.12 Reference documentation and code samples for the Google Cloud Redis V1 Client class MaintenancePolicy.

Maintenance policy for an instance.

Generated from protobuf message `google.cloud.redis.v1.MaintenancePolicy`

## Namespace

Google \\ Cloud \\ Redis \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the policy was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the policy was last updated. |
| `↳ description` | `string` Optional. Description of what this policy is for. Create/Update methods return INVALID_ARGUMENT if the length is greater than 512. |
| `↳ weekly_maintenance_window` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-redis/latest/V1.WeeklyMaintenanceWindow>` Optional. Maintenance window that is applied to resources covered by this policy. Minimum 1. For the current version, the maximum number of weekly_window is expected to be one. |

### getCreateTime

Output only. The time when the policy was created.

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

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time when the policy was created.

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

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

### getUpdateTime

Output only. The time when the policy was last updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time when the policy was last updated.

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

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

### getDescription

Optional. Description of what this policy is for. Create/Update methods
return INVALID_ARGUMENT if the length is greater than 512.

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

### setDescription

Optional. Description of what this policy is for. Create/Update methods
return INVALID_ARGUMENT if the length is greater than 512.

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

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

### getWeeklyMaintenanceWindow

Optional. Maintenance window that is applied to resources covered by this
policy. Minimum 1. For the current version, the maximum number of
weekly_window is expected to be one.

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

### setWeeklyMaintenanceWindow

Optional. Maintenance window that is applied to resources covered by this
policy. Minimum 1. For the current version, the maximum number of
weekly_window is expected to be one.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-redis/latest/V1.WeeklyMaintenanceWindow>` |

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