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

namespace Google\Cloud\Maintenance\Api\V1beta\MaintenanceControl;

use UnexpectedValueException;

/**
 * Sets the type of control supported. comment (as in logs).
 *
 * Protobuf type <code>google.cloud.maintenance.api.v1beta.MaintenanceControl.Control</code>
 */
class Control
{
    /**
     * Unspecified control.
     *
     * Generated from protobuf enum <code>CONTROL_UNSPECIFIED = 0;</code>
     */
    const CONTROL_UNSPECIFIED = 0;
    /**
     * Apply control.
     *
     * Generated from protobuf enum <code>APPLY = 1;</code>
     */
    const APPLY = 1;
    /**
     * Manage policy control.
     *
     * Generated from protobuf enum <code>MANAGE_POLICY = 2;</code>
     */
    const MANAGE_POLICY = 2;
    /**
     * Reschedule control.
     *
     * Generated from protobuf enum <code>RESCHEDULE = 3;</code>
     */
    const RESCHEDULE = 3;

    private static $valueToName = [
        self::CONTROL_UNSPECIFIED => 'CONTROL_UNSPECIFIED',
        self::APPLY => 'APPLY',
        self::MANAGE_POLICY => 'MANAGE_POLICY',
        self::RESCHEDULE => 'RESCHEDULE',
    ];

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


