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

namespace Google\Cloud\Talent\V4beta1;

use UnexpectedValueException;

/**
 * Method for commute.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.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, etc.
     *
     * Generated from protobuf enum <code>TRANSIT = 2;</code>
     */
    const TRANSIT = 2;
    /**
     * Commute time is calculated based on walking time.
     *
     * Generated from protobuf enum <code>WALKING = 3;</code>
     */
    const WALKING = 3;
    /**
     * Commute time is calculated based on biking time.
     *
     * Generated from protobuf enum <code>CYCLING = 4;</code>
     */
    const CYCLING = 4;

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

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

