# Google Cloud Cloud Controls Partner V1beta Client - Class Violation (0.5.3)

0.5.3 (latest) 0.5.2 0.4.1 0.3.0 0.2.2 0.1.4

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Cloud Controls Partner V1beta Client class Violation.

Details of resource Violation

Generated from protobuf message `google.cloud.cloudcontrolspartner.v1beta.Violation`

## Namespace

Google \\ Cloud \\ CloudControlsPartner \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}` |
| `↳ description` | `string` Output only. Description for the Violation. e.g. OrgPolicy gcp.resourceLocations has non compliant value. |
| `↳ begin_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time of the event which triggered the Violation. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The last time when the Violation record was updated. |
| `↳ resolve_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Time of the event which fixed the Violation. If the violation is ACTIVE this will be empty. |
| `↳ category` | `string` Output only. Category under which this violation is mapped. e.g. Location, Service Usage, Access, Encryption, etc. |
| `↳ state` | `int` Output only. State of the violation |
| `↳ non_compliant_org_policy` | `string` Output only. Immutable. Name of the OrgPolicy which was modified with non-compliant change and resulted this violation. Format: `projects/{project_number}/policies/{constraint_name}` `folders/{folder_id}/policies/{constraint_name}` `organizations/{organization_id}/policies/{constraint_name}` |
| `↳ folder_id` | `int|string` The folder_id of the violation |
| `↳ remediation` | `https://docs.cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest/V1beta.Violation.Remediation` Output only. Compliance violation remediation |

### getName

Identifier. Format:
`organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`

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

### setName

Identifier. Format:
`organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}`

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

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

### getDescription

Output only. Description for the Violation.

e.g. OrgPolicy gcp.resourceLocations has non compliant value.

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

### setDescription

Output only. Description for the Violation.

e.g. OrgPolicy gcp.resourceLocations has non compliant value.

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

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

### getBeginTime

Output only. Time of the event which triggered the Violation.

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

### hasBeginTime

### clearBeginTime

### setBeginTime

Output only. Time of the event which triggered the Violation.

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

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

### getUpdateTime

Output only. The last time when the Violation record was updated.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last time when the Violation record was updated.

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

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

### getResolveTime

Output only. Time of the event which fixed the Violation.

If the violation is ACTIVE this will be empty.

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

### hasResolveTime

### clearResolveTime

### setResolveTime

Output only. Time of the event which fixed the Violation.

If the violation is ACTIVE this will be empty.

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

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

### getCategory

Output only. Category under which this violation is mapped.

e.g. Location, Service Usage, Access, Encryption, etc.

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

### setCategory

Output only. Category under which this violation is mapped.

e.g. Location, Service Usage, Access, Encryption, etc.

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

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

### getState

Output only. State of the violation

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest/V1beta.Violation.State). |

### setState

Output only. State of the violation

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest/V1beta.Violation.State). |

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

### getNonCompliantOrgPolicy

Output only. Immutable. Name of the OrgPolicy which was modified with
non-compliant change and resulted this violation. Format:
`projects/{project_number}/policies/{constraint_name}`
`folders/{folder_id}/policies/{constraint_name}`
`organizations/{organization_id}/policies/{constraint_name}`

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

### setNonCompliantOrgPolicy

Output only. Immutable. Name of the OrgPolicy which was modified with
non-compliant change and resulted this violation. Format:
`projects/{project_number}/policies/{constraint_name}`
`folders/{folder_id}/policies/{constraint_name}`
`organizations/{organization_id}/policies/{constraint_name}`

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

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

### getFolderId

The folder_id of the violation

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

### setFolderId

The folder_id of the violation

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

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

### getRemediation

Output only. Compliance violation remediation

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest/V1beta.Violation.Remediation|null` |   |

### hasRemediation

### clearRemediation

### setRemediation

Output only. Compliance violation remediation

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-cloudcontrolspartner/latest/V1beta.Violation.Remediation` |

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