Class Budget (2.49.0)

public final class Budget extends GeneratedMessageV3 implements BudgetOrBuilder

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). The budget time period is configurable, with options such as month (default), quarter, year, or custom time period.

Protobuf type google.cloud.billing.budgets.v1beta1.Budget

Implements

BudgetOrBuilder

Static Fields

ALL_UPDATES_RULE_FIELD_NUMBER

public static final int ALL_UPDATES_RULE_FIELD_NUMBER
Field Value
Type Description
int

AMOUNT_FIELD_NUMBER

public static final int AMOUNT_FIELD_NUMBER
Field Value
Type Description
int

BUDGET_FILTER_FIELD_NUMBER

public static final int BUDGET_FILTER_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

THRESHOLD_RULES_FIELD_NUMBER

public static final int THRESHOLD_RULES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Budget getDefaultInstance()
Returns
Type Description
Budget

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Budget.Builder newBuilder()
Returns
Type Description
Budget.Builder

newBuilder(Budget prototype)

public static Budget.Builder newBuilder(Budget prototype)
Parameter
Name Description
prototype Budget
Returns
Type Description
Budget.Builder

parseDelimitedFrom(InputStream input)

public static Budget parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Budget parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Budget parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Budget parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Budget parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Budget parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Budget
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Budget> parser()
Returns
Type Description
Parser<Budget>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAllUpdatesRule()

public AllUpdatesRule getAllUpdatesRule()

Optional. Rules to apply to notifications sent based on budget spend and thresholds.

.google.cloud.billing.budgets.v1beta1.AllUpdatesRule all_updates_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllUpdatesRule

The allUpdatesRule.

getAllUpdatesRuleOrBuilder()

public AllUpdatesRuleOrBuilder getAllUpdatesRuleOrBuilder()

Optional. Rules to apply to notifications sent based on budget spend and thresholds.

.google.cloud.billing.budgets.v1beta1.AllUpdatesRule all_updates_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllUpdatesRuleOrBuilder

getAmount()

public BudgetAmount getAmount()

Required. Budgeted amount.

.google.cloud.billing.budgets.v1beta1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
BudgetAmount

The amount.

getAmountOrBuilder()

public BudgetAmountOrBuilder getAmountOrBuilder()

Required. Budgeted amount.

.google.cloud.billing.budgets.v1beta1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
BudgetAmountOrBuilder

getBudgetFilter()

public Filter getBudgetFilter()

Optional. Filters that define which resources are used to compute the actual spend against the budget amount, such as projects, services, and the budget's time period, as well as other filters.

.google.cloud.billing.budgets.v1beta1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Filter

The budgetFilter.

getBudgetFilterOrBuilder()

public FilterOrBuilder getBudgetFilterOrBuilder()

Optional. Filters that define which resources are used to compute the actual spend against the budget amount, such as projects, services, and the budget's time period, as well as other filters.

.google.cloud.billing.budgets.v1beta1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
FilterOrBuilder

getDefaultInstanceForType()

public Budget getDefaultInstanceForType()
Returns
Type Description
Budget

getDisplayName()

public String getDisplayName()

User data for display name in UI. Validation: <= 60 chars.

string display_name = 2;

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

User data for display name in UI. Validation: <= 60 chars.

string display_name = 2;

Returns
Type Description
ByteString

The bytes for displayName.

getEtag()

public String getEtag()

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.

string etag = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

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.

string etag = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for etag.

getName()

public String getName()

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}.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

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}.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Budget> getParserForType()
Returns
Type Description
Parser<Budget>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getThresholdRules(int index)

public ThresholdRule getThresholdRules(int index)

Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget.

Optional for pubsubTopic notifications.

Required if using email notifications.

repeated .google.cloud.billing.budgets.v1beta1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ThresholdRule

getThresholdRulesCount()

public int getThresholdRulesCount()

Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget.

Optional for pubsubTopic notifications.

Required if using email notifications.

repeated .google.cloud.billing.budgets.v1beta1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getThresholdRulesList()

public List<ThresholdRule> getThresholdRulesList()

Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget.

Optional for pubsubTopic notifications.

Required if using email notifications.

repeated .google.cloud.billing.budgets.v1beta1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<ThresholdRule>

getThresholdRulesOrBuilder(int index)

public ThresholdRuleOrBuilder getThresholdRulesOrBuilder(int index)

Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget.

Optional for pubsubTopic notifications.

Required if using email notifications.

repeated .google.cloud.billing.budgets.v1beta1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int
Returns
Type Description
ThresholdRuleOrBuilder

getThresholdRulesOrBuilderList()

public List<? extends ThresholdRuleOrBuilder> getThresholdRulesOrBuilderList()

Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget.

Optional for pubsubTopic notifications.

Required if using email notifications.

repeated .google.cloud.billing.budgets.v1beta1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
List<? extends com.google.cloud.billing.budgets.v1beta1.ThresholdRuleOrBuilder>

hasAllUpdatesRule()

public boolean hasAllUpdatesRule()

Optional. Rules to apply to notifications sent based on budget spend and thresholds.

.google.cloud.billing.budgets.v1beta1.AllUpdatesRule all_updates_rule = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the allUpdatesRule field is set.

hasAmount()

public boolean hasAmount()

Required. Budgeted amount.

.google.cloud.billing.budgets.v1beta1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the amount field is set.

hasBudgetFilter()

public boolean hasBudgetFilter()

Optional. Filters that define which resources are used to compute the actual spend against the budget amount, such as projects, services, and the budget's time period, as well as other filters.

.google.cloud.billing.budgets.v1beta1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the budgetFilter field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Budget.Builder newBuilderForType()
Returns
Type Description
Budget.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Budget.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Budget.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Budget.Builder toBuilder()
Returns
Type Description
Budget.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException