sentry_protos 0.53.0

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
/// Invoices an immediate mid-term contract change and rolls the contract over
/// now. The caller supplies the change to apply (target package/interval and the
/// caps taking effect now) plus the plan-change line items (the prorated
/// new-plan charge and the credit for unused time on the current plan). The
/// invoicer settles accrued pay-as-you-go usage at the current contract's rates,
/// applies monetary grants and sales tax, closes the current contract
/// immediately, and opens the new contract with the supplied change applied.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BillContractChangeRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    /// The plan-change line items billed alongside accrued usage; they take the
    /// place of the term's subscription renewal billing on the closing invoice.
    #[prost(message, repeated, tag = "2")]
    pub line_items: ::prost::alloc::vec::Vec<
        super::super::contract::v1::InvoiceLineItem,
    >,
    /// The change applied to the new contract: the target package/interval and the
    /// PAYG caps taking effect now. Reuses the PendingChange shape the rollover
    /// consumes, but here it applies immediately rather than at a period boundary,
    /// so the caller does not stage it in the pending-change store.
    #[prost(message, optional, tag = "3")]
    pub change: ::core::option::Option<super::super::super::common::v1::PendingChange>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BillContractChangeResponse {
    /// The invoice that settles the change (and closes the previous contract).
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChargeInvoicesRequest {
    /// The current time used to select invoices that are due and require a
    /// charge to be processed.
    #[prost(message, optional, tag = "1")]
    pub current_ts: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChargeInvoicesResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAndBillContractRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    #[prost(string, tag = "2")]
    pub package_uid: ::prost::alloc::string::String,
    #[prost(message, repeated, tag = "3")]
    pub user_configs: ::prost::alloc::vec::Vec<super::super::contract::v1::UserConfig>,
    #[prost(uint32, tag = "4")]
    pub month_interval: u32,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateAndBillContractResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateInvoicesRequest {
    /// The current time used to select contracts whose billing period has ended
    /// and require an invoice to be generated.
    #[prost(message, optional, tag = "1")]
    pub current_ts: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateInvoicesResponse {}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GeneratePdfRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
    #[prost(string, tag = "2")]
    pub invoice_guid: ::prost::alloc::string::String,
    #[prost(uint64, tag = "3")]
    pub organization_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PdfData {
    /// Right-aligned lines drawn at the top of the page (e.g. company address
    /// and tax IDs).
    #[prost(string, repeated, tag = "1")]
    pub header: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Left column of pre-formatted text lines drawn below the header.
    #[prost(string, repeated, tag = "2")]
    pub billing_lines: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, repeated, tag = "3")]
    pub invoice_lines: ::prost::alloc::vec::Vec<pdf_data::LabeledLine>,
    #[prost(message, repeated, tag = "4")]
    pub table_data: ::prost::alloc::vec::Vec<pdf_data::TableRow>,
    /// Optional FTC disclaimer paragraph drawn below the table.
    #[prost(string, optional, tag = "5")]
    pub disclaimer: ::core::option::Option<::prost::alloc::string::String>,
}
/// Nested message and enum types in `PdfData`.
pub mod pdf_data {
    /// Right column below the header. Each entry renders as the `label` drawn
    /// in one text column and the corresponding `value` drawn in the next.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LabeledLine {
        #[prost(string, tag = "1")]
        pub label: ::prost::alloc::string::String,
        #[prost(string, tag = "2")]
        pub value: ::prost::alloc::string::String,
    }
    /// Rows of the invoice line-item table. The first row is the header row
    /// ("Description" / "Amount"); every subsequent row has the same number of
    /// cells. Cells may contain reportlab markup (e.g. <b>, <br/>, <small>) for
    /// multi-line/styled descriptions.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct TableRow {
        #[prost(string, repeated, tag = "1")]
        pub cells: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeneratePdfResponse {
    #[prost(message, optional, tag = "1")]
    pub pdf_data: ::core::option::Option<PdfData>,
    #[prost(string, tag = "2")]
    pub filename: ::prost::alloc::string::String,
}
/// Request to react to a Stripe `charge.dispute.created` webhook event for a
/// charge created by the billing platform.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HandleChargeDisputedRequest {
    /// Stripe id of the disputed charge (e.g. "ch_xxx").
    #[prost(string, tag = "1")]
    pub stripe_charge_id: ::prost::alloc::string::String,
    /// Stripe id of the dispute itself (e.g. "dp_xxx"). Used for logging and
    /// correlation; not required to process the event.
    #[prost(string, optional, tag = "2")]
    pub stripe_dispute_id: ::core::option::Option<::prost::alloc::string::String>,
    /// Stripe-supplied reason for the dispute (e.g. "fraudulent",
    /// "product_not_received"). Used for logging and correlation.
    #[prost(string, optional, tag = "3")]
    pub reason: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HandleChargeDisputedResponse {
    /// True when the charge was created by the billing platform and the
    /// service has finished its handling.
    #[prost(bool, tag = "1")]
    pub handled: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HandleChargeSucceededRequest {
    #[prost(message, optional, tag = "1")]
    pub stripe_charge: ::core::option::Option<
        super::super::super::common::v1::StripeCharge,
    >,
    #[prost(uint64, optional, tag = "2")]
    pub invoice_id: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "3")]
    pub organization_id: ::core::option::Option<u64>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HandleChargeSucceededResponse {
    #[prost(bool, tag = "1")]
    pub handled: bool,
}
/// Backfills a PlatformCharge row for a Stripe charge that doesn't have one
/// yet, by resolving the invoice guid via ContractService.find_invoice_by_guid
/// and asking ChargeService.create_platform_charge_for_invoice to upsert the
/// row atomically. Presentation-layer orchestrator -- the data services
/// themselves stay decoupled.
///
/// Used by the `charge.succeeded` webhook to materialise the missing row
/// after the manual Pay Now flow, where the endpoint only created a Stripe
/// PaymentIntent and no local PlatformCharge yet exists.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MaterializePlatformChargeRequest {
    #[prost(message, optional, tag = "1")]
    pub stripe_charge: ::core::option::Option<
        super::super::super::common::v1::StripeCharge,
    >,
    #[prost(string, tag = "2")]
    pub invoice_guid: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MaterializePlatformChargeResponse {
    /// Unset when no PlatformInvoice matches the guid -- caller falls
    /// through to legacy handling (the charge belongs to the legacy Invoice
    /// flow).
    #[prost(uint64, optional, tag = "1")]
    pub charge_id: ::core::option::Option<u64>,
    /// True when this call inserted a new row; false on idempotent re-runs
    /// or when no matching invoice was found.
    #[prost(bool, tag = "2")]
    pub created: bool,
}
/// Read-only preview of the invoice a contract will next be billed, without
/// creating the invoice or charging. Mirrors the assembly the invoicer runs when
/// it actually rolls a contract over: renewal (subscription + reserved) line
/// items, accrued pay-as-you-go usage, applied account credit (as negative
/// balance_change line items), and sales tax.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PreviewNextInvoiceRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PreviewNextInvoiceResponse {
    /// The line items the next invoice would carry, including negative
    /// balance_change credit lines and a sales_tax line when applicable.
    #[prost(message, repeated, tag = "1")]
    pub line_items: ::prost::alloc::vec::Vec<
        super::super::contract::v1::InvoiceLineItem,
    >,
    /// The amount that would be charged: the sum of line_items after applied
    /// credit. Never negative (credit is capped at the pre-tax subtotal).
    #[prost(uint64, tag = "2")]
    pub amount_billed_cents: u64,
}