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

namespace Google\Cloud\Talent\V4beta1\LocationFilter;

use UnexpectedValueException;

/**
 * Specify whether to include telecommute jobs.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference</code>
 */
class TelecommutePreference
{
    /**
     * Default value if the telecommute preference isn't specified.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0;</code>
     */
    const TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0;
    /**
     * Exclude telecommute jobs.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_EXCLUDED = 1;</code>
     */
    const TELECOMMUTE_EXCLUDED = 1;
    /**
     * Allow telecommute jobs.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_ALLOWED = 2;</code>
     */
    const TELECOMMUTE_ALLOWED = 2;

    private static $valueToName = [
        self::TELECOMMUTE_PREFERENCE_UNSPECIFIED => 'TELECOMMUTE_PREFERENCE_UNSPECIFIED',
        self::TELECOMMUTE_EXCLUDED => 'TELECOMMUTE_EXCLUDED',
        self::TELECOMMUTE_ALLOWED => 'TELECOMMUTE_ALLOWED',
    ];

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

