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

namespace Google\Cloud\OracleDatabase\V1\AutonomousDatabaseProperties;

use UnexpectedValueException;

/**
 * The types of local disaster recovery available for an Autonomous Database.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.AutonomousDatabaseProperties.LocalDisasterRecoveryType</code>
 */
class LocalDisasterRecoveryType
{
    /**
     * Default unspecified value.
     *
     * Generated from protobuf enum <code>LOCAL_DISASTER_RECOVERY_TYPE_UNSPECIFIED = 0;</code>
     */
    const LOCAL_DISASTER_RECOVERY_TYPE_UNSPECIFIED = 0;
    /**
     * Autonomous Data Guard recovery.
     *
     * Generated from protobuf enum <code>ADG = 1;</code>
     */
    const ADG = 1;
    /**
     * Backup based recovery.
     *
     * Generated from protobuf enum <code>BACKUP_BASED = 2;</code>
     */
    const BACKUP_BASED = 2;

    private static $valueToName = [
        self::LOCAL_DISASTER_RECOVERY_TYPE_UNSPECIFIED => 'LOCAL_DISASTER_RECOVERY_TYPE_UNSPECIFIED',
        self::ADG => 'ADG',
        self::BACKUP_BASED => 'BACKUP_BASED',
    ];

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


