<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/speech/v2/cloud_speech.proto

namespace Google\Cloud\Speech\V2;

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

/**
 * Final results for a single file.
 *
 * Generated from protobuf message <code>google.cloud.speech.v2.BatchRecognizeFileResult</code>
 */
class BatchRecognizeFileResult extends \Google\Protobuf\Internal\Message
{
    /**
     * The Cloud Storage URI to which recognition results were written.
     *
     * Generated from protobuf field <code>string uri = 1;</code>
     */
    private $uri = '';
    /**
     * Error if one was encountered.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     */
    private $error = null;
    /**
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionResponseMetadata metadata = 3;</code>
     */
    private $metadata = null;
    /**
     * The transcript for the audio file. This is populated only when
     * [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in
     * the
     * [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.BatchRecognizeResults transcript = 4;</code>
     */
    private $transcript = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $uri
     *           The Cloud Storage URI to which recognition results were written.
     *     @type \Google\Rpc\Status $error
     *           Error if one was encountered.
     *     @type \Google\Cloud\Speech\V2\RecognitionResponseMetadata $metadata
     *     @type \Google\Cloud\Speech\V2\BatchRecognizeResults $transcript
     *           The transcript for the audio file. This is populated only when
     *           [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in
     *           the
     *           [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V2\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * The Cloud Storage URI to which recognition results were written.
     *
     * Generated from protobuf field <code>string uri = 1;</code>
     * @return string
     */
    public function getUri()
    {
        return $this->uri;
    }

    /**
     * The Cloud Storage URI to which recognition results were written.
     *
     * Generated from protobuf field <code>string uri = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->uri = $var;

        return $this;
    }

    /**
     * Error if one was encountered.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     * @return \Google\Rpc\Status|null
     */
    public function getError()
    {
        return $this->error;
    }

    public function hasError()
    {
        return isset($this->error);
    }

    public function clearError()
    {
        unset($this->error);
    }

    /**
     * Error if one was encountered.
     *
     * Generated from protobuf field <code>.google.rpc.Status error = 2;</code>
     * @param \Google\Rpc\Status $var
     * @return $this
     */
    public function setError($var)
    {
        GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
        $this->error = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionResponseMetadata metadata = 3;</code>
     * @return \Google\Cloud\Speech\V2\RecognitionResponseMetadata|null
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

    /**
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionResponseMetadata metadata = 3;</code>
     * @param \Google\Cloud\Speech\V2\RecognitionResponseMetadata $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\RecognitionResponseMetadata::class);
        $this->metadata = $var;

        return $this;
    }

    /**
     * The transcript for the audio file. This is populated only when
     * [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in
     * the
     * [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.BatchRecognizeResults transcript = 4;</code>
     * @return \Google\Cloud\Speech\V2\BatchRecognizeResults|null
     */
    public function getTranscript()
    {
        return $this->transcript;
    }

    public function hasTranscript()
    {
        return isset($this->transcript);
    }

    public function clearTranscript()
    {
        unset($this->transcript);
    }

    /**
     * The transcript for the audio file. This is populated only when
     * [InlineOutputConfig][google.cloud.speech.v2.InlineOutputConfig] is set in
     * the
     * [RecognitionOutputConfig][[google.cloud.speech.v2.RecognitionOutputConfig].
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.BatchRecognizeResults transcript = 4;</code>
     * @param \Google\Cloud\Speech\V2\BatchRecognizeResults $var
     * @return $this
     */
    public function setTranscript($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\BatchRecognizeResults::class);
        $this->transcript = $var;

        return $this;
    }

}

