Class: Google::Cloud::Billing::V1::PricingExpression
- Inherits:
-
Object
- Object
- Google::Cloud::Billing::V1::PricingExpression
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/cloud/billing/v1/cloud_catalog.rb
Overview
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.
Defined Under Namespace
Classes: TierRate
Instance Attribute Summary collapse
-
#base_unit ⇒ ::String
The base unit for the SKU which is the unit used in usage exports.
-
#base_unit_conversion_factor ⇒ ::Float
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.
-
#base_unit_description ⇒ ::String
The base unit in human readable form.
-
#display_quantity ⇒ ::Float
The recommended quantity of units for displaying pricing info.
-
#tiered_rates ⇒ ::Array<::Google::Cloud::Billing::V1::PricingExpression::TierRate>
The list of tiered rates for this pricing.
-
#usage_unit ⇒ ::String
The short hand for unit of usage this pricing is specified in.
-
#usage_unit_description ⇒ ::String
The unit of usage in human readable form.
Instance Attribute Details
#base_unit ⇒ ::String
Returns The base unit for the SKU which is the unit used in usage exports. Example: "By".
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#base_unit_conversion_factor ⇒ ::Float
Returns 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.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#base_unit_description ⇒ ::String
Returns The base unit in human readable form. Example: "byte".
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#display_quantity ⇒ ::Float
Returns 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".
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#tiered_rates ⇒ ::Array<::Google::Cloud::Billing::V1::PricingExpression::TierRate>
Returns 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.
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#usage_unit ⇒ ::String
Returns 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".
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |
#usage_unit_description ⇒ ::String
Returns The unit of usage in human readable form. Example: "gibi byte".
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'proto_docs/google/cloud/billing/v1/cloud_catalog.rb', line 182 class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # The price rate indicating starting usage and its corresponding price. # @!attribute [rw] start_usage_amount # @return [::Float] # Usage is priced at this rate only after this amount. # Example: start_usage_amount of 10 indicates that the usage will be priced # at the unit_price after the first 10 usage_units. # @!attribute [rw] unit_price # @return [::Google::Type::Money] # The price per unit of usage. # Example: unit_price of amount $10 indicates that each unit will cost $10. class TierRate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end |