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

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/billingbudgets_v1beta1/classes.rb,
generated/google/apis/billingbudgets_v1beta1/representations.rb,
generated/google/apis/billingbudgets_v1beta1/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

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudBillingBudgetsV1beta1ThresholdRule

Returns a new instance of GoogleCloudBillingBudgetsV1beta1ThresholdRule.


309
310
311
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 309

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)

301
302
303
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 301

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)

307
308
309
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 307

def threshold_percent
  @threshold_percent
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object


314
315
316
317
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 314

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