public sealed class AddSecretVersionRequest : IMessage<AddSecretVersionRequest>, IEquatable<AddSecretVersionRequest>, IDeepCloneable<AddSecretVersionRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Secret Manager v1 API class AddSecretVersionRequest.
Request message for
[SecretManagerService.AddSecretVersion][google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion].
Required. The resource name of the
[Secret][google.cloud.secretmanager.v1.Secret] to associate with the
[SecretVersion][google.cloud.secretmanager.v1.SecretVersion] in the format
projects/*/secrets/* or projects/*/locations/*/secrets/*.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis webpage provides reference documentation for the \u003ccode\u003eAddSecretVersionRequest\u003c/code\u003e class within the Google Cloud Secret Manager v1 API for .NET.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eAddSecretVersionRequest\u003c/code\u003e is 2.5.0, with documentation available for versions ranging back to 1.3.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAddSecretVersionRequest\u003c/code\u003e class is used to define a request for adding a new version to a secret, and it implements various interfaces, such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eAddSecretVersionRequest\u003c/code\u003e include \u003ccode\u003eParent\u003c/code\u003e, which specifies the associated secret's resource name, and \u003ccode\u003ePayload\u003c/code\u003e, which contains the new secret version's data.\u003c/p\u003e\n"],["\u003cp\u003eThere are also constructors available to initialize a new \u003ccode\u003eAddSecretVersionRequest\u003c/code\u003e instance with no default values or to initialize it with another instance.\u003c/p\u003e\n"]]],[],null,["# Secret Manager v1 API - Class AddSecretVersionRequest (2.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.5.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.4.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.3.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.2.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.1.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/2.0.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.9.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.9.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.8.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.8.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.7.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.7.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.6.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.5.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.4.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/1.3.0/Google.Cloud.SecretManager.V1.AddSecretVersionRequest) \n\n public sealed class AddSecretVersionRequest : IMessage\u003cAddSecretVersionRequest\u003e, IEquatable\u003cAddSecretVersionRequest\u003e, IDeepCloneable\u003cAddSecretVersionRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Secret Manager v1 API class AddSecretVersionRequest.\n\nRequest message for\n\\[SecretManagerService.AddSecretVersion\\]\\[google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e AddSecretVersionRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[AddSecretVersionRequest](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.AddSecretVersionRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[AddSecretVersionRequest](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.AddSecretVersionRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[AddSecretVersionRequest](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.AddSecretVersionRequest), [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) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.SecretManager.V1](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.SecretManager.V1.dll\n\nConstructors\n------------\n\n### AddSecretVersionRequest()\n\n public AddSecretVersionRequest()\n\n### AddSecretVersionRequest(AddSecretVersionRequest)\n\n public AddSecretVersionRequest(AddSecretVersionRequest other)\n\nProperties\n----------\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. The resource name of the\n\\[Secret\\]\\[google.cloud.secretmanager.v1.Secret\\] to associate with the\n\\[SecretVersion\\]\\[google.cloud.secretmanager.v1.SecretVersion\\] in the format\n`projects/*/secrets/*` or `projects/*/locations/*/secrets/*`.\n\n### ParentAsSecretName\n\n public SecretName ParentAsSecretName { get; set; }\n\n[SecretName](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.SecretName)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.SecretManager.V1/latest/Google.Cloud.SecretManager.V1.AddSecretVersionRequest#Google_Cloud_SecretManager_V1_AddSecretVersionRequest_Parent) resource name property.\n\n### Payload\n\n public SecretPayload Payload { get; set; }\n\nRequired. The secret payload of the\n\\[SecretVersion\\]\\[google.cloud.secretmanager.v1.SecretVersion\\]."]]