<?php
 
 
 

namespace PhpWA\Protocol\Proto\StatusAttribution\ExternalShare;

use UnexpectedValueException;




class Source
{
    


    const UNKNOWN = 0;
    


    const INSTAGRAM = 1;
    


    const FACEBOOK = 2;
    


    const MESSENGER = 3;
    


    const SPOTIFY = 4;
    


    const YOUTUBE = 5;
    


    const PINTEREST = 6;
    


    const THREADS = 7;
    


    const APPLE_MUSIC = 8;
    


    const SHARECHAT = 9;
    


    const GOOGLE_PHOTOS = 10;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::INSTAGRAM => 'INSTAGRAM',
        self::FACEBOOK => 'FACEBOOK',
        self::MESSENGER => 'MESSENGER',
        self::SPOTIFY => 'SPOTIFY',
        self::YOUTUBE => 'YOUTUBE',
        self::PINTEREST => 'PINTEREST',
        self::THREADS => 'THREADS',
        self::APPLE_MUSIC => 'APPLE_MUSIC',
        self::SHARECHAT => 'SHARECHAT',
        self::GOOGLE_PHOTOS => 'GOOGLE_PHOTOS',
    ];

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

