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

namespace Google\Cloud\Tasks\V2;

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

/**
 * Request message for [CreateQueue][google.cloud.tasks.v2.CloudTasks.CreateQueue].
 *
 * Generated from protobuf message <code>google.cloud.tasks.v2.CreateQueueRequest</code>
 */
class CreateQueueRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The location name in which the queue will be created.
     * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
     * The list of allowed locations can be obtained by calling Cloud
     * Tasks' implementation of
     * [ListLocations][google.cloud.location.Locations.ListLocations].
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The queue to create.
     * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
     *
     * Generated from protobuf field <code>.google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $queue = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The location name in which the queue will be created.
     *           For example: `projects/PROJECT_ID/locations/LOCATION_ID`
     *           The list of allowed locations can be obtained by calling Cloud
     *           Tasks' implementation of
     *           [ListLocations][google.cloud.location.Locations.ListLocations].
     *     @type \Google\Cloud\Tasks\V2\Queue $queue
     *           Required. The queue to create.
     *           [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Tasks\V2\Cloudtasks::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The location name in which the queue will be created.
     * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
     * The list of allowed locations can be obtained by calling Cloud
     * Tasks' implementation of
     * [ListLocations][google.cloud.location.Locations.ListLocations].
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The location name in which the queue will be created.
     * For example: `projects/PROJECT_ID/locations/LOCATION_ID`
     * The list of allowed locations can be obtained by calling Cloud
     * Tasks' implementation of
     * [ListLocations][google.cloud.location.Locations.ListLocations].
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The queue to create.
     * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
     *
     * Generated from protobuf field <code>.google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Tasks\V2\Queue|null
     */
    public function getQueue()
    {
        return $this->queue;
    }

    public function hasQueue()
    {
        return isset($this->queue);
    }

    public function clearQueue()
    {
        unset($this->queue);
    }

    /**
     * Required. The queue to create.
     * [Queue's name][google.cloud.tasks.v2.Queue.name] cannot be the same as an existing queue.
     *
     * Generated from protobuf field <code>.google.cloud.tasks.v2.Queue queue = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Tasks\V2\Queue $var
     * @return $this
     */
    public function setQueue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Tasks\V2\Queue::class);
        $this->queue = $var;

        return $this;
    }

}

