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

namespace Livekit;

use UnexpectedValueException;

/**
 * Protobuf type <code>livekit.ProviderType</code>
 */
class ProviderType
{
    /**
     * Generated from protobuf enum <code>PROVIDER_TYPE_UNKNOWN = 0;</code>
     */
    const PROVIDER_TYPE_UNKNOWN = 0;
    /**
     * Internally implemented
     *
     * Generated from protobuf enum <code>PROVIDER_TYPE_INTERNAL = 1;</code>
     */
    const PROVIDER_TYPE_INTERNAL = 1;
    /**
     * Vendor provided
     *
     * Generated from protobuf enum <code>PROVIDER_TYPE_EXTERNAL = 2;</code>
     */
    const PROVIDER_TYPE_EXTERNAL = 2;

    private static $valueToName = [
        self::PROVIDER_TYPE_UNKNOWN => 'PROVIDER_TYPE_UNKNOWN',
        self::PROVIDER_TYPE_INTERNAL => 'PROVIDER_TYPE_INTERNAL',
        self::PROVIDER_TYPE_EXTERNAL => 'PROVIDER_TYPE_EXTERNAL',
    ];

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

