public sealed class NotificationsRule : IMessage<NotificationsRule>, IEquatable<NotificationsRule>, IDeepCloneable<NotificationsRule>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Billing Budget v1 API class NotificationsRule.
NotificationsRule defines notifications that are sent based on budget spend
and thresholds.
public bool DisableDefaultIamRecipients { get; set; }
Optional. When set to true, disables default notifications sent when a
threshold is exceeded. Default notifications are sent to those with Billing
Account Administrator and Billing Account User IAM roles for the target
account.
public bool EnableProjectLevelRecipients { get; set; }
Optional. When set to true, and when the budget has a single project
configured, notifications will be sent to project level recipients of that
project. This field will be ignored if the budget has multiple or no
project configured.
Currently, project level recipients are the users with Owner role on a
cloud project.
public RepeatedField<string> MonitoringNotificationChannels { get; }
Optional. Email targets to send notifications to when a threshold is
exceeded. This is in addition to the DefaultIamRecipients who receive
alert emails based on their billing account IAM role. The value is the full
REST resource name of a Cloud Monitoring email notification channel with
the form projects/{project_id}/notificationChannels/{channel_id}. A
maximum of 5 email notifications are allowed.
To customize budget alert email recipients with monitoring notification
channels, you must create the monitoring notification channels before
you link them to a budget. For guidance on setting up notification
channels to use with budgets, see
Customize budget alert email
recipients.
For Cloud Billing budget alerts, you must use email notification
channels. The other types of notification channels are not
supported, such as Slack, SMS, or PagerDuty. If you want to
send budget notifications to
Slack,
use a pubsubTopic and configure
programmatic
notifications.
Optional. The name of the Pub/Sub topic where budget-related messages are
published, in the form projects/{project_id}/topics/{topic_id}. Updates
are sent to the topic at regular intervals; the timing of the updates is
not dependent on the threshold rules you've set.
Note that if you want your
Pub/Sub JSON
object
to contain data for alertThresholdExceeded, you need at least one
alert threshold rule. When you set threshold rules, you
must also enable at least one of the email notification options, either
using the default IAM recipients or Cloud Monitoring email notification
channels.
To use Pub/Sub topics with budgets, you must do the following:
Grant the API caller the pubsub.topics.setIamPolicy permission on
the Pub/Sub topic. If not set, the API call fails with PERMISSION_DENIED.
For additional details on Pub/Sub roles and permissions, see
Permissions required for this
task.
Optional. Required when
[NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic]
is set. The schema version of the notification sent to
[NotificationsRule.pubsub_topic][google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic].
Only "1.0" is accepted. It represents the JSON schema as defined in
https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eNotificationsRule\u003c/code\u003e API class is 2.6.0, part of the Google Cloud Billing Budget v1 API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eNotificationsRule\u003c/code\u003e defines how notifications are sent based on budget spending and thresholds within the Google Cloud Billing Budget service.\u003c/p\u003e\n"],["\u003cp\u003eNotifications can be sent to default IAM recipients or to custom email notification channels configured in Cloud Monitoring, and up to five monitoring notification channels can be configured.\u003c/p\u003e\n"],["\u003cp\u003eNotifications can be published to a Pub/Sub topic, which requires the caller to have the \u003ccode\u003epubsub.topics.setIamPolicy\u003c/code\u003e permission, and the schema version must be set to "1.0" when using Pub/Sub.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDisableDefaultIamRecipients\u003c/code\u003e property can be set to disable default notifications, and the \u003ccode\u003eEnableProjectLevelRecipients\u003c/code\u003e property will send notifications to project level recipients when enabled and if the budget is configured for a single project.\u003c/p\u003e\n"]]],[],null,["# Cloud Billing Budget v1 API - Class NotificationsRule (2.6.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.0 (latest)](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.5.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.4.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.3.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.2.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.1.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/2.0.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/1.2.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/1.1.0/Google.Cloud.Billing.Budgets.V1.NotificationsRule) \n\n public sealed class NotificationsRule : IMessage\u003cNotificationsRule\u003e, IEquatable\u003cNotificationsRule\u003e, IDeepCloneable\u003cNotificationsRule\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Billing Budget v1 API class NotificationsRule.\n\nNotificationsRule defines notifications that are sent based on budget spend\nand thresholds. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e NotificationsRule \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[NotificationsRule](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.NotificationsRule), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[NotificationsRule](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.NotificationsRule), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[NotificationsRule](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1.NotificationsRule), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Billing.Budgets.V1](/dotnet/docs/reference/Google.Cloud.Billing.Budgets.V1/latest/Google.Cloud.Billing.Budgets.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Billing.Budgets.V1.dll\n\nConstructors\n------------\n\n### NotificationsRule()\n\n public NotificationsRule()\n\n### NotificationsRule(NotificationsRule)\n\n public NotificationsRule(NotificationsRule other)\n\nProperties\n----------\n\n### DisableDefaultIamRecipients\n\n public bool DisableDefaultIamRecipients { get; set; }\n\nOptional. When set to true, disables default notifications sent when a\nthreshold is exceeded. Default notifications are sent to those with Billing\nAccount Administrator and Billing Account User IAM roles for the target\naccount.\n\n### EnableProjectLevelRecipients\n\n public bool EnableProjectLevelRecipients { get; set; }\n\nOptional. When set to true, and when the budget has a single project\nconfigured, notifications will be sent to project level recipients of that\nproject. This field will be ignored if the budget has multiple or no\nproject configured.\n\nCurrently, project level recipients are the users with `Owner` role on a\ncloud project.\n\n### MonitoringNotificationChannels\n\n public RepeatedField\u003cstring\u003e MonitoringNotificationChannels { get; }\n\nOptional. Email targets to send notifications to when a threshold is\nexceeded. This is in addition to the `DefaultIamRecipients` who receive\nalert emails based on their billing account IAM role. The value is the full\nREST resource name of a Cloud Monitoring email notification channel with\nthe form `projects/{project_id}/notificationChannels/{channel_id}`. A\nmaximum of 5 email notifications are allowed.\n\nTo customize budget alert email recipients with monitoring notification\nchannels, you *must create the monitoring notification channels before\nyou link them to a budget* . For guidance on setting up notification\nchannels to use with budgets, see\n[Customize budget alert email\nrecipients](https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients).\n\nFor Cloud Billing budget alerts, you *must use email notification\nchannels* . The other types of notification channels are *not*\nsupported, such as Slack, SMS, or PagerDuty. If you want to\n[send budget notifications to\nSlack](https://cloud.google.com/billing/docs/how-to/notify#send_notifications_to_slack),\nuse a pubsubTopic and configure\n[programmatic\nnotifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications).\n\n### PubsubTopic\n\n public string PubsubTopic { get; set; }\n\nOptional. The name of the Pub/Sub topic where budget-related messages are\npublished, in the form `projects/{project_id}/topics/{topic_id}`. Updates\nare sent to the topic at regular intervals; the timing of the updates is\nnot dependent on the [threshold rules](#thresholdrule) you've set.\n\nNote that if you want your\n[Pub/Sub JSON\nobject](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format)\nto contain data for `alertThresholdExceeded`, you need at least one\n[alert threshold rule](#thresholdrule). When you set threshold rules, you\nmust also enable at least one of the email notification options, either\nusing the default IAM recipients or Cloud Monitoring email notification\nchannels.\n\nTo use Pub/Sub topics with budgets, you must do the following:\n\n1. Create the Pub/Sub topic\n before connecting it to your budget. For guidance, see\n [Manage programmatic budget alert\n notifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications).\n\n2. Grant the API caller the `pubsub.topics.setIamPolicy` permission on\n the Pub/Sub topic. If not set, the API call fails with PERMISSION_DENIED.\n For additional details on Pub/Sub roles and permissions, see\n [Permissions required for this\n task](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task).\n\n### SchemaVersion\n\n public string SchemaVersion { get; set; }\n\nOptional. Required when\n\\[NotificationsRule.pubsub_topic\\]\\[google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic\\]\nis set. The schema version of the notification sent to\n\\[NotificationsRule.pubsub_topic\\]\\[google.cloud.billing.budgets.v1.NotificationsRule.pubsub_topic\\].\nOnly \"1.0\" is accepted. It represents the JSON schema as defined in\n\u003chttps://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format\u003e."]]