Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions proto/sentry_protos/billing/v1/common/v1/pricing_tier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,12 @@ message PricingTier {
message TieredPricingRate {
repeated PricingTier tiers = 1;
}

message FixedPricingTier {
int64 value = 1;
uint64 base_price_cents = 2;
}

message FixedTierList {
repeated FixedPricingTier tiers = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ message LineItemConfig {
// Base price for the line item (upgraded reserved volumes or add-on activation fees)
uint64 base_price_cents = 1;
sentry_protos.billing.v1.common.v1.TieredPricingRate payg_rate = 3;
//DEPRECATED: use reserved_pricing instead
sentry_protos.billing.v1.common.v1.TieredPricingRate reserved_rate = 4; // for reserved budget line items

// how many of this lineitem are included in the package, the customer can reserve more on their contract
Expand All @@ -19,6 +20,13 @@ message LineItemConfig {
}

sentry_protos.billing.v1.common.v1.LineItemDetails line_item = 7;

oneof reserved_pricing {
// Used to calculate spend against reserved_pool_cents for shared line items
sentry_protos.billing.v1.common.v1.TieredPricingRate reserved_pricing_rate = 8;
// Used to determine prices for distinct reserved tiers (ie 100K errors is $X / month)
sentry_protos.billing.v1.common.v1.FixedTierList reserved_tiers = 9;
}
}

// Represents a budget included in a package that is collectively used by one or more line items,
Expand Down
12 changes: 12 additions & 0 deletions rust/src/sentry_protos.billing.v1.common.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,15 @@ pub struct TieredPricingRate {
#[prost(message, repeated, tag = "1")]
pub tiers: ::prost::alloc::vec::Vec<PricingTier>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FixedPricingTier {
#[prost(int64, tag = "1")]
pub value: i64,
#[prost(uint64, tag = "2")]
pub base_price_cents: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FixedTierList {
#[prost(message, repeated, tag = "1")]
pub tiers: ::prost::alloc::vec::Vec<FixedPricingTier>,
}
13 changes: 13 additions & 0 deletions rust/src/sentry_protos.billing.v1.services.package.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pub struct LineItemConfig {
pub payg_rate: ::core::option::Option<
super::super::super::common::v1::TieredPricingRate,
>,
/// DEPRECATED: use reserved_pricing instead
///
/// for reserved budget line items
#[prost(message, optional, tag = "4")]
pub reserved_rate: ::core::option::Option<
Expand All @@ -22,6 +24,8 @@ pub struct LineItemConfig {
pub included_reserved_units: ::core::option::Option<
line_item_config::IncludedReservedUnits,
>,
#[prost(oneof = "line_item_config::ReservedPricing", tags = "8, 9")]
pub reserved_pricing: ::core::option::Option<line_item_config::ReservedPricing>,
}
/// Nested message and enum types in `LineItemConfig`.
pub mod line_item_config {
Expand All @@ -34,6 +38,15 @@ pub mod line_item_config {
#[prost(uint64, tag = "6")]
NumReservedUnits(u64),
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ReservedPricing {
/// Used to calculate spend against reserved_pool_cents for shared line items
#[prost(message, tag = "8")]
ReservedPricingRate(super::super::super::super::common::v1::TieredPricingRate),
/// Used to determine prices for distinct reserved tiers (ie 100K errors is $X / month)
#[prost(message, tag = "9")]
ReservedTiers(super::super::super::super::common::v1::FixedTierList),
}
}
/// Represents a budget included in a package that is collectively used by one or more line items,
/// allowing multiple line items to draw from the same reserved budget.
Expand Down
Loading