Class: Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1ThresholdRule

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/billingbudgets_v1beta1/classes.rb,
lib/google/apis/billingbudgets_v1beta1/representations.rb,
lib/google/apis/billingbudgets_v1beta1/representations.rb

Overview

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. Threshold rules also affect the fields included in the JSON data object sent to a Pub/Sub topic. Threshold rules are required if using email notifications. Threshold rules are optional if only setting a pubsubTopic 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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudBillingBudgetsV1beta1ThresholdRule

Returns a new instance of GoogleCloudBillingBudgetsV1beta1ThresholdRule.



426
427
428
# File 'lib/google/apis/billingbudgets_v1beta1/classes.rb', line 426

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#spend_basisString

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

Returns:

  • (String)


418
419
420
# File 'lib/google/apis/billingbudgets_v1beta1/classes.rb', line 418

def spend_basis
  @spend_basis
end

#threshold_percentFloat

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

Returns:

  • (Float)


424
425
426
# File 'lib/google/apis/billingbudgets_v1beta1/classes.rb', line 424

def threshold_percent
  @threshold_percent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



431
432
433
434
# File 'lib/google/apis/billingbudgets_v1beta1/classes.rb', line 431

def update!(**args)
  @spend_basis = args[:spend_basis] if args.key?(:spend_basis)
  @threshold_percent = args[:threshold_percent] if args.key?(:threshold_percent)
end