Google Cloud Tasks V2beta2 Client - Class Task (1.11.11)

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

Methods

__construct

Constructor.

Parameters
NameDescription
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.

↳ 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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Tasks\V2beta2\AppEngineHttpRequest
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Tasks\V2beta2\PullMessage
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getCreateTime

Output only. The time that the task was created.

create_time will be truncated to the nearest second.

Returns
TypeDescription
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
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getStatus

Output only. The task status.

Returns
TypeDescription
Google\Cloud\Tasks\V2beta2\TaskStatus|null

hasStatus

clearStatus

setStatus

Output only. The task status.

Parameter
NameDescription
var Google\Cloud\Tasks\V2beta2\TaskStatus
Returns
TypeDescription
$this

getView

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

Returns
TypeDescription
int

setView

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

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getPayloadType

Returns
TypeDescription
string