google.cloud.dialogflow.v2.Intent.TrainingPhrase
*/
class Intent_TrainingPhrase extends \Google\Protobuf\Internal\Message
{
/**
* Required. The unique identifier of this training phrase.
*
* Generated from protobuf field string name = 1;
*/
private $name = '';
/**
* Required. The type of the training phrase.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;
*/
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 repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;
*/
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 int32 times_added_count = 4;
*/
private $times_added_count = 0;
public function __construct() {
\GPBMetadata\Google\Cloud\Dialogflow\V2\Intent::initOnce();
parent::__construct();
}
/**
* Required. The unique identifier of this training phrase.
*
* Generated from protobuf field string name = 1;
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Required. The unique identifier of this training phrase.
*
* Generated from protobuf field string name = 1;
* @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 .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;
* @return int
*/
public function getType()
{
return $this->type;
}
/**
* Required. The type of the training phrase.
*
* Generated from protobuf field .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type type = 2;
* @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 repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;
* @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 repeated .google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part parts = 3;
* @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 int32 times_added_count = 4;
* @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 int32 times_added_count = 4;
* @param int $var
* @return $this
*/
public function setTimesAddedCount($var)
{
GPBUtil::checkInt32($var);
$this->times_added_count = $var;
return $this;
}
}