<?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;
    /**
     * index into `str_data`
     *
     * Generated from protobuf field <code>uint32 participant_identity = 2;</code>
     */
    protected $participant_identity = 0;
    /**
     * index into `str_data`
     *
     * Generated from protobuf field <code>uint32 track_sid = 3;</code>
     */
    protected $track_sid = 0;
    /**
     * start time of event based on a monotonic clock (in milliseconds)
     *
     * Generated from protobuf field <code>int64 start_timestamp_ms = 4;</code>
     */
    protected $start_timestamp_ms = 0;
    /**
     * end time of event based on a monotonic clock (in milliseconds), if needed
     *
     * Generated from protobuf field <code>optional int64 end_timestamp_ms = 5;</code>
     */
    protected $end_timestamp_ms = null;
    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp normalized_start_timestamp = 6;</code>
     */
    protected $normalized_start_timestamp = null;
    /**
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp normalized_end_timestamp = 7;</code>
     */
    protected $normalized_end_timestamp = null;
    /**
     * Generated from protobuf field <code>string metadata = 8;</code>
     */
    protected $metadata = '';
    /**
     * index into 'str_data'
     *
     * Generated from protobuf field <code>uint32 rid = 9;</code>
     */
    protected $rid = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $label
     *     @type int $participant_identity
     *           index into `str_data`
     *     @type int $track_sid
     *           index into `str_data`
     *     @type int|string $start_timestamp_ms
     *           start time of event based on a monotonic clock (in milliseconds)
     *     @type int|string $end_timestamp_ms
     *           end time of event based on a monotonic clock (in milliseconds), if needed
     *     @type \Google\Protobuf\Timestamp $normalized_start_timestamp
     *     @type \Google\Protobuf\Timestamp $normalized_end_timestamp
     *     @type string $metadata
     *     @type int $rid
     *           index into 'str_data'
     * }
     */
    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;
    }

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

    /**
     * index into `str_data`
     *
     * 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;
    }

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

    /**
     * index into `str_data`
     *
     * 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;
    }

    /**
     * start time of event based on a monotonic clock (in milliseconds)
     *
     * Generated from protobuf field <code>int64 start_timestamp_ms = 4;</code>
     * @return int|string
     */
    public function getStartTimestampMs()
    {
        return $this->start_timestamp_ms;
    }

    /**
     * start time of event based on a monotonic clock (in milliseconds)
     *
     * Generated from protobuf field <code>int64 start_timestamp_ms = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartTimestampMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->start_timestamp_ms = $var;

        return $this;
    }

    /**
     * end time of event based on a monotonic clock (in milliseconds), if needed
     *
     * Generated from protobuf field <code>optional int64 end_timestamp_ms = 5;</code>
     * @return int|string
     */
    public function getEndTimestampMs()
    {
        return isset($this->end_timestamp_ms) ? $this->end_timestamp_ms : 0;
    }

    public function hasEndTimestampMs()
    {
        return isset($this->end_timestamp_ms);
    }

    public function clearEndTimestampMs()
    {
        unset($this->end_timestamp_ms);
    }

    /**
     * end time of event based on a monotonic clock (in milliseconds), if needed
     *
     * Generated from protobuf field <code>optional int64 end_timestamp_ms = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setEndTimestampMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->end_timestamp_ms = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp normalized_start_timestamp = 6;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getNormalizedStartTimestamp()
    {
        return $this->normalized_start_timestamp;
    }

    public function hasNormalizedStartTimestamp()
    {
        return isset($this->normalized_start_timestamp);
    }

    public function clearNormalizedStartTimestamp()
    {
        unset($this->normalized_start_timestamp);
    }

    /**
     * Generated from protobuf field <code>.google.protobuf.Timestamp normalized_start_timestamp = 6;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setNormalizedStartTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->normalized_start_timestamp = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp normalized_end_timestamp = 7;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getNormalizedEndTimestamp()
    {
        return $this->normalized_end_timestamp;
    }

    public function hasNormalizedEndTimestamp()
    {
        return isset($this->normalized_end_timestamp);
    }

    public function clearNormalizedEndTimestamp()
    {
        unset($this->normalized_end_timestamp);
    }

    /**
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp normalized_end_timestamp = 7;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setNormalizedEndTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->normalized_end_timestamp = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * index into 'str_data'
     *
     * Generated from protobuf field <code>uint32 rid = 9;</code>
     * @return int
     */
    public function getRid()
    {
        return $this->rid;
    }

    /**
     * index into 'str_data'
     *
     * Generated from protobuf field <code>uint32 rid = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setRid($var)
    {
        GPBUtil::checkUint32($var);
        $this->rid = $var;

        return $this;
    }

}

