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

namespace PhpWA\Protocol\Proto\StatusAttribution;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.StatusAttribution.Type</code>
 */
class Type
{
    /**
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>RESHARE = 1;</code>
     */
    const RESHARE = 1;
    /**
     * Generated from protobuf enum <code>EXTERNAL_SHARE = 2;</code>
     */
    const EXTERNAL_SHARE = 2;
    /**
     * Generated from protobuf enum <code>MUSIC = 3;</code>
     */
    const MUSIC = 3;
    /**
     * Generated from protobuf enum <code>STATUS_MENTION = 4;</code>
     */
    const STATUS_MENTION = 4;
    /**
     * Generated from protobuf enum <code>GROUP_STATUS = 5;</code>
     */
    const GROUP_STATUS = 5;
    /**
     * Generated from protobuf enum <code>RL_ATTRIBUTION = 6;</code>
     */
    const RL_ATTRIBUTION = 6;
    /**
     * Generated from protobuf enum <code>AI_CREATED = 7;</code>
     */
    const AI_CREATED = 7;
    /**
     * Generated from protobuf enum <code>LAYOUTS = 8;</code>
     */
    const LAYOUTS = 8;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::RESHARE => 'RESHARE',
        self::EXTERNAL_SHARE => 'EXTERNAL_SHARE',
        self::MUSIC => 'MUSIC',
        self::STATUS_MENTION => 'STATUS_MENTION',
        self::GROUP_STATUS => 'GROUP_STATUS',
        self::RL_ATTRIBUTION => 'RL_ATTRIBUTION',
        self::AI_CREATED => 'AI_CREATED',
        self::LAYOUTS => 'LAYOUTS',
    ];

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

