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

namespace Google\Cloud\BigQuery\Connection\V1;

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

/**
 * Connection properties specific to Amazon Web Services (AWS).
 *
 * Generated from protobuf message <code>google.cloud.bigquery.connection.v1.AwsProperties</code>
 */
class AwsProperties extends \Google\Protobuf\Internal\Message
{
    protected $authentication_method;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $cross_account_role
     *           Authentication using Google owned AWS IAM user's access key to assume
     *           into customer's AWS IAM Role.
     *           Deprecated, do not use.
     *     @type \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $access_role
     *           Authentication using Google owned service account to assume into
     *           customer's AWS IAM Role.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce();
        parent::__construct($data);
    }

    /**
     * Authentication using Google owned AWS IAM user's access key to assume
     * into customer's AWS IAM Role.
     * Deprecated, do not use.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true];</code>
     * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null
     * @deprecated
     */
    public function getCrossAccountRole()
    {
        @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED);
        return $this->readOneof(2);
    }

    public function hasCrossAccountRole()
    {
        @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED);
        return $this->hasOneof(2);
    }

    /**
     * Authentication using Google owned AWS IAM user's access key to assume
     * into customer's AWS IAM Role.
     * Deprecated, do not use.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true];</code>
     * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var
     * @return $this
     * @deprecated
     */
    public function setCrossAccountRole($var)
    {
        @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Authentication using Google owned service account to assume into
     * customer's AWS IAM Role.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3;</code>
     * @return \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole|null
     */
    public function getAccessRole()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Authentication using Google owned service account to assume into
     * customer's AWS IAM Role.
     *
     * Generated from protobuf field <code>.google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3;</code>
     * @param \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $var
     * @return $this
     */
    public function setAccessRole($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

