public final class PricingExpression extends GeneratedMessageV3 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
Static Fields
BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER
public static final int BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER
Field Value
BASE_UNIT_DESCRIPTION_FIELD_NUMBER
public static final int BASE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value
BASE_UNIT_FIELD_NUMBER
public static final int BASE_UNIT_FIELD_NUMBER
Field Value
DISPLAY_QUANTITY_FIELD_NUMBER
public static final int DISPLAY_QUANTITY_FIELD_NUMBER
Field Value
TIERED_RATES_FIELD_NUMBER
public static final int TIERED_RATES_FIELD_NUMBER
Field Value
USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
public static final int USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value
USAGE_UNIT_FIELD_NUMBER
public static final int USAGE_UNIT_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static PricingExpression getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static PricingExpression.Builder newBuilder()
Returns
newBuilder(PricingExpression prototype)
public static PricingExpression.Builder newBuilder(PricingExpression prototype)
Parameter
Returns
public static PricingExpression parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static PricingExpression parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static PricingExpression parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static PricingExpression parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static PricingExpression parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static PricingExpression parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static PricingExpression parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static PricingExpression parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static PricingExpression parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<PricingExpression> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getBaseUnit()
public String getBaseUnit()
The base unit for the SKU which is the unit used in usage exports.
Example: "By"
string base_unit = 5;
Returns
Type | Description |
String | The baseUnit.
|
getBaseUnitBytes()
public ByteString getBaseUnitBytes()
The base unit for the SKU which is the unit used in usage exports.
Example: "By"
string base_unit = 5;
Returns
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;
Returns
Type | Description |
double | The baseUnitConversionFactor.
|
getBaseUnitDescription()
public String getBaseUnitDescription()
The base unit in human readable form.
Example: "byte".
string base_unit_description = 6;
Returns
Type | Description |
String | The baseUnitDescription.
|
getBaseUnitDescriptionBytes()
public ByteString getBaseUnitDescriptionBytes()
The base unit in human readable form.
Example: "byte".
string base_unit_description = 6;
Returns
Type | Description |
ByteString | The bytes for baseUnitDescription.
|
getDefaultInstanceForType()
public PricingExpression getDefaultInstanceForType()
Returns
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;
Returns
Type | Description |
double | The displayQuantity.
|
getParserForType()
public Parser<PricingExpression> getParserForType()
Returns
Overrides
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
getTieredRates(int index)
public PricingExpression.TierRate getTieredRates(int index)
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;
Parameter
Returns
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;
Returns
getTieredRatesList()
public List<PricingExpression.TierRate> 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;
Returns
getTieredRatesOrBuilder(int index)
public PricingExpression.TierRateOrBuilder getTieredRatesOrBuilder(int index)
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;
Parameter
Returns
getTieredRatesOrBuilderList()
public List<? extends PricingExpression.TierRateOrBuilder> 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;
Returns
Type | Description |
List<? extends com.google.cloud.billing.v1.PricingExpression.TierRateOrBuilder> | |
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
getUsageUnit()
public String 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;
Returns
Type | Description |
String | The usageUnit.
|
getUsageUnitBytes()
public 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;
Returns
getUsageUnitDescription()
public String getUsageUnitDescription()
The unit of usage in human readable form.
Example: "gibi byte".
string usage_unit_description = 4;
Returns
Type | Description |
String | The usageUnitDescription.
|
getUsageUnitDescriptionBytes()
public ByteString getUsageUnitDescriptionBytes()
The unit of usage in human readable form.
Example: "gibi byte".
string usage_unit_description = 4;
Returns
Type | Description |
ByteString | The bytes for usageUnitDescription.
|
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public PricingExpression.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected PricingExpression.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public PricingExpression.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions