<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_models.proto

namespace Livekit\DataStream;

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

/**
 * Generated from protobuf message <code>livekit.DataStream.Trailer</code>
 */
class Trailer extends \Google\Protobuf\Internal\Message
{
    /**
     * unique identifier for this data stream
     *
     * Generated from protobuf field <code>string stream_id = 1;</code>
     */
    protected $stream_id = '';
    /**
     * reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)
     *
     * Generated from protobuf field <code>string reason = 2;</code>
     */
    protected $reason = '';
    /**
     * finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
     *
     * Generated from protobuf field <code>map<string, string> attributes = 3;</code>
     */
    private $attributes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $stream_id
     *           unique identifier for this data stream
     *     @type string $reason
     *           reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)
     *     @type array|\Google\Protobuf\Internal\MapField $attributes
     *           finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

    /**
     * unique identifier for this data stream
     *
     * Generated from protobuf field <code>string stream_id = 1;</code>
     * @return string
     */
    public function getStreamId()
    {
        return $this->stream_id;
    }

    /**
     * unique identifier for this data stream
     *
     * Generated from protobuf field <code>string stream_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setStreamId($var)
    {
        GPBUtil::checkString($var, True);
        $this->stream_id = $var;

        return $this;
    }

    /**
     * reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)
     *
     * Generated from protobuf field <code>string reason = 2;</code>
     * @return string
     */
    public function getReason()
    {
        return $this->reason;
    }

    /**
     * reason why the stream was closed (could contain "error" / "interrupted" / empty for expected end)
     *
     * Generated from protobuf field <code>string reason = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setReason($var)
    {
        GPBUtil::checkString($var, True);
        $this->reason = $var;

        return $this;
    }

    /**
     * finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
     *
     * Generated from protobuf field <code>map<string, string> attributes = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * finalizing updates for the stream, can also include additional insights for errors or endTime for transcription
     *
     * Generated from protobuf field <code>map<string, string> attributes = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAttributes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->attributes = $arr;

        return $this;
    }

}

