<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/tasks/v2beta2/target.proto

namespace Google\Cloud\Tasks\V2beta2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * The pull message contains data that can be used by the caller of
 * [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] to process the task.
 * This proto can only be used for tasks in a queue which has
 * [pull_target][google.cloud.tasks.v2beta2.Queue.pull_target] set.
 *
 * Generated from protobuf message <code>google.cloud.tasks.v2beta2.PullMessage</code>
 */
class PullMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * A data payload consumed by the worker to execute the task.
     *
     * Generated from protobuf field <code>bytes payload = 1;</code>
     */
    private $payload = '';
    /**
     * The task's tag.
     * Tags allow similar tasks to be processed in a batch. If you label
     * tasks with a tag, your worker can
     * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the same tag using
     * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, if you want to
     * aggregate the events associated with a specific user once a day,
     * you could tag tasks with the user ID.
     * The task's tag can only be set when the
     * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
     * The tag must be less than 500 characters.
     * SDK compatibility: Although the SDK allows tags to be either
     * string or [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
     * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
     * encoded, the tag will be empty when the task is returned by Cloud Tasks.
     *
     * Generated from protobuf field <code>string tag = 2;</code>
     */
    private $tag = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $payload
     *           A data payload consumed by the worker to execute the task.
     *     @type string $tag
     *           The task's tag.
     *           Tags allow similar tasks to be processed in a batch. If you label
     *           tasks with a tag, your worker can
     *           [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the same tag using
     *           [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, if you want to
     *           aggregate the events associated with a specific user once a day,
     *           you could tag tasks with the user ID.
     *           The task's tag can only be set when the
     *           [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
     *           The tag must be less than 500 characters.
     *           SDK compatibility: Although the SDK allows tags to be either
     *           string or [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
     *           only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
     *           encoded, the tag will be empty when the task is returned by Cloud Tasks.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Tasks\V2Beta2\Target::initOnce();
        parent::__construct($data);
    }

    /**
     * A data payload consumed by the worker to execute the task.
     *
     * Generated from protobuf field <code>bytes payload = 1;</code>
     * @return string
     */
    public function getPayload()
    {
        return $this->payload;
    }

    /**
     * A data payload consumed by the worker to execute the task.
     *
     * Generated from protobuf field <code>bytes payload = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPayload($var)
    {
        GPBUtil::checkString($var, False);
        $this->payload = $var;

        return $this;
    }

    /**
     * The task's tag.
     * Tags allow similar tasks to be processed in a batch. If you label
     * tasks with a tag, your worker can
     * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the same tag using
     * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, if you want to
     * aggregate the events associated with a specific user once a day,
     * you could tag tasks with the user ID.
     * The task's tag can only be set when the
     * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
     * The tag must be less than 500 characters.
     * SDK compatibility: Although the SDK allows tags to be either
     * string or [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
     * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
     * encoded, the tag will be empty when the task is returned by Cloud Tasks.
     *
     * Generated from protobuf field <code>string tag = 2;</code>
     * @return string
     */
    public function getTag()
    {
        return $this->tag;
    }

    /**
     * The task's tag.
     * Tags allow similar tasks to be processed in a batch. If you label
     * tasks with a tag, your worker can
     * [lease tasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks] with the same tag using
     * [filter][google.cloud.tasks.v2beta2.LeaseTasksRequest.filter]. For example, if you want to
     * aggregate the events associated with a specific user once a day,
     * you could tag tasks with the user ID.
     * The task's tag can only be set when the
     * [task is created][google.cloud.tasks.v2beta2.CloudTasks.CreateTask].
     * The tag must be less than 500 characters.
     * SDK compatibility: Although the SDK allows tags to be either
     * string or [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
     * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
     * encoded, the tag will be empty when the task is returned by Cloud Tasks.
     *
     * Generated from protobuf field <code>string tag = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setTag($var)
    {
        GPBUtil::checkString($var, True);
        $this->tag = $var;

        return $this;
    }

}

