1.8.4 (latest) 1.7.2 1.6.0 1.5.0 1.4.0 1.3.1 1.2.1 1.1.3 1.0.0 0.6.5 0.5.1 0.4.4 0.3.13 Reference documentation and code samples for the Google Cloud Artifact Registry V1 Client class CleanupPolicy.

Artifact policy configuration for repository cleanup policies.

Generated from protobuf message `google.devtools.artifactregistry.v1.CleanupPolicy`

## Namespace

Google \\ Cloud \\ ArtifactRegistry \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ condition` | `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyCondition` Policy condition for matching versions. |
| `↳ most_recent_versions` | `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyMostRecentVersions` Policy condition for retaining a minimum number of versions. May only be specified with a Keep action. |
| `↳ id` | `string` The user-provided ID of the cleanup policy. |
| `↳ action` | `int` Policy action. |

### getCondition

Policy condition for matching versions.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyCondition|null` |   |

### hasCondition

### setCondition

Policy condition for matching versions.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyCondition` |

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

### getMostRecentVersions

Policy condition for retaining a minimum number of versions. May only be
specified with a Keep action.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyMostRecentVersions|null` |   |

### hasMostRecentVersions

### setMostRecentVersions

Policy condition for retaining a minimum number of versions. May only be
specified with a Keep action.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-artifact-registry/latest/V1.CleanupPolicyMostRecentVersions` |

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

### getId

The user-provided ID of the cleanup policy.

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

### setId

The user-provided ID of the cleanup policy.

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

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

### getAction

Policy action.

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

### setAction

Policy action.

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

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

### getConditionType

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