# Identity and Access Management (IAM) v1 API - Class CreateRoleRequest (2.5.0)

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

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/latest/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.4.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.3.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.2.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.1.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/2.0.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.2.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.1.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.Admin.V1/1.0.0/Google.Cloud.Iam.Admin.V1.CreateRoleRequest)

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

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

The request to create a new role.

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.Iam.Admin.V1.dll

## Constructors

### CreateRoleRequest()

    public CreateRoleRequest()

### CreateRoleRequest(CreateRoleRequest)

    public CreateRoleRequest(CreateRoleRequest other)

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

## Properties

### Parent

    public string Parent { get; set; }

The `parent` parameter's value depends on the target resource for the
request, namely
[`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles)
or
[`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
Each resource type's `parent` value format is described below:

- [`projects.roles.create()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/create):
  `projects/{PROJECT_ID}`. This method creates project-level
  [custom
  roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  Example request URL:
  `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles`

- [`organizations.roles.create()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/create):
  `organizations/{ORGANIZATION_ID}`. This method creates organization-level
  [custom
  roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  Example request URL:
  `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles`

Note: Wildcard (\*) values are invalid; you must specify a complete project
ID or organization ID.

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

### ParentAsResourceName

    public IResourceName ParentAsResourceName { get; set; }

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

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

### Role

    public Role Role { get; set; }

The Role resource to create.

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

### RoleId

    public string RoleId { get; set; }

The role ID to use for this role.

A role ID may contain alphanumeric characters, underscores (`_`), and
periods (`.`). It must contain a minimum of 3 characters and a maximum of
64 characters.

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