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

namespace Google\Cloud\Dlp\V2;

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

/**
 * Target used to match against for Discovery.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DiscoveryTarget</code>
 */
class DiscoveryTarget extends \Google\Protobuf\Internal\Message
{
    protected $target;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\BigQueryDiscoveryTarget $big_query_target
     *           BigQuery target for Discovery. The first target to match a table will be
     *           the one applied.
     *     @type \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget $cloud_sql_target
     *           Cloud SQL target for Discovery. The first target to match a table will be
     *           the one applied.
     *     @type \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget $secrets_target
     *           Discovery target that looks for credentials and secrets stored in cloud
     *           resource metadata and reports them as vulnerabilities to Security Command
     *           Center. Only one target of this type is allowed.
     *     @type \Google\Cloud\Dlp\V2\CloudStorageDiscoveryTarget $cloud_storage_target
     *           Cloud Storage target for Discovery. The first target to match a table
     *           will be the one applied.
     *     @type \Google\Cloud\Dlp\V2\OtherCloudDiscoveryTarget $other_cloud_target
     *           Other clouds target for discovery. The first target to match a resource
     *           will be the one applied.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * BigQuery target for Discovery. The first target to match a table will be
     * the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.BigQueryDiscoveryTarget big_query_target = 1;</code>
     * @return \Google\Cloud\Dlp\V2\BigQueryDiscoveryTarget|null
     */
    public function getBigQueryTarget()
    {
        return $this->readOneof(1);
    }

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

    /**
     * BigQuery target for Discovery. The first target to match a table will be
     * the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.BigQueryDiscoveryTarget big_query_target = 1;</code>
     * @param \Google\Cloud\Dlp\V2\BigQueryDiscoveryTarget $var
     * @return $this
     */
    public function setBigQueryTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\BigQueryDiscoveryTarget::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Cloud SQL target for Discovery. The first target to match a table will be
     * the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CloudSqlDiscoveryTarget cloud_sql_target = 2;</code>
     * @return \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget|null
     */
    public function getCloudSqlTarget()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Cloud SQL target for Discovery. The first target to match a table will be
     * the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CloudSqlDiscoveryTarget cloud_sql_target = 2;</code>
     * @param \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget $var
     * @return $this
     */
    public function setCloudSqlTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudSqlDiscoveryTarget::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Discovery target that looks for credentials and secrets stored in cloud
     * resource metadata and reports them as vulnerabilities to Security Command
     * Center. Only one target of this type is allowed.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.SecretsDiscoveryTarget secrets_target = 3;</code>
     * @return \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget|null
     */
    public function getSecretsTarget()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Discovery target that looks for credentials and secrets stored in cloud
     * resource metadata and reports them as vulnerabilities to Security Command
     * Center. Only one target of this type is allowed.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.SecretsDiscoveryTarget secrets_target = 3;</code>
     * @param \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget $var
     * @return $this
     */
    public function setSecretsTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\SecretsDiscoveryTarget::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Cloud Storage target for Discovery. The first target to match a table
     * will be the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CloudStorageDiscoveryTarget cloud_storage_target = 4;</code>
     * @return \Google\Cloud\Dlp\V2\CloudStorageDiscoveryTarget|null
     */
    public function getCloudStorageTarget()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Cloud Storage target for Discovery. The first target to match a table
     * will be the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.CloudStorageDiscoveryTarget cloud_storage_target = 4;</code>
     * @param \Google\Cloud\Dlp\V2\CloudStorageDiscoveryTarget $var
     * @return $this
     */
    public function setCloudStorageTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\CloudStorageDiscoveryTarget::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Other clouds target for discovery. The first target to match a resource
     * will be the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.OtherCloudDiscoveryTarget other_cloud_target = 5;</code>
     * @return \Google\Cloud\Dlp\V2\OtherCloudDiscoveryTarget|null
     */
    public function getOtherCloudTarget()
    {
        return $this->readOneof(5);
    }

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

    /**
     * Other clouds target for discovery. The first target to match a resource
     * will be the one applied.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.OtherCloudDiscoveryTarget other_cloud_target = 5;</code>
     * @param \Google\Cloud\Dlp\V2\OtherCloudDiscoveryTarget $var
     * @return $this
     */
    public function setOtherCloudTarget($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\OtherCloudDiscoveryTarget::class);
        $this->writeOneof(5, $var);

        return $this;
    }

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

}

