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

namespace Google\Cloud\BackupDR\V1\Backup;

use UnexpectedValueException;

/**
 * Type of the backup, scheduled or ondemand.
 *
 * Protobuf type <code>google.cloud.backupdr.v1.Backup.BackupType</code>
 */
class BackupType
{
    /**
     * Backup type is unspecified.
     *
     * Generated from protobuf enum <code>BACKUP_TYPE_UNSPECIFIED = 0;</code>
     */
    const BACKUP_TYPE_UNSPECIFIED = 0;
    /**
     * Scheduled backup.
     *
     * Generated from protobuf enum <code>SCHEDULED = 1;</code>
     */
    const SCHEDULED = 1;
    /**
     * On demand backup.
     *
     * Generated from protobuf enum <code>ON_DEMAND = 2;</code>
     */
    const ON_DEMAND = 2;

    private static $valueToName = [
        self::BACKUP_TYPE_UNSPECIFIED => 'BACKUP_TYPE_UNSPECIFIED',
        self::SCHEDULED => 'SCHEDULED',
        self::ON_DEMAND => 'ON_DEMAND',
    ];

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


