Reference documentation and code samples for the Google Cloud Tasks V2 Client class RunTaskRequest.
Request message for forcing a task to run now using
RunTask.
Generated from protobuf message google.cloud.tasks.v2.RunTaskRequest
Namespace
Google \ Cloud \ Tasks \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
Required. The task name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
↳ response_view
int
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.fullViewGoogle IAM permission on the Task resource.
getName
Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
Returns
Type
Description
string
setName
Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getResponseView
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.fullViewGoogle IAM
permission on the Task resource.
Returns
Type
Description
int
setResponseView
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.fullViewGoogle IAM
permission on the Task resource.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
static::build
Parameter
Name
Description
name
string
Required. The task name. For example:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID
Please see CloudTasksClient::taskName() for help formatting this field.
[[["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."],[],[],null,["# Google Cloud Tasks V2 Client - Class RunTaskRequest (2.0.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.2 (latest)](/php/docs/reference/cloud-tasks/latest/V2.RunTaskRequest)\n- [2.0.1](/php/docs/reference/cloud-tasks/2.0.1/V2.RunTaskRequest)\n- [1.15.2](/php/docs/reference/cloud-tasks/1.15.2/V2.RunTaskRequest)\n- [1.14.6](/php/docs/reference/cloud-tasks/1.14.6/V2.RunTaskRequest)\n- [1.13.2](/php/docs/reference/cloud-tasks/1.13.2/V2.RunTaskRequest)\n- [1.12.2](/php/docs/reference/cloud-tasks/1.12.2/V2.RunTaskRequest)\n- [1.11.11](/php/docs/reference/cloud-tasks/1.11.11/V2.RunTaskRequest) \nReference documentation and code samples for the Google Cloud Tasks V2 Client class RunTaskRequest.\n\nRequest message for forcing a task to run now using\n[RunTask](/php/docs/reference/cloud-tasks/latest/V2.Client.CloudTasksClient#_Google_Cloud_Tasks_V2_Client_CloudTasksClient__runTask__).\n\nGenerated from protobuf message `google.cloud.tasks.v2.RunTaskRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Tasks \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nRequired. The task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`\n\n### setName\n\nRequired. The task name. For example:\n`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`\n\n### getResponseView\n\nThe response_view specifies which subset of the\n[Task](/php/docs/reference/cloud-tasks/latest/V2.Task) will be returned.\n\nBy default response_view is [BASIC](/php/docs/reference/cloud-tasks/latest/V2.Task.View#_Google_Cloud_Tasks_V2_Task_View__BASIC);\nnot all information is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\nAuthorization for [FULL](/php/docs/reference/cloud-tasks/latest/V2.Task.View#_Google_Cloud_Tasks_V2_Task_View__FULL) requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the [Task](/php/docs/reference/cloud-tasks/latest/V2.Task) resource.\n\n### setResponseView\n\nThe response_view specifies which subset of the\n[Task](/php/docs/reference/cloud-tasks/latest/V2.Task) will be returned.\n\nBy default response_view is [BASIC](/php/docs/reference/cloud-tasks/latest/V2.Task.View#_Google_Cloud_Tasks_V2_Task_View__BASIC);\nnot all information is retrieved by default because some data, such as\npayloads, might be desirable to return only when needed because\nof its large size or because of the sensitivity of data that it\ncontains.\nAuthorization for [FULL](/php/docs/reference/cloud-tasks/latest/V2.Task.View#_Google_Cloud_Tasks_V2_Task_View__FULL) requires\n`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)\npermission on the [Task](/php/docs/reference/cloud-tasks/latest/V2.Task) resource.\n\n### static::build"]]