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

namespace Google\Cloud\Batch\V1;

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

/**
 * Notification configurations.
 *
 * Generated from protobuf message <code>google.cloud.batch.v1.JobNotification</code>
 */
class JobNotification extends \Google\Protobuf\Internal\Message
{
    /**
     * The Pub/Sub topic where notifications like the job state changes
     * will be published. This topic exist in the same project as the job
     * and billings will be charged to this project.
     * If not specified, no Pub/Sub messages will be sent.
     * Topic format: `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string pubsub_topic = 1;</code>
     */
    private $pubsub_topic = '';
    /**
     * The attribute requirements of messages to be sent to this Pub/Sub topic.
     * Without this field, no message will be sent.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.JobNotification.Message message = 2;</code>
     */
    private $message = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $pubsub_topic
     *           The Pub/Sub topic where notifications like the job state changes
     *           will be published. This topic exist in the same project as the job
     *           and billings will be charged to this project.
     *           If not specified, no Pub/Sub messages will be sent.
     *           Topic format: `projects/{project}/topics/{topic}`.
     *     @type \Google\Cloud\Batch\V1\JobNotification\Message $message
     *           The attribute requirements of messages to be sent to this Pub/Sub topic.
     *           Without this field, no message will be sent.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Batch\V1\Job::initOnce();
        parent::__construct($data);
    }

    /**
     * The Pub/Sub topic where notifications like the job state changes
     * will be published. This topic exist in the same project as the job
     * and billings will be charged to this project.
     * If not specified, no Pub/Sub messages will be sent.
     * Topic format: `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string pubsub_topic = 1;</code>
     * @return string
     */
    public function getPubsubTopic()
    {
        return $this->pubsub_topic;
    }

    /**
     * The Pub/Sub topic where notifications like the job state changes
     * will be published. This topic exist in the same project as the job
     * and billings will be charged to this project.
     * If not specified, no Pub/Sub messages will be sent.
     * Topic format: `projects/{project}/topics/{topic}`.
     *
     * Generated from protobuf field <code>string pubsub_topic = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPubsubTopic($var)
    {
        GPBUtil::checkString($var, True);
        $this->pubsub_topic = $var;

        return $this;
    }

    /**
     * The attribute requirements of messages to be sent to this Pub/Sub topic.
     * Without this field, no message will be sent.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.JobNotification.Message message = 2;</code>
     * @return \Google\Cloud\Batch\V1\JobNotification\Message|null
     */
    public function getMessage()
    {
        return $this->message;
    }

    public function hasMessage()
    {
        return isset($this->message);
    }

    public function clearMessage()
    {
        unset($this->message);
    }

    /**
     * The attribute requirements of messages to be sent to this Pub/Sub topic.
     * Without this field, no message will be sent.
     *
     * Generated from protobuf field <code>.google.cloud.batch.v1.JobNotification.Message message = 2;</code>
     * @param \Google\Cloud\Batch\V1\JobNotification\Message $var
     * @return $this
     */
    public function setMessage($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Batch\V1\JobNotification\Message::class);
        $this->message = $var;

        return $this;
    }

}

