<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/participant.proto

namespace Google\Cloud\Dialogflow\V2\SuggestionInput;

use UnexpectedValueException;

/**
 * Indicate what type of action to take with the tool call.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.SuggestionInput.Action</code>
 */
class Action
{
    /**
     * Action not specified.
     *
     * Generated from protobuf enum <code>ACTION_UNSPECIFIED = 0;</code>
     */
    const ACTION_UNSPECIFIED = 0;
    /**
     * Indicates the user chooses to not make the tool call. It
     * is only applicable to tool calls that are waiting for user
     * confirmation.
     *
     * Generated from protobuf enum <code>CANCEL = 1;</code>
     */
    const CANCEL = 1;
    /**
     * Makes the tool call with provided parameters. This action is intended
     * for tool calls that only read but not write data.
     *
     * Generated from protobuf enum <code>REVISE = 2;</code>
     */
    const REVISE = 2;
    /**
     * Makes the tool call with provided parameters. This action is intended
     * for tool calls that may write data.
     *
     * Generated from protobuf enum <code>CONFIRM = 3;</code>
     */
    const CONFIRM = 3;

    private static $valueToName = [
        self::ACTION_UNSPECIFIED => 'ACTION_UNSPECIFIED',
        self::CANCEL => 'CANCEL',
        self::REVISE => 'REVISE',
        self::CONFIRM => 'CONFIRM',
    ];

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

