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

namespace Google\Cloud\Talent\V4\LocationFilter;

use UnexpectedValueException;

/**
 * Specify whether to include telecommute jobs.
 *
 * Protobuf type <code>google.cloud.talent.v4.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;
    /**
     * Deprecated: Ignore telecommute status of jobs. Use
     * TELECOMMUTE_JOBS_EXCLUDED if want to exclude telecommute jobs.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_EXCLUDED = 1 [deprecated = true];</code>
     */
    const TELECOMMUTE_EXCLUDED = 1;
    /**
     * Allow telecommute jobs.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_ALLOWED = 2;</code>
     */
    const TELECOMMUTE_ALLOWED = 2;
    /**
     * Exclude telecommute jobs.
     *
     * Generated from protobuf enum <code>TELECOMMUTE_JOBS_EXCLUDED = 3;</code>
     */
    const TELECOMMUTE_JOBS_EXCLUDED = 3;

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

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


