Class PricingExpression (2.27.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
TypeDescription
int

BASE_UNIT_DESCRIPTION_FIELD_NUMBER

public static final int BASE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

BASE_UNIT_FIELD_NUMBER

public static final int BASE_UNIT_FIELD_NUMBER
Field Value
TypeDescription
int

DISPLAY_QUANTITY_FIELD_NUMBER

public static final int DISPLAY_QUANTITY_FIELD_NUMBER
Field Value
TypeDescription
int

TIERED_RATES_FIELD_NUMBER

public static final int TIERED_RATES_FIELD_NUMBER
Field Value
TypeDescription
int

USAGE_UNIT_DESCRIPTION_FIELD_NUMBER

public static final int USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

USAGE_UNIT_FIELD_NUMBER

public static final int USAGE_UNIT_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static PricingExpression getDefaultInstance()
Returns
TypeDescription
PricingExpression

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static PricingExpression.Builder newBuilder()
Returns
TypeDescription
PricingExpression.Builder

newBuilder(PricingExpression prototype)

public static PricingExpression.Builder newBuilder(PricingExpression prototype)
Parameter
NameDescription
prototypePricingExpression
Returns
TypeDescription
PricingExpression.Builder

parseDelimitedFrom(InputStream input)

public static PricingExpression parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static PricingExpression parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static PricingExpression parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static PricingExpression parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static PricingExpression parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static PricingExpression parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static PricingExpression parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PricingExpression
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<PricingExpression> parser()
Returns
TypeDescription
Parser<PricingExpression>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
double

The baseUnitConversionFactor.

getBaseUnitDescription()

public String getBaseUnitDescription()

The base unit in human readable form. Example: "byte".

string base_unit_description = 6;

Returns
TypeDescription
String

The baseUnitDescription.

getBaseUnitDescriptionBytes()

public ByteString getBaseUnitDescriptionBytes()

The base unit in human readable form. Example: "byte".

string base_unit_description = 6;

Returns
TypeDescription
ByteString

The bytes for baseUnitDescription.

getDefaultInstanceForType()

public PricingExpression getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
double

The displayQuantity.

getParserForType()

public Parser<PricingExpression> getParserForType()
Returns
TypeDescription
Parser<PricingExpression>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
String

The usageUnitDescription.

getUsageUnitDescriptionBytes()

public ByteString getUsageUnitDescriptionBytes()

The unit of usage in human readable form. Example: "gibi byte".

string usage_unit_description = 4;

Returns
TypeDescription
ByteString

The bytes for usageUnitDescription.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public PricingExpression.Builder newBuilderForType()
Returns
TypeDescription
PricingExpression.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected PricingExpression.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
PricingExpression.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public PricingExpression.Builder toBuilder()
Returns
TypeDescription
PricingExpression.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException