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

namespace PhpWA\Protocol\Proto\DisappearingMode;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.DisappearingMode.Initiator</code>
 */
class Initiator
{
    /**
     * Generated from protobuf enum <code>CHANGED_IN_CHAT = 0;</code>
     */
    const CHANGED_IN_CHAT = 0;
    /**
     * Generated from protobuf enum <code>INITIATED_BY_ME = 1;</code>
     */
    const INITIATED_BY_ME = 1;
    /**
     * Generated from protobuf enum <code>INITIATED_BY_OTHER = 2;</code>
     */
    const INITIATED_BY_OTHER = 2;
    /**
     * Generated from protobuf enum <code>BIZ_UPGRADE_FB_HOSTING = 3;</code>
     */
    const BIZ_UPGRADE_FB_HOSTING = 3;

    private static $valueToName = [
        self::CHANGED_IN_CHAT => 'CHANGED_IN_CHAT',
        self::INITIATED_BY_ME => 'INITIATED_BY_ME',
        self::INITIATED_BY_OTHER => 'INITIATED_BY_OTHER',
        self::BIZ_UPGRADE_FB_HOSTING => 'BIZ_UPGRADE_FB_HOSTING',
    ];

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

