sentry_protos 0.8.30

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
/// Canonical projection of a stored platform charge. Returned by charge
/// service endpoints that need to expose the persisted charge state to
/// callers.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PlatformCharge {
    #[prost(string, tag = "1")]
    pub stripe_id: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub organization_id: u64,
    /// Unset when the charge is not associated with an invoice (e.g. ad-hoc
    /// charges created outside the invoicing flow).
    #[prost(uint64, optional, tag = "3")]
    pub invoice_id: ::core::option::Option<u64>,
    #[prost(bool, tag = "4")]
    pub paid: bool,
    #[prost(uint64, tag = "5")]
    pub amount: u64,
    #[prost(string, optional, tag = "6")]
    pub failure_code: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(bool, tag = "7")]
    pub refunded: bool,
    #[prost(uint64, tag = "8")]
    pub amount_refunded: u64,
    #[prost(string, optional, tag = "9")]
    pub card_last_4: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CaptureChargeRequest {
    #[prost(enumeration = "ChargeMethod", tag = "1")]
    pub charge_method: i32,
    #[prost(uint64, tag = "2")]
    pub amount_cents: u64,
    #[prost(string, optional, tag = "3")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(uint64, tag = "4")]
    pub organization_id: u64,
    #[prost(message, optional, tag = "5")]
    pub current_ts: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(string, optional, tag = "6")]
    pub invoice_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "7")]
    pub invoice_guid: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "8")]
    pub payment_config: ::core::option::Option<
        super::super::super::common::v1::PaymentConfig,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CaptureChargeResponse {
    #[prost(bool, tag = "1")]
    pub paid: bool,
    #[prost(string, optional, tag = "2")]
    pub failure_code: ::core::option::Option<::prost::alloc::string::String>,
}
/// How the charge should be executed against the payment provider.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ChargeMethod {
    /// Default zero value. Requests with this value must be rejected so
    /// that an unset charge_method is never silently treated as an active
    /// billing choice.
    Unspecified = 0,
    /// Record the charge against our DB models without contacting any
    /// external payment provider. Payment is expected to be collected
    /// externally.
    None = 1,
    /// Call the Stripe API to bill the customer for this charge.
    Stripe = 2,
}
impl ChargeMethod {
    /// 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 => "CHARGE_METHOD_UNSPECIFIED",
            Self::None => "CHARGE_METHOD_NONE",
            Self::Stripe => "CHARGE_METHOD_STRIPE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CHARGE_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
            "CHARGE_METHOD_NONE" => Some(Self::None),
            "CHARGE_METHOD_STRIPE" => Some(Self::Stripe),
            _ => None,
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Charge {
    #[prost(uint64, tag = "1")]
    pub amount_cents: u64,
    #[prost(bool, tag = "2")]
    pub paid: bool,
    #[prost(string, optional, tag = "3")]
    pub failure_code: ::core::option::Option<::prost::alloc::string::String>,
}
/// No pagination on this request because there are expected to be only a handful
/// of attempted charges per invoice.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListChargesForInvoiceRequest {
    #[prost(uint64, tag = "1")]
    pub invoice_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChargesForInvoiceResponse {
    #[prost(message, repeated, tag = "1")]
    pub charges: ::prost::alloc::vec::Vec<Charge>,
}
/// Synchronizes a stored platform charge with the latest snapshot from
/// Stripe. The charge is identified by `stripe_charge.id`. Fields like
/// `paid`, `failure_code` and refund state are copied onto the stored
/// record so the database reflects the current payment-provider state.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateChargeRequest {
    #[prost(message, optional, tag = "1")]
    pub stripe_charge: ::core::option::Option<
        super::super::super::common::v1::StripeCharge,
    >,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateChargeResponse {
    /// Unset when no platform charge with the given stripe_id exists.
    #[prost(message, optional, tag = "1")]
    pub charge: ::core::option::Option<PlatformCharge>,
}