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

namespace Google\Cloud\Dialogflow\V2\Tool\Authentication;

use UnexpectedValueException;

/**
 * The location of the API key in the request.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation</code>
 */
class RequestLocation
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>REQUEST_LOCATION_UNSPECIFIED = 0;</code>
     */
    const REQUEST_LOCATION_UNSPECIFIED = 0;
    /**
     * Represents the key in http header.
     *
     * Generated from protobuf enum <code>HEADER = 1;</code>
     */
    const HEADER = 1;
    /**
     * Represents the key in query string.
     *
     * Generated from protobuf enum <code>QUERY_STRING = 2;</code>
     */
    const QUERY_STRING = 2;

    private static $valueToName = [
        self::REQUEST_LOCATION_UNSPECIFIED => 'REQUEST_LOCATION_UNSPECIFIED',
        self::HEADER => 'HEADER',
        self::QUERY_STRING => 'QUERY_STRING',
    ];

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

