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

namespace Google\Cloud\Container\V1;

use UnexpectedValueException;

/**
 * Strategy used for node pool update.
 *
 * Protobuf type <code>google.container.v1.NodePoolUpdateStrategy</code>
 */
class NodePoolUpdateStrategy
{
    /**
     * Default value if unset. GKE internally defaults the update strategy to
     * SURGE for unspecified strategies.
     *
     * Generated from protobuf enum <code>NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0;</code>
     */
    const NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0;
    /**
     * blue-green upgrade.
     *
     * Generated from protobuf enum <code>BLUE_GREEN = 2;</code>
     */
    const BLUE_GREEN = 2;
    /**
     * SURGE is the traditional way of upgrade a node pool.
     * max_surge and max_unavailable determines the level of upgrade parallelism.
     *
     * Generated from protobuf enum <code>SURGE = 3;</code>
     */
    const SURGE = 3;

    private static $valueToName = [
        self::NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED => 'NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED',
        self::BLUE_GREEN => 'BLUE_GREEN',
        self::SURGE => 'SURGE',
    ];

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

