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

namespace Livekit;

use UnexpectedValueException;

/**
 * index from [0; 512] are for predefined labels (`MetricLabel`)
 *
 * Protobuf type <code>livekit.MetricLabel</code>
 */
class MetricLabel
{
    /**
     * time to first token from LLM
     *
     * Generated from protobuf enum <code>AGENTS_LLM_TTFT = 0;</code>
     */
    const AGENTS_LLM_TTFT = 0;
    /**
     * time to final transcription
     *
     * Generated from protobuf enum <code>AGENTS_STT_TTFT = 1;</code>
     */
    const AGENTS_STT_TTFT = 1;
    /**
     * time to first byte
     *
     * Generated from protobuf enum <code>AGENTS_TTS_TTFB = 2;</code>
     */
    const AGENTS_TTS_TTFB = 2;
    /**
     * Generated from protobuf enum <code>METRIC_LABEL_MAX_VALUE = 512;</code>
     */
    const METRIC_LABEL_MAX_VALUE = 512;

    private static $valueToName = [
        self::AGENTS_LLM_TTFT => 'AGENTS_LLM_TTFT',
        self::AGENTS_STT_TTFT => 'AGENTS_STT_TTFT',
        self::AGENTS_TTS_TTFB => 'AGENTS_TTS_TTFB',
        self::METRIC_LABEL_MAX_VALUE => 'METRIC_LABEL_MAX_VALUE',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

