Class Budget (2.6.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.v1.Budget

Implements

BudgetOrBuilder

Static Fields

AMOUNT_FIELD_NUMBER

public static final int AMOUNT_FIELD_NUMBER
Field Value
TypeDescription
int

BUDGET_FILTER_FIELD_NUMBER

public static final int BUDGET_FILTER_FIELD_NUMBER
Field Value
TypeDescription
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

NOTIFICATIONS_RULE_FIELD_NUMBER

public static final int NOTIFICATIONS_RULE_FIELD_NUMBER
Field Value
TypeDescription
int

THRESHOLD_RULES_FIELD_NUMBER

public static final int THRESHOLD_RULES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Budget getDefaultInstance()
Returns
TypeDescription
Budget

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Budget.Builder newBuilder()
Returns
TypeDescription
Budget.Builder

newBuilder(Budget prototype)

public static Budget.Builder newBuilder(Budget prototype)
Parameter
NameDescription
prototypeBudget
Returns
TypeDescription
Budget.Builder

parseDelimitedFrom(InputStream input)

public static Budget parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Budget parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Budget parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Budget parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Budget parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Budget parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Budget parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Budget
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Budget> parser()
Returns
TypeDescription
Parser<Budget>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAmount()

public BudgetAmount getAmount()

Required. Budgeted amount.

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

Returns
TypeDescription
BudgetAmount

The amount.

getAmountOrBuilder()

public BudgetAmountOrBuilder getAmountOrBuilder()

Required. Budgeted amount.

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

Returns
TypeDescription
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.v1.Filter budget_filter = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
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
TypeDescription
FilterOrBuilder

getDefaultInstanceForType()

public Budget getDefaultInstanceForType()
Returns
TypeDescription
Budget

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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

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
TypeDescription
NotificationsRule

The notificationsRule.

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
TypeDescription
NotificationsRuleOrBuilder

getParserForType()

public Parser<Budget> getParserForType()
Returns
TypeDescription
Parser<Budget>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
ThresholdRule

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

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

Returns
TypeDescription
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.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
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.

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

Returns
TypeDescription
List<? extends com.google.cloud.billing.budgets.v1.ThresholdRuleOrBuilder>

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hasAmount()

public boolean hasAmount()

Required. Budgeted amount.

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the notificationsRule field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Budget.Builder newBuilderForType()
Returns
TypeDescription
Budget.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Budget.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Budget.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Budget.Builder toBuilder()
Returns
TypeDescription
Budget.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException