class Google::Apis::BillingbudgetsV1::GoogleCloudBillingBudgetsV1ThresholdRule

ThresholdRule contains the definition of a threshold. Threshold rules define the triggering events used to generate a budget notification email. When a threshold is crossed (spend exceeds the specified percentages of the budget), budget alert emails are sent to the email recipients you specify in the [ NotificationsRule](notificationsrule). Threshold rules also affect the fields included in the [JSON data object](cloud.google.com/billing/docs/how- to/budgets-programmatic-notifications#notification_format) sent to a Pub/Sub topic. Threshold rules are required if using email notifications. Threshold rules are optional if only setting a [`pubsubTopic` NotificationsRule](# NotificationsRule), unless you want your JSON data object to include data about the thresholds you set. For more information, see [set budget threshold rules and actions](cloud.google.com/billing/docs/how-to/budgets#budget- actions).

Attributes

spend_basis[RW]

Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set. Corresponds to the JSON property `spendBasis` @return [String]

threshold_percent[RW]

Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number. Corresponds to the JSON property `thresholdPercent` @return [Float]

Public Class Methods

new(**args) click to toggle source
# File lib/google/apis/billingbudgets_v1/classes.rb, line 393
def initialize(**args)
   update!(**args)
end

Public Instance Methods

update!(**args) click to toggle source

Update properties of this object

# File lib/google/apis/billingbudgets_v1/classes.rb, line 398
def update!(**args)
  @spend_basis = args[:spend_basis] if args.key?(:spend_basis)
  @threshold_percent = args[:threshold_percent] if args.key?(:threshold_percent)
end