<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/translate/v3/translation_service.proto

namespace Google\Cloud\Translate\V3;

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

/**
 * A translated document response message.
 *
 * Generated from protobuf message <code>google.cloud.translation.v3.TranslateDocumentResponse</code>
 */
class TranslateDocumentResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * Translated document.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation document_translation = 1;</code>
     */
    private $document_translation = null;
    /**
     * The document's translation output if a glossary is provided in the request.
     * This can be the same as [TranslateDocumentResponse.document_translation]
     * if no glossary terms apply.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;</code>
     */
    private $glossary_document_translation = null;
    /**
     * Only present when 'model' is present in the request.
     * 'model' is normalized to have a project number.
     * For example:
     * If the 'model' field in TranslateDocumentRequest is:
     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
     * `model` here would be normalized to
     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
     *
     * Generated from protobuf field <code>string model = 3;</code>
     */
    private $model = '';
    /**
     * The `glossary_config` used for this translation.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;</code>
     */
    private $glossary_config = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Translate\V3\DocumentTranslation $document_translation
     *           Translated document.
     *     @type \Google\Cloud\Translate\V3\DocumentTranslation $glossary_document_translation
     *           The document's translation output if a glossary is provided in the request.
     *           This can be the same as [TranslateDocumentResponse.document_translation]
     *           if no glossary terms apply.
     *     @type string $model
     *           Only present when 'model' is present in the request.
     *           'model' is normalized to have a project number.
     *           For example:
     *           If the 'model' field in TranslateDocumentRequest is:
     *           `projects/{project-id}/locations/{location-id}/models/general/nmt` then
     *           `model` here would be normalized to
     *           `projects/{project-number}/locations/{location-id}/models/general/nmt`.
     *     @type \Google\Cloud\Translate\V3\TranslateTextGlossaryConfig $glossary_config
     *           The `glossary_config` used for this translation.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Translated document.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation document_translation = 1;</code>
     * @return \Google\Cloud\Translate\V3\DocumentTranslation|null
     */
    public function getDocumentTranslation()
    {
        return $this->document_translation;
    }

    public function hasDocumentTranslation()
    {
        return isset($this->document_translation);
    }

    public function clearDocumentTranslation()
    {
        unset($this->document_translation);
    }

    /**
     * Translated document.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation document_translation = 1;</code>
     * @param \Google\Cloud\Translate\V3\DocumentTranslation $var
     * @return $this
     */
    public function setDocumentTranslation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Translate\V3\DocumentTranslation::class);
        $this->document_translation = $var;

        return $this;
    }

    /**
     * The document's translation output if a glossary is provided in the request.
     * This can be the same as [TranslateDocumentResponse.document_translation]
     * if no glossary terms apply.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;</code>
     * @return \Google\Cloud\Translate\V3\DocumentTranslation|null
     */
    public function getGlossaryDocumentTranslation()
    {
        return $this->glossary_document_translation;
    }

    public function hasGlossaryDocumentTranslation()
    {
        return isset($this->glossary_document_translation);
    }

    public function clearGlossaryDocumentTranslation()
    {
        unset($this->glossary_document_translation);
    }

    /**
     * The document's translation output if a glossary is provided in the request.
     * This can be the same as [TranslateDocumentResponse.document_translation]
     * if no glossary terms apply.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.DocumentTranslation glossary_document_translation = 2;</code>
     * @param \Google\Cloud\Translate\V3\DocumentTranslation $var
     * @return $this
     */
    public function setGlossaryDocumentTranslation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Translate\V3\DocumentTranslation::class);
        $this->glossary_document_translation = $var;

        return $this;
    }

    /**
     * Only present when 'model' is present in the request.
     * 'model' is normalized to have a project number.
     * For example:
     * If the 'model' field in TranslateDocumentRequest is:
     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
     * `model` here would be normalized to
     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
     *
     * Generated from protobuf field <code>string model = 3;</code>
     * @return string
     */
    public function getModel()
    {
        return $this->model;
    }

    /**
     * Only present when 'model' is present in the request.
     * 'model' is normalized to have a project number.
     * For example:
     * If the 'model' field in TranslateDocumentRequest is:
     * `projects/{project-id}/locations/{location-id}/models/general/nmt` then
     * `model` here would be normalized to
     * `projects/{project-number}/locations/{location-id}/models/general/nmt`.
     *
     * Generated from protobuf field <code>string model = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setModel($var)
    {
        GPBUtil::checkString($var, True);
        $this->model = $var;

        return $this;
    }

    /**
     * The `glossary_config` used for this translation.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;</code>
     * @return \Google\Cloud\Translate\V3\TranslateTextGlossaryConfig|null
     */
    public function getGlossaryConfig()
    {
        return $this->glossary_config;
    }

    public function hasGlossaryConfig()
    {
        return isset($this->glossary_config);
    }

    public function clearGlossaryConfig()
    {
        unset($this->glossary_config);
    }

    /**
     * The `glossary_config` used for this translation.
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.TranslateTextGlossaryConfig glossary_config = 4;</code>
     * @param \Google\Cloud\Translate\V3\TranslateTextGlossaryConfig $var
     * @return $this
     */
    public function setGlossaryConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Translate\V3\TranslateTextGlossaryConfig::class);
        $this->glossary_config = $var;

        return $this;
    }

}

