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

namespace Google\Maps\FleetEngine\V1;

use UnexpectedValueException;

/**
 * The status of a trip indicating its progression.
 *
 * Protobuf type <code>maps.fleetengine.v1.TripStatus</code>
 */
class TripStatus
{
    /**
     * Default, used for unspecified or unrecognized trip status.
     *
     * Generated from protobuf enum <code>UNKNOWN_TRIP_STATUS = 0;</code>
     */
    const UNKNOWN_TRIP_STATUS = 0;
    /**
     * Newly created trip.
     *
     * Generated from protobuf enum <code>NEW = 1;</code>
     */
    const PBNEW = 1;
    /**
     * The driver is on their way to the pickup point.
     *
     * Generated from protobuf enum <code>ENROUTE_TO_PICKUP = 2;</code>
     */
    const ENROUTE_TO_PICKUP = 2;
    /**
     * The driver has arrived at the pickup point.
     *
     * Generated from protobuf enum <code>ARRIVED_AT_PICKUP = 3;</code>
     */
    const ARRIVED_AT_PICKUP = 3;
    /**
     * The driver has arrived at an intermediate destination and is waiting for
     * the rider.
     *
     * Generated from protobuf enum <code>ARRIVED_AT_INTERMEDIATE_DESTINATION = 7;</code>
     */
    const ARRIVED_AT_INTERMEDIATE_DESTINATION = 7;
    /**
     * The driver is on their way to an intermediate destination
     * (not the dropoff point).
     *
     * Generated from protobuf enum <code>ENROUTE_TO_INTERMEDIATE_DESTINATION = 8;</code>
     */
    const ENROUTE_TO_INTERMEDIATE_DESTINATION = 8;
    /**
     * The driver has picked up the rider and is on their way to the
     * next destination.
     *
     * Generated from protobuf enum <code>ENROUTE_TO_DROPOFF = 4;</code>
     */
    const ENROUTE_TO_DROPOFF = 4;
    /**
     * The rider has been dropped off and the trip is complete.
     *
     * Generated from protobuf enum <code>COMPLETE = 5;</code>
     */
    const COMPLETE = 5;
    /**
     * The trip was canceled prior to pickup by the driver, rider, or
     * rideshare provider.
     *
     * Generated from protobuf enum <code>CANCELED = 6;</code>
     */
    const CANCELED = 6;

    private static $valueToName = [
        self::UNKNOWN_TRIP_STATUS => 'UNKNOWN_TRIP_STATUS',
        self::PBNEW => 'NEW',
        self::ENROUTE_TO_PICKUP => 'ENROUTE_TO_PICKUP',
        self::ARRIVED_AT_PICKUP => 'ARRIVED_AT_PICKUP',
        self::ARRIVED_AT_INTERMEDIATE_DESTINATION => 'ARRIVED_AT_INTERMEDIATE_DESTINATION',
        self::ENROUTE_TO_INTERMEDIATE_DESTINATION => 'ENROUTE_TO_INTERMEDIATE_DESTINATION',
        self::ENROUTE_TO_DROPOFF => 'ENROUTE_TO_DROPOFF',
        self::COMPLETE => 'COMPLETE',
        self::CANCELED => 'CANCELED',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

