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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.WebhookEvent</code>
 */
class WebhookEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * one of room_started, room_finished, participant_joined, participant_left,
     * track_published, track_unpublished, egress_started, egress_updated, egress_ended,
     * ingress_started, ingress_ended
     *
     * Generated from protobuf field <code>string event = 1;</code>
     */
    protected $event = '';
    /**
     * Generated from protobuf field <code>.livekit.Room room = 2;</code>
     */
    protected $room = null;
    /**
     * set when event is participant_* or track_*
     *
     * Generated from protobuf field <code>.livekit.ParticipantInfo participant = 3;</code>
     */
    protected $participant = null;
    /**
     * set when event is egress_*
     *
     * Generated from protobuf field <code>.livekit.EgressInfo egress_info = 9;</code>
     */
    protected $egress_info = null;
    /**
     * set when event is ingress_*
     *
     * Generated from protobuf field <code>.livekit.IngressInfo ingress_info = 10;</code>
     */
    protected $ingress_info = null;
    /**
     * set when event is track_*
     *
     * Generated from protobuf field <code>.livekit.TrackInfo track = 8;</code>
     */
    protected $track = null;
    /**
     * unique event uuid
     *
     * Generated from protobuf field <code>string id = 6;</code>
     */
    protected $id = '';
    /**
     * timestamp in seconds
     *
     * Generated from protobuf field <code>int64 created_at = 7;</code>
     */
    protected $created_at = 0;
    /**
     * Generated from protobuf field <code>int32 num_dropped = 11 [deprecated = true];</code>
     * @deprecated
     */
    protected $num_dropped = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $event
     *           one of room_started, room_finished, participant_joined, participant_left,
     *           track_published, track_unpublished, egress_started, egress_updated, egress_ended,
     *           ingress_started, ingress_ended
     *     @type \Livekit\Room $room
     *     @type \Livekit\ParticipantInfo $participant
     *           set when event is participant_* or track_*
     *     @type \Livekit\EgressInfo $egress_info
     *           set when event is egress_*
     *     @type \Livekit\IngressInfo $ingress_info
     *           set when event is ingress_*
     *     @type \Livekit\TrackInfo $track
     *           set when event is track_*
     *     @type string $id
     *           unique event uuid
     *     @type int|string $created_at
     *           timestamp in seconds
     *     @type int $num_dropped
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitWebhook::initOnce();
        parent::__construct($data);
    }

    /**
     * one of room_started, room_finished, participant_joined, participant_left,
     * track_published, track_unpublished, egress_started, egress_updated, egress_ended,
     * ingress_started, ingress_ended
     *
     * Generated from protobuf field <code>string event = 1;</code>
     * @return string
     */
    public function getEvent()
    {
        return $this->event;
    }

    /**
     * one of room_started, room_finished, participant_joined, participant_left,
     * track_published, track_unpublished, egress_started, egress_updated, egress_ended,
     * ingress_started, ingress_ended
     *
     * Generated from protobuf field <code>string event = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setEvent($var)
    {
        GPBUtil::checkString($var, True);
        $this->event = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.Room room = 2;</code>
     * @return \Livekit\Room|null
     */
    public function getRoom()
    {
        return $this->room;
    }

    public function hasRoom()
    {
        return isset($this->room);
    }

    public function clearRoom()
    {
        unset($this->room);
    }

    /**
     * Generated from protobuf field <code>.livekit.Room room = 2;</code>
     * @param \Livekit\Room $var
     * @return $this
     */
    public function setRoom($var)
    {
        GPBUtil::checkMessage($var, \Livekit\Room::class);
        $this->room = $var;

        return $this;
    }

    /**
     * set when event is participant_* or track_*
     *
     * Generated from protobuf field <code>.livekit.ParticipantInfo participant = 3;</code>
     * @return \Livekit\ParticipantInfo|null
     */
    public function getParticipant()
    {
        return $this->participant;
    }

    public function hasParticipant()
    {
        return isset($this->participant);
    }

    public function clearParticipant()
    {
        unset($this->participant);
    }

    /**
     * set when event is participant_* or track_*
     *
     * Generated from protobuf field <code>.livekit.ParticipantInfo participant = 3;</code>
     * @param \Livekit\ParticipantInfo $var
     * @return $this
     */
    public function setParticipant($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ParticipantInfo::class);
        $this->participant = $var;

        return $this;
    }

    /**
     * set when event is egress_*
     *
     * Generated from protobuf field <code>.livekit.EgressInfo egress_info = 9;</code>
     * @return \Livekit\EgressInfo|null
     */
    public function getEgressInfo()
    {
        return $this->egress_info;
    }

    public function hasEgressInfo()
    {
        return isset($this->egress_info);
    }

    public function clearEgressInfo()
    {
        unset($this->egress_info);
    }

    /**
     * set when event is egress_*
     *
     * Generated from protobuf field <code>.livekit.EgressInfo egress_info = 9;</code>
     * @param \Livekit\EgressInfo $var
     * @return $this
     */
    public function setEgressInfo($var)
    {
        GPBUtil::checkMessage($var, \Livekit\EgressInfo::class);
        $this->egress_info = $var;

        return $this;
    }

    /**
     * set when event is ingress_*
     *
     * Generated from protobuf field <code>.livekit.IngressInfo ingress_info = 10;</code>
     * @return \Livekit\IngressInfo|null
     */
    public function getIngressInfo()
    {
        return $this->ingress_info;
    }

    public function hasIngressInfo()
    {
        return isset($this->ingress_info);
    }

    public function clearIngressInfo()
    {
        unset($this->ingress_info);
    }

    /**
     * set when event is ingress_*
     *
     * Generated from protobuf field <code>.livekit.IngressInfo ingress_info = 10;</code>
     * @param \Livekit\IngressInfo $var
     * @return $this
     */
    public function setIngressInfo($var)
    {
        GPBUtil::checkMessage($var, \Livekit\IngressInfo::class);
        $this->ingress_info = $var;

        return $this;
    }

    /**
     * set when event is track_*
     *
     * Generated from protobuf field <code>.livekit.TrackInfo track = 8;</code>
     * @return \Livekit\TrackInfo|null
     */
    public function getTrack()
    {
        return $this->track;
    }

    public function hasTrack()
    {
        return isset($this->track);
    }

    public function clearTrack()
    {
        unset($this->track);
    }

    /**
     * set when event is track_*
     *
     * Generated from protobuf field <code>.livekit.TrackInfo track = 8;</code>
     * @param \Livekit\TrackInfo $var
     * @return $this
     */
    public function setTrack($var)
    {
        GPBUtil::checkMessage($var, \Livekit\TrackInfo::class);
        $this->track = $var;

        return $this;
    }

    /**
     * unique event uuid
     *
     * Generated from protobuf field <code>string id = 6;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * unique event uuid
     *
     * Generated from protobuf field <code>string id = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * timestamp in seconds
     *
     * Generated from protobuf field <code>int64 created_at = 7;</code>
     * @return int|string
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * timestamp in seconds
     *
     * Generated from protobuf field <code>int64 created_at = 7;</code>
     * @param int|string $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkInt64($var);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 num_dropped = 11 [deprecated = true];</code>
     * @return int
     * @deprecated
     */
    public function getNumDropped()
    {
        @trigger_error('num_dropped is deprecated.', E_USER_DEPRECATED);
        return $this->num_dropped;
    }

    /**
     * Generated from protobuf field <code>int32 num_dropped = 11 [deprecated = true];</code>
     * @param int $var
     * @return $this
     * @deprecated
     */
    public function setNumDropped($var)
    {
        @trigger_error('num_dropped is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkInt32($var);
        $this->num_dropped = $var;

        return $this;
    }

}

