<?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 document translation request input config.
 *
 * Generated from protobuf message <code>google.cloud.translation.v3.DocumentInputConfig</code>
 */
class DocumentInputConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Specifies the input document's mime_type.
     * If not specified it will be determined using the file extension for
     * gcs_source provided files. For a file provided through bytes content the
     * mime_type must be provided.
     * Currently supported mime types are:
     * - application/pdf
     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
     *
     * Generated from protobuf field <code>string mime_type = 4;</code>
     */
    private $mime_type = '';
    protected $source;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $content
     *           Document's content represented as a stream of bytes.
     *     @type \Google\Cloud\Translate\V3\GcsSource $gcs_source
     *           Google Cloud Storage location. This must be a single file.
     *           For example: gs://example_bucket/example_file.pdf
     *     @type string $mime_type
     *           Specifies the input document's mime_type.
     *           If not specified it will be determined using the file extension for
     *           gcs_source provided files. For a file provided through bytes content the
     *           mime_type must be provided.
     *           Currently supported mime types are:
     *           - application/pdf
     *           - application/vnd.openxmlformats-officedocument.wordprocessingml.document
     *           - application/vnd.openxmlformats-officedocument.presentationml.presentation
     *           - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Document's content represented as a stream of bytes.
     *
     * Generated from protobuf field <code>bytes content = 1;</code>
     * @return string
     */
    public function getContent()
    {
        return $this->readOneof(1);
    }

    public function hasContent()
    {
        return $this->hasOneof(1);
    }

    /**
     * Document's content represented as a stream of bytes.
     *
     * Generated from protobuf field <code>bytes content = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Google Cloud Storage location. This must be a single file.
     * For example: gs://example_bucket/example_file.pdf
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.GcsSource gcs_source = 2;</code>
     * @return \Google\Cloud\Translate\V3\GcsSource|null
     */
    public function getGcsSource()
    {
        return $this->readOneof(2);
    }

    public function hasGcsSource()
    {
        return $this->hasOneof(2);
    }

    /**
     * Google Cloud Storage location. This must be a single file.
     * For example: gs://example_bucket/example_file.pdf
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.GcsSource gcs_source = 2;</code>
     * @param \Google\Cloud\Translate\V3\GcsSource $var
     * @return $this
     */
    public function setGcsSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Translate\V3\GcsSource::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Specifies the input document's mime_type.
     * If not specified it will be determined using the file extension for
     * gcs_source provided files. For a file provided through bytes content the
     * mime_type must be provided.
     * Currently supported mime types are:
     * - application/pdf
     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
     *
     * Generated from protobuf field <code>string mime_type = 4;</code>
     * @return string
     */
    public function getMimeType()
    {
        return $this->mime_type;
    }

    /**
     * Specifies the input document's mime_type.
     * If not specified it will be determined using the file extension for
     * gcs_source provided files. For a file provided through bytes content the
     * mime_type must be provided.
     * Currently supported mime types are:
     * - application/pdf
     * - application/vnd.openxmlformats-officedocument.wordprocessingml.document
     * - application/vnd.openxmlformats-officedocument.presentationml.presentation
     * - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
     *
     * Generated from protobuf field <code>string mime_type = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setMimeType($var)
    {
        GPBUtil::checkString($var, True);
        $this->mime_type = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getSource()
    {
        return $this->whichOneof("source");
    }

}

