<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/securitycenter/v1p1beta1/notification_message.proto

namespace Google\Cloud\SecurityCenter\V1p1beta1;

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

/**
 * Cloud SCC's Notification
 *
 * Generated from protobuf message <code>google.cloud.securitycenter.v1p1beta1.NotificationMessage</code>
 */
class NotificationMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the notification config that generated current notification.
     *
     * Generated from protobuf field <code>string notification_config_name = 1;</code>
     */
    private $notification_config_name = '';
    protected $event;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $notification_config_name
     *           Name of the notification config that generated current notification.
     *     @type \Google\Cloud\SecurityCenter\V1p1beta1\Finding $finding
     *           If it's a Finding based notification config, this field will be
     *           populated.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V1P1Beta1\NotificationMessage::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the notification config that generated current notification.
     *
     * Generated from protobuf field <code>string notification_config_name = 1;</code>
     * @return string
     */
    public function getNotificationConfigName()
    {
        return $this->notification_config_name;
    }

    /**
     * Name of the notification config that generated current notification.
     *
     * Generated from protobuf field <code>string notification_config_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNotificationConfigName($var)
    {
        GPBUtil::checkString($var, True);
        $this->notification_config_name = $var;

        return $this;
    }

    /**
     * If it's a Finding based notification config, this field will be
     * populated.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1p1beta1.Finding finding = 2;</code>
     * @return \Google\Cloud\SecurityCenter\V1p1beta1\Finding
     */
    public function getFinding()
    {
        return $this->readOneof(2);
    }

    /**
     * If it's a Finding based notification config, this field will be
     * populated.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v1p1beta1.Finding finding = 2;</code>
     * @param \Google\Cloud\SecurityCenter\V1p1beta1\Finding $var
     * @return $this
     */
    public function setFinding($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V1p1beta1\Finding::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

