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 |
---|
Type | Description |
int | |
BASE_UNIT_DESCRIPTION_FIELD_NUMBER
public static final int BASE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
BASE_UNIT_FIELD_NUMBER
public static final int BASE_UNIT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
DISPLAY_QUANTITY_FIELD_NUMBER
public static final int DISPLAY_QUANTITY_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
TIERED_RATES_FIELD_NUMBER
public static final int TIERED_RATES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
public static final int USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
USAGE_UNIT_FIELD_NUMBER
public static final int USAGE_UNIT_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
getDefaultInstance()
public static PricingExpression getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static PricingExpression.Builder newBuilder()
newBuilder(PricingExpression prototype)
public static PricingExpression.Builder newBuilder(PricingExpression prototype)
public static PricingExpression parseDelimitedFrom(InputStream input)
public static PricingExpression parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static PricingExpression parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static PricingExpression parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(CodedInputStream input)
public static PricingExpression parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(InputStream input)
public static PricingExpression parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static PricingExpression parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static PricingExpression parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<PricingExpression> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
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 |
---|
Type | Description |
ByteString | The bytes for baseUnit.
|
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()
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()
Overrides
getSerializedSize()
public int getSerializedSize()
Returns |
---|
Type | Description |
int | |
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 |
---|
Name | Description |
index | int
|
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 |
---|
Type | Description |
int | |
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;
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 |
---|
Name | Description |
index | int
|
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()
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 |
---|
Type | Description |
ByteString | The bytes for usageUnit.
|
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 |
---|
Type | Description |
int | |
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public PricingExpression.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected PricingExpression.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
toBuilder()
public PricingExpression.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides