Class ThresholdRule.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder
-
- com.google.protobuf.AbstractMessage.Builder<BuilderT>
-
- com.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
- com.google.cloud.billing.budgets.v1beta1.ThresholdRule.Builder
-
- All Implemented Interfaces:
ThresholdRuleOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- ThresholdRule
public static final class ThresholdRule.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder> implements ThresholdRuleOrBuilder
ThresholdRule contains the definition of a threshold. Threshold rules define the triggering events used to generate a budget notification email. When a threshold is crossed (spend exceeds the specified percentages of the budget), budget alert emails are sent to the email recipients you specify in the [NotificationsRule](#notificationsrule). Threshold rules also affect the fields included in the [JSON data object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format) sent to a Pub/Sub topic. Threshold rules are _required_ if using email notifications. Threshold rules are _optional_ if only setting a [`pubsubTopic` NotificationsRule](#NotificationsRule), unless you want your JSON data object to include data about the thresholds you set. For more information, see [set budget threshold rules and actions](https://cloud.google.com/billing/docs/how-to/budgets#budget-actions).
Protobuf typegoogle.cloud.billing.budgets.v1beta1.ThresholdRule
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ThresholdRule.BuilderaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)ThresholdRulebuild()ThresholdRulebuildPartial()ThresholdRule.Builderclear()ThresholdRule.BuilderclearField(com.google.protobuf.Descriptors.FieldDescriptor field)ThresholdRule.BuilderclearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)ThresholdRule.BuilderclearSpendBasis()Optional.ThresholdRule.BuilderclearThresholdPercent()Required.ThresholdRule.Builderclone()ThresholdRulegetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.Descriptors.DescriptorgetDescriptorForType()ThresholdRule.BasisgetSpendBasis()Optional.intgetSpendBasisValue()Optional.doublegetThresholdPercent()Required.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()ThresholdRule.BuildermergeFrom(ThresholdRule other)ThresholdRule.BuildermergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)ThresholdRule.BuildermergeFrom(com.google.protobuf.Message other)ThresholdRule.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)ThresholdRule.BuildersetField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)ThresholdRule.BuildersetRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)ThresholdRule.BuildersetSpendBasis(ThresholdRule.Basis value)Optional.ThresholdRule.BuildersetSpendBasisValue(int value)Optional.ThresholdRule.BuildersetThresholdPercent(double value)Required.ThresholdRule.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3
-
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
clear
public ThresholdRule.Builder clear()
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
getDefaultInstanceForType
public ThresholdRule getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
public ThresholdRule build()
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
public ThresholdRule buildPartial()
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
public ThresholdRule.Builder clone()
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
setField
public ThresholdRule.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
clearField
public ThresholdRule.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
clearOneof
public ThresholdRule.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
setRepeatedField
public ThresholdRule.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
- Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
addRepeatedField
public ThresholdRule.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
- Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
mergeFrom
public ThresholdRule.Builder mergeFrom(com.google.protobuf.Message other)
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ThresholdRule.Builder>
-
mergeFrom
public ThresholdRule.Builder mergeFrom(ThresholdRule other)
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
mergeFrom
public ThresholdRule.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ThresholdRule.Builder>- Throws:
IOException
-
getThresholdPercent
public double getThresholdPercent()
Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number.
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getThresholdPercentin interfaceThresholdRuleOrBuilder- Returns:
- The thresholdPercent.
-
setThresholdPercent
public ThresholdRule.Builder setThresholdPercent(double value)
Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number.
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The thresholdPercent to set.- Returns:
- This builder for chaining.
-
clearThresholdPercent
public ThresholdRule.Builder clearThresholdPercent()
Required. Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Validation: non-negative number.
double threshold_percent = 1 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
getSpendBasisValue
public int getSpendBasisValue()
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
.google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getSpendBasisValuein interfaceThresholdRuleOrBuilder- Returns:
- The enum numeric value on the wire for spendBasis.
-
setSpendBasisValue
public ThresholdRule.Builder setSpendBasisValue(int value)
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
.google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The enum numeric value on the wire for spendBasis to set.- Returns:
- This builder for chaining.
-
getSpendBasis
public ThresholdRule.Basis getSpendBasis()
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
.google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getSpendBasisin interfaceThresholdRuleOrBuilder- Returns:
- The spendBasis.
-
setSpendBasis
public ThresholdRule.Builder setSpendBasis(ThresholdRule.Basis value)
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
.google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The spendBasis to set.- Returns:
- This builder for chaining.
-
clearSpendBasis
public ThresholdRule.Builder clearSpendBasis()
Optional. The type of basis used to determine if spend has passed the threshold. Behavior defaults to CURRENT_SPEND if not set.
.google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis spend_basis = 2 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
setUnknownFields
public final ThresholdRule.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
mergeUnknownFields
public final ThresholdRule.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
- Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<ThresholdRule.Builder>
-
-