sentry_protos 0.11.0

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Address {
    #[prost(string, tag = "1")]
    pub city: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub region: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub country_code: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub postal_code: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub address_line_1: ::prost::alloc::string::String,
    #[prost(string, tag = "6")]
    pub address_line_2: ::prost::alloc::string::String,
    #[prost(string, tag = "7")]
    pub address_line_3: ::prost::alloc::string::String,
}
/// Defines how usage data is transformed into a billable line item through arithmetic operations.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BillableMetric {
    /// Unique identifier for the billable metric.
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// Name of the billable metric (e.g., "performance_units").
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// Expression defining how to calculate this metric from usage data.
    #[prost(message, optional, tag = "3")]
    pub expression: ::core::option::Option<Expression>,
}
/// Represents an arithmetic expression that can reference usage data categories or constants.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Expression {
    #[prost(oneof = "expression::ExpressionType", tags = "1, 2, 3")]
    pub expression_type: ::core::option::Option<expression::ExpressionType>,
}
/// Nested message and enum types in `Expression`.
pub mod expression {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum ExpressionType {
        /// Reference to a data category's usage count.
        #[prost(message, tag = "1")]
        CategoryRef(super::CategoryReference),
        /// A constant numeric value.
        #[prost(double, tag = "2")]
        Constant(f64),
        /// A binary arithmetic operation.
        #[prost(message, tag = "3")]
        BinaryOp(::prost::alloc::boxed::Box<super::BinaryOperation>),
    }
}
/// Reference to a usage data category.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CategoryReference {
    #[prost(oneof = "category_reference::CategoryType", tags = "1, 2")]
    pub category_type: ::core::option::Option<category_reference::CategoryType>,
}
/// Nested message and enum types in `CategoryReference`.
pub mod category_reference {
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum CategoryType {
        #[prost(enumeration = "super::super::super::DataCategory", tag = "1")]
        DataCategory(i32),
        #[prost(enumeration = "super::super::super::SeatCategory", tag = "2")]
        SeatCategory(i32),
    }
}
/// A binary arithmetic operation between two expressions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BinaryOperation {
    /// The operator to apply.
    #[prost(enumeration = "Operator", tag = "1")]
    pub operator: i32,
    /// Left operand.
    #[prost(message, optional, boxed, tag = "2")]
    pub left: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
    /// Right operand.
    #[prost(message, optional, boxed, tag = "3")]
    pub right: ::core::option::Option<::prost::alloc::boxed::Box<Expression>>,
}
/// Supported arithmetic operators.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operator {
    Unspecified = 0,
    /// *
    Add = 1,
    /// *
    Subtract = 2,
    /// *
    Multiply = 3,
    /// /
    Divide = 4,
}
impl Operator {
    /// 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 => "OPERATOR_UNSPECIFIED",
            Self::Add => "OPERATOR_ADD",
            Self::Subtract => "OPERATOR_SUBTRACT",
            Self::Multiply => "OPERATOR_MULTIPLY",
            Self::Divide => "OPERATOR_DIVIDE",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
            "OPERATOR_ADD" => Some(Self::Add),
            "OPERATOR_SUBTRACT" => Some(Self::Subtract),
            "OPERATOR_MULTIPLY" => Some(Self::Multiply),
            "OPERATOR_DIVIDE" => Some(Self::Divide),
            _ => None,
        }
    }
}
/// Billing interval for packages and contracts.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BillingInterval {
    Unspecified = 0,
    Monthly = 1,
    AnnualBaseMonthlyPayg = 2,
}
impl BillingInterval {
    /// 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 => "BILLING_INTERVAL_UNSPECIFIED",
            Self::Monthly => "BILLING_INTERVAL_MONTHLY",
            Self::AnnualBaseMonthlyPayg => "BILLING_INTERVAL_ANNUAL_BASE_MONTHLY_PAYG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BILLING_INTERVAL_UNSPECIFIED" => Some(Self::Unspecified),
            "BILLING_INTERVAL_MONTHLY" => Some(Self::Monthly),
            "BILLING_INTERVAL_ANNUAL_BASE_MONTHLY_PAYG" => {
                Some(Self::AnnualBaseMonthlyPayg)
            }
            _ => None,
        }
    }
}
/// Unit information for measurement and conversion.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnitInfo {
    /// Short name for the unit (e.g., "GB", "cm", "count").
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Full descriptive name (e.g., "gigabytes", "centimeters", "count").
    #[prost(string, tag = "2")]
    pub full_name: ::prost::alloc::string::String,
    /// Base unit for conversion.
    #[prost(enumeration = "BaseUnit", tag = "3")]
    pub base_unit: i32,
    /// Multiplier to convert to base unit (e.g., 1e9 for GB to bytes).
    #[prost(double, tag = "4")]
    pub multiplier: f64,
}
/// Base unit types for measurement and conversion.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum BaseUnit {
    Unspecified = 0,
    Byte = 1,
    Count = 2,
    Second = 3,
    Millisecond = 4,
}
impl BaseUnit {
    /// 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 => "BASE_UNIT_UNSPECIFIED",
            Self::Byte => "BASE_UNIT_BYTE",
            Self::Count => "BASE_UNIT_COUNT",
            Self::Second => "BASE_UNIT_SECOND",
            Self::Millisecond => "BASE_UNIT_MILLISECOND",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "BASE_UNIT_UNSPECIFIED" => Some(Self::Unspecified),
            "BASE_UNIT_BYTE" => Some(Self::Byte),
            "BASE_UNIT_COUNT" => Some(Self::Count),
            "BASE_UNIT_SECOND" => Some(Self::Second),
            "BASE_UNIT_MILLISECOND" => Some(Self::Millisecond),
            _ => None,
        }
    }
}
/// Details of a SKU line item in the billing system.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LineItemDetails {
    /// Unique identifier for the line item.
    #[prost(string, tag = "1")]
    pub uid: ::prost::alloc::string::String,
    /// Customer-facing display name for the line item.
    #[prost(string, tag = "3")]
    pub customer_facing_name: ::prost::alloc::string::String,
    /// Plural form of the customer-facing name.
    #[prost(string, tag = "4")]
    pub plural: ::prost::alloc::string::String,
    /// Unit information for measurement.
    #[prost(message, optional, tag = "5")]
    pub units: ::core::option::Option<UnitInfo>,
    /// Defines how usage data is transformed into this line item.
    #[prost(message, optional, tag = "6")]
    pub billable_metric: ::core::option::Option<BillableMetric>,
}
/// Stripe-specific payment information for an organization.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StripePaymentData {
    #[prost(string, optional, tag = "1")]
    pub customer_stripe_id: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "2")]
    pub default_payment_method_id: ::core::option::Option<
        ::prost::alloc::string::String,
    >,
}
/// Payment provider configuration with support for multiple providers.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PaymentConfig {
    #[prost(oneof = "payment_config::Config", tags = "1")]
    pub config: ::core::option::Option<payment_config::Config>,
}
/// Nested message and enum types in `PaymentConfig`.
pub mod payment_config {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Config {
        /// Future payment providers (e.g., PayPal, Braintree) can be added here
        #[prost(message, tag = "1")]
        Stripe(super::StripePaymentData),
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PricingTier {
    #[prost(int64, tag = "1")]
    pub start: i64,
    #[prost(int64, tag = "2")]
    pub end: i64,
    #[prost(int64, tag = "3")]
    pub rate_per_unit_cpe: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TieredPricingRate {
    #[prost(message, repeated, tag = "1")]
    pub tiers: ::prost::alloc::vec::Vec<PricingTier>,
}
/// Card payment method details.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Card {
    #[prost(string, tag = "1")]
    pub last_4: ::prost::alloc::string::String,
}
/// Provider-specific payment method information attached to a charge.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PaymentMethodDetails {
    #[prost(oneof = "payment_method_details::Details", tags = "1")]
    pub details: ::core::option::Option<payment_method_details::Details>,
}
/// Nested message and enum types in `PaymentMethodDetails`.
pub mod payment_method_details {
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Details {
        #[prost(message, tag = "1")]
        Card(super::Card),
    }
}
/// A snapshot of a Stripe charge object. Used as the payload when reacting
/// to Stripe webhook events.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct StripeCharge {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(uint64, tag = "2")]
    pub amount: u64,
    #[prost(bool, tag = "3")]
    pub refunded: bool,
    #[prost(bool, tag = "4")]
    pub paid: bool,
    #[prost(uint64, tag = "5")]
    pub amount_refunded: u64,
    /// Stripe's "created" field, expressed as Unix epoch seconds.
    #[prost(int64, tag = "6")]
    pub created_st: i64,
    #[prost(string, optional, tag = "7")]
    pub failure_code: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "8")]
    pub payment_method_details: ::core::option::Option<PaymentMethodDetails>,
}