<?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;

/**
 * Point In Time Recovery feature enablement.
 *
 * Protobuf type <code>google.firestore.admin.v1.Database.PointInTimeRecoveryEnablement</code>
 */
class PointInTimeRecoveryEnablement
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0;</code>
     */
    const POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED = 0;
    /**
     * Reads are supported on selected versions of the data from within the past
     * 7 days:
     * * Reads against any timestamp within the past hour
     * * Reads against 1-minute snapshots beyond 1 hour and within 7 days
     * `version_retention_period` and `earliest_version_time` can be
     * used to determine the supported versions.
     *
     * Generated from protobuf enum <code>POINT_IN_TIME_RECOVERY_ENABLED = 1;</code>
     */
    const POINT_IN_TIME_RECOVERY_ENABLED = 1;
    /**
     * Reads are supported on any version of the data from within the past 1
     * hour.
     *
     * Generated from protobuf enum <code>POINT_IN_TIME_RECOVERY_DISABLED = 2;</code>
     */
    const POINT_IN_TIME_RECOVERY_DISABLED = 2;

    private static $valueToName = [
        self::POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED => 'POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED',
        self::POINT_IN_TIME_RECOVERY_ENABLED => 'POINT_IN_TIME_RECOVERY_ENABLED',
        self::POINT_IN_TIME_RECOVERY_DISABLED => 'POINT_IN_TIME_RECOVERY_DISABLED',
    ];

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

