public sealed class CreateSnapshotRequest : IMessage<CreateSnapshotRequest>, IEquatable<CreateSnapshotRequest>, IDeepCloneable<CreateSnapshotRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Pub/Sub v1 API class CreateSnapshotRequest.
Required. User-provided name for this snapshot. If the name is not provided
in the request, the server will assign a random name for this snapshot on
the same project as the subscription. Note that for REST API requests, you
must specify a name. See the resource name
rules.
Format is projects/{project}/snapshots/{snap}.
Required. The subscription whose backlog the snapshot retains.
Specifically, the created snapshot is guaranteed to retain:
(a) The existing backlog on the subscription. More precisely, this is
defined as the messages in the subscription's backlog that are
unacknowledged upon the successful completion of the
CreateSnapshot request; as well as:
(b) Any messages published to the subscription's topic following the
successful completion of the CreateSnapshot request.
Format is projects/{project}/subscriptions/{sub}.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThe latest version for the \u003ccode\u003eCreateSnapshotRequest\u003c/code\u003e class in the Google Cloud Pub/Sub v1 API is 3.23.0, with a comprehensive list of previous versions provided, ranging down to version 2.3.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCreateSnapshotRequest\u003c/code\u003e is used for creating snapshots in the Cloud Pub/Sub service and it implements interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, indicating its role in message handling and object management.\u003c/p\u003e\n"],["\u003cp\u003eThis class contains properties such as \u003ccode\u003eLabels\u003c/code\u003e, \u003ccode\u003eName\u003c/code\u003e, \u003ccode\u003eSnapshotName\u003c/code\u003e, \u003ccode\u003eSubscription\u003c/code\u003e, and \u003ccode\u003eSubscriptionAsSubscriptionName\u003c/code\u003e, which are essential for configuring and identifying a snapshot, including associating it with a subscription and setting user-defined labels.\u003c/p\u003e\n"],["\u003cp\u003eCreating a \u003ccode\u003eCreateSnapshotRequest\u003c/code\u003e involves providing a user-defined name for the snapshot and specifying the subscription from which the snapshot will retain its backlog.\u003c/p\u003e\n"],["\u003cp\u003eThe format for the \u003ccode\u003eName\u003c/code\u003e and \u003ccode\u003eSubscription\u003c/code\u003e properties should adhere to the specified resource name rules which can be found at \u003ccode\u003eprojects/{project}/snapshots/{snap}\u003c/code\u003e and \u003ccode\u003eprojects/{project}/subscriptions/{sub}\u003c/code\u003e respectively.\u003c/p\u003e\n"]]],[],null,["# Cloud Pub/Sub v1 API - Class CreateSnapshotRequest (3.27.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.0 (latest)](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.26.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.26.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.25.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.25.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.24.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.24.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.23.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.23.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.22.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.22.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.21.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.21.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.20.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.20.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.19.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.19.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.18.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.18.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.17.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.17.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.16.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.16.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.15.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.15.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.14.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.13.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.12.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.11.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.10.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.10.1/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.9.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.9.1/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.8.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.7.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.6.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.5.1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.5.1/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.4.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.3.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.2.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.2.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.1.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.1.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [3.0.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/3.0.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.10.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.9.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.8.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.7.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.6.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.5.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.4.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.PubSub.V1/2.3.0/Google.Cloud.PubSub.V1.CreateSnapshotRequest) \n\n public sealed class CreateSnapshotRequest : IMessage\u003cCreateSnapshotRequest\u003e, IEquatable\u003cCreateSnapshotRequest\u003e, IDeepCloneable\u003cCreateSnapshotRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Pub/Sub v1 API class CreateSnapshotRequest.\n\nRequest for the `CreateSnapshot` method. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CreateSnapshotRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateSnapshotRequest](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateSnapshotRequest](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateSnapshotRequest](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest), [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.PubSub.V1](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.PubSub.V1.dll\n\nConstructors\n------------\n\n### CreateSnapshotRequest()\n\n public CreateSnapshotRequest()\n\n### CreateSnapshotRequest(CreateSnapshotRequest)\n\n public CreateSnapshotRequest(CreateSnapshotRequest other)\n\nProperties\n----------\n\n### Labels\n\n public MapField\u003cstring, string\u003e Labels { get; }\n\nOptional. See [Creating and managing\nlabels](https://cloud.google.com/pubsub/docs/labels).\n\n### Name\n\n public string Name { get; set; }\n\nRequired. User-provided name for this snapshot. If the name is not provided\nin the request, the server will assign a random name for this snapshot on\nthe same project as the subscription. Note that for REST API requests, you\nmust specify a name. See the [resource name\nrules](https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).\nFormat is `projects/{project}/snapshots/{snap}`.\n\n### SnapshotName\n\n public SnapshotName SnapshotName { get; set; }\n\n[SnapshotName](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SnapshotName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest#Google_Cloud_PubSub_V1_CreateSnapshotRequest_Name) resource name property.\n\n### Subscription\n\n public string Subscription { get; set; }\n\nRequired. The subscription whose backlog the snapshot retains.\nSpecifically, the created snapshot is guaranteed to retain:\n(a) The existing backlog on the subscription. More precisely, this is\ndefined as the messages in the subscription's backlog that are\nunacknowledged upon the successful completion of the\n`CreateSnapshot` request; as well as:\n(b) Any messages published to the subscription's topic following the\nsuccessful completion of the CreateSnapshot request.\nFormat is `projects/{project}/subscriptions/{sub}`.\n\n### SubscriptionAsSubscriptionName\n\n public SubscriptionName SubscriptionAsSubscriptionName { get; set; }\n\n[SubscriptionName](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriptionName)-typed view over the [Subscription](/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.CreateSnapshotRequest#Google_Cloud_PubSub_V1_CreateSnapshotRequest_Subscription) resource name property."]]