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

namespace PhpWA\Protocol\Proto\Message\CallLogMessage;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.Message.CallLogMessage.CallOutcome</code>
 */
class CallOutcome
{
    /**
     * Generated from protobuf enum <code>CONNECTED = 0;</code>
     */
    const CONNECTED = 0;
    /**
     * Generated from protobuf enum <code>MISSED = 1;</code>
     */
    const MISSED = 1;
    /**
     * Generated from protobuf enum <code>FAILED = 2;</code>
     */
    const FAILED = 2;
    /**
     * Generated from protobuf enum <code>REJECTED = 3;</code>
     */
    const REJECTED = 3;
    /**
     * Generated from protobuf enum <code>ACCEPTED_ELSEWHERE = 4;</code>
     */
    const ACCEPTED_ELSEWHERE = 4;
    /**
     * Generated from protobuf enum <code>ONGOING = 5;</code>
     */
    const ONGOING = 5;
    /**
     * Generated from protobuf enum <code>SILENCED_BY_DND = 6;</code>
     */
    const SILENCED_BY_DND = 6;
    /**
     * Generated from protobuf enum <code>SILENCED_UNKNOWN_CALLER = 7;</code>
     */
    const SILENCED_UNKNOWN_CALLER = 7;

    private static $valueToName = [
        self::CONNECTED => 'CONNECTED',
        self::MISSED => 'MISSED',
        self::FAILED => 'FAILED',
        self::REJECTED => 'REJECTED',
        self::ACCEPTED_ELSEWHERE => 'ACCEPTED_ELSEWHERE',
        self::ONGOING => 'ONGOING',
        self::SILENCED_BY_DND => 'SILENCED_BY_DND',
        self::SILENCED_UNKNOWN_CALLER => 'SILENCED_UNKNOWN_CALLER',
    ];

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

