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

namespace Google\Cloud\Firestore\Admin\V1\Database;

use UnexpectedValueException;

/**
 * The edition of the database.
 *
 * Protobuf type <code>google.firestore.admin.v1.Database.DatabaseEdition</code>
 */
class DatabaseEdition
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>DATABASE_EDITION_UNSPECIFIED = 0;</code>
     */
    const DATABASE_EDITION_UNSPECIFIED = 0;
    /**
     * Standard edition.
     * This is the default setting if not specified.
     *
     * Generated from protobuf enum <code>STANDARD = 1;</code>
     */
    const STANDARD = 1;
    /**
     * Enterprise edition.
     *
     * Generated from protobuf enum <code>ENTERPRISE = 2;</code>
     */
    const ENTERPRISE = 2;

    private static $valueToName = [
        self::DATABASE_EDITION_UNSPECIFIED => 'DATABASE_EDITION_UNSPECIFIED',
        self::STANDARD => 'STANDARD',
        self::ENTERPRISE => 'ENTERPRISE',
    ];

    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(DatabaseEdition::class, \Google\Cloud\Firestore\Admin\V1\Database_DatabaseEdition::class);

