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

namespace Google\Cloud\Tasks\V2beta3;

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

/**
 * Request message for
 * [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask].
 *
 * Generated from protobuf message <code>google.cloud.tasks.v2beta3.BufferTaskRequest</code>
 */
class BufferTaskRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent queue name. For example:
     * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
     * The queue must already exist.
     *
     * Generated from protobuf field <code>string queue = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $queue = '';
    /**
     * Optional. Task ID for the task being created. If not provided, a random
     * task ID is assigned to the task.
     *
     * Generated from protobuf field <code>string task_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $task_id = '';
    /**
     * Optional. Body of the HTTP request.
     * The body can take any generic value. The value is written to the
     * [HttpRequest][payload] of the [Task].
     *
     * Generated from protobuf field <code>.google.api.HttpBody body = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $body = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $queue
     *           Required. The parent queue name. For example:
     *           projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
     *           The queue must already exist.
     *     @type string $task_id
     *           Optional. Task ID for the task being created. If not provided, a random
     *           task ID is assigned to the task.
     *     @type \Google\Api\HttpBody $body
     *           Optional. Body of the HTTP request.
     *           The body can take any generic value. The value is written to the
     *           [HttpRequest][payload] of the [Task].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Tasks\V2Beta3\Cloudtasks::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent queue name. For example:
     * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
     * The queue must already exist.
     *
     * Generated from protobuf field <code>string queue = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getQueue()
    {
        return $this->queue;
    }

    /**
     * Required. The parent queue name. For example:
     * projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
     * The queue must already exist.
     *
     * Generated from protobuf field <code>string queue = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setQueue($var)
    {
        GPBUtil::checkString($var, True);
        $this->queue = $var;

        return $this;
    }

    /**
     * Optional. Task ID for the task being created. If not provided, a random
     * task ID is assigned to the task.
     *
     * Generated from protobuf field <code>string task_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getTaskId()
    {
        return $this->task_id;
    }

    /**
     * Optional. Task ID for the task being created. If not provided, a random
     * task ID is assigned to the task.
     *
     * Generated from protobuf field <code>string task_id = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setTaskId($var)
    {
        GPBUtil::checkString($var, True);
        $this->task_id = $var;

        return $this;
    }

    /**
     * Optional. Body of the HTTP request.
     * The body can take any generic value. The value is written to the
     * [HttpRequest][payload] of the [Task].
     *
     * Generated from protobuf field <code>.google.api.HttpBody body = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Api\HttpBody|null
     */
    public function getBody()
    {
        return $this->body;
    }

    public function hasBody()
    {
        return isset($this->body);
    }

    public function clearBody()
    {
        unset($this->body);
    }

    /**
     * Optional. Body of the HTTP request.
     * The body can take any generic value. The value is written to the
     * [HttpRequest][payload] of the [Task].
     *
     * Generated from protobuf field <code>.google.api.HttpBody body = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Api\HttpBody $var
     * @return $this
     */
    public function setBody($var)
    {
        GPBUtil::checkMessage($var, \Google\Api\HttpBody::class);
        $this->body = $var;

        return $this;
    }

}

