# Secret Manager v1 API - Class CreateSecretRequest (2.7.0)

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

- [2.7.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.6.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.5.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.4.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.3.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.2.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.1.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.0.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.9.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.9.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.8.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.7.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.6.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.5.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.4.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.3.0/Google.Cloud.SecretManager.V1.CreateSecretRequest)

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

Reference documentation and code samples for the Secret Manager v1 API class CreateSecretRequest.

Request message for
\[SecretManagerService.CreateSecret\]\[google.cloud.secretmanager.v1.SecretManagerService.CreateSecret\].

## Inheritance

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

## Implements

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

## Assembly

Google.Cloud.SecretManager.V1.dll

## Constructors

### CreateSecretRequest()

    public CreateSecretRequest()

### CreateSecretRequest(CreateSecretRequest)

    public CreateSecretRequest(CreateSecretRequest other)

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

## Properties

### Parent

    public string Parent { get; set; }

Required. The resource name of the project to associate with the
\[Secret\]\[google.cloud.secretmanager.v1.Secret\], in the format `projects/*`
or `projects/*/locations/*`.

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

### ParentAsLocationName

    public LocationName ParentAsLocationName { get; set; }

[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.CreateSecretRequest#Google_Cloud_SecretManager_V1_CreateSecretRequest_Parent) resource name property.

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

### ParentAsProjectName

    public ProjectName ParentAsProjectName { get; set; }

[ProjectName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.ProjectName.html)-typed view over the [Parent](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.CreateSecretRequest#Google_Cloud_SecretManager_V1_CreateSecretRequest_Parent) resource name property.

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

### 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.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.CreateSecretRequest#Google_Cloud_SecretManager_V1_CreateSecretRequest_Parent) resource name property.

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

### Secret

    public Secret Secret { get; set; }

Required. A \[Secret\]\[google.cloud.secretmanager.v1.Secret\] with initial
field values.

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

### SecretId

    public string SecretId { get; set; }

Required. This must be unique within the project.

A secret ID is a string with a maximum length of 255 characters and can
contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and
underscore (`_`) characters.

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