sentry_protos 0.16.2

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
/// A quota allowance granted to an organization for a time window.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Grant {
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(uint64, tag = "2")]
    pub organization_id: u64,
    #[prost(enumeration = "GrantType", tag = "3")]
    pub r#type: i32,
    /// The line items this grant applies to.
    #[prost(string, repeated, tag = "4")]
    pub line_item_uids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(int64, tag = "5")]
    pub amount: i64,
    #[prost(message, optional, tag = "6")]
    pub start_date: ::core::option::Option<super::super::super::Date>,
    #[prost(message, optional, tag = "7")]
    pub end_date: ::core::option::Option<super::super::super::Date>,
    #[prost(enumeration = "GrantStatus", tag = "8")]
    pub status: i32,
}
/// Denomination of a Grant.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantType {
    Unspecified = 0,
    /// A quantity of units for specific line items.
    Units = 1,
    /// A monetary allowance measured in cents.
    Cents = 2,
}
impl GrantType {
    /// 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 => "GRANT_TYPE_UNSPECIFIED",
            Self::Units => "GRANT_TYPE_UNITS",
            Self::Cents => "GRANT_TYPE_CENTS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANT_TYPE_UNITS" => Some(Self::Units),
            "GRANT_TYPE_CENTS" => Some(Self::Cents),
            _ => None,
        }
    }
}
/// Lifecycle state of a Grant.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum GrantStatus {
    Unspecified = 0,
    /// Consumable now; within \[start_date, end_date\].
    Active = 1,
    /// Manually deactivated (admin revoke, customer opt-out, etc.).
    Inactive = 2,
    /// Past end_date.
    Expired = 3,
}
impl GrantStatus {
    /// 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 => "GRANT_STATUS_UNSPECIFIED",
            Self::Active => "GRANT_STATUS_ACTIVE",
            Self::Inactive => "GRANT_STATUS_INACTIVE",
            Self::Expired => "GRANT_STATUS_EXPIRED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "GRANT_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "GRANT_STATUS_ACTIVE" => Some(Self::Active),
            "GRANT_STATUS_INACTIVE" => Some(Self::Inactive),
            "GRANT_STATUS_EXPIRED" => Some(Self::Expired),
            _ => None,
        }
    }
}