1.5.0 (latest) 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

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

Reference documentation and code samples for the API Keys v2 API class CreateKeyRequest.

Request message for `CreateKey` method.

## Inheritance

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

## Implements

[IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.md.txt)[CreateKeyRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiKeys.V2/latest/Google.Cloud.ApiKeys.V2.CreateKeyRequest.md.txt), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateKeyRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiKeys.V2/latest/Google.Cloud.ApiKeys.V2.CreateKeyRequest.md.txt), [IDeepCloneable](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.md.txt)[CreateKeyRequest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiKeys.V2/latest/Google.Cloud.ApiKeys.V2.CreateKeyRequest.md.txt), [IBufferMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.md.txt), [IMessage](https://docs.cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.md.txt)

## 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.ApiKeys.V2](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiKeys.V2/latest/Google.Cloud.ApiKeys.V2.md.txt)

## Assembly

Google.Cloud.ApiKeys.V2.dll

## Constructors

### CreateKeyRequest()

    public CreateKeyRequest()

### CreateKeyRequest(CreateKeyRequest)

    public CreateKeyRequest(CreateKeyRequest other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `CreateKeyRequest` |

## Properties

### Key

    public Key Key { get; set; }

Required. The API key fields to set at creation time.
You can configure only the `display_name`, `restrictions`, and
`annotations` fields.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `Key` |   |

### KeyId

    public string KeyId { get; set; }

User specified key id (optional). If specified, it will become the final
component of the key resource name.

The id must be unique within the project, must conform with RFC-1034,
is restricted to lower-cased letters, and has a maximum length of 63
characters. In another word, the id must match the regular
expression: `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.

The id must NOT be a UUID-like string.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### Parent

    public string Parent { get; set; }

Required. The project in which the API key is created.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### ParentAsLocationName

    public LocationName ParentAsLocationName { get; set; }

[LocationName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.md.txt)-typed view over the [Parent](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiKeys.V2/latest/Google.Cloud.ApiKeys.V2.CreateKeyRequest.md.txt#Google_Cloud_ApiKeys_V2_CreateKeyRequest_Parent) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `LocationName` |   |