# Google Cloud Policy Simulator V1 Client - Class BindingExplanation (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 BindingExplanation.

Details about how a binding in a policy affects a principal's ability to use
a permission.

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

## Namespace

Google \\ Cloud \\ PolicySimulator \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ access` | `int` Required. Indicates whether *this binding* provides the specified permission to the specified principal for the specified resource. This field does *not* indicate whether the principal actually has the permission for the resource. There might be another binding that overrides this binding. To determine whether the principal actually has the permission, use the `access` field in the TroubleshootIamPolicyResponse. |
| `↳ role` | `string` The role that this binding grants. For example, `roles/compute.serviceAgent`. For a complete list of predefined IAM roles, as well as the permissions in each role, see <https://cloud.google.com/iam/help/roles/reference>. |
| `↳ role_permission` | `int` Indicates whether the role granted by this binding contains the specified permission. |
| `↳ role_permission_relevance` | `int` The relevance of the permission's existence, or nonexistence, in the role to the overall determination for the entire policy. |
| `↳ memberships` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Indicates whether each principal in the binding includes the principal specified in the request, either directly or indirectly. Each key identifies a principal in the binding, and each value indicates whether the principal in the binding includes the principal in the request. For example, suppose that a binding includes the following principals: \* \* `user:alice\@example.com` \* \* `group:product-eng\@example.com` The principal in the replayed access tuple is `user:bob\@example.com`. This user is a principal of the group `group:product-eng\@example.com`. For the first principal in the binding, the key is `user:alice\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_NOT_INCLUDED`. For the second principal in the binding, the key is `group:product-eng\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_INCLUDED`. |
| `↳ relevance` | `int` The relevance of this binding to the overall determination for the entire policy. |
| `↳ condition` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Expr.html` A condition expression that prevents this binding from granting access unless the expression evaluates to `true`. To learn about IAM Conditions, see <https://cloud.google.com/iam/docs/conditions-overview>. |

### getAccess

Required. Indicates whether *this binding* provides the specified
permission to the specified principal for the specified resource.

This field does *not* indicate whether the principal actually has the
permission for the resource. There might be another binding that overrides
this binding. To determine whether the principal actually has the
permission, use the `access` field in the
TroubleshootIamPolicyResponse.

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

### setAccess

Required. Indicates whether *this binding* provides the specified
permission to the specified principal for the specified resource.

This field does *not* indicate whether the principal actually has the
permission for the resource. There might be another binding that overrides
this binding. To determine whether the principal actually has the
permission, use the `access` field in the
TroubleshootIamPolicyResponse.

| **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` |   |

### getRole

The role that this binding grants. For example,
`roles/compute.serviceAgent`.

For a complete list of predefined IAM roles, as well as the permissions in
each role, see <https://cloud.google.com/iam/help/roles/reference>.

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

### setRole

The role that this binding grants. For example,
`roles/compute.serviceAgent`.

For a complete list of predefined IAM roles, as well as the permissions in
each role, see <https://cloud.google.com/iam/help/roles/reference>.

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

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

### getRolePermission

Indicates whether the role granted by this binding contains the specified
permission.

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

### setRolePermission

Indicates whether the role granted by this binding contains the specified
permission.

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

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

### getRolePermissionRelevance

The relevance of the permission's existence, or nonexistence, in the role
to the overall determination for the entire policy.

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

### setRolePermissionRelevance

The relevance of the permission's existence, or nonexistence, in the role
to the overall determination for the entire policy.

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

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

### getMemberships

Indicates whether each principal in the binding includes the principal
specified in the request, either directly or indirectly. Each key
identifies a principal in the binding, and each value indicates whether the
principal in the binding includes the principal in the request.

For example, suppose that a binding includes the following principals:

- `user:alice\@example.com`
- `group:product-eng\@example.com` The principal in the replayed access tuple is `user:bob\@example.com`. This user is a principal of the group `group:product-eng\@example.com`. For the first principal in the binding, the key is `user:alice\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_NOT_INCLUDED`. For the second principal in the binding, the key is `group:product-eng\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_INCLUDED`.

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

### setMemberships

Indicates whether each principal in the binding includes the principal
specified in the request, either directly or indirectly. Each key
identifies a principal in the binding, and each value indicates whether the
principal in the binding includes the principal in the request.

For example, suppose that a binding includes the following principals:

- `user:alice\@example.com`
- `group:product-eng\@example.com` The principal in the replayed access tuple is `user:bob\@example.com`. This user is a principal of the group `group:product-eng\@example.com`. For the first principal in the binding, the key is `user:alice\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_NOT_INCLUDED`. For the second principal in the binding, the key is `group:product-eng\@example.com`, and the `membership` field in the value is set to `MEMBERSHIP_INCLUDED`.

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

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

### getRelevance

The relevance of this binding to the overall determination for the entire
policy.

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

### setRelevance

The relevance of this binding to the overall determination for the entire
policy.

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

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

### getCondition

A condition expression that prevents this binding from granting access
unless the expression evaluates to `true`.

To learn about IAM Conditions, see
<https://cloud.google.com/iam/docs/conditions-overview>.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Expr.html|null` |   |

### hasCondition

### clearCondition

### setCondition

A condition expression that prevents this binding from granting access
unless the expression evaluates to `true`.

To learn about IAM Conditions, see
<https://cloud.google.com/iam/docs/conditions-overview>.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Type.Expr.html` |

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