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

namespace Google\Cloud\BigQuery\AnalyticsHub\V1\Listing\BigQueryDatasetSource\Replica;

use UnexpectedValueException;

/**
 * Replica state of the shared dataset.
 *
 * Protobuf type <code>google.cloud.bigquery.analyticshub.v1.Listing.BigQueryDatasetSource.Replica.ReplicaState</code>
 */
class ReplicaState
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>REPLICA_STATE_UNSPECIFIED = 0;</code>
     */
    const REPLICA_STATE_UNSPECIFIED = 0;
    /**
     * The replica is backfilled and ready to use.
     *
     * Generated from protobuf enum <code>READY_TO_USE = 1;</code>
     */
    const READY_TO_USE = 1;
    /**
     * The replica is unavailable, does not exist, or has not been
     * backfilled yet.
     *
     * Generated from protobuf enum <code>UNAVAILABLE = 2;</code>
     */
    const UNAVAILABLE = 2;

    private static $valueToName = [
        self::REPLICA_STATE_UNSPECIFIED => 'REPLICA_STATE_UNSPECIFIED',
        self::READY_TO_USE => 'READY_TO_USE',
        self::UNAVAILABLE => 'UNAVAILABLE',
    ];

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


