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.v1.Budget
Static Fields
AMOUNT_FIELD_NUMBER
public static final int AMOUNT_FIELD_NUMBER
Field Value
BUDGET_FILTER_FIELD_NUMBER
public static final int BUDGET_FILTER_FIELD_NUMBER
Field Value
DISPLAY_NAME_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
ETAG_FIELD_NUMBER
public static final int ETAG_FIELD_NUMBER
Field Value
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
Field Value
NOTIFICATIONS_RULE_FIELD_NUMBER
public static final int NOTIFICATIONS_RULE_FIELD_NUMBER
Field Value
THRESHOLD_RULES_FIELD_NUMBER
public static final int THRESHOLD_RULES_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Budget getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Budget.Builder newBuilder()
Returns
newBuilder(Budget prototype)
public static Budget.Builder newBuilder(Budget prototype)
Parameter
Name | Description |
prototype | Budget
|
Returns
public static Budget parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Budget parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Budget parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Budget parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Budget parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Budget parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Budget parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Budget parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Budget parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Budget parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Budget parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Budget parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Budget> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getAmount()
public BudgetAmount getAmount()
Required. Budgeted amount.
.google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
Returns
getAmountOrBuilder()
public BudgetAmountOrBuilder getAmountOrBuilder()
Required. Budgeted amount.
.google.cloud.billing.budgets.v1.BudgetAmount amount = 4 [(.google.api.field_behavior) = REQUIRED];
Returns
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.v1.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.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns
getDefaultInstanceForType()
public Budget getDefaultInstanceForType()
Returns
getDisplayName()
public String getDisplayName()
User data for display name in UI. The name must be less than or equal to 60
characters.
string display_name = 2;
Returns
Type | Description |
String | The displayName.
|
getDisplayNameBytes()
public ByteString getDisplayNameBytes()
User data for display name in UI. The name must be less than or equal to 60
characters.
string display_name = 2;
Returns
Type | Description |
ByteString | The bytes for displayName.
|
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
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
getNotificationsRule()
public NotificationsRule getNotificationsRule()
Optional. Rules to apply to notifications sent based on budget spend and
thresholds.
.google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns
getNotificationsRuleOrBuilder()
public NotificationsRuleOrBuilder getNotificationsRuleOrBuilder()
Optional. Rules to apply to notifications sent based on budget spend and
thresholds.
.google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns
getParserForType()
public Parser<Budget> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
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.
repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
Parameter
Returns
getThresholdRulesCount()
public int getThresholdRulesCount()
Optional. Rules that trigger alerts (notifications of thresholds
being crossed) when spend exceeds the specified percentages of the budget.
repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns
getThresholdRulesList()
public List<ThresholdRule> getThresholdRulesList()
Optional. Rules that trigger alerts (notifications of thresholds
being crossed) when spend exceeds the specified percentages of the budget.
repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns
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.
repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
Parameter
Returns
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.
repeated .google.cloud.billing.budgets.v1.ThresholdRule threshold_rules = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns
Type | Description |
List<? extends com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder> | |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hasAmount()
public boolean hasAmount()
Required. Budgeted amount.
.google.cloud.billing.budgets.v1.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.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];
Returns
Type | Description |
boolean | Whether the budgetFilter field is set.
|
hasNotificationsRule()
public boolean hasNotificationsRule()
Optional. Rules to apply to notifications sent based on budget spend and
thresholds.
.google.cloud.billing.budgets.v1.NotificationsRule notifications_rule = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns
Type | Description |
boolean | Whether the notificationsRule field is set.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Budget.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Budget.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Budget.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions