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

namespace Google\Cloud\Container\V1\Operation;

use UnexpectedValueException;

/**
 * Operation type.
 *
 * Protobuf type <code>google.container.v1.Operation.Type</code>
 */
class Type
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * Cluster create.
     *
     * Generated from protobuf enum <code>CREATE_CLUSTER = 1;</code>
     */
    const CREATE_CLUSTER = 1;
    /**
     * Cluster delete.
     *
     * Generated from protobuf enum <code>DELETE_CLUSTER = 2;</code>
     */
    const DELETE_CLUSTER = 2;
    /**
     * A master upgrade.
     *
     * Generated from protobuf enum <code>UPGRADE_MASTER = 3;</code>
     */
    const UPGRADE_MASTER = 3;
    /**
     * A node upgrade.
     *
     * Generated from protobuf enum <code>UPGRADE_NODES = 4;</code>
     */
    const UPGRADE_NODES = 4;
    /**
     * Cluster repair.
     *
     * Generated from protobuf enum <code>REPAIR_CLUSTER = 5;</code>
     */
    const REPAIR_CLUSTER = 5;
    /**
     * Cluster update.
     *
     * Generated from protobuf enum <code>UPDATE_CLUSTER = 6;</code>
     */
    const UPDATE_CLUSTER = 6;
    /**
     * Node pool create.
     *
     * Generated from protobuf enum <code>CREATE_NODE_POOL = 7;</code>
     */
    const CREATE_NODE_POOL = 7;
    /**
     * Node pool delete.
     *
     * Generated from protobuf enum <code>DELETE_NODE_POOL = 8;</code>
     */
    const DELETE_NODE_POOL = 8;
    /**
     * Set node pool management.
     *
     * Generated from protobuf enum <code>SET_NODE_POOL_MANAGEMENT = 9;</code>
     */
    const SET_NODE_POOL_MANAGEMENT = 9;
    /**
     * Automatic node pool repair.
     *
     * Generated from protobuf enum <code>AUTO_REPAIR_NODES = 10;</code>
     */
    const AUTO_REPAIR_NODES = 10;
    /**
     * Automatic node upgrade.
     *
     * Generated from protobuf enum <code>AUTO_UPGRADE_NODES = 11;</code>
     */
    const AUTO_UPGRADE_NODES = 11;
    /**
     * Set labels.
     *
     * Generated from protobuf enum <code>SET_LABELS = 12;</code>
     */
    const SET_LABELS = 12;
    /**
     * Set/generate master auth materials
     *
     * Generated from protobuf enum <code>SET_MASTER_AUTH = 13;</code>
     */
    const SET_MASTER_AUTH = 13;
    /**
     * Set node pool size.
     *
     * Generated from protobuf enum <code>SET_NODE_POOL_SIZE = 14;</code>
     */
    const SET_NODE_POOL_SIZE = 14;
    /**
     * Updates network policy for a cluster.
     *
     * Generated from protobuf enum <code>SET_NETWORK_POLICY = 15;</code>
     */
    const SET_NETWORK_POLICY = 15;
    /**
     * Set the maintenance policy.
     *
     * Generated from protobuf enum <code>SET_MAINTENANCE_POLICY = 16;</code>
     */
    const SET_MAINTENANCE_POLICY = 16;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::CREATE_CLUSTER => 'CREATE_CLUSTER',
        self::DELETE_CLUSTER => 'DELETE_CLUSTER',
        self::UPGRADE_MASTER => 'UPGRADE_MASTER',
        self::UPGRADE_NODES => 'UPGRADE_NODES',
        self::REPAIR_CLUSTER => 'REPAIR_CLUSTER',
        self::UPDATE_CLUSTER => 'UPDATE_CLUSTER',
        self::CREATE_NODE_POOL => 'CREATE_NODE_POOL',
        self::DELETE_NODE_POOL => 'DELETE_NODE_POOL',
        self::SET_NODE_POOL_MANAGEMENT => 'SET_NODE_POOL_MANAGEMENT',
        self::AUTO_REPAIR_NODES => 'AUTO_REPAIR_NODES',
        self::AUTO_UPGRADE_NODES => 'AUTO_UPGRADE_NODES',
        self::SET_LABELS => 'SET_LABELS',
        self::SET_MASTER_AUTH => 'SET_MASTER_AUTH',
        self::SET_NODE_POOL_SIZE => 'SET_NODE_POOL_SIZE',
        self::SET_NETWORK_POLICY => 'SET_NETWORK_POLICY',
        self::SET_MAINTENANCE_POLICY => 'SET_MAINTENANCE_POLICY',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Type::class, \Google\Cloud\Container\V1\Operation_Type::class);

