Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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;
}
5 changes: 4 additions & 1 deletion rust/src/sentry_protos.billing.v1.services.contract.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ pub struct GetUninvoicedContractsResponse {
#[prost(uint64, repeated, tag = "3")]
pub contract_ids: ::prost::alloc::vec::Vec<u64>,
}
#[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")]
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<u64>,
/// 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<Self> {
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")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,26 @@ pub struct GetSeerWalletConfigResponse {
#[prost(message, optional, tag = "1")]
pub config: ::core::option::Option<SeerWalletConfig>,
}
/// 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<u64>,
/// 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.
Expand Down
Loading