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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.EventMetric</code>
 */
class EventMetric extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>uint32 label = 1;</code>
     */
    protected $label = 0;
    /**
     * Generated from protobuf field <code>uint32 participant_identity = 2;</code>
     */
    protected $participant_identity = 0;
    /**
     * 0 =
     *
     * Generated from protobuf field <code>uint32 track_sid = 3;</code>
     */
    protected $track_sid = 0;
    /**
     * Generated from protobuf field <code>int64 start_timestamp = 4;</code>
     */
    protected $start_timestamp = 0;
    /**
     * Generated from protobuf field <code>optional int64 end_timestamp = 5;</code>
     */
    protected $end_timestamp = null;
    /**
     * Generated from protobuf field <code>string metadata = 6;</code>
     */
    protected $metadata = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $label
     *     @type int $participant_identity
     *     @type int $track_sid
     *           0 =
     *     @type int|string $start_timestamp
     *     @type int|string $end_timestamp
     *     @type string $metadata
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitMetrics::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>uint32 label = 1;</code>
     * @return int
     */
    public function getLabel()
    {
        return $this->label;
    }

    /**
     * Generated from protobuf field <code>uint32 label = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setLabel($var)
    {
        GPBUtil::checkUint32($var);
        $this->label = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint32 participant_identity = 2;</code>
     * @return int
     */
    public function getParticipantIdentity()
    {
        return $this->participant_identity;
    }

    /**
     * Generated from protobuf field <code>uint32 participant_identity = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setParticipantIdentity($var)
    {
        GPBUtil::checkUint32($var);
        $this->participant_identity = $var;

        return $this;
    }

    /**
     * 0 =
     *
     * Generated from protobuf field <code>uint32 track_sid = 3;</code>
     * @return int
     */
    public function getTrackSid()
    {
        return $this->track_sid;
    }

    /**
     * 0 =
     *
     * Generated from protobuf field <code>uint32 track_sid = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setTrackSid($var)
    {
        GPBUtil::checkUint32($var);
        $this->track_sid = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 start_timestamp = 4;</code>
     * @return int|string
     */
    public function getStartTimestamp()
    {
        return $this->start_timestamp;
    }

    /**
     * Generated from protobuf field <code>int64 start_timestamp = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartTimestamp($var)
    {
        GPBUtil::checkInt64($var);
        $this->start_timestamp = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int64 end_timestamp = 5;</code>
     * @return int|string
     */
    public function getEndTimestamp()
    {
        return isset($this->end_timestamp) ? $this->end_timestamp : 0;
    }

    public function hasEndTimestamp()
    {
        return isset($this->end_timestamp);
    }

    public function clearEndTimestamp()
    {
        unset($this->end_timestamp);
    }

    /**
     * Generated from protobuf field <code>optional int64 end_timestamp = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setEndTimestamp($var)
    {
        GPBUtil::checkInt64($var);
        $this->end_timestamp = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string metadata = 6;</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

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

        return $this;
    }

}

