Class PricingExpression

  • All Implemented Interfaces:
    PricingExpressionOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class PricingExpression
    extends com.google.protobuf.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
    See Also:
    Serialized Form
    • Field Detail

      • USAGE_UNIT_FIELD_NUMBER

        public static final int USAGE_UNIT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DISPLAY_QUANTITY_FIELD_NUMBER

        public static final int DISPLAY_QUANTITY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TIERED_RATES_FIELD_NUMBER

        public static final int TIERED_RATES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • USAGE_UNIT_DESCRIPTION_FIELD_NUMBER

        public static final int USAGE_UNIT_DESCRIPTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • BASE_UNIT_DESCRIPTION_FIELD_NUMBER

        public static final int BASE_UNIT_DESCRIPTION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER

        public static final int BASE_UNIT_CONVERSION_FACTOR_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getUsageUnit in interface PricingExpressionOrBuilder
        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:
        getUsageUnitBytes in interface PricingExpressionOrBuilder
        Returns:
        The bytes for usageUnit.
      • 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:
        getDisplayQuantity in interface PricingExpressionOrBuilder
        Returns:
        The displayQuantity.
      • 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;
        Specified by:
        getTieredRatesList in interface PricingExpressionOrBuilder
      • 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;
        Specified by:
        getTieredRatesOrBuilderList in interface PricingExpressionOrBuilder
      • 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:
        getTieredRatesCount in interface PricingExpressionOrBuilder
      • getTieredRates

        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;
        Specified by:
        getTieredRates in interface PricingExpressionOrBuilder
      • getTieredRatesOrBuilder

        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;
        Specified by:
        getTieredRatesOrBuilder in interface PricingExpressionOrBuilder
      • getUsageUnitDescription

        public String getUsageUnitDescription()
         The unit of usage in human readable form.
         Example: "gibi byte".
         
        string usage_unit_description = 4;
        Specified by:
        getUsageUnitDescription in interface PricingExpressionOrBuilder
        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:
        getUsageUnitDescriptionBytes in interface PricingExpressionOrBuilder
        Returns:
        The bytes for usageUnitDescription.
      • getBaseUnit

        public String getBaseUnit()
         The base unit for the SKU which is the unit used in usage exports.
         Example: "By"
         
        string base_unit = 5;
        Specified by:
        getBaseUnit in interface PricingExpressionOrBuilder
        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:
        getBaseUnitBytes in interface PricingExpressionOrBuilder
        Returns:
        The bytes for baseUnit.
      • getBaseUnitDescriptionBytes

        public com.google.protobuf.ByteString getBaseUnitDescriptionBytes()
         The base unit in human readable form.
         Example: "byte".
         
        string base_unit_description = 6;
        Specified by:
        getBaseUnitDescriptionBytes in interface PricingExpressionOrBuilder
        Returns:
        The bytes for baseUnitDescription.
      • 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:
        getBaseUnitConversionFactor in interface PricingExpressionOrBuilder
        Returns:
        The baseUnitConversionFactor.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static PricingExpression parseFrom​(ByteBuffer data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(ByteBuffer data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(com.google.protobuf.ByteString data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(com.google.protobuf.ByteString data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(byte[] data)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(byte[] data,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static PricingExpression parseFrom​(com.google.protobuf.CodedInputStream input,
                                                  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                           throws IOException
        Throws:
        IOException
      • newBuilderForType

        public PricingExpression.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public PricingExpression.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected PricingExpression.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getParserForType

        public com.google.protobuf.Parser<PricingExpression> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public PricingExpression getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder