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

namespace Google\Cloud\AdvisoryNotifications\V1;

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

/**
 * A notification object for notifying customers about security and privacy
 * issues.
 *
 * Generated from protobuf message <code>google.cloud.advisorynotifications.v1.Notification</code>
 */
class Notification extends \Google\Protobuf\Internal\Message
{
    /**
     * The resource name of the notification.
     * Format:
     * organizations/{organization}/locations/{location}/notifications/{notification}
     * or projects/{project}/locations/{location}/notifications/{notification}.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * The subject line of the notification.
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.Subject subject = 2;</code>
     */
    protected $subject = null;
    /**
     * A list of messages in the notification.
     *
     * Generated from protobuf field <code>repeated .google.cloud.advisorynotifications.v1.Message messages = 3;</code>
     */
    private $messages;
    /**
     * Output only. Time the notification was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Type of notification
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
     */
    protected $notification_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The resource name of the notification.
     *           Format:
     *           organizations/{organization}/locations/{location}/notifications/{notification}
     *           or projects/{project}/locations/{location}/notifications/{notification}.
     *     @type \Google\Cloud\AdvisoryNotifications\V1\Subject $subject
     *           The subject line of the notification.
     *     @type array<\Google\Cloud\AdvisoryNotifications\V1\Message>|\Google\Protobuf\Internal\RepeatedField $messages
     *           A list of messages in the notification.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Time the notification was created.
     *     @type int $notification_type
     *           Type of notification
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Advisorynotifications\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * The resource name of the notification.
     * Format:
     * organizations/{organization}/locations/{location}/notifications/{notification}
     * or projects/{project}/locations/{location}/notifications/{notification}.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The resource name of the notification.
     * Format:
     * organizations/{organization}/locations/{location}/notifications/{notification}
     * or projects/{project}/locations/{location}/notifications/{notification}.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The subject line of the notification.
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.Subject subject = 2;</code>
     * @return \Google\Cloud\AdvisoryNotifications\V1\Subject|null
     */
    public function getSubject()
    {
        return $this->subject;
    }

    public function hasSubject()
    {
        return isset($this->subject);
    }

    public function clearSubject()
    {
        unset($this->subject);
    }

    /**
     * The subject line of the notification.
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.Subject subject = 2;</code>
     * @param \Google\Cloud\AdvisoryNotifications\V1\Subject $var
     * @return $this
     */
    public function setSubject($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AdvisoryNotifications\V1\Subject::class);
        $this->subject = $var;

        return $this;
    }

    /**
     * A list of messages in the notification.
     *
     * Generated from protobuf field <code>repeated .google.cloud.advisorynotifications.v1.Message messages = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMessages()
    {
        return $this->messages;
    }

    /**
     * A list of messages in the notification.
     *
     * Generated from protobuf field <code>repeated .google.cloud.advisorynotifications.v1.Message messages = 3;</code>
     * @param array<\Google\Cloud\AdvisoryNotifications\V1\Message>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AdvisoryNotifications\V1\Message::class);
        $this->messages = $arr;

        return $this;
    }

    /**
     * Output only. Time the notification was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Time the notification was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Type of notification
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
     * @return int
     */
    public function getNotificationType()
    {
        return $this->notification_type;
    }

    /**
     * Type of notification
     *
     * Generated from protobuf field <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setNotificationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AdvisoryNotifications\V1\NotificationType::class);
        $this->notification_type = $var;

        return $this;
    }

}

