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

namespace Livekit;

use UnexpectedValueException;

/**
 * Phone number type enumeration
 *
 * Protobuf type <code>livekit.PhoneNumberType</code>
 */
class PhoneNumberType
{
    /**
     * Default value - unknown or parsing error
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_TYPE_UNKNOWN = 0;</code>
     */
    const PHONE_NUMBER_TYPE_UNKNOWN = 0;
    /**
     * Mobile phone number
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_TYPE_MOBILE = 1;</code>
     */
    const PHONE_NUMBER_TYPE_MOBILE = 1;
    /**
     * Local/fixed line number
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_TYPE_LOCAL = 2;</code>
     */
    const PHONE_NUMBER_TYPE_LOCAL = 2;
    /**
     * Toll-free number
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_TYPE_TOLL_FREE = 3;</code>
     */
    const PHONE_NUMBER_TYPE_TOLL_FREE = 3;

    private static $valueToName = [
        self::PHONE_NUMBER_TYPE_UNKNOWN => 'PHONE_NUMBER_TYPE_UNKNOWN',
        self::PHONE_NUMBER_TYPE_MOBILE => 'PHONE_NUMBER_TYPE_MOBILE',
        self::PHONE_NUMBER_TYPE_LOCAL => 'PHONE_NUMBER_TYPE_LOCAL',
        self::PHONE_NUMBER_TYPE_TOLL_FREE => 'PHONE_NUMBER_TYPE_TOLL_FREE',
    ];

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

