<?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;

/**
 * A task to execute when a data profile has been generated.
 *
 * Generated from protobuf message <code>google.privacy.dlp.v2.DataProfileAction</code>
 */
class DataProfileAction extends \Google\Protobuf\Internal\Message
{
    protected $action;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dlp\V2\DataProfileAction\Export $export_data
     *           Export data profiles into a provided location.
     *     @type \Google\Cloud\Dlp\V2\DataProfileAction\PubSubNotification $pub_sub_notification
     *           Publish a message into the Pub/Sub topic.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Privacy\Dlp\V2\Dlp::initOnce();
        parent::__construct($data);
    }

    /**
     * Export data profiles into a provided location.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileAction.Export export_data = 1;</code>
     * @return \Google\Cloud\Dlp\V2\DataProfileAction\Export|null
     */
    public function getExportData()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Export data profiles into a provided location.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileAction.Export export_data = 1;</code>
     * @param \Google\Cloud\Dlp\V2\DataProfileAction\Export $var
     * @return $this
     */
    public function setExportData($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DataProfileAction\Export::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Publish a message into the Pub/Sub topic.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileAction.PubSubNotification pub_sub_notification = 2;</code>
     * @return \Google\Cloud\Dlp\V2\DataProfileAction\PubSubNotification|null
     */
    public function getPubSubNotification()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Publish a message into the Pub/Sub topic.
     *
     * Generated from protobuf field <code>.google.privacy.dlp.v2.DataProfileAction.PubSubNotification pub_sub_notification = 2;</code>
     * @param \Google\Cloud\Dlp\V2\DataProfileAction\PubSubNotification $var
     * @return $this
     */
    public function setPubSubNotification($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\DataProfileAction\PubSubNotification::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

