Class PricingExpression (2.42.0)

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()
Returns
Type Description
PricingExpression

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static PricingExpression.Builder newBuilder()
Returns
Type Description
PricingExpression.Builder

newBuilder(PricingExpression prototype)

public static PricingExpression.Builder newBuilder(PricingExpression prototype)
Parameter
Name Description
prototype PricingExpression
Returns
Type Description
PricingExpression.Builder

parseDelimitedFrom(InputStream input)

public static PricingExpression parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static PricingExpression parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PricingExpression parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PricingExpression parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static PricingExpression parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static PricingExpression parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
PricingExpression
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<PricingExpression> parser()
Returns
Type Description
Parser<PricingExpression>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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()
Returns
Type Description
PricingExpression

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
Type Description
Parser<PricingExpression>
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
Returns
Type Description
PricingExpression.TierRate

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;

Returns
Type Description
List<TierRate>

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
Returns
Type Description
PricingExpression.TierRateOrBuilder

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>

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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public PricingExpression.Builder newBuilderForType()
Returns
Type Description
PricingExpression.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PricingExpression.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
PricingExpression.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public PricingExpression.Builder toBuilder()
Returns
Type Description
PricingExpression.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException