public sealed class CreateTaskRequest : IMessage<CreateTaskRequest>, IEquatable<CreateTaskRequest>, IDeepCloneable<CreateTaskRequest>, IBufferMessage, IMessage
Reference documentation and code samples for the Google Cloud Tasks v2beta3 API class CreateTaskRequest.
Request message for
[CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
The response_view specifies which subset of the
[Task][google.cloud.tasks.v2beta3.Task] will be returned.
By default response_view is
[BASIC][google.cloud.tasks.v2beta3.Task.View.BASIC]; not all information is
retrieved by default because some data, such as payloads, might be
desirable to return only when needed because of its large size or because
of the sensitivity of data that it contains.
Authorization for [FULL][google.cloud.tasks.v2beta3.Task.View.FULL]
requires cloudtasks.tasks.fullViewGoogle
IAM permission on the
[Task][google.cloud.tasks.v2beta3.Task] resource.
Task names have the following format:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID.
The user can optionally specify a task
[name][google.cloud.tasks.v2beta3.Task.name]. If a name is not specified
then the system will generate a random unique task id, which will be set in
the task returned in the [response][google.cloud.tasks.v2beta3.Task.name].
If [schedule_time][google.cloud.tasks.v2beta3.Task.schedule_time] is not
set or is in the past then Cloud Tasks will set it to the current time.
Task De-duplication:
Explicitly specifying a task ID enables task de-duplication. If
a task's ID is identical to that of an existing task or a task
that was deleted or executed recently then the call will fail
with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
If the task's queue was created using Cloud Tasks, then another task with
the same name can't be created for ~1 hour after the original task was
deleted or executed. If the task's queue was created using queue.yaml or
queue.xml, then another task with the same name can't be created
for ~9 days after the original task was deleted or executed.
Because there is an extra lookup cost to identify duplicate task
names, these [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]
calls have significantly increased latency. Using hashed strings for the
task id or for the prefix of the task id is recommended. Choosing task ids
that are sequential or have sequential prefixes, for example using a
timestamp, causes an increase in latency and error rates in all
task commands. The infrastructure relies on an approximately
uniform distribution of task ids to store and serve tasks
efficiently.
[[["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-04 UTC."],[[["\u003cp\u003eThis document provides reference information for the \u003ccode\u003eCreateTaskRequest\u003c/code\u003e class within the Google Cloud Tasks v2beta3 API, specifically for the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCreateTaskRequest\u003c/code\u003e is a request message class used for creating tasks within Google Cloud Tasks, and it implements several interfaces like \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, and \u003ccode\u003eIDeepCloneable\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreateTaskRequest\u003c/code\u003e class includes properties such as \u003ccode\u003eParent\u003c/code\u003e (the queue name), \u003ccode\u003eParentAsQueueName\u003c/code\u003e (a typed view of the queue name), \u003ccode\u003eResponseView\u003c/code\u003e (specifying which subset of task information to return), and \u003ccode\u003eTask\u003c/code\u003e (the task to be added).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTask\u003c/code\u003e property allows you to define the details of the task, and if a task name is not provided, the system generates a unique task ID, and it also supports task de-duplication.\u003c/p\u003e\n"],["\u003cp\u003eThere are three different versions available to select from for this class, the latest being 3.0.0-beta07, which is accessible by navigating to the appropriate link.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Tasks v2beta3 API - Class CreateTaskRequest (3.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [3.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest)\n- [3.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/3.0.0-beta06/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest)\n- [2.0.0-beta08](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/2.0.0-beta08/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest) \n\n public sealed class CreateTaskRequest : IMessage\u003cCreateTaskRequest\u003e, IEquatable\u003cCreateTaskRequest\u003e, IDeepCloneable\u003cCreateTaskRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Tasks v2beta3 API class CreateTaskRequest.\n\nRequest message for\n\\[CreateTask\\]\\[google.cloud.tasks.v2beta3.CloudTasks.CreateTask\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CreateTaskRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CreateTaskRequest](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CreateTaskRequest](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CreateTaskRequest](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest), [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.Tasks.V2Beta3](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3)\n\nAssembly\n--------\n\nGoogle.Cloud.Tasks.V2Beta3.dll\n\nConstructors\n------------\n\n### CreateTaskRequest()\n\n public CreateTaskRequest()\n\n### CreateTaskRequest(CreateTaskRequest)\n\n public CreateTaskRequest(CreateTaskRequest other)\n\nProperties\n----------\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. The queue name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`\n\nThe queue must already exist.\n\n### ParentAsQueueName\n\n public QueueName ParentAsQueueName { get; set; }\n\n[QueueName](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.QueueName)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.Tasks.V2Beta3/latest/Google.Cloud.Tasks.V2Beta3.CreateTaskRequest#Google_Cloud_Tasks_V2Beta3_CreateTaskRequest_Parent) resource name property.\n\n### ResponseView\n\n public Task.Types.View ResponseView { get; set; }\n\nThe response_view specifies which subset of the\n\\[Task\\]\\[google.cloud.tasks.v2beta3.Task\\] will be returned.\n\nBy default response_view is\n\\[BASIC\\]\\[google.cloud.tasks.v2beta3.Task.View.BASIC\\]; not all information is\nretrieved by default because some data, such as payloads, might be\ndesirable to return only when needed because of its large size or because\nof the sensitivity of data that it contains.\n\nAuthorization for \\[FULL\\]\\[google.cloud.tasks.v2beta3.Task.View.FULL\\]\nrequires `cloudtasks.tasks.fullView` [Google\nIAM](https://cloud.google.com/iam/) permission on the\n\\[Task\\]\\[google.cloud.tasks.v2beta3.Task\\] resource.\n\n### Task\n\n public Task Task { get; set; }\n\nRequired. The task to add.\n\nTask names have the following format:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.\nThe user can optionally specify a task\n\\[name\\]\\[google.cloud.tasks.v2beta3.Task.name\\]. If a name is not specified\nthen the system will generate a random unique task id, which will be set in\nthe task returned in the \\[response\\]\\[google.cloud.tasks.v2beta3.Task.name\\].\n\nIf \\[schedule_time\\]\\[google.cloud.tasks.v2beta3.Task.schedule_time\\] is not\nset or is in the past then Cloud Tasks will set it to the current time.\n\nTask De-duplication:\n\nExplicitly specifying a task ID enables task de-duplication. If\na task's ID is identical to that of an existing task or a task\nthat was deleted or executed recently then the call will fail\nwith \\[ALREADY_EXISTS\\]\\[google.rpc.Code.ALREADY_EXISTS\\].\nIf the task's queue was created using Cloud Tasks, then another task with\nthe same name can't be created for \\~1 hour after the original task was\ndeleted or executed. If the task's queue was created using queue.yaml or\nqueue.xml, then another task with the same name can't be created\nfor \\~9 days after the original task was deleted or executed.\n\nBecause there is an extra lookup cost to identify duplicate task\nnames, these \\[CreateTask\\]\\[google.cloud.tasks.v2beta3.CloudTasks.CreateTask\\]\ncalls have significantly increased latency. Using hashed strings for the\ntask id or for the prefix of the task id is recommended. Choosing task ids\nthat are sequential or have sequential prefixes, for example using a\ntimestamp, causes an increase in latency and error rates in all\ntask commands. The infrastructure relies on an approximately\nuniform distribution of task ids to store and serve tasks\nefficiently."]]