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

namespace Google\Cloud\SecurityCenter\V2;

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.v2.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>
     */
    protected $notification_config_name = '';
    /**
     * The Cloud resource tied to this notification's Finding.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.Resource resource = 3;</code>
     */
    protected $resource = null;
    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\V2\Finding $finding
     *           If it's a Finding based notification config, this field will be
     *           populated.
     *     @type \Google\Cloud\SecurityCenter\V2\Resource $resource
     *           The Cloud resource tied to this notification's Finding.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Securitycenter\V2\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.v2.Finding finding = 2;</code>
     * @return \Google\Cloud\SecurityCenter\V2\Finding|null
     */
    public function getFinding()
    {
        return $this->readOneof(2);
    }

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

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

        return $this;
    }

    /**
     * The Cloud resource tied to this notification's Finding.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.Resource resource = 3;</code>
     * @return \Google\Cloud\SecurityCenter\V2\Resource|null
     */
    public function getResource()
    {
        return $this->resource;
    }

    public function hasResource()
    {
        return isset($this->resource);
    }

    public function clearResource()
    {
        unset($this->resource);
    }

    /**
     * The Cloud resource tied to this notification's Finding.
     *
     * Generated from protobuf field <code>.google.cloud.securitycenter.v2.Resource resource = 3;</code>
     * @param \Google\Cloud\SecurityCenter\V2\Resource $var
     * @return $this
     */
    public function setResource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\SecurityCenter\V2\Resource::class);
        $this->resource = $var;

        return $this;
    }

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

}

