<?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 sensor or methodology used to determine the location.
 *
 * Protobuf type <code>maps.fleetengine.delivery.v1.DeliveryVehicleLocationSensor</code>
 */
class DeliveryVehicleLocationSensor
{
    /**
     * The sensor is unspecified or unknown.
     *
     * Generated from protobuf enum <code>UNKNOWN_SENSOR = 0;</code>
     */
    const UNKNOWN_SENSOR = 0;
    /**
     * GPS or Assisted GPS.
     *
     * Generated from protobuf enum <code>GPS = 1;</code>
     */
    const GPS = 1;
    /**
     * Assisted GPS, cell tower ID, or WiFi access point.
     *
     * Generated from protobuf enum <code>NETWORK = 2;</code>
     */
    const NETWORK = 2;
    /**
     * Cell tower ID or WiFi access point.
     *
     * Generated from protobuf enum <code>PASSIVE = 3;</code>
     */
    const PASSIVE = 3;
    /**
     * A location determined by the mobile device to be the most likely
     * road position.
     *
     * Generated from protobuf enum <code>ROAD_SNAPPED_LOCATION_PROVIDER = 4;</code>
     */
    const ROAD_SNAPPED_LOCATION_PROVIDER = 4;
    /**
     * A customer-supplied location from an independent source.  Typically, this
     * value is used for a location provided from sources other than the mobile
     * device running Driver SDK.  If the original source is described by one of
     * the other enum values, use that value. Locations marked
     * CUSTOMER_SUPPLIED_LOCATION are typically provided via a DeliveryVehicle's
     * `last_location.supplemental_location_sensor`.
     *
     * Generated from protobuf enum <code>CUSTOMER_SUPPLIED_LOCATION = 5;</code>
     */
    const CUSTOMER_SUPPLIED_LOCATION = 5;
    /**
     * A location calculated by Fleet Engine based on the signals available to it.
     * Output only. This value will be rejected if it is received in a request.
     *
     * Generated from protobuf enum <code>FLEET_ENGINE_LOCATION = 6;</code>
     */
    const FLEET_ENGINE_LOCATION = 6;
    /**
     * Android's Fused Location Provider.
     *
     * Generated from protobuf enum <code>FUSED_LOCATION_PROVIDER = 100;</code>
     */
    const FUSED_LOCATION_PROVIDER = 100;
    /**
     * The location provider on Apple operating systems.
     *
     * Generated from protobuf enum <code>CORE_LOCATION = 200;</code>
     */
    const CORE_LOCATION = 200;

    private static $valueToName = [
        self::UNKNOWN_SENSOR => 'UNKNOWN_SENSOR',
        self::GPS => 'GPS',
        self::NETWORK => 'NETWORK',
        self::PASSIVE => 'PASSIVE',
        self::ROAD_SNAPPED_LOCATION_PROVIDER => 'ROAD_SNAPPED_LOCATION_PROVIDER',
        self::CUSTOMER_SUPPLIED_LOCATION => 'CUSTOMER_SUPPLIED_LOCATION',
        self::FLEET_ENGINE_LOCATION => 'FLEET_ENGINE_LOCATION',
        self::FUSED_LOCATION_PROVIDER => 'FUSED_LOCATION_PROVIDER',
        self::CORE_LOCATION => 'CORE_LOCATION',
    ];

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

