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

namespace OS\PB;

use UnexpectedValueException;

/**
 * \@brief   DaysOfWeekBits uses AccessDaysOfWeek bit masks to check if a day is set
 *
 * Protobuf type <code>OS.PB.AccessDaysOfWeekBits</code>
 */
class AccessDaysOfWeekBits
{
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_AllDays = 0;</code>
     */
    const AccessDaysOfWeek_AllDays = 0;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Monday = 1;</code>
     */
    const AccessDaysOfWeek_Monday = 1;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Tuesday = 2;</code>
     */
    const AccessDaysOfWeek_Tuesday = 2;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Wednesday = 4;</code>
     */
    const AccessDaysOfWeek_Wednesday = 4;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Thursday = 8;</code>
     */
    const AccessDaysOfWeek_Thursday = 8;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Friday = 16;</code>
     */
    const AccessDaysOfWeek_Friday = 16;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Saturday = 32;</code>
     */
    const AccessDaysOfWeek_Saturday = 32;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Sunday = 64;</code>
     */
    const AccessDaysOfWeek_Sunday = 64;
    /**
     * Generated from protobuf enum <code>AccessDaysOfWeek_Holidays = 128;</code>
     */
    const AccessDaysOfWeek_Holidays = 128;

    private static $valueToName = [
        self::AccessDaysOfWeek_AllDays => 'AccessDaysOfWeek_AllDays',
        self::AccessDaysOfWeek_Monday => 'AccessDaysOfWeek_Monday',
        self::AccessDaysOfWeek_Tuesday => 'AccessDaysOfWeek_Tuesday',
        self::AccessDaysOfWeek_Wednesday => 'AccessDaysOfWeek_Wednesday',
        self::AccessDaysOfWeek_Thursday => 'AccessDaysOfWeek_Thursday',
        self::AccessDaysOfWeek_Friday => 'AccessDaysOfWeek_Friday',
        self::AccessDaysOfWeek_Saturday => 'AccessDaysOfWeek_Saturday',
        self::AccessDaysOfWeek_Sunday => 'AccessDaysOfWeek_Sunday',
        self::AccessDaysOfWeek_Holidays => 'AccessDaysOfWeek_Holidays',
    ];

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

