<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/clouddebugger/v2/data.proto

namespace Google\Cloud\Debugger\V2\Breakpoint;

use UnexpectedValueException;

/**
 * Actions that can be taken when a breakpoint hits.
 * Agents should reject breakpoints with unsupported or unknown action values.
 *
 * Protobuf type <code>google.devtools.clouddebugger.v2.Breakpoint.Action</code>
 */
class Action
{
    /**
     * Capture stack frame and variables and update the breakpoint.
     * The data is only captured once. After that the breakpoint is set
     * in a final state.
     *
     * Generated from protobuf enum <code>CAPTURE = 0;</code>
     */
    const CAPTURE = 0;
    /**
     * Log each breakpoint hit. The breakpoint remains active until
     * deleted or expired.
     *
     * Generated from protobuf enum <code>LOG = 1;</code>
     */
    const LOG = 1;

    private static $valueToName = [
        self::CAPTURE => 'CAPTURE',
        self::LOG => 'LOG',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Action::class, \Google\Cloud\Debugger\V2\Breakpoint_Action::class);

