<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/cloudbuild/v1/cloudbuild.proto

namespace Google\Cloud\Build\V1;

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

/**
 * Request to create a new `WorkerPool`.
 *
 * Generated from protobuf message <code>google.devtools.cloudbuild.v1.CreateWorkerPoolRequest</code>
 */
class CreateWorkerPoolRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * ID of the parent project.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     */
    private $parent = '';
    /**
     * `WorkerPool` resource to create.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2;</code>
     */
    private $worker_pool = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           ID of the parent project.
     *     @type \Google\Cloud\Build\V1\WorkerPool $worker_pool
     *           `WorkerPool` resource to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Devtools\Cloudbuild\V1\Cloudbuild::initOnce();
        parent::__construct($data);
    }

    /**
     * ID of the parent project.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * ID of the parent project.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * `WorkerPool` resource to create.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2;</code>
     * @return \Google\Cloud\Build\V1\WorkerPool|null
     */
    public function getWorkerPool()
    {
        return isset($this->worker_pool) ? $this->worker_pool : null;
    }

    public function hasWorkerPool()
    {
        return isset($this->worker_pool);
    }

    public function clearWorkerPool()
    {
        unset($this->worker_pool);
    }

    /**
     * `WorkerPool` resource to create.
     *
     * Generated from protobuf field <code>.google.devtools.cloudbuild.v1.WorkerPool worker_pool = 2;</code>
     * @param \Google\Cloud\Build\V1\WorkerPool $var
     * @return $this
     */
    public function setWorkerPool($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Build\V1\WorkerPool::class);
        $this->worker_pool = $var;

        return $this;
    }

}

