# Google Cloud Binary Authorization V1 Client - Class AdmissionRule (1.1.2)

1.1.2 (latest) 1.1.1 1.0.5 0.8.7 0.7.0 0.6.1 0.5.13 Reference documentation and code samples for the Google Cloud Binary Authorization V1 Client class AdmissionRule.

An [admission rule](https://docs.cloud.google.com/php/docs/reference/cloud-binary-authorization/latest/V1.AdmissionRule) specifies either that all container images
used in a pod creation request must be attested to by one or more
[attestors](https://docs.cloud.google.com/php/docs/reference/cloud-binary-authorization/latest/V1.Attestor), that all pod creations will be allowed, or that all
pod creations will be denied.

Images matching an [admission allowlist pattern](https://docs.cloud.google.com/php/docs/reference/cloud-binary-authorization/latest/V1.AdmissionWhitelistPattern)
are exempted from admission rules and will never block a pod creation.

Generated from protobuf message `google.cloud.binaryauthorization.v1.AdmissionRule`

## Namespace

Google \\ Cloud \\ BinaryAuthorization \\ V1

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getEvaluationMode

Required. How this admission rule will be evaluated.

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

### setEvaluationMode

Required. How this admission rule will be evaluated.

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

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

### getRequireAttestationsBy

Optional. The resource names of the attestors that must attest to
a container image, in the format `projects/*/attestors/*`. Each
attestor must exist before a policy can reference it. To add an attestor
to a policy the principal issuing the policy change request must be able
to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies
REQUIRE_ATTESTATION, otherwise it must be empty.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setRequireAttestationsBy

Optional. The resource names of the attestors that must attest to
a container image, in the format `projects/*/attestors/*`. Each
attestor must exist before a policy can reference it. To add an attestor
to a policy the principal issuing the policy change request must be able
to read the attestor resource.

Note: this field must be non-empty when the evaluation_mode field specifies
REQUIRE_ATTESTATION, otherwise it must be empty.

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

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

### getEnforcementMode

Required. The action when a pod creation is denied by the admission rule.

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

### setEnforcementMode

Required. The action when a pod creation is denied by the admission rule.

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

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