<?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;
    /**
     * SHORT_LIVED is the dedicated upgrade strategy for
     * QueuedProvisioning and flex start nodepools scaled up only by enqueueing to
     * the Dynamic Workload Scheduler (DWS).
     *
     * Generated from protobuf enum <code>SHORT_LIVED = 5;</code>
     */
    const SHORT_LIVED = 5;

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

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

