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

namespace Google\Cloud\Metastore\V1beta\Restore;

use UnexpectedValueException;

/**
 * The type of restore. If unspecified, defaults to `METADATA_ONLY`.
 *
 * Protobuf type <code>google.cloud.metastore.v1beta.Restore.RestoreType</code>
 */
class RestoreType
{
    /**
     * The restore type is unknown.
     *
     * Generated from protobuf enum <code>RESTORE_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESTORE_TYPE_UNSPECIFIED = 0;
    /**
     * The service's metadata and configuration are restored.
     *
     * Generated from protobuf enum <code>FULL = 1;</code>
     */
    const FULL = 1;
    /**
     * Only the service's metadata is restored.
     *
     * Generated from protobuf enum <code>METADATA_ONLY = 2;</code>
     */
    const METADATA_ONLY = 2;

    private static $valueToName = [
        self::RESTORE_TYPE_UNSPECIFIED => 'RESTORE_TYPE_UNSPECIFIED',
        self::FULL => 'FULL',
        self::METADATA_ONLY => 'METADATA_ONLY',
    ];

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

