<?php
 
 
 

namespace PhpWA\Protocol\Proto;

use UnexpectedValueException;




class AIRichResponseSubMessageType
{
    


    const AI_RICH_RESPONSE_UNKNOWN = 0;
    


    const AI_RICH_RESPONSE_GRID_IMAGE = 1;
    


    const AI_RICH_RESPONSE_TEXT = 2;
    


    const AI_RICH_RESPONSE_INLINE_IMAGE = 3;
    


    const AI_RICH_RESPONSE_TABLE = 4;
    


    const AI_RICH_RESPONSE_CODE = 5;
    


    const AI_RICH_RESPONSE_DYNAMIC = 6;
    


    const AI_RICH_RESPONSE_MAP = 7;
    


    const AI_RICH_RESPONSE_LATEX = 8;
    


    const AI_RICH_RESPONSE_CONTENT_ITEMS = 9;

    private static $valueToName = [
        self::AI_RICH_RESPONSE_UNKNOWN => 'AI_RICH_RESPONSE_UNKNOWN',
        self::AI_RICH_RESPONSE_GRID_IMAGE => 'AI_RICH_RESPONSE_GRID_IMAGE',
        self::AI_RICH_RESPONSE_TEXT => 'AI_RICH_RESPONSE_TEXT',
        self::AI_RICH_RESPONSE_INLINE_IMAGE => 'AI_RICH_RESPONSE_INLINE_IMAGE',
        self::AI_RICH_RESPONSE_TABLE => 'AI_RICH_RESPONSE_TABLE',
        self::AI_RICH_RESPONSE_CODE => 'AI_RICH_RESPONSE_CODE',
        self::AI_RICH_RESPONSE_DYNAMIC => 'AI_RICH_RESPONSE_DYNAMIC',
        self::AI_RICH_RESPONSE_MAP => 'AI_RICH_RESPONSE_MAP',
        self::AI_RICH_RESPONSE_LATEX => 'AI_RICH_RESPONSE_LATEX',
        self::AI_RICH_RESPONSE_CONTENT_ITEMS => 'AI_RICH_RESPONSE_CONTENT_ITEMS',
    ];

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

