<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/cx/v3/playbook.proto

namespace Google\Cloud\Dialogflow\Cx\V3;

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

/**
 * The request message for
 * [Playbooks.CreatePlaybook][google.cloud.dialogflow.cx.v3.Playbooks.CreatePlaybook].
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.CreatePlaybookRequest</code>
 */
class CreatePlaybookRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The agent to create a playbook for.
     * Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. The playbook to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Playbook playbook = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $playbook = null;

    /**
     * @param string                                  $parent   Required. The agent to create a playbook for.
     *                                                          Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`. Please see
     *                                                          {@see PlaybooksClient::agentName()} for help formatting this field.
     * @param \Google\Cloud\Dialogflow\Cx\V3\Playbook $playbook Required. The playbook to create.
     *
     * @return \Google\Cloud\Dialogflow\Cx\V3\CreatePlaybookRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Dialogflow\Cx\V3\Playbook $playbook): self
    {
        return (new self())
            ->setParent($parent)
            ->setPlaybook($playbook);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The agent to create a playbook for.
     *           Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
     *     @type \Google\Cloud\Dialogflow\Cx\V3\Playbook $playbook
     *           Required. The playbook to create.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\Playbook::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The agent to create a playbook for.
     * Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
     *
     * 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 agent to create a playbook for.
     * Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.
     *
     * 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 playbook to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Playbook playbook = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Dialogflow\Cx\V3\Playbook|null
     */
    public function getPlaybook()
    {
        return $this->playbook;
    }

    public function hasPlaybook()
    {
        return isset($this->playbook);
    }

    public function clearPlaybook()
    {
        unset($this->playbook);
    }

    /**
     * Required. The playbook to create.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.cx.v3.Playbook playbook = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Dialogflow\Cx\V3\Playbook $var
     * @return $this
     */
    public function setPlaybook($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dialogflow\Cx\V3\Playbook::class);
        $this->playbook = $var;

        return $this;
    }

}

