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

namespace Google\Cloud\Metastore\V1\Federation;

use UnexpectedValueException;

/**
 * The current state of the federation.
 *
 * Protobuf type <code>google.cloud.metastore.v1.Federation.State</code>
 */
class State
{
    /**
     * The state of the metastore federation is unknown.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The metastore federation is in the process of being created.
     *
     * Generated from protobuf enum <code>CREATING = 1;</code>
     */
    const CREATING = 1;
    /**
     * The metastore federation is running and ready to serve queries.
     *
     * Generated from protobuf enum <code>ACTIVE = 2;</code>
     */
    const ACTIVE = 2;
    /**
     * The metastore federation is being updated. It remains usable but cannot
     * accept additional update requests or be deleted at this time.
     *
     * Generated from protobuf enum <code>UPDATING = 3;</code>
     */
    const UPDATING = 3;
    /**
     * The metastore federation is undergoing deletion. It cannot be used.
     *
     * Generated from protobuf enum <code>DELETING = 4;</code>
     */
    const DELETING = 4;
    /**
     * The metastore federation has encountered an error and cannot be used. The
     * metastore federation should be deleted.
     *
     * Generated from protobuf enum <code>ERROR = 5;</code>
     */
    const ERROR = 5;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::CREATING => 'CREATING',
        self::ACTIVE => 'ACTIVE',
        self::UPDATING => 'UPDATING',
        self::DELETING => 'DELETING',
        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);
    }
}


