google.cloud.translation.v3.DetectedLanguage */ class DetectedLanguage extends \Google\Protobuf\Internal\Message { /** * The BCP-47 language code of source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; */ private $language_code = ''; /** * The confidence of the detection result for this language. * * Generated from protobuf field float confidence = 2; */ private $confidence = 0.0; /** * Constructor. * * @param array $data { * Optional. Data for populating the Message object. * * @type string $language_code * The BCP-47 language code of source content in the request, detected * automatically. * @type float $confidence * The confidence of the detection result for this language. * } */ public function __construct($data = NULL) { \GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce(); parent::__construct($data); } /** * The BCP-47 language code of source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; * @return string */ public function getLanguageCode() { return $this->language_code; } /** * The BCP-47 language code of source content in the request, detected * automatically. * * Generated from protobuf field string language_code = 1; * @param string $var * @return $this */ public function setLanguageCode($var) { GPBUtil::checkString($var, True); $this->language_code = $var; return $this; } /** * The confidence of the detection result for this language. * * Generated from protobuf field float confidence = 2; * @return float */ public function getConfidence() { return $this->confidence; } /** * The confidence of the detection result for this language. * * Generated from protobuf field float confidence = 2; * @param float $var * @return $this */ public function setConfidence($var) { GPBUtil::checkFloat($var); $this->confidence = $var; return $this; } }