<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: livekit_models.proto

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.EncryptedPacketPayload</code>
 */
class EncryptedPacketPayload extends \Google\Protobuf\Internal\Message
{
    protected $value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\UserPacket $user
     *     @type \Livekit\ChatMessage $chat_message
     *     @type \Livekit\RpcRequest $rpc_request
     *     @type \Livekit\RpcAck $rpc_ack
     *     @type \Livekit\RpcResponse $rpc_response
     *     @type \Livekit\DataStream\Header $stream_header
     *     @type \Livekit\DataStream\Chunk $stream_chunk
     *     @type \Livekit\DataStream\Trailer $stream_trailer
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.livekit.UserPacket user = 1;</code>
     * @return \Livekit\UserPacket|null
     */
    public function getUser()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Generated from protobuf field <code>.livekit.UserPacket user = 1;</code>
     * @param \Livekit\UserPacket $var
     * @return $this
     */
    public function setUser($var)
    {
        GPBUtil::checkMessage($var, \Livekit\UserPacket::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ChatMessage chat_message = 3;</code>
     * @return \Livekit\ChatMessage|null
     */
    public function getChatMessage()
    {
        return $this->readOneof(3);
    }

    public function hasChatMessage()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.livekit.ChatMessage chat_message = 3;</code>
     * @param \Livekit\ChatMessage $var
     * @return $this
     */
    public function setChatMessage($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ChatMessage::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcRequest rpc_request = 4;</code>
     * @return \Livekit\RpcRequest|null
     */
    public function getRpcRequest()
    {
        return $this->readOneof(4);
    }

    public function hasRpcRequest()
    {
        return $this->hasOneof(4);
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcRequest rpc_request = 4;</code>
     * @param \Livekit\RpcRequest $var
     * @return $this
     */
    public function setRpcRequest($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RpcRequest::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcAck rpc_ack = 5;</code>
     * @return \Livekit\RpcAck|null
     */
    public function getRpcAck()
    {
        return $this->readOneof(5);
    }

    public function hasRpcAck()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcAck rpc_ack = 5;</code>
     * @param \Livekit\RpcAck $var
     * @return $this
     */
    public function setRpcAck($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RpcAck::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcResponse rpc_response = 6;</code>
     * @return \Livekit\RpcResponse|null
     */
    public function getRpcResponse()
    {
        return $this->readOneof(6);
    }

    public function hasRpcResponse()
    {
        return $this->hasOneof(6);
    }

    /**
     * Generated from protobuf field <code>.livekit.RpcResponse rpc_response = 6;</code>
     * @param \Livekit\RpcResponse $var
     * @return $this
     */
    public function setRpcResponse($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RpcResponse::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Header stream_header = 7;</code>
     * @return \Livekit\DataStream\Header|null
     */
    public function getStreamHeader()
    {
        return $this->readOneof(7);
    }

    public function hasStreamHeader()
    {
        return $this->hasOneof(7);
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Header stream_header = 7;</code>
     * @param \Livekit\DataStream\Header $var
     * @return $this
     */
    public function setStreamHeader($var)
    {
        GPBUtil::checkMessage($var, \Livekit\DataStream\Header::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Chunk stream_chunk = 8;</code>
     * @return \Livekit\DataStream\Chunk|null
     */
    public function getStreamChunk()
    {
        return $this->readOneof(8);
    }

    public function hasStreamChunk()
    {
        return $this->hasOneof(8);
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Chunk stream_chunk = 8;</code>
     * @param \Livekit\DataStream\Chunk $var
     * @return $this
     */
    public function setStreamChunk($var)
    {
        GPBUtil::checkMessage($var, \Livekit\DataStream\Chunk::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Trailer stream_trailer = 9;</code>
     * @return \Livekit\DataStream\Trailer|null
     */
    public function getStreamTrailer()
    {
        return $this->readOneof(9);
    }

    public function hasStreamTrailer()
    {
        return $this->hasOneof(9);
    }

    /**
     * Generated from protobuf field <code>.livekit.DataStream.Trailer stream_trailer = 9;</code>
     * @param \Livekit\DataStream\Trailer $var
     * @return $this
     */
    public function setStreamTrailer($var)
    {
        GPBUtil::checkMessage($var, \Livekit\DataStream\Trailer::class);
        $this->writeOneof(9, $var);

        return $this;
    }

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

}

