sentry_protos 0.58.1

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
/// Compiles per-day, per-line-item usage breakdowns spanning one or more
/// contracts. UsagePricer evaluates each contract's package
/// `BillableMetric.expression` once per outcome field of the raw
/// usage, so callers receive the package-projected `UsageData` view
/// rather than the raw outcomes returned by `BillingUsageService`.
///
/// This is the "non-pricing" derived view UsagePricer exposes -- the
/// projection step pricing already performs internally, lifted out so
/// other presentation services (e.g. ChargeService for CSV / UI) can
/// consume it without re-implementing evaluation.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDailyBreakdownRequest {
    /// The contracts whose daily breakdowns should be returned.
    #[prost(string, repeated, tag = "1")]
    pub contract_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// One line item's projected per-outcome quantities on a given date.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LineItemDailyOutcomes {
    /// Package line item uid (UsagePricer's native vocabulary).
    #[prost(string, tag = "1")]
    pub line_item_uid: ::prost::alloc::string::String,
    /// The seven outcome fields, each populated by evaluating the line
    /// item's `BillableMetric.expression` against that outcome's raw
    /// counts in the day's usage.
    #[prost(message, optional, tag = "2")]
    pub outcomes: ::core::option::Option<super::super::super::UsageData>,
}
/// One row per calendar date spanning the union of the requested
/// contracts' on-demand periods.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DailyLineItemOutcomes {
    #[prost(message, optional, tag = "1")]
    pub date: ::core::option::Option<super::super::super::Date>,
    /// Per-line-item outcomes on this date. Every metered line item from
    /// the union of the requested contracts' packages is emitted,
    /// including line items with zero usage, so consumers can render
    /// zero-rows without a separate zero-fill pass.
    #[prost(message, repeated, tag = "2")]
    pub line_items: ::prost::alloc::vec::Vec<LineItemDailyOutcomes>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDailyBreakdownResponse {
    /// Days in ascending date order. A given calendar date appears at
    /// most once regardless of how many of the requested contracts
    /// overlap it (BillingUsageService reports usage at calendar-day
    /// granularity, so a day straddling a mid-day rollover is still one
    /// row carrying the day's full outcomes). Contract ids from the
    /// request that do not resolve contribute no rows.
    #[prost(message, repeated, tag = "1")]
    pub days: ::prost::alloc::vec::Vec<DailyLineItemOutcomes>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UsagePricerRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    #[prost(message, optional, tag = "2")]
    pub start: ::core::option::Option<::prost_types::Timestamp>,
    #[prost(message, optional, tag = "3")]
    pub end: ::core::option::Option<::prost_types::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetPriceForContractRequest {
    #[prost(uint64, tag = "1")]
    pub contract_id: u64,
    #[prost(message, optional, tag = "2")]
    pub usage_start_watermark_ts: ::core::option::Option<::prost_types::Timestamp>,
    /// Instead of getting the usage for the contract at query time, pass in
    /// pre-constructed usage data to simulate what the priced usage would be
    #[prost(message, optional, tag = "3")]
    pub simulated_usage: ::core::option::Option<
        super::super::usage::v1::GetUsageResponse,
    >,
    /// When set, price the contract's usage against this package's rate card instead
    /// of the contract's own -- "what would this usage cost under package X". Used by
    /// checkout to freeze a PAYG cap against usage re-priced under an upgrade's target
    /// package. The contract's overrides (e.g. reserved volumes) still apply.
    #[prost(string, optional, tag = "4")]
    pub override_package_uid: ::core::option::Option<::prost::alloc::string::String>,
    /// Paired with override_package_uid: price at this billing interval instead of the
    /// contract's own, for an upgrade that also changes the interval.
    #[prost(uint32, optional, tag = "5")]
    pub override_month_interval: ::core::option::Option<u32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SkuUsageSummary {
    #[prost(enumeration = "super::super::super::Sku", tag = "1")]
    pub sku: i32,
    /// Net cents consumed by this SKU in the billing period (after credits/trials applied).
    #[prost(uint64, tag = "2")]
    pub payg_spend_cents: u64,
    /// Total units consumed by this SKU in the billing period.
    #[prost(uint64, tag = "3")]
    pub usage_volume: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SharedBudgetUsageSummary {
    #[prost(enumeration = "super::super::super::Sku", repeated, tag = "1")]
    pub skus: ::prost::alloc::vec::Vec<i32>,
    /// Net cents consumed across all SKUs in this shared budget (after credits/trials applied).
    #[prost(uint64, tag = "2")]
    pub payg_spend_cents: u64,
    /// Per-SKU breakdown within the shared budget.
    #[prost(message, repeated, tag = "3")]
    pub sku_summaries: ::prost::alloc::vec::Vec<SkuUsageSummary>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct LineItemUsageSummary {
    /// Refers to uid in sentry_protos.billing.v1.common.v1.LineItemDetails
    #[prost(string, tag = "1")]
    pub line_item_uid: ::prost::alloc::string::String,
    /// Net cents consumed by this line item in the billing period (after credits/trials applied).
    #[prost(uint64, tag = "2")]
    pub payg_spend_cents: u64,
    /// How much of the line item was consumed by PAYG (in the line item's units)
    #[prost(uint64, tag = "3")]
    pub quantity: u64,
    /// Whether the usage pricer had to cap the spend based on the budget set by the contract
    #[prost(bool, tag = "4")]
    pub payg_budget_exhausted: bool,
    /// false when this line item still has reserved quantity left.
    /// It's possible that PAYG is exhausted whereas reserved is not.
    /// Example: there's an overall PAYG budget of $10, a customer sends $10 worth of errors
    /// the payg_budget_exhausted field is true for all line items
    /// however, the plan still includes 5GB of free logs, so reserved_budget_exhausted is false for logs.
    #[prost(bool, tag = "5")]
    pub reserved_budget_exhausted: bool,
    /// Total units consumed by this line item in the billing period, including
    /// both reserved and PAYG usage (in the line item's units). Unlike `quantity`,
    /// this is not reduced by the reserved amount.
    #[prost(uint64, tag = "6")]
    pub total_quantity: u64,
    /// Cents this line item drew from its shared reserved budget in the billing
    /// period. Only set for members of a shared reserved-budget pool (e.g. Seer);
    /// 0 for line items without a reserved budget.
    #[prost(uint64, tag = "7")]
    pub reserved_spend_cents: u64,
    /// True when this line item can continue accepting usage from any capacity
    /// source, including reserved, PAYG, or granted capacity.
    #[prost(bool, tag = "8")]
    pub has_remaining_capacity: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SharedLineItemUsageSummary {
    /// Net cents consumed across all SKUs in this shared budget (after credits/trials applied).
    #[prost(uint64, tag = "1")]
    pub payg_spend_cents: u64,
    /// Line item breakdown within shared budget
    #[prost(message, repeated, tag = "2")]
    pub line_item_summaries: ::prost::alloc::vec::Vec<LineItemUsageSummary>,
    /// Whether the usage pricer had to cap the spend based on the budget set by the contract
    #[prost(bool, tag = "3")]
    pub payg_budget_exhausted: bool,
    /// false when this pool still has reserved quantity left.
    #[prost(bool, tag = "4")]
    pub reserved_budget_exhausted: bool,
    /// True when any member of this pool can continue accepting usage.
    #[prost(bool, tag = "5")]
    pub has_remaining_capacity: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UsagePricerResponse {
    /// use line_item_summaries
    #[deprecated]
    #[prost(message, repeated, tag = "1")]
    pub sku_summaries: ::prost::alloc::vec::Vec<SkuUsageSummary>,
    /// use shared_line_item_summaries
    #[deprecated]
    #[prost(message, repeated, tag = "2")]
    pub shared_budget_summaries: ::prost::alloc::vec::Vec<SharedBudgetUsageSummary>,
    #[prost(message, repeated, tag = "3")]
    pub line_item_summaries: ::prost::alloc::vec::Vec<LineItemUsageSummary>,
    #[prost(message, repeated, tag = "4")]
    pub shared_line_item_summaries: ::prost::alloc::vec::Vec<SharedLineItemUsageSummary>,
    #[prost(message, optional, tag = "5")]
    pub last_usage_ts: ::core::option::Option<::prost_types::Timestamp>,
}