Class: Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Budget

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

A budget is a plan that describes what you expect to spend on Cloud projects, plus the rules to execute as spend is tracked against that plan, (for example, send an alert when 90% of the target spend is met). Currently all plans are monthly budgets so the usage period(s) tracked are implied (calendar months of usage back-to-back).

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) ⇒ GoogleCloudBillingBudgetsV1beta1Budget

Returns a new instance of GoogleCloudBillingBudgetsV1beta1Budget.



116
117
118
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 116

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

Instance Attribute Details

#all_updates_ruleGoogle::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1AllUpdatesRule

AllUpdatesRule defines notifications that are sent on every update to the billing account's spend, regardless of the thresholds defined using threshold rules. Corresponds to the JSON property allUpdatesRule



78
79
80
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 78

def all_updates_rule
  @all_updates_rule
end

#amountGoogle::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1BudgetAmount

The budgeted amount for each usage period. Corresponds to the JSON property amount



83
84
85
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 83

def amount
  @amount
end

#budget_filterGoogle::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1Filter

A filter for a budget, limiting the scope of the cost to calculate. Corresponds to the JSON property budgetFilter



88
89
90
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 88

def budget_filter
  @budget_filter
end

#display_nameString

User data for display name in UI. Validation: <= 60 chars. Corresponds to the JSON property displayName

Returns:

  • (String)


94
95
96
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 94

def display_name
  @display_name
end

#etagString

Optional. Etag to validate that the object is unchanged for a read-modify-write operation. An empty etag will cause an update to overwrite other changes. Corresponds to the JSON property etag

Returns:

  • (String)


101
102
103
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 101

def etag
  @etag
end

#nameString

Output only. Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/billingAccountId/budgets/budgetId`. Corresponds to the JSON propertyname`

Returns:

  • (String)


108
109
110
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 108

def name
  @name
end

#threshold_rulesArray<Google::Apis::BillingbudgetsV1beta1::GoogleCloudBillingBudgetsV1beta1ThresholdRule>

Required. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Corresponds to the JSON property thresholdRules



114
115
116
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 114

def threshold_rules
  @threshold_rules
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



121
122
123
124
125
126
127
128
129
# File 'generated/google/apis/billingbudgets_v1beta1/classes.rb', line 121

def update!(**args)
  @all_updates_rule = args[:all_updates_rule] if args.key?(:all_updates_rule)
  @amount = args[:amount] if args.key?(:amount)
  @budget_filter = args[:budget_filter] if args.key?(:budget_filter)
  @display_name = args[:display_name] if args.key?(:display_name)
  @etag = args[:etag] if args.key?(:etag)
  @name = args[:name] if args.key?(:name)
  @threshold_rules = args[:threshold_rules] if args.key?(:threshold_rules)
end