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

namespace Google\Cloud\Talent\V4;

use UnexpectedValueException;

/**
 * Method for commute.
 *
 * Protobuf type <code>google.cloud.talent.v4.CommuteMethod</code>
 */
class CommuteMethod
{
    /**
     * Commute method isn't specified.
     *
     * Generated from protobuf enum <code>COMMUTE_METHOD_UNSPECIFIED = 0;</code>
     */
    const COMMUTE_METHOD_UNSPECIFIED = 0;
    /**
     * Commute time is calculated based on driving time.
     *
     * Generated from protobuf enum <code>DRIVING = 1;</code>
     */
    const DRIVING = 1;
    /**
     * Commute time is calculated based on public transit including bus, metro,
     * subway, and so on.
     *
     * Generated from protobuf enum <code>TRANSIT = 2;</code>
     */
    const TRANSIT = 2;

    private static $valueToName = [
        self::COMMUTE_METHOD_UNSPECIFIED => 'COMMUTE_METHOD_UNSPECIFIED',
        self::DRIVING => 'DRIVING',
        self::TRANSIT => 'TRANSIT',
    ];

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

