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

namespace OS\PB\CodeHopResponse;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.CodeHopResponse.CodeHopResponseTypes</code>
 */
class CodeHopResponseTypes
{
    /**
     * Generated from protobuf enum <code>CodeHopResponse_NotSet = 0;</code>
     */
    const CodeHopResponse_NotSet = 0;
    /**
     * Successfully determined the codehop serial and no other serials were reported during that time
     *
     * Generated from protobuf enum <code>CodeHopResponse_Success = 1;</code>
     */
    const CodeHopResponse_Success = 1;
    /**
     * Determined a codehop serial but other codehop serials were detected during the CodeHopEnroll request.
     *
     * Generated from protobuf enum <code>CodeHopResponse_Unclear = 2;</code>
     */
    const CodeHopResponse_Unclear = 2;
    /**
     * No Serial was detected during the process that matched the button pressed
     *
     * Generated from protobuf enum <code>CodeHopResponse_Failed = 3;</code>
     */
    const CodeHopResponse_Failed = 3;

    private static $valueToName = [
        self::CodeHopResponse_NotSet => 'CodeHopResponse_NotSet',
        self::CodeHopResponse_Success => 'CodeHopResponse_Success',
        self::CodeHopResponse_Unclear => 'CodeHopResponse_Unclear',
        self::CodeHopResponse_Failed => 'CodeHopResponse_Failed',
    ];

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

