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

namespace Google\Cloud\Dialogflow\V2\Intent;

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

/**
 * Represents an example or template that the agent is trained on.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Intent.TrainingPhrase</code>
 */
class TrainingPhrase extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The unique identifier of this training phrase.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Required. The type of the training phrase.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;</code>
     */
    private $type = 0;
    /**
     * Required. The collection of training phrase parts (can be annotated).
     * Fields: `entity_type`, `alias` and `user_defined` should be populated
     * only for the annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;</code>
     */
    private $parts;
    /**
     * Optional. Indicates how many times this example or template was added to
     * the intent. Each time a developer adds an existing sample by editing an
     * intent or training, this counter is increased.
     *
     * Generated from protobuf field <code>int32 times_added_count = 4;</code>
     */
    private $times_added_count = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. The unique identifier of this training phrase.
     *     @type int $type
     *           Required. The type of the training phrase.
     *     @type \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part[]|\Google\Protobuf\Internal\RepeatedField $parts
     *           Required. The collection of training phrase parts (can be annotated).
     *           Fields: `entity_type`, `alias` and `user_defined` should be populated
     *           only for the annotated parts of the training phrase.
     *     @type int $times_added_count
     *           Optional. Indicates how many times this example or template was added to
     *           the intent. Each time a developer adds an existing sample by editing an
     *           intent or training, this counter is increased.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The unique identifier of this training phrase.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. The unique identifier of this training phrase.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. The type of the training phrase.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Required. The type of the training phrase.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase_Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Required. The collection of training phrase parts (can be annotated).
     * Fields: `entity_type`, `alias` and `user_defined` should be populated
     * only for the annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getParts()
    {
        return $this->parts;
    }

    /**
     * Required. The collection of training phrase parts (can be annotated).
     * Fields: `entity_type`, `alias` and `user_defined` should be populated
     * only for the annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;</code>
     * @param \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setParts($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase\Part::class);
        $this->parts = $arr;

        return $this;
    }

    /**
     * Optional. Indicates how many times this example or template was added to
     * the intent. Each time a developer adds an existing sample by editing an
     * intent or training, this counter is increased.
     *
     * Generated from protobuf field <code>int32 times_added_count = 4;</code>
     * @return int
     */
    public function getTimesAddedCount()
    {
        return $this->times_added_count;
    }

    /**
     * Optional. Indicates how many times this example or template was added to
     * the intent. Each time a developer adds an existing sample by editing an
     * intent or training, this counter is increased.
     *
     * Generated from protobuf field <code>int32 times_added_count = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setTimesAddedCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->times_added_count = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TrainingPhrase::class, \Google\Cloud\Dialogflow\V2\Intent_TrainingPhrase::class);

