Class CreateTaskRequest.Builder (2.14.0)

publicstaticfinalclass CreateTaskRequest.BuilderextendsGeneratedMessageV3.Builder<CreateTaskRequest.Builder>implementsCreateTaskRequestOrBuilder

Request message for CreateTask.

Protobuf type google.cloud.tasks.v2.CreateTaskRequest

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicCreateTaskRequest.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CreateTaskRequest.Builder
Overrides

build()

publicCreateTaskRequestbuild()
Returns
Type Description
CreateTaskRequest

buildPartial()

publicCreateTaskRequestbuildPartial()
Returns
Type Description
CreateTaskRequest

clear()

publicCreateTaskRequest.Builderclear()
Returns
Type Description
CreateTaskRequest.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicCreateTaskRequest.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
CreateTaskRequest.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

publicCreateTaskRequest.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CreateTaskRequest.Builder
Overrides

clearParent()

publicCreateTaskRequest.BuilderclearParent()

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID The queue must already exist.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

clearResponseView()

publicCreateTaskRequest.BuilderclearResponseView()

The response_view specifies which subset of the Task will be returned. By default response_view is 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 requires cloudtasks.tasks.fullView Google IAM permission on the Task resource.

.google.cloud.tasks.v2.Task.View response_view = 3;

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

clearTask()

publicCreateTaskRequest.BuilderclearTask()

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
CreateTaskRequest.Builder

clone()

publicCreateTaskRequest.Builderclone()
Returns
Type Description
CreateTaskRequest.Builder
Overrides

getDefaultInstanceForType()

publicCreateTaskRequestgetDefaultInstanceForType()
Returns
Type Description
CreateTaskRequest

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getParent()

publicStringgetParent()

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID The queue must already exist.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
String

The parent.

getParentBytes()

publicByteStringgetParentBytes()

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID The queue must already exist.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
Type Description
ByteString

The bytes for parent.

getResponseView()

publicTask.ViewgetResponseView()

The response_view specifies which subset of the Task will be returned. By default response_view is 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 requires cloudtasks.tasks.fullView Google IAM permission on the Task resource.

.google.cloud.tasks.v2.Task.View response_view = 3;

Returns
Type Description
Task.View

The responseView.

getResponseViewValue()

publicintgetResponseViewValue()

The response_view specifies which subset of the Task will be returned. By default response_view is 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 requires cloudtasks.tasks.fullView Google IAM permission on the Task resource.

.google.cloud.tasks.v2.Task.View response_view = 3;

Returns
Type Description
int

The enum numeric value on the wire for responseView.

getTask()

publicTaskgetTask()

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Task

The task.

getTaskBuilder()

publicTask.BuildergetTaskBuilder()

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Task.Builder

getTaskOrBuilder()

publicTaskOrBuildergetTaskOrBuilder()

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
TaskOrBuilder

hasTask()

publicbooleanhasTask()

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the task field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CreateTaskRequest other)

publicCreateTaskRequest.BuildermergeFrom(CreateTaskRequestother)
Parameter
Name Description
other CreateTaskRequest
Returns
Type Description
CreateTaskRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicCreateTaskRequest.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CreateTaskRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicCreateTaskRequest.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
CreateTaskRequest.Builder
Overrides

mergeTask(Task value)

publicCreateTaskRequest.BuildermergeTask(Taskvalue)

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Task
Returns
Type Description
CreateTaskRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalCreateTaskRequest.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CreateTaskRequest.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

publicCreateTaskRequest.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CreateTaskRequest.Builder
Overrides

setParent(String value)

publicCreateTaskRequest.BuildersetParent(Stringvalue)

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID The queue must already exist.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value String

The parent to set.

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

setParentBytes(ByteString value)

publicCreateTaskRequest.BuildersetParentBytes(ByteStringvalue)

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID The queue must already exist.

string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
Name Description
value ByteString

The bytes for parent to set.

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

publicCreateTaskRequest.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CreateTaskRequest.Builder
Overrides

setResponseView(Task.View value)

publicCreateTaskRequest.BuildersetResponseView(Task.Viewvalue)

The response_view specifies which subset of the Task will be returned. By default response_view is 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 requires cloudtasks.tasks.fullView Google IAM permission on the Task resource.

.google.cloud.tasks.v2.Task.View response_view = 3;

Parameter
Name Description
value Task.View

The responseView to set.

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

setResponseViewValue(int value)

publicCreateTaskRequest.BuildersetResponseViewValue(intvalue)

The response_view specifies which subset of the Task will be returned. By default response_view is 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 requires cloudtasks.tasks.fullView Google IAM permission on the Task resource.

.google.cloud.tasks.v2.Task.View response_view = 3;

Parameter
Name Description
value int

The enum numeric value on the wire for responseView to set.

Returns
Type Description
CreateTaskRequest.Builder

This builder for chaining.

setTask(Task value)

publicCreateTaskRequest.BuildersetTask(Taskvalue)

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Task
Returns
Type Description
CreateTaskRequest.Builder

setTask(Task.Builder builderForValue)

publicCreateTaskRequest.BuildersetTask(Task.BuilderbuilderForValue)

Required. The task to add. 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. 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. If 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. If the task's queue was created using Cloud Tasks, then another task with the same name can't be created for ~1hour 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 ~9days after the original task was deleted or executed. Because there is an extra lookup cost to identify duplicate task names, these 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.

.google.cloud.tasks.v2.Task task = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Task.Builder
Returns
Type Description
CreateTaskRequest.Builder

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalCreateTaskRequest.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CreateTaskRequest.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.