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

namespace Google\Cloud\BackupDR\V1;

use UnexpectedValueException;

/**
 * Backup configuration state. Is the resource configured for backup?
 *
 * Protobuf type <code>google.cloud.backupdr.v1.BackupConfigState</code>
 */
class BackupConfigState
{
    /**
     * The possible states of backup configuration.
     * Status not set.
     *
     * Generated from protobuf enum <code>BACKUP_CONFIG_STATE_UNSPECIFIED = 0;</code>
     */
    const BACKUP_CONFIG_STATE_UNSPECIFIED = 0;
    /**
     * The data source is actively protected (i.e. there is a
     * BackupPlanAssociation or Appliance SLA pointing to it)
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * The data source is no longer protected (but may have backups under it)
     *
     * Generated from protobuf enum <code>PASSIVE = 2;</code>
     */
    const PASSIVE = 2;

    private static $valueToName = [
        self::BACKUP_CONFIG_STATE_UNSPECIFIED => 'BACKUP_CONFIG_STATE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::PASSIVE => 'PASSIVE',
    ];

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

