<?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 delete protection state of the database.
 *
 * Protobuf type <code>google.firestore.admin.v1.Database.DeleteProtectionState</code>
 */
class DeleteProtectionState
{
    /**
     * The default value. Delete protection type is not specified
     *
     * Generated from protobuf enum <code>DELETE_PROTECTION_STATE_UNSPECIFIED = 0;</code>
     */
    const DELETE_PROTECTION_STATE_UNSPECIFIED = 0;
    /**
     * Delete protection is disabled
     *
     * Generated from protobuf enum <code>DELETE_PROTECTION_DISABLED = 1;</code>
     */
    const DELETE_PROTECTION_DISABLED = 1;
    /**
     * Delete protection is enabled
     *
     * Generated from protobuf enum <code>DELETE_PROTECTION_ENABLED = 2;</code>
     */
    const DELETE_PROTECTION_ENABLED = 2;

    private static $valueToName = [
        self::DELETE_PROTECTION_STATE_UNSPECIFIED => 'DELETE_PROTECTION_STATE_UNSPECIFIED',
        self::DELETE_PROTECTION_DISABLED => 'DELETE_PROTECTION_DISABLED',
        self::DELETE_PROTECTION_ENABLED => 'DELETE_PROTECTION_ENABLED',
    ];

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

