<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/admin/v2/bigtable_instance_admin.proto

namespace Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata\TableProgress;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.bigtable.admin.v2.CreateClusterMetadata.TableProgress.State</code>
 */
class State
{
    /**
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The table has not yet begun copying to the new cluster.
     *
     * Generated from protobuf enum <code>PENDING = 1;</code>
     */
    const PENDING = 1;
    /**
     * The table is actively being copied to the new cluster.
     *
     * Generated from protobuf enum <code>COPYING = 2;</code>
     */
    const COPYING = 2;
    /**
     * The table has been fully copied to the new cluster.
     *
     * Generated from protobuf enum <code>COMPLETED = 3;</code>
     */
    const COMPLETED = 3;
    /**
     * The table was deleted before it finished copying to the new cluster.
     * Note that tables deleted after completion will stay marked as
     * COMPLETED, not CANCELLED.
     *
     * Generated from protobuf enum <code>CANCELLED = 4;</code>
     */
    const CANCELLED = 4;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::PENDING => 'PENDING',
        self::COPYING => 'COPYING',
        self::COMPLETED => 'COMPLETED',
        self::CANCELLED => 'CANCELLED',
    ];

    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(State::class, \Google\Cloud\Bigtable\Admin\V2\CreateClusterMetadata_TableProgress_State::class);

