From 976e833f2c5efcbc2b43a985b3f570225a390fcf Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Fri, 6 Nov 2026 11:22:17 -0800 Subject: [PATCH 1/3] feat(billing): Add SeerWalletConfig, deprecate auto top-up protos The auto top-up config mixed two settings: when to buy more Seer credit, and a daily cap on spending. SeerWalletConfig keeps them as separate AutoTopUpConfig and SpendConfig messages behind one upsert endpoint. A section the upsert request leaves unset keeps its stored value, so either can be saved without touching the other. The spend cap is in cents before tax rather than credits. The Wallet enum is dropped because the service only covers the Seer wallet. --- Cargo.lock | 2 +- .../auto_top_up/v1/auto_top_up_config.proto | 8 +++ .../v1/endpoint_get_auto_top_up_config.proto | 8 +++ .../endpoint_upsert_auto_top_up_config.proto | 8 +++ .../v1/endpoint_get_seer_wallet_config.proto | 14 ++++ .../endpoint_upsert_seer_wallet_config.proto | 18 +++++ .../v1/seer_wallet_config.proto | 33 +++++++++ rust/src/_include.rs | 5 ++ ...lling.v1.services.seer_wallet_config.v1.rs | 67 +++++++++++++++++++ 9 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_get_seer_wallet_config.proto create mode 100644 proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_upsert_seer_wallet_config.proto create mode 100644 proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto create mode 100644 rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs diff --git a/Cargo.lock b/Cargo.lock index b0fde2a6..ed958942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -717,7 +717,7 @@ checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "sentry_protos" -version = "0.104.0" +version = "0.106.0" dependencies = [ "prost", "prost-types", diff --git a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto index 825f7fb0..8f7cec2f 100644 --- a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto +++ b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto @@ -2,8 +2,14 @@ syntax = "proto3"; package sentry_protos.billing.v1.services.auto_top_up.v1; +// Deprecated: use sentry_protos.billing.v1.services.seer_wallet_config.v1, +// which keeps the auto top-up and spend settings apart. +option deprecated = true; + // A prepaid balance that auto top-up can refill. enum Wallet { + option deprecated = true; + WALLET_UNSPECIFIED = 0; WALLET_SEER = 1; } @@ -13,6 +19,8 @@ enum Wallet { // buys. Whether a top-up is in progress or has failed is not stored here; the // off-cycle invoices that bought the credit are the record of that. message AutoTopUpConfig { + option deprecated = true; + uint64 id = 1; uint64 organization_id = 2; Wallet wallet = 3; diff --git a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_get_auto_top_up_config.proto b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_get_auto_top_up_config.proto index ad218883..ccc174e0 100644 --- a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_get_auto_top_up_config.proto +++ b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_get_auto_top_up_config.proto @@ -4,12 +4,20 @@ package sentry_protos.billing.v1.services.auto_top_up.v1; import "sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto"; +// Deprecated: use sentry_protos.billing.v1.services.seer_wallet_config.v1, +// which keeps the auto top-up and spend settings apart. +option deprecated = true; + message GetAutoTopUpConfigRequest { + option deprecated = true; + uint64 organization_id = 1; Wallet wallet = 2; } message GetAutoTopUpConfigResponse { + option deprecated = true; + // Unset when the organization never saved a config for the wallet. optional AutoTopUpConfig config = 1; } diff --git a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_upsert_auto_top_up_config.proto b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_upsert_auto_top_up_config.proto index f9e3da04..1e67a431 100644 --- a/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_upsert_auto_top_up_config.proto +++ b/proto/sentry_protos/billing/v1/services/auto_top_up/v1/endpoint_upsert_auto_top_up_config.proto @@ -4,8 +4,14 @@ package sentry_protos.billing.v1.services.auto_top_up.v1; import "sentry_protos/billing/v1/services/auto_top_up/v1/auto_top_up_config.proto"; +// Deprecated: use sentry_protos.billing.v1.services.seer_wallet_config.v1, +// which keeps the auto top-up and spend settings apart. +option deprecated = true; + // Replaces the organization's config for the wallet, or creates it. message UpsertAutoTopUpConfigRequest { + option deprecated = true; + uint64 organization_id = 1; Wallet wallet = 2; bool enabled = 3; @@ -17,5 +23,7 @@ message UpsertAutoTopUpConfigRequest { } message UpsertAutoTopUpConfigResponse { + option deprecated = true; + AutoTopUpConfig config = 1; } diff --git a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_get_seer_wallet_config.proto b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_get_seer_wallet_config.proto new file mode 100644 index 00000000..cebe4318 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_get_seer_wallet_config.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_wallet_config.v1; + +import "sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto"; + +message GetSeerWalletConfigRequest { + uint64 organization_id = 1; +} + +message GetSeerWalletConfigResponse { + // Unset when the organization never saved a config. + optional SeerWalletConfig config = 1; +} diff --git a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_upsert_seer_wallet_config.proto b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_upsert_seer_wallet_config.proto new file mode 100644 index 00000000..557c01da --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_upsert_seer_wallet_config.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_wallet_config.v1; + +import "sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto"; + +// Creates the organization's config, or replaces the sections the request +// sets. A section left unset keeps its stored value, so the auto top-up and +// spend settings can be saved independently. +message UpsertSeerWalletConfigRequest { + uint64 organization_id = 1; + optional AutoTopUpConfig auto_top_up = 2; + optional SpendConfig spend = 3; +} + +message UpsertSeerWalletConfigResponse { + SeerWalletConfig config = 1; +} diff --git a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto new file mode 100644 index 00000000..1f32ec18 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_wallet_config.v1; + +// When and how much credit to buy once the Seer wallet runs low. Amounts are +// in credits before tax, because credits are what the customer buys. Whether a +// top-up is in progress or has failed is not stored here; the off-cycle +// invoices that bought the credit are the record of that. +message AutoTopUpConfig { + // Set only by the customer. + bool enabled = 1; + // A top-up starts when the balance is below this. + uint64 threshold_credits = 2; + // The credits each top-up buys. Must be positive. + uint64 top_up_credits = 3; +} + +// Limits on how much the organization spends from the Seer wallet, whether or +// not auto top-up is on. Amounts are in cents before tax. +message SpendConfig { + // The most the organization spends in any 24 hours, in cents before tax. + // Unset means no cap. + optional uint64 daily_cap_cents = 1; +} + +// An organization's settings for its Seer wallet. Each section is unset until +// the organization first saves it. +message SeerWalletConfig { + uint64 id = 1; + uint64 organization_id = 2; + optional AutoTopUpConfig auto_top_up = 3; + optional SpendConfig spend = 4; +} diff --git a/rust/src/_include.rs b/rust/src/_include.rs index c8a96c2f..ca0d3e2a 100644 --- a/rust/src/_include.rs +++ b/rust/src/_include.rs @@ -135,6 +135,11 @@ pub mod sentry_protos { include!("sentry_protos.billing.v1.services.seer_feature_billing.v1.rs"); } } + pub mod seer_wallet_config { + pub mod v1 { + include!("sentry_protos.billing.v1.services.seer_wallet_config.v1.rs"); + } + } pub mod trial { pub mod v1 { include!("sentry_protos.billing.v1.services.trial.v1.rs"); diff --git a/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs new file mode 100644 index 00000000..89b47226 --- /dev/null +++ b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs @@ -0,0 +1,67 @@ +// This file is @generated by prost-build. +/// When and how much credit to buy once the Seer wallet runs low. Amounts are +/// in credits before tax, because credits are what the customer buys. Whether a +/// top-up is in progress or has failed is not stored here; the off-cycle +/// invoices that bought the credit are the record of that. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AutoTopUpConfig { + /// Set only by the customer. + #[prost(bool, tag = "1")] + pub enabled: bool, + /// A top-up starts when the balance is below this. + #[prost(uint64, tag = "2")] + pub threshold_credits: u64, + /// The credits each top-up buys. Must be positive. + #[prost(uint64, tag = "3")] + pub top_up_credits: u64, +} +/// Limits on how much the organization spends from the Seer wallet, whether or +/// not auto top-up is on. Amounts are in cents before tax. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SpendConfig { + /// The most the organization spends in any 24 hours, in cents before tax. + /// Unset means no cap. + #[prost(uint64, optional, tag = "1")] + pub daily_cap_cents: ::core::option::Option, +} +/// An organization's settings for its Seer wallet. Each section is unset until +/// the organization first saves it. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SeerWalletConfig { + #[prost(uint64, tag = "1")] + pub id: u64, + #[prost(uint64, tag = "2")] + pub organization_id: u64, + #[prost(message, optional, tag = "3")] + pub auto_top_up: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub spend: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetSeerWalletConfigRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct GetSeerWalletConfigResponse { + /// Unset when the organization never saved a config. + #[prost(message, optional, tag = "1")] + pub config: ::core::option::Option, +} +/// Creates the organization's config, or replaces the sections the request +/// sets. A section left unset keeps its stored value, so the auto top-up and +/// spend settings can be saved independently. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UpsertSeerWalletConfigRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, + #[prost(message, optional, tag = "2")] + pub auto_top_up: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub spend: ::core::option::Option, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct UpsertSeerWalletConfigResponse { + #[prost(message, optional, tag = "1")] + pub config: ::core::option::Option, +} From 52cd2c085d5c688c4822122818d70f4c2b2a7612 Mon Sep 17 00:00:00 2001 From: Volo Kluev Date: Fri, 6 Nov 2026 11:46:43 -0800 Subject: [PATCH 2/3] ref(billing): Drop id from SeerWalletConfig Each section of the config is stored on its own, so there is no single config row for an id to name. --- .../seer_wallet_config/v1/seer_wallet_config.proto | 7 +++---- ...try_protos.billing.v1.services.seer_wallet_config.v1.rs | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto index 1f32ec18..10a84795 100644 --- a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto +++ b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/seer_wallet_config.proto @@ -26,8 +26,7 @@ message SpendConfig { // An organization's settings for its Seer wallet. Each section is unset until // the organization first saves it. message SeerWalletConfig { - uint64 id = 1; - uint64 organization_id = 2; - optional AutoTopUpConfig auto_top_up = 3; - optional SpendConfig spend = 4; + uint64 organization_id = 1; + optional AutoTopUpConfig auto_top_up = 2; + optional SpendConfig spend = 3; } diff --git a/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs index 89b47226..8b5175a6 100644 --- a/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs @@ -29,12 +29,10 @@ pub struct SpendConfig { #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] pub struct SeerWalletConfig { #[prost(uint64, tag = "1")] - pub id: u64, - #[prost(uint64, tag = "2")] pub organization_id: u64, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "2")] pub auto_top_up: ::core::option::Option, - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag = "3")] pub spend: ::core::option::Option, } #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] From 83082506c61ad4f0ca3d1264784c5df5f4457715 Mon Sep 17 00:00:00 2001 From: volokluev <3169433+volokluev@users.noreply.github.com> Date: Fri, 6 Nov 2026 16:04:24 -0800 Subject: [PATCH 3/3] feat(billing): Add protos for the Seer wallet auto top-up job (#507) * feat(billing): Add protos for the Seer wallet auto top-up job The job lists organizations with auto top-up enabled, then asks SeerWalletService to top up each one whose balance is below its threshold. It skips an organization whose last top-up invoice is still unpaid, which needs ListInvoices to filter by client_id. * docs(billing): Say a failed top-up blocks auto top-up until paid --- .../contract/v1/endpoint_list_invoices.proto | 3 + .../v1/endpoint_auto_top_up_seer_wallet.proto | 36 +++++++++ ...point_list_auto_top_up_organizations.proto | 19 +++++ ..._protos.billing.v1.services.contract.v1.rs | 5 +- ...ing.v1.services.seer_feature_billing.v1.rs | 81 +++++++++++++++++++ ...lling.v1.services.seer_wallet_config.v1.rs | 20 +++++ 6 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto create mode 100644 proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_list_auto_top_up_organizations.proto diff --git a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_list_invoices.proto b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_list_invoices.proto index ae0f65f0..f7cfcd87 100644 --- a/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_list_invoices.proto +++ b/proto/sentry_protos/billing/v1/services/contract/v1/endpoint_list_invoices.proto @@ -20,6 +20,9 @@ message ListInvoicesRequest { // When true, omit invoices with hide_from_customer_receipts=true so the // response (and total) match what customers should see on receipts. bool customer_receipts_only = 4; + + // When set, only off-cycle invoices requested by this client are returned. + optional string client_id = 5; } message ListInvoicesResponse { diff --git a/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto new file mode 100644 index 00000000..53626a98 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_feature_billing/v1/endpoint_auto_top_up_seer_wallet.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_feature_billing.v1; + +import "google/protobuf/timestamp.proto"; + +// Buys the organization's configured top-up when its Seer wallet balance is +// below the auto top-up threshold. Safe to repeat: calls with a current_ts in +// the same five-minute window bill at most once. +message AutoTopUpSeerWalletRequest { + uint64 organization_id = 1; + google.protobuf.Timestamp current_ts = 2; +} + +message AutoTopUpSeerWalletResponse { + enum Outcome { + OUTCOME_UNSPECIFIED = 0; + // No auto top-up config, or it is disabled. + OUTCOME_NOT_ENABLED = 1; + // The current contract has no Seer wallet. + OUTCOME_NO_WALLET = 2; + OUTCOME_ABOVE_THRESHOLD = 3; + // Another top-up for the organization holds the charge lock. + OUTCOME_LOCKED = 4; + // The last top-up invoice is unpaid, including when its charge failed. + // Top-ups resume once the customer pays it. + OUTCOME_INVOICE_PENDING = 5; + OUTCOME_BILLED = 6; + } + Outcome outcome = 1; + // Set when outcome is OUTCOME_BILLED. + optional uint64 invoice_id = 2; + // Whether the top-up invoice was paid. Only meaningful when outcome is + // OUTCOME_BILLED. + bool paid = 3; +} diff --git a/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_list_auto_top_up_organizations.proto b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_list_auto_top_up_organizations.proto new file mode 100644 index 00000000..acd4e1f7 --- /dev/null +++ b/proto/sentry_protos/billing/v1/services/seer_wallet_config/v1/endpoint_list_auto_top_up_organizations.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package sentry_protos.billing.v1.services.seer_wallet_config.v1; + +// Lists the organizations whose auto top-up is enabled, in ascending +// organization_id order. +message ListAutoTopUpOrganizationsRequest { + // Only organizations with a larger id are returned. Pass the last id of the + // previous page to read the next one. + uint64 after_organization_id = 1; + // Must be positive. + uint32 max_items = 2; +} + +message ListAutoTopUpOrganizationsResponse { + repeated uint64 organization_ids = 1; + // True when more organizations follow the last one returned. + bool truncated = 2; +} 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 554659ce..026bb6bc 100644 --- a/rust/src/sentry_protos.billing.v1.services.contract.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.contract.v1.rs @@ -1103,7 +1103,7 @@ pub struct GetUninvoicedContractsResponse { #[prost(uint64, repeated, tag = "3")] pub contract_ids: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ListInvoicesRequest { /// Only invoices owned by this organization are returned. #[prost(uint64, tag = "1")] @@ -1121,6 +1121,9 @@ pub struct ListInvoicesRequest { /// response (and total) match what customers should see on receipts. #[prost(bool, tag = "4")] pub customer_receipts_only: bool, + /// When set, only off-cycle invoices requested by this client are returned. + #[prost(string, optional, tag = "5")] + pub client_id: ::core::option::Option<::prost::alloc::string::String>, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListInvoicesResponse { diff --git a/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs b/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs index 4454e214..8f1efde9 100644 --- a/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.seer_feature_billing.v1.rs @@ -1,4 +1,85 @@ // This file is @generated by prost-build. +/// Buys the organization's configured top-up when its Seer wallet balance is +/// below the auto top-up threshold. Safe to repeat: calls with a current_ts in +/// the same five-minute window bill at most once. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AutoTopUpSeerWalletRequest { + #[prost(uint64, tag = "1")] + pub organization_id: u64, + #[prost(message, optional, tag = "2")] + pub current_ts: ::core::option::Option<::prost_types::Timestamp>, +} +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AutoTopUpSeerWalletResponse { + #[prost(enumeration = "auto_top_up_seer_wallet_response::Outcome", tag = "1")] + pub outcome: i32, + /// Set when outcome is OUTCOME_BILLED. + #[prost(uint64, optional, tag = "2")] + pub invoice_id: ::core::option::Option, + /// Whether the top-up invoice was paid. Only meaningful when outcome is + /// OUTCOME_BILLED. + #[prost(bool, tag = "3")] + pub paid: bool, +} +/// Nested message and enum types in `AutoTopUpSeerWalletResponse`. +pub mod auto_top_up_seer_wallet_response { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Outcome { + Unspecified = 0, + /// No auto top-up config, or it is disabled. + NotEnabled = 1, + /// The current contract has no Seer wallet. + NoWallet = 2, + AboveThreshold = 3, + /// Another top-up for the organization holds the charge lock. + Locked = 4, + /// The last top-up invoice is unpaid, including when its charge failed. + /// Top-ups resume once the customer pays it. + InvoicePending = 5, + Billed = 6, + } + impl Outcome { + /// 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 => "OUTCOME_UNSPECIFIED", + Self::NotEnabled => "OUTCOME_NOT_ENABLED", + Self::NoWallet => "OUTCOME_NO_WALLET", + Self::AboveThreshold => "OUTCOME_ABOVE_THRESHOLD", + Self::Locked => "OUTCOME_LOCKED", + Self::InvoicePending => "OUTCOME_INVOICE_PENDING", + Self::Billed => "OUTCOME_BILLED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "OUTCOME_UNSPECIFIED" => Some(Self::Unspecified), + "OUTCOME_NOT_ENABLED" => Some(Self::NotEnabled), + "OUTCOME_NO_WALLET" => Some(Self::NoWallet), + "OUTCOME_ABOVE_THRESHOLD" => Some(Self::AboveThreshold), + "OUTCOME_LOCKED" => Some(Self::Locked), + "OUTCOME_INVOICE_PENDING" => Some(Self::InvoicePending), + "OUTCOME_BILLED" => Some(Self::Billed), + _ => None, + } + } + } +} #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct CheckSeerCreditsRequest { #[prost(uint64, tag = "1")] diff --git a/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs index 8b5175a6..d8b3ac77 100644 --- a/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs +++ b/rust/src/sentry_protos.billing.v1.services.seer_wallet_config.v1.rs @@ -46,6 +46,26 @@ pub struct GetSeerWalletConfigResponse { #[prost(message, optional, tag = "1")] pub config: ::core::option::Option, } +/// Lists the organizations whose auto top-up is enabled, in ascending +/// organization_id order. +#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ListAutoTopUpOrganizationsRequest { + /// Only organizations with a larger id are returned. Pass the last id of the + /// previous page to read the next one. + #[prost(uint64, tag = "1")] + pub after_organization_id: u64, + /// Must be positive. + #[prost(uint32, tag = "2")] + pub max_items: u32, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ListAutoTopUpOrganizationsResponse { + #[prost(uint64, repeated, tag = "1")] + pub organization_ids: ::prost::alloc::vec::Vec, + /// True when more organizations follow the last one returned. + #[prost(bool, tag = "2")] + pub truncated: bool, +} /// Creates the organization's config, or replaces the sections the request /// sets. A section left unset keeps its stored value, so the auto top-up and /// spend settings can be saved independently.