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

namespace Google\Cloud\BackupDR\V1\Scheduling;

use UnexpectedValueException;

/**
 * Defines the maintenance behavior for this instance=
 *
 * Protobuf type <code>google.cloud.backupdr.v1.Scheduling.OnHostMaintenance</code>
 */
class OnHostMaintenance
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>ON_HOST_MAINTENANCE_UNSPECIFIED = 0;</code>
     */
    const ON_HOST_MAINTENANCE_UNSPECIFIED = 0;
    /**
     * Tells Compute Engine to terminate and (optionally) restart the instance
     * away from the maintenance activity.
     *
     * Generated from protobuf enum <code>TERMINATE = 1;</code>
     */
    const TERMINATE = 1;
    /**
     * Default, Allows Compute Engine to automatically migrate instances
     * out of the way of maintenance events.
     *
     * Generated from protobuf enum <code>MIGRATE = 1000;</code>
     */
    const MIGRATE = 1000;

    private static $valueToName = [
        self::ON_HOST_MAINTENANCE_UNSPECIFIED => 'ON_HOST_MAINTENANCE_UNSPECIFIED',
        self::TERMINATE => 'TERMINATE',
        self::MIGRATE => 'MIGRATE',
    ];

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


