diff --git a/Cargo.lock b/Cargo.lock index c5ac8903..1be87b53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.130.0" +version = "0.132.0" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto b/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto index 6b8b1346..fc873509 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/pricing_config.proto @@ -76,8 +76,16 @@ message Reservation { // Represents how much of the total reserved amount is allocated to a specific project // for a given line item. message SpendAllocation { + // A checkout operation on the allocation. The default sets the allocation to + // quantity. A contract never stores CHANGE_REMOVE. It is a request to delete the + // project's allocation, and quantity is ignored. + enum Change { + CHANGE_UNSPECIFIED = 0; + CHANGE_REMOVE = 1; + } uint64 quantity = 1; uint64 project_id = 2; + Change change = 3; } // Allows usage beyond a reservation without PAYG charges. diff --git a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs index 03a44e25..e8810a0e 100644 --- a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs @@ -421,6 +421,50 @@ pub struct SpendAllocation { pub quantity: u64, #[prost(uint64, tag = "2")] pub project_id: u64, + #[prost(enumeration = "spend_allocation::Change", tag = "3")] + pub change: i32, +} +/// Nested message and enum types in `SpendAllocation`. +pub mod spend_allocation { + /// A checkout operation on the allocation. The default sets the allocation to + /// quantity. A contract never stores CHANGE_REMOVE. It is a request to delete the + /// project's allocation, and quantity is ignored. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Change { + Unspecified = 0, + Remove = 1, + } + impl Change { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Self::Unspecified => "CHANGE_UNSPECIFIED", + Self::Remove => "CHANGE_REMOVE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "CHANGE_UNSPECIFIED" => Some(Self::Unspecified), + "CHANGE_REMOVE" => Some(Self::Remove), + _ => None, + } + } + } } /// Allows usage beyond a reservation without PAYG charges. #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]