<?php
 
 
 

namespace PhpWA\Protocol\Proto\SyncActionValue\LabelEditAction;

use UnexpectedValueException;




class ListType
{
    


    const NONE = 0;
    


    const UNREAD = 1;
    


    const GROUPS = 2;
    


    const FAVORITES = 3;
    


    const PREDEFINED = 4;
    


    const CUSTOM = 5;
    


    const COMMUNITY = 6;
    


    const SERVER_ASSIGNED = 7;
    


    const DRAFTED = 8;
    


    const AI_HANDOFF = 9;

    private static $valueToName = [
        self::NONE => 'NONE',
        self::UNREAD => 'UNREAD',
        self::GROUPS => 'GROUPS',
        self::FAVORITES => 'FAVORITES',
        self::PREDEFINED => 'PREDEFINED',
        self::CUSTOM => 'CUSTOM',
        self::COMMUNITY => 'COMMUNITY',
        self::SERVER_ASSIGNED => 'SERVER_ASSIGNED',
        self::DRAFTED => 'DRAFTED',
        self::AI_HANDOFF => 'AI_HANDOFF',
    ];

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

