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

namespace PhpWA\Protocol\Proto\PaymentInfo;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.PaymentInfo.Status</code>
 */
class Status
{
    /**
     * Generated from protobuf enum <code>UNKNOWN_STATUS = 0;</code>
     */
    const UNKNOWN_STATUS = 0;
    /**
     * Generated from protobuf enum <code>PROCESSING = 1;</code>
     */
    const PROCESSING = 1;
    /**
     * Generated from protobuf enum <code>SENT = 2;</code>
     */
    const SENT = 2;
    /**
     * Generated from protobuf enum <code>NEED_TO_ACCEPT = 3;</code>
     */
    const NEED_TO_ACCEPT = 3;
    /**
     * Generated from protobuf enum <code>COMPLETE = 4;</code>
     */
    const COMPLETE = 4;
    /**
     * Generated from protobuf enum <code>COULD_NOT_COMPLETE = 5;</code>
     */
    const COULD_NOT_COMPLETE = 5;
    /**
     * Generated from protobuf enum <code>REFUNDED = 6;</code>
     */
    const REFUNDED = 6;
    /**
     * Generated from protobuf enum <code>EXPIRED = 7;</code>
     */
    const EXPIRED = 7;
    /**
     * Generated from protobuf enum <code>REJECTED = 8;</code>
     */
    const REJECTED = 8;
    /**
     * Generated from protobuf enum <code>CANCELLED = 9;</code>
     */
    const CANCELLED = 9;
    /**
     * Generated from protobuf enum <code>WAITING_FOR_PAYER = 10;</code>
     */
    const WAITING_FOR_PAYER = 10;
    /**
     * Generated from protobuf enum <code>WAITING = 11;</code>
     */
    const WAITING = 11;

    private static $valueToName = [
        self::UNKNOWN_STATUS => 'UNKNOWN_STATUS',
        self::PROCESSING => 'PROCESSING',
        self::SENT => 'SENT',
        self::NEED_TO_ACCEPT => 'NEED_TO_ACCEPT',
        self::COMPLETE => 'COMPLETE',
        self::COULD_NOT_COMPLETE => 'COULD_NOT_COMPLETE',
        self::REFUNDED => 'REFUNDED',
        self::EXPIRED => 'EXPIRED',
        self::REJECTED => 'REJECTED',
        self::CANCELLED => 'CANCELLED',
        self::WAITING_FOR_PAYER => 'WAITING_FOR_PAYER',
        self::WAITING => 'WAITING',
    ];

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

