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

namespace Google\Cloud\Dialogflow\Cx\V3\Tool;

use UnexpectedValueException;

/**
 * Represents the type of the tool.
 *
 * Protobuf type <code>google.cloud.dialogflow.cx.v3.Tool.ToolType</code>
 */
class ToolType
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>TOOL_TYPE_UNSPECIFIED = 0;</code>
     */
    const TOOL_TYPE_UNSPECIFIED = 0;
    /**
     * Customer provided tool.
     *
     * Generated from protobuf enum <code>CUSTOMIZED_TOOL = 1;</code>
     */
    const CUSTOMIZED_TOOL = 1;
    /**
     * First party built-in tool created by Dialogflow which cannot be modified.
     *
     * Generated from protobuf enum <code>BUILTIN_TOOL = 2;</code>
     */
    const BUILTIN_TOOL = 2;

    private static $valueToName = [
        self::TOOL_TYPE_UNSPECIFIED => 'TOOL_TYPE_UNSPECIFIED',
        self::CUSTOMIZED_TOOL => 'CUSTOMIZED_TOOL',
        self::BUILTIN_TOOL => 'BUILTIN_TOOL',
    ];

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

