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

namespace Google\Cloud\GkeMultiCloud\V1\NodeTaint;

use UnexpectedValueException;

/**
 * The taint effect.
 *
 * Protobuf type <code>google.cloud.gkemulticloud.v1.NodeTaint.Effect</code>
 */
class Effect
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>EFFECT_UNSPECIFIED = 0;</code>
     */
    const EFFECT_UNSPECIFIED = 0;
    /**
     * Do not allow new pods to schedule onto the node unless they tolerate the
     * taint, but allow all pods submitted to Kubelet without going through the
     * scheduler to start, and allow all already-running pods to continue
     * running. Enforced by the scheduler.
     *
     * Generated from protobuf enum <code>NO_SCHEDULE = 1;</code>
     */
    const NO_SCHEDULE = 1;
    /**
     * Like TaintEffectNoSchedule, but the scheduler tries not to schedule
     * new pods onto the node, rather than prohibiting new pods from scheduling
     * onto the node entirely. Enforced by the scheduler.
     *
     * Generated from protobuf enum <code>PREFER_NO_SCHEDULE = 2;</code>
     */
    const PREFER_NO_SCHEDULE = 2;
    /**
     * Evict any already-running pods that do not tolerate the taint.
     * Currently enforced by NodeController.
     *
     * 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);
    }
}


