Reference documentation and code samples for the Google Cloud Batch V1 Client class JobNotification.
Notification configurations.
Generated from protobuf messagegoogle.cloud.batch.v1.JobNotification
Namespace
Google \ Cloud \ Batch \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ pubsub_topic
string
The Pub/Sub topic where notifications for the job, like state changes, will be published. If undefined, no Pub/Sub notifications are sent for this job. Specify the topic using the following format:projects/{project}/topics/{topic}. Notably, if you want to specify a Pub/Sub topic that is in a different project than the job, your administrator must grant your project's Batch service agent permission to publish to that topic. For more information about configuring Pub/Sub notifications for a job, seehttps://cloud.google.com/batch/docs/enable-notifications.
The attribute requirements of messages to be sent to this Pub/Sub topic. Without this field, no message will be sent.
getPubsubTopic
The Pub/Sub topic where notifications for the job, like state
changes, will be published. If undefined, no Pub/Sub notifications
are sent for this job.
Specify the topic using the following format:projects/{project}/topics/{topic}.
Notably, if you want to specify a Pub/Sub topic that is in a
different project than the job, your administrator must grant your
project's Batch service agent permission to publish to that topic.
For more information about configuring Pub/Sub notifications for
a job, seehttps://cloud.google.com/batch/docs/enable-notifications.
Returns
Type
Description
string
setPubsubTopic
The Pub/Sub topic where notifications for the job, like state
changes, will be published. If undefined, no Pub/Sub notifications
are sent for this job.
Specify the topic using the following format:projects/{project}/topics/{topic}.
Notably, if you want to specify a Pub/Sub topic that is in a
different project than the job, your administrator must grant your
project's Batch service agent permission to publish to that topic.
For more information about configuring Pub/Sub notifications for
a job, seehttps://cloud.google.com/batch/docs/enable-notifications.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getMessage
The attribute requirements of messages to be sent to this Pub/Sub topic.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Cloud Batch V1 Client - Class JobNotification (1.2.2)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.2 (latest)](/php/docs/reference/cloud-batch/latest/V1.JobNotification)\n- [1.2.1](/php/docs/reference/cloud-batch/1.2.1/V1.JobNotification)\n- [1.1.7](/php/docs/reference/cloud-batch/1.1.7/V1.JobNotification)\n- [1.0.3](/php/docs/reference/cloud-batch/1.0.3/V1.JobNotification)\n- [0.17.0](/php/docs/reference/cloud-batch/0.17.0/V1.JobNotification)\n- [0.16.10](/php/docs/reference/cloud-batch/0.16.10/V1.JobNotification)\n- [0.15.0](/php/docs/reference/cloud-batch/0.15.0/V1.JobNotification)\n- [0.14.0](/php/docs/reference/cloud-batch/0.14.0/V1.JobNotification)\n- [0.13.1](/php/docs/reference/cloud-batch/0.13.1/V1.JobNotification)\n- [0.12.1](/php/docs/reference/cloud-batch/0.12.1/V1.JobNotification)\n- [0.11.3](/php/docs/reference/cloud-batch/0.11.3/V1.JobNotification)\n- [0.10.0](/php/docs/reference/cloud-batch/0.10.0/V1.JobNotification)\n- [0.9.0](/php/docs/reference/cloud-batch/0.9.0/V1.JobNotification)\n- [0.8.0](/php/docs/reference/cloud-batch/0.8.0/V1.JobNotification)\n- [0.7.0](/php/docs/reference/cloud-batch/0.7.0/V1.JobNotification)\n- [0.6.0](/php/docs/reference/cloud-batch/0.6.0/V1.JobNotification)\n- [0.5.2](/php/docs/reference/cloud-batch/0.5.2/V1.JobNotification)\n- [0.4.0](/php/docs/reference/cloud-batch/0.4.0/V1.JobNotification)\n- [0.3.0](/php/docs/reference/cloud-batch/0.3.0/V1.JobNotification)\n- [0.2.2](/php/docs/reference/cloud-batch/0.2.2/V1.JobNotification) \nReference documentation and code samples for the Google Cloud Batch V1 Client class JobNotification.\n\nNotification configurations.\n\nGenerated from protobuf message `google.cloud.batch.v1.JobNotification`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Batch \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getPubsubTopic\n\nThe Pub/Sub topic where notifications for the job, like state\nchanges, will be published. If undefined, no Pub/Sub notifications\nare sent for this job.\n\nSpecify the topic using the following format:\n`projects/{project}/topics/{topic}`.\nNotably, if you want to specify a Pub/Sub topic that is in a\ndifferent project than the job, your administrator must grant your\nproject's Batch service agent permission to publish to that topic.\nFor more information about configuring Pub/Sub notifications for\na job, see\n\u003chttps://cloud.google.com/batch/docs/enable-notifications\u003e.\n\n### setPubsubTopic\n\nThe Pub/Sub topic where notifications for the job, like state\nchanges, will be published. If undefined, no Pub/Sub notifications\nare sent for this job.\n\nSpecify the topic using the following format:\n`projects/{project}/topics/{topic}`.\nNotably, if you want to specify a Pub/Sub topic that is in a\ndifferent project than the job, your administrator must grant your\nproject's Batch service agent permission to publish to that topic.\nFor more information about configuring Pub/Sub notifications for\na job, see\n\u003chttps://cloud.google.com/batch/docs/enable-notifications\u003e.\n\n### getMessage\n\nThe attribute requirements of messages to be sent to this Pub/Sub topic.\n\nWithout this field, no message will be sent.\n\n### hasMessage\n\n### clearMessage\n\n### setMessage\n\nThe attribute requirements of messages to be sent to this Pub/Sub topic.\n\nWithout this field, no message will be sent."]]