# Google Cloud Identity and Access Management (IAM) v2 API - Class PolicyRule (1.4.0)

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

- [1.4.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/1.3.0/Google.Cloud.Iam.V2.PolicyRule)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/1.2.0/Google.Cloud.Iam.V2.PolicyRule)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/1.1.0/Google.Cloud.Iam.V2.PolicyRule)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/1.0.0/Google.Cloud.Iam.V2.PolicyRule)

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

Reference documentation and code samples for the Google Cloud Identity and Access Management (IAM) v2 API class PolicyRule.

A single rule in a `Policy`.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[PolicyRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[PolicyRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[PolicyRule](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule), [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.Iam.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2)

## Assembly

Google.Cloud.Iam.V2.dll

## Constructors

### PolicyRule()

    public PolicyRule()

### PolicyRule(PolicyRule)

    public PolicyRule(PolicyRule other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule` |

## Properties

### DenyRule

    public DenyRule DenyRule { get; set; }

A rule for a deny policy.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.DenyRule` |   |

### Description

    public string Description { get; set; }

A user-specified description of the rule. This value can be up to 256
characters.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### KindCase

    public PolicyRule.KindOneofCase KindCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRulehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V2/latest/Google.Cloud.Iam.V2.PolicyRule.KindOneofCase` |   |