Class: Google::Apis::BillingbudgetsV1::GoogleCloudBillingBudgetsV1ThresholdRule

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

Overview

ThresholdRule contains a definition of a threshold which triggers an alert (a notification of a threshold being crossed) to be sent when spend goes above the specified amount. Alerts are automatically e-mailed to users with the Billing Account Administrator role or the Billing Account User role. The thresholds here have no effect on notifications sent to anything configured under Budget.all_updates_rule.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudBillingBudgetsV1ThresholdRule

Returns a new instance of GoogleCloudBillingBudgetsV1ThresholdRule.



308
309
310
# File 'generated/google/apis/billingbudgets_v1/classes.rb', line 308

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)


300
301
302
# File 'generated/google/apis/billingbudgets_v1/classes.rb', line 300

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)


306
307
308
# File 'generated/google/apis/billingbudgets_v1/classes.rb', line 306

def threshold_percent
  @threshold_percent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



313
314
315
316
# File 'generated/google/apis/billingbudgets_v1/classes.rb', line 313

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