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

namespace Google\Cloud\Speech\V2;

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

/**
 * Request message for the
 * [CreatePhraseSet][google.cloud.speech.v2.Speech.CreatePhraseSet] method.
 *
 * Generated from protobuf message <code>google.cloud.speech.v2.CreatePhraseSetRequest</code>
 */
class CreatePhraseSetRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The PhraseSet to create.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $phrase_set = null;
    /**
     * If set, validate the request and preview the PhraseSet, but do not
     * actually create it.
     *
     * Generated from protobuf field <code>bool validate_only = 2;</code>
     */
    private $validate_only = false;
    /**
     * The ID to use for the PhraseSet, which will become the final component of
     * the PhraseSet's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string phrase_set_id = 3;</code>
     */
    private $phrase_set_id = '';
    /**
     * Required. The project and location where this PhraseSet will be created.
     * The expected format is `projects/{project}/locations/{location}`.
     *
     * Generated from protobuf field <code>string parent = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Speech\V2\PhraseSet $phrase_set
     *           Required. The PhraseSet to create.
     *     @type bool $validate_only
     *           If set, validate the request and preview the PhraseSet, but do not
     *           actually create it.
     *     @type string $phrase_set_id
     *           The ID to use for the PhraseSet, which will become the final component of
     *           the PhraseSet's resource name.
     *           This value should be 4-63 characters, and valid characters
     *           are /[a-z][0-9]-/.
     *     @type string $parent
     *           Required. The project and location where this PhraseSet will be created.
     *           The expected format is `projects/{project}/locations/{location}`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V2\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The PhraseSet to create.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Speech\V2\PhraseSet|null
     */
    public function getPhraseSet()
    {
        return $this->phrase_set;
    }

    public function hasPhraseSet()
    {
        return isset($this->phrase_set);
    }

    public function clearPhraseSet()
    {
        unset($this->phrase_set);
    }

    /**
     * Required. The PhraseSet to create.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.PhraseSet phrase_set = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Speech\V2\PhraseSet $var
     * @return $this
     */
    public function setPhraseSet($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\PhraseSet::class);
        $this->phrase_set = $var;

        return $this;
    }

    /**
     * If set, validate the request and preview the PhraseSet, but do not
     * actually create it.
     *
     * Generated from protobuf field <code>bool validate_only = 2;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * If set, validate the request and preview the PhraseSet, but do not
     * actually create it.
     *
     * Generated from protobuf field <code>bool validate_only = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

    /**
     * The ID to use for the PhraseSet, which will become the final component of
     * the PhraseSet's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string phrase_set_id = 3;</code>
     * @return string
     */
    public function getPhraseSetId()
    {
        return $this->phrase_set_id;
    }

    /**
     * The ID to use for the PhraseSet, which will become the final component of
     * the PhraseSet's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string phrase_set_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setPhraseSetId($var)
    {
        GPBUtil::checkString($var, True);
        $this->phrase_set_id = $var;

        return $this;
    }

    /**
     * Required. The project and location where this PhraseSet will be created.
     * The expected format is `projects/{project}/locations/{location}`.
     *
     * Generated from protobuf field <code>string parent = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The project and location where this PhraseSet will be created.
     * The expected format is `projects/{project}/locations/{location}`.
     *
     * Generated from protobuf field <code>string parent = 4 [(.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;
    }

}

