# Google Cloud Policy Simulator V1 Client - Class ExplainedAccess (1.3.4)

1.3.4 (latest) 1.3.3 1.2.0 1.1.1 1.0.3 0.2.5 0.1.1 Reference documentation and code samples for the Google Cloud Policy Simulator V1 Client class ExplainedAccess.

Details about how a set of policies, listed in
[ExplainedPolicy](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.ExplainedPolicy), resulted
in a certain [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) when
replaying an access tuple.

Generated from protobuf message `google.cloud.policysimulator.v1.ExplainedAccess`

## Namespace

Google \\ Cloud \\ PolicySimulator \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ access_state` | `int` Whether the principal in the access tuple has permission to access the resource in the access tuple under the given policies. |
| `↳ policies` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.ExplainedPolicy>` If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is `UNKNOWN`, this field contains the policies that led to that result. If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is omitted. |
| `↳ errors` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html>` If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is `UNKNOWN`, this field contains a list of errors explaining why the result is `UNKNOWN`. If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is omitted. |

### getAccessState

Whether the principal in the access tuple has permission to access the
resource in the access tuple under the given policies.

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

### setAccessState

Whether the principal in the access tuple has permission to access the
resource in the access tuple under the given policies.

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

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

### getPolicies

If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is
`UNKNOWN`, this field contains the policies that led to that result.

If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is
omitted.

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

### setPolicies

If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is
`UNKNOWN`, this field contains the policies that led to that result.

If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is
omitted.

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

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

### getErrors

If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is
`UNKNOWN`, this field contains a list of errors explaining why the result
is `UNKNOWN`.

If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is
omitted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html>` |   |

### setErrors

If the [AccessState](https://docs.cloud.google.com/php/docs/reference/cloud-policysimulator/latest/V1.AccessState) is
`UNKNOWN`, this field contains a list of errors explaining why the result
is `UNKNOWN`.

If the `AccessState` is `GRANTED` or `NOT_GRANTED`, this field is
omitted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Status.html>` |

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