<?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 Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Config for authentication with API key.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Tool.Authentication.ApiKeyConfig</code>
 */
class ApiKeyConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parameter name or the header name of the API key.
     * E.g., If the API request is "https://example.com/act?X-Api-Key=<API
     * KEY>", "X-Api-Key" would be the parameter name.
     *
     * Generated from protobuf field <code>string key_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $key_name = '';
    /**
     * Optional. The API key. If the `secret_version_for_api_key` field is
     * set, this field will be ignored.
     *
     * Generated from protobuf field <code>string api_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $api_key = '';
    /**
     * Optional. The name of the SecretManager secret version resource storing
     * the API key. If this field is set, the `api_key` field will be ignored.
     * Format: `projects/{project}/secrets/{secret}/versions/{version}`
     *
     * Generated from protobuf field <code>string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $secret_version_for_api_key = '';
    /**
     * Required. Key location in the request.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $request_location = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key_name
     *           Required. The parameter name or the header name of the API key.
     *           E.g., If the API request is "https://example.com/act?X-Api-Key=<API
     *           KEY>", "X-Api-Key" would be the parameter name.
     *     @type string $api_key
     *           Optional. The API key. If the `secret_version_for_api_key` field is
     *           set, this field will be ignored.
     *     @type string $secret_version_for_api_key
     *           Optional. The name of the SecretManager secret version resource storing
     *           the API key. If this field is set, the `api_key` field will be ignored.
     *           Format: `projects/{project}/secrets/{secret}/versions/{version}`
     *     @type int $request_location
     *           Required. Key location in the request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parameter name or the header name of the API key.
     * E.g., If the API request is "https://example.com/act?X-Api-Key=<API
     * KEY>", "X-Api-Key" would be the parameter name.
     *
     * Generated from protobuf field <code>string key_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getKeyName()
    {
        return $this->key_name;
    }

    /**
     * Required. The parameter name or the header name of the API key.
     * E.g., If the API request is "https://example.com/act?X-Api-Key=<API
     * KEY>", "X-Api-Key" would be the parameter name.
     *
     * Generated from protobuf field <code>string key_name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setKeyName($var)
    {
        GPBUtil::checkString($var, True);
        $this->key_name = $var;

        return $this;
    }

    /**
     * Optional. The API key. If the `secret_version_for_api_key` field is
     * set, this field will be ignored.
     *
     * Generated from protobuf field <code>string api_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getApiKey()
    {
        return $this->api_key;
    }

    /**
     * Optional. The API key. If the `secret_version_for_api_key` field is
     * set, this field will be ignored.
     *
     * Generated from protobuf field <code>string api_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setApiKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->api_key = $var;

        return $this;
    }

    /**
     * Optional. The name of the SecretManager secret version resource storing
     * the API key. If this field is set, the `api_key` field will be ignored.
     * Format: `projects/{project}/secrets/{secret}/versions/{version}`
     *
     * Generated from protobuf field <code>string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSecretVersionForApiKey()
    {
        return $this->secret_version_for_api_key;
    }

    /**
     * Optional. The name of the SecretManager secret version resource storing
     * the API key. If this field is set, the `api_key` field will be ignored.
     * Format: `projects/{project}/secrets/{secret}/versions/{version}`
     *
     * Generated from protobuf field <code>string secret_version_for_api_key = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSecretVersionForApiKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->secret_version_for_api_key = $var;

        return $this;
    }

    /**
     * Required. Key location in the request.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRequestLocation()
    {
        return $this->request_location;
    }

    /**
     * Required. Key location in the request.
     *
     * Generated from protobuf field <code>.google.cloud.dialogflow.v2.Tool.Authentication.RequestLocation request_location = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRequestLocation($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Dialogflow\V2\Tool\Authentication\RequestLocation::class);
        $this->request_location = $var;

        return $this;
    }

}

