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

namespace Google\Cloud\Dialogflow\V2\Tool;

use UnexpectedValueException;

/**
 * The method type of the tool.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Tool.MethodType</code>
 */
class MethodType
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>METHOD_TYPE_UNSPECIFIED = 0;</code>
     */
    const METHOD_TYPE_UNSPECIFIED = 0;
    /**
     * GET method.
     *
     * Generated from protobuf enum <code>GET = 1;</code>
     */
    const GET = 1;
    /**
     * POST method.
     *
     * Generated from protobuf enum <code>POST = 2;</code>
     */
    const POST = 2;
    /**
     * PUT method.
     *
     * Generated from protobuf enum <code>PUT = 3;</code>
     */
    const PUT = 3;
    /**
     * DELETE method.
     *
     * Generated from protobuf enum <code>DELETE = 4;</code>
     */
    const DELETE = 4;
    /**
     * PATCH method.
     *
     * Generated from protobuf enum <code>PATCH = 5;</code>
     */
    const PATCH = 5;

    private static $valueToName = [
        self::METHOD_TYPE_UNSPECIFIED => 'METHOD_TYPE_UNSPECIFIED',
        self::GET => 'GET',
        self::POST => 'POST',
        self::PUT => 'PUT',
        self::DELETE => 'DELETE',
        self::PATCH => 'PATCH',
    ];

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

