sentry_protos 0.8.16

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
/// 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,
}
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",
        }
    }
    /// 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),
            _ => 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>,
}
#[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>,
}