<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_models.proto

namespace Livekit\ParticipantInfo;

use UnexpectedValueException;

/**
 * Protobuf type <code>livekit.ParticipantInfo.Kind</code>
 */
class Kind
{
    /**
     * standard participants, e.g. web clients
     *
     * Generated from protobuf enum <code>STANDARD = 0;</code>
     */
    const STANDARD = 0;
    /**
     * only ingests streams
     *
     * Generated from protobuf enum <code>INGRESS = 1;</code>
     */
    const INGRESS = 1;
    /**
     * only consumes streams
     *
     * Generated from protobuf enum <code>EGRESS = 2;</code>
     */
    const EGRESS = 2;
    /**
     * SIP participants
     *
     * Generated from protobuf enum <code>SIP = 3;</code>
     */
    const SIP = 3;
    /**
     * LiveKit agents
     *
     * Generated from protobuf enum <code>AGENT = 4;</code>
     */
    const AGENT = 4;
    /**
     * Connectors participants
     *
     * Generated from protobuf enum <code>CONNECTOR = 7;</code>
     */
    const CONNECTOR = 7;
    /**
     * Bridge participants
     *
     * Generated from protobuf enum <code>BRIDGE = 8;</code>
     */
    const BRIDGE = 8;

    private static $valueToName = [
        self::STANDARD => 'STANDARD',
        self::INGRESS => 'INGRESS',
        self::EGRESS => 'EGRESS',
        self::SIP => 'SIP',
        self::AGENT => 'AGENT',
        self::CONNECTOR => 'CONNECTOR',
        self::BRIDGE => 'BRIDGE',
    ];

    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);
    }
}

