<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/fleetengine/delivery/v1/common.proto

namespace Google\Maps\FleetEngine\Delivery\V1;

use UnexpectedValueException;

/**
 * The vehicle's navigation status.
 *
 * Protobuf type <code>maps.fleetengine.delivery.v1.DeliveryVehicleNavigationStatus</code>
 */
class DeliveryVehicleNavigationStatus
{
    /**
     * Unspecified navigation status.
     *
     * Generated from protobuf enum <code>UNKNOWN_NAVIGATION_STATUS = 0;</code>
     */
    const UNKNOWN_NAVIGATION_STATUS = 0;
    /**
     * The Driver app's navigation is in `FREE_NAV` mode.
     *
     * Generated from protobuf enum <code>NO_GUIDANCE = 1;</code>
     */
    const NO_GUIDANCE = 1;
    /**
     * Turn-by-turn navigation is available and the Driver app navigation has
     * entered `GUIDED_NAV` mode.
     *
     * Generated from protobuf enum <code>ENROUTE_TO_DESTINATION = 2;</code>
     */
    const ENROUTE_TO_DESTINATION = 2;
    /**
     * The vehicle has gone off the suggested route.
     *
     * Generated from protobuf enum <code>OFF_ROUTE = 3;</code>
     */
    const OFF_ROUTE = 3;
    /**
     * The vehicle is within approximately 50m of the destination.
     *
     * Generated from protobuf enum <code>ARRIVED_AT_DESTINATION = 4;</code>
     */
    const ARRIVED_AT_DESTINATION = 4;

    private static $valueToName = [
        self::UNKNOWN_NAVIGATION_STATUS => 'UNKNOWN_NAVIGATION_STATUS',
        self::NO_GUIDANCE => 'NO_GUIDANCE',
        self::ENROUTE_TO_DESTINATION => 'ENROUTE_TO_DESTINATION',
        self::OFF_ROUTE => 'OFF_ROUTE',
        self::ARRIVED_AT_DESTINATION => 'ARRIVED_AT_DESTINATION',
    ];

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

