# Binary Authorization v1beta1 API - Class AdmissionRule (2.0.0-beta09)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.0.0-beta09 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule)
- [2.0.0-beta08](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/2.0.0-beta08/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule)
- [1.0.0-beta05](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/1.0.0-beta05/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule)

    public sealed class AdmissionRule : IMessage<AdmissionRule>, IEquatable<AdmissionRule>, IDeepCloneable<AdmissionRule>, IBufferMessage, IMessage

Reference documentation and code samples for the Binary Authorization v1beta1 API class AdmissionRule.

An \[admission rule\]\[google.cloud.binaryauthorization.v1beta1.AdmissionRule\] specifies either that all container images
used in a pod creation request must be attested to by one or more
\[attestors\]\[google.cloud.binaryauthorization.v1beta1.Attestor\], that all pod creations will be allowed, or that all
pod creations will be denied.

Images matching an \[admission allowlist pattern\]\[google.cloud.binaryauthorization.v1beta1.AdmissionWhitelistPattern\]
are exempted from admission rules and will never block a pod creation.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> AdmissionRule

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AdmissionRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AdmissionRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AdmissionRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.BinaryAuthorization.V1Beta1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1)

## Assembly

Google.Cloud.BinaryAuthorization.V1Beta1.dll

## Constructors

### AdmissionRule()

    public AdmissionRule()

### AdmissionRule(AdmissionRule)

    public AdmissionRule(AdmissionRule other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule` |

## Properties

### EnforcementMode

    public AdmissionRule.Types.EnforcementMode EnforcementMode { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule.Types.EnforcementMode` |   |

### EvaluationMode

    public AdmissionRule.Types.EvaluationMode EvaluationMode { get; set; }

Required. How this admission rule will be evaluated.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.AdmissionRule.Types.EvaluationMode` |   |

### RequireAttestationsBy

    public RepeatedField<string> RequireAttestationsBy { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://learn.microsoft.com/dotnet/api/system.string` |   |