google.cloud.translation.v3.TranslateTextResponse
*/
class TranslateTextResponse extends \Google\Protobuf\Internal\Message
{
/**
* Text translation responses with no glossary applied.
* This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation translations = 1;
*/
private $translations;
/**
* Text translation responses if a glossary is provided in the request.
* This can be the same as
* [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations]
* if no terms apply. This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation glossary_translations = 3;
*/
private $glossary_translations;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Google\Cloud\Translate\V3\Translation[]|\Google\Protobuf\Internal\RepeatedField $translations
* Text translation responses with no glossary applied.
* This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
* @type \Google\Cloud\Translate\V3\Translation[]|\Google\Protobuf\Internal\RepeatedField $glossary_translations
* Text translation responses if a glossary is provided in the request.
* This can be the same as
* [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations]
* if no terms apply. This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce();
parent::__construct($data);
}
/**
* Text translation responses with no glossary applied.
* This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation translations = 1;
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getTranslations()
{
return $this->translations;
}
/**
* Text translation responses with no glossary applied.
* This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation translations = 1;
* @param \Google\Cloud\Translate\V3\Translation[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setTranslations($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Translate\V3\Translation::class);
$this->translations = $arr;
return $this;
}
/**
* Text translation responses if a glossary is provided in the request.
* This can be the same as
* [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations]
* if no terms apply. This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation glossary_translations = 3;
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getGlossaryTranslations()
{
return $this->glossary_translations;
}
/**
* Text translation responses if a glossary is provided in the request.
* This can be the same as
* [`translations`][google.cloud.translation.v3.TranslateTextResponse.translations]
* if no terms apply. This field has the same length as
* [`contents`][google.cloud.translation.v3.TranslateTextRequest.contents].
*
* Generated from protobuf field repeated .google.cloud.translation.v3.Translation glossary_translations = 3;
* @param \Google\Cloud\Translate\V3\Translation[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setGlossaryTranslations($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Translate\V3\Translation::class);
$this->glossary_translations = $arr;
return $this;
}
}