<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/container/v1/cluster_service.proto

namespace Google\Cloud\Container\V1\NodeTaint;

use UnexpectedValueException;

/**
 * Possible values for Effect in taint.
 *
 * Protobuf type <code>google.container.v1.NodeTaint.Effect</code>
 */
class Effect
{
    /**
     * Not set
     *
     * Generated from protobuf enum <code>EFFECT_UNSPECIFIED = 0;</code>
     */
    const EFFECT_UNSPECIFIED = 0;
    /**
     * NoSchedule
     *
     * Generated from protobuf enum <code>NO_SCHEDULE = 1;</code>
     */
    const NO_SCHEDULE = 1;
    /**
     * PreferNoSchedule
     *
     * Generated from protobuf enum <code>PREFER_NO_SCHEDULE = 2;</code>
     */
    const PREFER_NO_SCHEDULE = 2;
    /**
     * NoExecute
     *
     * Generated from protobuf enum <code>NO_EXECUTE = 3;</code>
     */
    const NO_EXECUTE = 3;

    private static $valueToName = [
        self::EFFECT_UNSPECIFIED => 'EFFECT_UNSPECIFIED',
        self::NO_SCHEDULE => 'NO_SCHEDULE',
        self::PREFER_NO_SCHEDULE => 'PREFER_NO_SCHEDULE',
        self::NO_EXECUTE => 'NO_EXECUTE',
    ];

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


