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

namespace PhpWA\Protocol\Proto\BotReminderMetadata;

use UnexpectedValueException;

/**
 * Protobuf type <code>proto.BotReminderMetadata.ReminderFrequency</code>
 */
class ReminderFrequency
{
    /**
     * Generated from protobuf enum <code>REMINDER_FREQUENCY_UNSPECIFIED = 0;</code>
     */
    const REMINDER_FREQUENCY_UNSPECIFIED = 0;
    /**
     * Generated from protobuf enum <code>ONCE = 1;</code>
     */
    const ONCE = 1;
    /**
     * Generated from protobuf enum <code>DAILY = 2;</code>
     */
    const DAILY = 2;
    /**
     * Generated from protobuf enum <code>WEEKLY = 3;</code>
     */
    const WEEKLY = 3;
    /**
     * Generated from protobuf enum <code>BIWEEKLY = 4;</code>
     */
    const BIWEEKLY = 4;
    /**
     * Generated from protobuf enum <code>MONTHLY = 5;</code>
     */
    const MONTHLY = 5;

    private static $valueToName = [
        self::REMINDER_FREQUENCY_UNSPECIFIED => 'REMINDER_FREQUENCY_UNSPECIFIED',
        self::ONCE => 'ONCE',
        self::DAILY => 'DAILY',
        self::WEEKLY => 'WEEKLY',
        self::BIWEEKLY => 'BIWEEKLY',
        self::MONTHLY => 'MONTHLY',
    ];

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

