<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/access_control/v1/keyapis_access_control_access_point_v1.proto

namespace Keyapis\AccessControl\V1\PostAccessPointOpenRequest;

use UnexpectedValueException;

/**
 * Тип ТС
 *
 * Protobuf type <code>keyapis.access_control.v1.PostAccessPointOpenRequest.VehicleType</code>
 */
class VehicleType
{
    /**
     * Не указано
     *
     * Generated from protobuf enum <code>VEHICLE_TYPE_UNKNOWN = 0;</code>
     */
    const VEHICLE_TYPE_UNKNOWN = 0;
    /**
     * МЧС
     *
     * Generated from protobuf enum <code>EMERGENCY = 1;</code>
     */
    const EMERGENCY = 1;
    /**
     * Полиция
     *
     * Generated from protobuf enum <code>POLICE = 2;</code>
     */
    const POLICE = 2;
    /**
     * Скорая помощь
     *
     * Generated from protobuf enum <code>AMBULANCE = 3;</code>
     */
    const AMBULANCE = 3;
    /**
     * Мусоровоз
     *
     * Generated from protobuf enum <code>GARBAGE_TRUCK = 4;</code>
     */
    const GARBAGE_TRUCK = 4;
    /**
     * Такси
     *
     * Generated from protobuf enum <code>TAXI = 5;</code>
     */
    const TAXI = 5;

    private static $valueToName = [
        self::VEHICLE_TYPE_UNKNOWN => 'VEHICLE_TYPE_UNKNOWN',
        self::EMERGENCY => 'EMERGENCY',
        self::POLICE => 'POLICE',
        self::AMBULANCE => 'AMBULANCE',
        self::GARBAGE_TRUCK => 'GARBAGE_TRUCK',
        self::TAXI => 'TAXI',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(VehicleType::class, \Keyapis\AccessControl\V1\PostAccessPointOpenRequest_VehicleType::class);

