# Google Cloud Security Command Center V1 Client - Class SecurityPosture (2.5.1)

2.5.1 (latest) 2.5.0 2.4.2 2.3.0 2.2.1 2.1.1 2.0.4 1.32.0 1.31.0 1.30.0 1.29.0 1.28.2 1.21.0 1.20.2 1.19.1 1.18.0 1.17.0 1.16.0 1.15.1 1.14.2 1.13.1 Reference documentation and code samples for the Google Cloud Security Command Center V1 Client class SecurityPosture.

Represents a posture that is deployed on Google Cloud by the
Security Command Center Posture Management service.

A posture contains one or more policy sets. A policy set is a
group of policies that enforce a set of security rules on Google
Cloud.

Generated from protobuf message `google.cloud.securitycenter.v1.SecurityPosture`

## Namespace

Google \\ Cloud \\ SecurityCenter \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Name of the posture, for example, `CIS-Posture`. |
| `↳ revision_id` | `string` The version of the posture, for example, `c7cfa2a8`. |
| `↳ posture_deployment_resource` | `string` The project, folder, or organization on which the posture is deployed, for example, `projects/{project_number}`. |
| `↳ posture_deployment` | `string` The name of the posture deployment, for example, `organizations/{org_id}/posturedeployments/{posture_deployment_id}`. |
| `↳ changed_policy` | `string` The name of the updated policy, for example, `projects/{project_id}/policies/{constraint_name}`. |
| `↳ policy_set` | `string` The name of the updated policyset, for example, `cis-policyset`. |
| `↳ policy` | `string` The ID of the updated policy, for example, `compute-policy-1`. |
| `↳ policy_drift_details` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V1.SecurityPosture.PolicyDriftDetails>` The details about a change in an updated policy that violates the deployed posture. |

### getName

Name of the posture, for example, `CIS-Posture`.

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

### setName

Name of the posture, for example, `CIS-Posture`.

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

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

### getRevisionId

The version of the posture, for example, `c7cfa2a8`.

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

### setRevisionId

The version of the posture, for example, `c7cfa2a8`.

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

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

### getPostureDeploymentResource

The project, folder, or organization on which the posture is deployed,
for example, `projects/{project_number}`.

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

### setPostureDeploymentResource

The project, folder, or organization on which the posture is deployed,
for example, `projects/{project_number}`.

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

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

### getPostureDeployment

The name of the posture deployment, for example,
`organizations/{org_id}/posturedeployments/{posture_deployment_id}`.

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

### setPostureDeployment

The name of the posture deployment, for example,
`organizations/{org_id}/posturedeployments/{posture_deployment_id}`.

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

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

### getChangedPolicy

The name of the updated policy, for example,
`projects/{project_id}/policies/{constraint_name}`.

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

### setChangedPolicy

The name of the updated policy, for example,
`projects/{project_id}/policies/{constraint_name}`.

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

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

### getPolicySet

The name of the updated policyset, for example, `cis-policyset`.

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

### setPolicySet

The name of the updated policyset, for example, `cis-policyset`.

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

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

### getPolicy

The ID of the updated policy, for example, `compute-policy-1`.

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

### setPolicy

The ID of the updated policy, for example, `compute-policy-1`.

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

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

### getPolicyDriftDetails

The details about a change in an updated policy that violates the deployed
posture.

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

### setPolicyDriftDetails

The details about a change in an updated policy that violates the deployed
posture.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-security-center/latest/V1.SecurityPosture.PolicyDriftDetails>` |

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