<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/mediatranslation/v1beta1/media_translation.proto

namespace Google\Cloud\MediaTranslation\V1beta1\StreamingTranslateSpeechResult;

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

/**
 * Text translation result.
 *
 * Generated from protobuf message <code>google.cloud.mediatranslation.v1beta1.StreamingTranslateSpeechResult.TextTranslationResult</code>
 */
class TextTranslationResult extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The translated sentence.
     *
     * Generated from protobuf field <code>string translation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $translation = '';
    /**
     * Output only. If `false`, this `StreamingTranslateSpeechResult` represents
     * an interim result that may change. If `true`, this is the final time the
     * translation service will return this particular
     * `StreamingTranslateSpeechResult`, the streaming translator will not
     * return any further hypotheses for this portion of the transcript and
     * corresponding audio.
     *
     * Generated from protobuf field <code>bool is_final = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $is_final = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $translation
     *           Output only. The translated sentence.
     *     @type bool $is_final
     *           Output only. If `false`, this `StreamingTranslateSpeechResult` represents
     *           an interim result that may change. If `true`, this is the final time the
     *           translation service will return this particular
     *           `StreamingTranslateSpeechResult`, the streaming translator will not
     *           return any further hypotheses for this portion of the transcript and
     *           corresponding audio.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Mediatranslation\V1Beta1\MediaTranslation::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The translated sentence.
     *
     * Generated from protobuf field <code>string translation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getTranslation()
    {
        return $this->translation;
    }

    /**
     * Output only. The translated sentence.
     *
     * Generated from protobuf field <code>string translation = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setTranslation($var)
    {
        GPBUtil::checkString($var, True);
        $this->translation = $var;

        return $this;
    }

    /**
     * Output only. If `false`, this `StreamingTranslateSpeechResult` represents
     * an interim result that may change. If `true`, this is the final time the
     * translation service will return this particular
     * `StreamingTranslateSpeechResult`, the streaming translator will not
     * return any further hypotheses for this portion of the transcript and
     * corresponding audio.
     *
     * Generated from protobuf field <code>bool is_final = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getIsFinal()
    {
        return $this->is_final;
    }

    /**
     * Output only. If `false`, this `StreamingTranslateSpeechResult` represents
     * an interim result that may change. If `true`, this is the final time the
     * translation service will return this particular
     * `StreamingTranslateSpeechResult`, the streaming translator will not
     * return any further hypotheses for this portion of the transcript and
     * corresponding audio.
     *
     * Generated from protobuf field <code>bool is_final = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setIsFinal($var)
    {
        GPBUtil::checkBool($var);
        $this->is_final = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(TextTranslationResult::class, \Google\Cloud\MediaTranslation\V1beta1\StreamingTranslateSpeechResult_TextTranslationResult::class);

