<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/talent/v4beta1/filters.proto

namespace Google\Cloud\Talent\V4beta1\CommuteFilter;

use UnexpectedValueException;

/**
 * The traffic density to use when calculating commute time.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic</code>
 */
class RoadTraffic
{
    /**
     * Road traffic situation isn't specified.
     *
     * Generated from protobuf enum <code>ROAD_TRAFFIC_UNSPECIFIED = 0;</code>
     */
    const ROAD_TRAFFIC_UNSPECIFIED = 0;
    /**
     * Optimal commute time without considering any traffic impact.
     *
     * Generated from protobuf enum <code>TRAFFIC_FREE = 1;</code>
     */
    const TRAFFIC_FREE = 1;
    /**
     * Commute time calculation takes in account the peak traffic impact.
     *
     * Generated from protobuf enum <code>BUSY_HOUR = 2;</code>
     */
    const BUSY_HOUR = 2;

    private static $valueToName = [
        self::ROAD_TRAFFIC_UNSPECIFIED => 'ROAD_TRAFFIC_UNSPECIFIED',
        self::TRAFFIC_FREE => 'TRAFFIC_FREE',
        self::BUSY_HOUR => 'BUSY_HOUR',
    ];

    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(RoadTraffic::class, \Google\Cloud\Talent\V4beta1\CommuteFilter_RoadTraffic::class);

