<?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 status enumeration
 *
 * Protobuf type <code>livekit.PhoneNumberStatus</code>
 */
class PhoneNumberStatus
{
    /**
     * Default value
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_STATUS_UNSPECIFIED = 0;</code>
     */
    const PHONE_NUMBER_STATUS_UNSPECIFIED = 0;
    /**
     * Number is active and ready for use
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_STATUS_ACTIVE = 1;</code>
     */
    const PHONE_NUMBER_STATUS_ACTIVE = 1;
    /**
     * Number is being provisioned
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_STATUS_PENDING = 2;</code>
     */
    const PHONE_NUMBER_STATUS_PENDING = 2;
    /**
     * Number has been released
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_STATUS_RELEASED = 3;</code>
     */
    const PHONE_NUMBER_STATUS_RELEASED = 3;
    /**
     * Number is offline (not associated with any dispatch rule)
     *
     * Generated from protobuf enum <code>PHONE_NUMBER_STATUS_OFFLINE = 4;</code>
     */
    const PHONE_NUMBER_STATUS_OFFLINE = 4;

    private static $valueToName = [
        self::PHONE_NUMBER_STATUS_UNSPECIFIED => 'PHONE_NUMBER_STATUS_UNSPECIFIED',
        self::PHONE_NUMBER_STATUS_ACTIVE => 'PHONE_NUMBER_STATUS_ACTIVE',
        self::PHONE_NUMBER_STATUS_PENDING => 'PHONE_NUMBER_STATUS_PENDING',
        self::PHONE_NUMBER_STATUS_RELEASED => 'PHONE_NUMBER_STATUS_RELEASED',
        self::PHONE_NUMBER_STATUS_OFFLINE => 'PHONE_NUMBER_STATUS_OFFLINE',
    ];

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

