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

namespace Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase;

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

/**
 * Represents a part of a training phrase.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part</code>
 */
class Part extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The text for this part.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     */
    private $text = '';
    /**
     * Optional. The entity type name prefixed with `&#64;`.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $entity_type = '';
    /**
     * Optional. The parameter name for the value extracted from the
     * annotated part of the example.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $alias = '';
    /**
     * Optional. Indicates whether the text was manually annotated.
     * This field is set to true when the Dialogflow Console is used to
     * manually annotate the part. When creating an annotated part with the
     * API, you must set this to true.
     *
     * Generated from protobuf field <code>bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $user_defined = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $text
     *           Required. The text for this part.
     *     @type string $entity_type
     *           Optional. The entity type name prefixed with `&#64;`.
     *           This field is required for annotated parts of the training phrase.
     *     @type string $alias
     *           Optional. The parameter name for the value extracted from the
     *           annotated part of the example.
     *           This field is required for annotated parts of the training phrase.
     *     @type bool $user_defined
     *           Optional. Indicates whether the text was manually annotated.
     *           This field is set to true when the Dialogflow Console is used to
     *           manually annotate the part. When creating an annotated part with the
     *           API, you must set this to true.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The text for this part.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @return string
     */
    public function getText()
    {
        return $this->text;
    }

    /**
     * Required. The text for this part.
     *
     * Generated from protobuf field <code>string text = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Optional. The entity type name prefixed with `&#64;`.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getEntityType()
    {
        return $this->entity_type;
    }

    /**
     * Optional. The entity type name prefixed with `&#64;`.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string entity_type = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setEntityType($var)
    {
        GPBUtil::checkString($var, True);
        $this->entity_type = $var;

        return $this;
    }

    /**
     * Optional. The parameter name for the value extracted from the
     * annotated part of the example.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAlias()
    {
        return $this->alias;
    }

    /**
     * Optional. The parameter name for the value extracted from the
     * annotated part of the example.
     * This field is required for annotated parts of the training phrase.
     *
     * Generated from protobuf field <code>string alias = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAlias($var)
    {
        GPBUtil::checkString($var, True);
        $this->alias = $var;

        return $this;
    }

    /**
     * Optional. Indicates whether the text was manually annotated.
     * This field is set to true when the Dialogflow Console is used to
     * manually annotate the part. When creating an annotated part with the
     * API, you must set this to true.
     *
     * Generated from protobuf field <code>bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return bool
     */
    public function getUserDefined()
    {
        return $this->user_defined;
    }

    /**
     * Optional. Indicates whether the text was manually annotated.
     * This field is set to true when the Dialogflow Console is used to
     * manually annotate the part. When creating an annotated part with the
     * API, you must set this to true.
     *
     * Generated from protobuf field <code>bool user_defined = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param bool $var
     * @return $this
     */
    public function setUserDefined($var)
    {
        GPBUtil::checkBool($var);
        $this->user_defined = $var;

        return $this;
    }

}

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

