<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/ces/v1/auth.proto

namespace Google\Cloud\Ces\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Authentication information required for API calls.
 *
 * Generated from protobuf message <code>google.cloud.ces.v1.ApiAuthentication</code>
 */
class ApiAuthentication extends \Google\Protobuf\Internal\Message
{
    protected $auth_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Ces\V1\ApiKeyConfig $api_key_config
     *           Optional. Config for API key auth.
     *     @type \Google\Cloud\Ces\V1\OAuthConfig $oauth_config
     *           Optional. Config for OAuth.
     *     @type \Google\Cloud\Ces\V1\ServiceAgentIdTokenAuthConfig $service_agent_id_token_auth_config
     *           Optional. Config for ID token auth generated from CES service agent.
     *     @type \Google\Cloud\Ces\V1\ServiceAccountAuthConfig $service_account_auth_config
     *           Optional. Config for service account authentication.
     *     @type \Google\Cloud\Ces\V1\BearerTokenConfig $bearer_token_config
     *           Optional. Config for bearer token auth.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Ces\V1\Auth::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Config for API key auth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ApiKeyConfig api_key_config = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ApiKeyConfig|null
     */
    public function getApiKeyConfig()
    {
        return $this->readOneof(1);
    }

    public function hasApiKeyConfig()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. Config for API key auth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ApiKeyConfig api_key_config = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ApiKeyConfig $var
     * @return $this
     */
    public function setApiKeyConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ApiKeyConfig::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. Config for OAuth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.OAuthConfig oauth_config = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\OAuthConfig|null
     */
    public function getOauthConfig()
    {
        return $this->readOneof(2);
    }

    public function hasOauthConfig()
    {
        return $this->hasOneof(2);
    }

    /**
     * Optional. Config for OAuth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.OAuthConfig oauth_config = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\OAuthConfig $var
     * @return $this
     */
    public function setOauthConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\OAuthConfig::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. Config for ID token auth generated from CES service agent.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig service_agent_id_token_auth_config = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ServiceAgentIdTokenAuthConfig|null
     */
    public function getServiceAgentIdTokenAuthConfig()
    {
        return $this->readOneof(3);
    }

    public function hasServiceAgentIdTokenAuthConfig()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. Config for ID token auth generated from CES service agent.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ServiceAgentIdTokenAuthConfig service_agent_id_token_auth_config = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ServiceAgentIdTokenAuthConfig $var
     * @return $this
     */
    public function setServiceAgentIdTokenAuthConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ServiceAgentIdTokenAuthConfig::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. Config for service account authentication.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ServiceAccountAuthConfig service_account_auth_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\ServiceAccountAuthConfig|null
     */
    public function getServiceAccountAuthConfig()
    {
        return $this->readOneof(4);
    }

    public function hasServiceAccountAuthConfig()
    {
        return $this->hasOneof(4);
    }

    /**
     * Optional. Config for service account authentication.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.ServiceAccountAuthConfig service_account_auth_config = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\ServiceAccountAuthConfig $var
     * @return $this
     */
    public function setServiceAccountAuthConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\ServiceAccountAuthConfig::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Optional. Config for bearer token auth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.BearerTokenConfig bearer_token_config = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Ces\V1\BearerTokenConfig|null
     */
    public function getBearerTokenConfig()
    {
        return $this->readOneof(5);
    }

    public function hasBearerTokenConfig()
    {
        return $this->hasOneof(5);
    }

    /**
     * Optional. Config for bearer token auth.
     *
     * Generated from protobuf field <code>.google.cloud.ces.v1.BearerTokenConfig bearer_token_config = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Ces\V1\BearerTokenConfig $var
     * @return $this
     */
    public function setBearerTokenConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Ces\V1\BearerTokenConfig::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getAuthConfig()
    {
        return $this->whichOneof("auth_config");
    }

}

