Package com.google.cloud.billing.v1
Class PricingExpression.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<PricingExpression.Builder>
com.google.cloud.billing.v1.PricingExpression.Builder
- All Implemented Interfaces:
PricingExpressionOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- PricingExpression
public static final class PricingExpression.Builder
extends com.google.protobuf.GeneratedMessage.Builder<PricingExpression.Builder>
implements PricingExpressionOrBuilder
Expresses a mathematical pricing formula. For Example:- `usage_unit: GBy` `tiered_rates:` `[start_usage_amount: 20, unit_price: $10]` `[start_usage_amount: 100, unit_price: $5]` The above expresses a pricing formula where the first 20GB is free, the next 80GB is priced at $10 per GB followed by $5 per GB for additional usage.Protobuf type
google.cloud.billing.v1.PricingExpression-
Method Summary
Modifier and TypeMethodDescriptionaddAllTieredRates(Iterable<? extends PricingExpression.TierRate> values) The list of tiered rates for this pricing.addTieredRates(int index, PricingExpression.TierRate value) The list of tiered rates for this pricing.addTieredRates(int index, PricingExpression.TierRate.Builder builderForValue) The list of tiered rates for this pricing.The list of tiered rates for this pricing.addTieredRates(PricingExpression.TierRate.Builder builderForValue) The list of tiered rates for this pricing.The list of tiered rates for this pricing.addTieredRatesBuilder(int index) The list of tiered rates for this pricing.build()clear()The base unit for the SKU which is the unit used in usage exports.Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit.The base unit in human readable form.The recommended quantity of units for displaying pricing info.The list of tiered rates for this pricing.The short hand for unit of usage this pricing is specified in.The unit of usage in human readable form.The base unit for the SKU which is the unit used in usage exports.com.google.protobuf.ByteStringThe base unit for the SKU which is the unit used in usage exports.doubleConversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit.The base unit in human readable form.com.google.protobuf.ByteStringThe base unit in human readable form.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptordoubleThe recommended quantity of units for displaying pricing info.getTieredRates(int index) The list of tiered rates for this pricing.getTieredRatesBuilder(int index) The list of tiered rates for this pricing.The list of tiered rates for this pricing.intThe list of tiered rates for this pricing.The list of tiered rates for this pricing.getTieredRatesOrBuilder(int index) The list of tiered rates for this pricing.List<? extends PricingExpression.TierRateOrBuilder>The list of tiered rates for this pricing.The short hand for unit of usage this pricing is specified in.com.google.protobuf.ByteStringThe short hand for unit of usage this pricing is specified in.The unit of usage in human readable form.com.google.protobuf.ByteStringThe unit of usage in human readable form.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(PricingExpression other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) removeTieredRates(int index) The list of tiered rates for this pricing.setBaseUnit(String value) The base unit for the SKU which is the unit used in usage exports.setBaseUnitBytes(com.google.protobuf.ByteString value) The base unit for the SKU which is the unit used in usage exports.setBaseUnitConversionFactor(double value) Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit.setBaseUnitDescription(String value) The base unit in human readable form.setBaseUnitDescriptionBytes(com.google.protobuf.ByteString value) The base unit in human readable form.setDisplayQuantity(double value) The recommended quantity of units for displaying pricing info.setTieredRates(int index, PricingExpression.TierRate value) The list of tiered rates for this pricing.setTieredRates(int index, PricingExpression.TierRate.Builder builderForValue) The list of tiered rates for this pricing.setUsageUnit(String value) The short hand for unit of usage this pricing is specified in.setUsageUnitBytes(com.google.protobuf.ByteString value) The short hand for unit of usage this pricing is specified in.setUsageUnitDescription(String value) The unit of usage in human readable form.setUsageUnitDescriptionBytes(com.google.protobuf.ByteString value) The unit of usage in human readable form.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<PricingExpression.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<PricingExpression.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.GeneratedMessage.Builder<PricingExpression.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<PricingExpression.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<PricingExpression.Builder>
-
mergeFrom
public PricingExpression.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<PricingExpression.Builder>- Throws:
IOException
-
getUsageUnit
The short hand for unit of usage this pricing is specified in. Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
string usage_unit = 1;- Specified by:
getUsageUnitin interfacePricingExpressionOrBuilder- Returns:
- The usageUnit.
-
getUsageUnitBytes
public com.google.protobuf.ByteString getUsageUnitBytes()The short hand for unit of usage this pricing is specified in. Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
string usage_unit = 1;- Specified by:
getUsageUnitBytesin interfacePricingExpressionOrBuilder- Returns:
- The bytes for usageUnit.
-
setUsageUnit
The short hand for unit of usage this pricing is specified in. Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
string usage_unit = 1;- Parameters:
value- The usageUnit to set.- Returns:
- This builder for chaining.
-
clearUsageUnit
The short hand for unit of usage this pricing is specified in. Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
string usage_unit = 1;- Returns:
- This builder for chaining.
-
setUsageUnitBytes
The short hand for unit of usage this pricing is specified in. Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
string usage_unit = 1;- Parameters:
value- The bytes for usageUnit to set.- Returns:
- This builder for chaining.
-
getDisplayQuantity
public double getDisplayQuantity()The recommended quantity of units for displaying pricing info. When displaying pricing info it is recommended to display: (unit_price * display_quantity) per display_quantity usage_unit. This field does not affect the pricing formula and is for display purposes only. Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and the display_quantity is "1000" then the recommended way of displaying the pricing info is "0.10 USD per 1000 GB"
double display_quantity = 2;- Specified by:
getDisplayQuantityin interfacePricingExpressionOrBuilder- Returns:
- The displayQuantity.
-
setDisplayQuantity
The recommended quantity of units for displaying pricing info. When displaying pricing info it is recommended to display: (unit_price * display_quantity) per display_quantity usage_unit. This field does not affect the pricing formula and is for display purposes only. Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and the display_quantity is "1000" then the recommended way of displaying the pricing info is "0.10 USD per 1000 GB"
double display_quantity = 2;- Parameters:
value- The displayQuantity to set.- Returns:
- This builder for chaining.
-
clearDisplayQuantity
The recommended quantity of units for displaying pricing info. When displaying pricing info it is recommended to display: (unit_price * display_quantity) per display_quantity usage_unit. This field does not affect the pricing formula and is for display purposes only. Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and the display_quantity is "1000" then the recommended way of displaying the pricing info is "0.10 USD per 1000 GB"
double display_quantity = 2;- Returns:
- This builder for chaining.
-
getTieredRatesList
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;- Specified by:
getTieredRatesListin interfacePricingExpressionOrBuilder
-
getTieredRatesCount
public int getTieredRatesCount()The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;- Specified by:
getTieredRatesCountin interfacePricingExpressionOrBuilder
-
getTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;- Specified by:
getTieredRatesin interfacePricingExpressionOrBuilder
-
setTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
setTieredRates
public PricingExpression.Builder setTieredRates(int index, PricingExpression.TierRate.Builder builderForValue) The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addTieredRates
public PricingExpression.Builder addTieredRates(int index, PricingExpression.TierRate.Builder builderForValue) The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addAllTieredRates
public PricingExpression.Builder addAllTieredRates(Iterable<? extends PricingExpression.TierRate> values) The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
clearTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
removeTieredRates
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
getTieredRatesBuilder
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
getTieredRatesOrBuilder
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;- Specified by:
getTieredRatesOrBuilderin interfacePricingExpressionOrBuilder
-
getTieredRatesOrBuilderList
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3;- Specified by:
getTieredRatesOrBuilderListin interfacePricingExpressionOrBuilder
-
addTieredRatesBuilder
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
addTieredRatesBuilder
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
getTieredRatesBuilderList
The list of tiered rates for this pricing. The total cost is computed by applying each of the tiered rates on usage. This repeated list is sorted by ascending order of start_usage_amount.
repeated .google.cloud.billing.v1.PricingExpression.TierRate tiered_rates = 3; -
getUsageUnitDescription
The unit of usage in human readable form. Example: "gibi byte".
string usage_unit_description = 4;- Specified by:
getUsageUnitDescriptionin interfacePricingExpressionOrBuilder- Returns:
- The usageUnitDescription.
-
getUsageUnitDescriptionBytes
public com.google.protobuf.ByteString getUsageUnitDescriptionBytes()The unit of usage in human readable form. Example: "gibi byte".
string usage_unit_description = 4;- Specified by:
getUsageUnitDescriptionBytesin interfacePricingExpressionOrBuilder- Returns:
- The bytes for usageUnitDescription.
-
setUsageUnitDescription
The unit of usage in human readable form. Example: "gibi byte".
string usage_unit_description = 4;- Parameters:
value- The usageUnitDescription to set.- Returns:
- This builder for chaining.
-
clearUsageUnitDescription
The unit of usage in human readable form. Example: "gibi byte".
string usage_unit_description = 4;- Returns:
- This builder for chaining.
-
setUsageUnitDescriptionBytes
The unit of usage in human readable form. Example: "gibi byte".
string usage_unit_description = 4;- Parameters:
value- The bytes for usageUnitDescription to set.- Returns:
- This builder for chaining.
-
getBaseUnit
The base unit for the SKU which is the unit used in usage exports. Example: "By"
string base_unit = 5;- Specified by:
getBaseUnitin interfacePricingExpressionOrBuilder- Returns:
- The baseUnit.
-
getBaseUnitBytes
public com.google.protobuf.ByteString getBaseUnitBytes()The base unit for the SKU which is the unit used in usage exports. Example: "By"
string base_unit = 5;- Specified by:
getBaseUnitBytesin interfacePricingExpressionOrBuilder- Returns:
- The bytes for baseUnit.
-
setBaseUnit
The base unit for the SKU which is the unit used in usage exports. Example: "By"
string base_unit = 5;- Parameters:
value- The baseUnit to set.- Returns:
- This builder for chaining.
-
clearBaseUnit
The base unit for the SKU which is the unit used in usage exports. Example: "By"
string base_unit = 5;- Returns:
- This builder for chaining.
-
setBaseUnitBytes
The base unit for the SKU which is the unit used in usage exports. Example: "By"
string base_unit = 5;- Parameters:
value- The bytes for baseUnit to set.- Returns:
- This builder for chaining.
-
getBaseUnitDescription
The base unit in human readable form. Example: "byte".
string base_unit_description = 6;- Specified by:
getBaseUnitDescriptionin interfacePricingExpressionOrBuilder- Returns:
- The baseUnitDescription.
-
getBaseUnitDescriptionBytes
public com.google.protobuf.ByteString getBaseUnitDescriptionBytes()The base unit in human readable form. Example: "byte".
string base_unit_description = 6;- Specified by:
getBaseUnitDescriptionBytesin interfacePricingExpressionOrBuilder- Returns:
- The bytes for baseUnitDescription.
-
setBaseUnitDescription
The base unit in human readable form. Example: "byte".
string base_unit_description = 6;- Parameters:
value- The baseUnitDescription to set.- Returns:
- This builder for chaining.
-
clearBaseUnitDescription
The base unit in human readable form. Example: "byte".
string base_unit_description = 6;- Returns:
- This builder for chaining.
-
setBaseUnitDescriptionBytes
The base unit in human readable form. Example: "byte".
string base_unit_description = 6;- Parameters:
value- The bytes for baseUnitDescription to set.- Returns:
- This builder for chaining.
-
getBaseUnitConversionFactor
public double getBaseUnitConversionFactor()Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit. unit_price / base_unit_conversion_factor = price per base_unit. start_usage_amount * base_unit_conversion_factor = start_usage_amount in base_unit.
double base_unit_conversion_factor = 7;- Specified by:
getBaseUnitConversionFactorin interfacePricingExpressionOrBuilder- Returns:
- The baseUnitConversionFactor.
-
setBaseUnitConversionFactor
Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit. unit_price / base_unit_conversion_factor = price per base_unit. start_usage_amount * base_unit_conversion_factor = start_usage_amount in base_unit.
double base_unit_conversion_factor = 7;- Parameters:
value- The baseUnitConversionFactor to set.- Returns:
- This builder for chaining.
-
clearBaseUnitConversionFactor
Conversion factor for converting from price per usage_unit to price per base_unit, and start_usage_amount to start_usage_amount in base_unit. unit_price / base_unit_conversion_factor = price per base_unit. start_usage_amount * base_unit_conversion_factor = start_usage_amount in base_unit.
double base_unit_conversion_factor = 7;- Returns:
- This builder for chaining.
-