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

namespace Google\Cloud\NetApp\V1\StoragePool;

use UnexpectedValueException;

/**
 * The Storage Pool States
 *
 * Protobuf type <code>google.cloud.netapp.v1.StoragePool.State</code>
 */
class State
{
    /**
     * Unspecified Storage Pool State
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Storage Pool State is Ready
     *
     * Generated from protobuf enum <code>READY = 1;</code>
     */
    const READY = 1;
    /**
     * Storage Pool State is Creating
     *
     * Generated from protobuf enum <code>CREATING = 2;</code>
     */
    const CREATING = 2;
    /**
     * Storage Pool State is Deleting
     *
     * Generated from protobuf enum <code>DELETING = 3;</code>
     */
    const DELETING = 3;
    /**
     * Storage Pool State is Updating
     *
     * Generated from protobuf enum <code>UPDATING = 4;</code>
     */
    const UPDATING = 4;
    /**
     * Storage Pool State is Restoring
     *
     * Generated from protobuf enum <code>RESTORING = 5;</code>
     */
    const RESTORING = 5;
    /**
     * Storage Pool State is Disabled
     *
     * Generated from protobuf enum <code>DISABLED = 6;</code>
     */
    const DISABLED = 6;
    /**
     * Storage Pool State is Error
     *
     * Generated from protobuf enum <code>ERROR = 7;</code>
     */
    const ERROR = 7;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::READY => 'READY',
        self::CREATING => 'CREATING',
        self::DELETING => 'DELETING',
        self::UPDATING => 'UPDATING',
        self::RESTORING => 'RESTORING',
        self::DISABLED => 'DISABLED',
        self::ERROR => 'ERROR',
    ];

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


