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

namespace PhpWA\Protocol\Proto\StatusAttribution\ExternalShare;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.StatusAttribution.ExternalShare.Source</code>
 */
class Source
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>INSTAGRAM = 1;</code>
     */
    const INSTAGRAM = 1;
    /**
     * Generated from protobuf enum <code>FACEBOOK = 2;</code>
     */
    const FACEBOOK = 2;
    /**
     * Generated from protobuf enum <code>MESSENGER = 3;</code>
     */
    const MESSENGER = 3;
    /**
     * Generated from protobuf enum <code>SPOTIFY = 4;</code>
     */
    const SPOTIFY = 4;
    /**
     * Generated from protobuf enum <code>YOUTUBE = 5;</code>
     */
    const YOUTUBE = 5;
    /**
     * Generated from protobuf enum <code>PINTEREST = 6;</code>
     */
    const PINTEREST = 6;
    /**
     * Generated from protobuf enum <code>THREADS = 7;</code>
     */
    const THREADS = 7;
    /**
     * Generated from protobuf enum <code>APPLE_MUSIC = 8;</code>
     */
    const APPLE_MUSIC = 8;
    /**
     * Generated from protobuf enum <code>SHARECHAT = 9;</code>
     */
    const SHARECHAT = 9;
    /**
     * Generated from protobuf enum <code>GOOGLE_PHOTOS = 10;</code>
     */
    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);
    }
}

