Google Cloud Tasks V2beta2 Client - Class Task (1.14.6)

Reference documentation and code samples for the Google Cloud Tasks V2beta2 Client class Task.

A unit of scheduled work.

Generated from protobuf message google.cloud.tasks.v2beta2.Task

Namespace

Google \ Cloud \ Tasks \ V2beta2

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

Optionally caller-specified in CreateTask. The task name. The task name must have the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID * PROJECT_ID can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see Identifying projects * LOCATION_ID is the canonical ID for the task's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * QUEUE_ID can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters. * TASK_ID can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.

↳ app_engine_http_request Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest

App Engine HTTP request that is sent to the task's target. Can be set only if app_engine_http_target is set on the queue. An App Engine task is a task that has AppEngineHttpRequest set.

↳ pull_message Google\Cloud\Tasks\V2beta2\PullMessage

LeaseTasks to process the task. Can be set only if pull_target is set on the queue. A pull task is a task that has PullMessage set.

↳ http_request Google\Cloud\Tasks\V2beta2\HttpRequest

HTTP request that is sent to the task's target. An HTTP task is a task that has HttpRequest set.

↳ schedule_time Google\Protobuf\Timestamp

The time when the task is scheduled to be attempted. For App Engine queues, this is when the task will be attempted or retried. For pull queues, this is the time when the task is available to be leased; if a task is currently leased, this is the time when the current lease expires, that is, the time that the task was leased plus the lease_duration. schedule_time will be truncated to the nearest microsecond.

↳ create_time Google\Protobuf\Timestamp

Output only. The time that the task was created. create_time will be truncated to the nearest second.

↳ status Google\Cloud\Tasks\V2beta2\TaskStatus

Output only. The task status.

↳ view int

Output only. The view specifies which subset of the Task has been returned.

getName

Optionally caller-specified in CreateTask.

The task name. The task name must have the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID

  • PROJECT_ID can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see Identifying projects
  • LOCATION_ID is the canonical ID for the task's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/.
  • QUEUE_ID can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.
  • TASK_ID can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
Returns
Type Description
string

setName

Optionally caller-specified in CreateTask.

The task name. The task name must have the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID

  • PROJECT_ID can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see Identifying projects
  • LOCATION_ID is the canonical ID for the task's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/.
  • QUEUE_ID can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.
  • TASK_ID can contain only letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The maximum length is 500 characters.
Parameter
Name Description
var string
Returns
Type Description
$this

getAppEngineHttpRequest

App Engine HTTP request that is sent to the task's target. Can be set only if app_engine_http_target is set on the queue.

An App Engine task is a task that has AppEngineHttpRequest set.

Returns
Type Description
Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest|null

hasAppEngineHttpRequest

setAppEngineHttpRequest

App Engine HTTP request that is sent to the task's target. Can be set only if app_engine_http_target is set on the queue.

An App Engine task is a task that has AppEngineHttpRequest set.

Parameter
Name Description
var Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest
Returns
Type Description
$this

getPullMessage

LeaseTasks to process the task. Can be set only if pull_target is set on the queue.

A pull task is a task that has PullMessage set.

Returns
Type Description
Google\Cloud\Tasks\V2beta2\PullMessage|null

hasPullMessage

setPullMessage

LeaseTasks to process the task. Can be set only if pull_target is set on the queue.

A pull task is a task that has PullMessage set.

Parameter
Name Description
var Google\Cloud\Tasks\V2beta2\PullMessage
Returns
Type Description
$this

getHttpRequest

HTTP request that is sent to the task's target.

An HTTP task is a task that has HttpRequest set.

Returns
Type Description
Google\Cloud\Tasks\V2beta2\HttpRequest|null

hasHttpRequest

setHttpRequest

HTTP request that is sent to the task's target.

An HTTP task is a task that has HttpRequest set.

Parameter
Name Description
var Google\Cloud\Tasks\V2beta2\HttpRequest
Returns
Type Description
$this

getScheduleTime

The time when the task is scheduled to be attempted.

For App Engine queues, this is when the task will be attempted or retried. For pull queues, this is the time when the task is available to be leased; if a task is currently leased, this is the time when the current lease expires, that is, the time that the task was leased plus the lease_duration. schedule_time will be truncated to the nearest microsecond.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasScheduleTime

clearScheduleTime

setScheduleTime

The time when the task is scheduled to be attempted.

For App Engine queues, this is when the task will be attempted or retried. For pull queues, this is the time when the task is available to be leased; if a task is currently leased, this is the time when the current lease expires, that is, the time that the task was leased plus the lease_duration. schedule_time will be truncated to the nearest microsecond.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getCreateTime

Output only. The time that the task was created.

create_time will be truncated to the nearest second.

Returns
Type Description
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. The time that the task was created.

create_time will be truncated to the nearest second.

Parameter
Name Description
var Google\Protobuf\Timestamp
Returns
Type Description
$this

getStatus

Output only. The task status.

Returns
Type Description
Google\Cloud\Tasks\V2beta2\TaskStatus|null

hasStatus

clearStatus

setStatus

Output only. The task status.

Parameter
Name Description
var Google\Cloud\Tasks\V2beta2\TaskStatus
Returns
Type Description
$this

getView

Output only. The view specifies which subset of the Task has been returned.

Returns
Type Description
int

setView

Output only. The view specifies which subset of the Task has been returned.

Parameter
Name Description
var int
Returns
Type Description
$this

getPayloadType

Returns
Type Description
string