<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/geminidataanalytics/v1beta/credentials.proto

namespace Google\Cloud\GeminiDataAnalytics\V1beta;

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

/**
 * Represents OAuth credentials.
 *
 * Generated from protobuf message <code>google.cloud.geminidataanalytics.v1beta.OAuthCredentials</code>
 */
class OAuthCredentials extends \Google\Protobuf\Internal\Message
{
    protected $kind;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\SecretBased $secret
     *           Secret-based OAuth credentials.
     *     @type \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\TokenBased $token
     *           Token-based OAuth credentials.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Geminidataanalytics\V1Beta\Credentials::initOnce();
        parent::__construct($data);
    }

    /**
     * Secret-based OAuth credentials.
     *
     * Generated from protobuf field <code>.google.cloud.geminidataanalytics.v1beta.OAuthCredentials.SecretBased secret = 2;</code>
     * @return \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\SecretBased|null
     */
    public function getSecret()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Secret-based OAuth credentials.
     *
     * Generated from protobuf field <code>.google.cloud.geminidataanalytics.v1beta.OAuthCredentials.SecretBased secret = 2;</code>
     * @param \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\SecretBased $var
     * @return $this
     */
    public function setSecret($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\SecretBased::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Token-based OAuth credentials.
     *
     * Generated from protobuf field <code>.google.cloud.geminidataanalytics.v1beta.OAuthCredentials.TokenBased token = 3;</code>
     * @return \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\TokenBased|null
     */
    public function getToken()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Token-based OAuth credentials.
     *
     * Generated from protobuf field <code>.google.cloud.geminidataanalytics.v1beta.OAuthCredentials.TokenBased token = 3;</code>
     * @param \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\TokenBased $var
     * @return $this
     */
    public function setToken($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\GeminiDataAnalytics\V1beta\OAuthCredentials\TokenBased::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

