# Google Cloud Identity and Access Management (IAM) v1 API - Class SetIamPolicyRequest (3.5.0)

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

- [3.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [3.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/3.4.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [3.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/3.3.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/3.2.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [3.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/3.1.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [3.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/3.0.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/2.4.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/2.3.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/2.2.0/Google.Cloud.Iam.V1.SetIamPolicyRequest)

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

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

Request message for `SetIamPolicy` method.

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.Iam.V1.dll

## Constructors

### SetIamPolicyRequest()

    public SetIamPolicyRequest()

### SetIamPolicyRequest(SetIamPolicyRequest)

    public SetIamPolicyRequest(SetIamPolicyRequest other)

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

## Properties

### Policy

    public Policy Policy { get; set; }

REQUIRED: The complete policy to be applied to the `resource`. The size of
the policy is limited to a few 10s of KB. An empty policy is a
valid policy but certain Cloud Platform services (such as Projects)
might reject them.

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

### Resource

    public string Resource { get; set; }

REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this field.

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

### ResourceAsResourceName

    public IResourceName ResourceAsResourceName { get; set; }

[IResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html)-typed view over the [Resource](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.SetIamPolicyRequest#Google_Cloud_Iam_V1_SetIamPolicyRequest_Resource) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html` |   |

### UpdateMask

    public FieldMask UpdateMask { get; set; }

OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
the fields in the mask will be modified. If no mask is provided, the
following default mask is used:

`paths: "bindings, etag"`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.FieldMask.html` |   |