diff --git a/Cargo.lock b/Cargo.lock index bf36ce53..6e27bf0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.62.0" +version = "0.62.1" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/services/rate_card/v1/rate_card.proto b/proto/sentry_protos/billing/v1/services/rate_card/v1/rate_card.proto index 8be03c83..4071a4e6 100644 --- a/proto/sentry_protos/billing/v1/services/rate_card/v1/rate_card.proto +++ b/proto/sentry_protos/billing/v1/services/rate_card/v1/rate_card.proto @@ -5,6 +5,13 @@ package sentry_protos.billing.v1.services.rate_card.v1; import "sentry_protos/billing/v1/common/v1/line_item_details.proto"; import "sentry_protos/billing/v1/common/v1/pricing_tier.proto"; +message ProjectSpendAllocation { + uint64 project_id = 1; + + // Reserved line-item units assigned exclusively to this project + uint64 quantity = 2; +} + message RateCardLineItem { sentry_protos.billing.v1.common.v1.LineItemDetails line_item_detail = 1; @@ -20,6 +27,8 @@ message RateCardLineItem { // Whether this line item is currently enabled bool is_enabled = 7; + + repeated ProjectSpendAllocation project_spend_allocations = 8; } message SharedRateCardLineItem { diff --git a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto index bd61ff02..df91b269 100644 --- a/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto +++ b/proto/sentry_protos/billing/v1/services/usage_pricer/v1/endpoint_usage_pricer.proto @@ -85,6 +85,17 @@ message LineItemUsageSummary { bool has_remaining_capacity = 8; } +message ProjectSpendAllocationSummary { + uint64 project_id = 1; + string line_item_uid = 2; + + // Reserved units assigned exclusively to this project + uint64 allocated_quantity = 3; + + // Amount of allocated quantity consumed by this project + uint64 consumed_quantity = 4; +} + message SharedLineItemUsageSummary { // Net cents consumed across all SKUs in this shared budget (after credits/trials applied). uint64 payg_spend_cents = 1; @@ -114,4 +125,6 @@ message UsagePricerResponse { repeated SharedLineItemUsageSummary shared_line_item_summaries = 4; google.protobuf.Timestamp last_usage_ts = 5; + + repeated ProjectSpendAllocationSummary project_spend_allocation_summaries = 6; } diff --git a/rust/src/sentry_protos.billing.v1.services.rate_card.v1.rs b/rust/src/sentry_protos.billing.v1.services.rate_card.v1.rs index a14f0f23..dd53053b 100644 --- a/rust/src/sentry_protos.billing.v1.services.rate_card.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.rate_card.v1.rs @@ -1,4 +1,12 @@ // This file is @generated by prost-build. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ProjectSpendAllocation { + #[prost(uint64, tag = "1")] + pub project_id: u64, + /// Reserved line-item units assigned exclusively to this project + #[prost(uint64, tag = "2")] + pub quantity: u64, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct RateCardLineItem { #[prost(message, optional, tag = "1")] @@ -20,6 +28,8 @@ pub struct RateCardLineItem { /// Whether this line item is currently enabled #[prost(bool, tag = "7")] pub is_enabled: bool, + #[prost(message, repeated, tag = "8")] + pub project_spend_allocations: ::prost::alloc::vec::Vec, /// The following values are the effective values *after* contract overrides have been resolved. If there are no /// contract overrides, the default package values are used. #[prost(oneof = "rate_card_line_item::ReservedUnits", tags = "2, 3")] diff --git a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs index 77ff2029..23de7ffb 100644 --- a/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.usage_pricer.v1.rs @@ -141,6 +141,19 @@ pub struct LineItemUsageSummary { #[prost(bool, tag = "8")] pub has_remaining_capacity: bool, } +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ProjectSpendAllocationSummary { + #[prost(uint64, tag = "1")] + pub project_id: u64, + #[prost(string, tag = "2")] + pub line_item_uid: ::prost::alloc::string::String, + /// Reserved units assigned exclusively to this project + #[prost(uint64, tag = "3")] + pub allocated_quantity: u64, + /// Amount of allocated quantity consumed by this project + #[prost(uint64, tag = "4")] + pub consumed_quantity: u64, +} #[derive(Clone, PartialEq, ::prost::Message)] pub struct SharedLineItemUsageSummary { /// Net cents consumed across all SKUs in this shared budget (after credits/trials applied). @@ -175,4 +188,8 @@ pub struct UsagePricerResponse { pub shared_line_item_summaries: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "5")] pub last_usage_ts: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, repeated, tag = "6")] + pub project_spend_allocation_summaries: ::prost::alloc::vec::Vec< + ProjectSpendAllocationSummary, + >, }