sentry_protos 0.20.0

Rust bindings for sentry-protos
Documentation
// This file is @generated by prost-build.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AccountStatus {
    /// The organization this status belongs to. Each org has one AccountStatus.
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    /// Current account status (active, closed, past-due, suspended).
    #[prost(enumeration = "Status", tag = "2")]
    pub status: i32,
    /// Free-form reason when status is STATUS_SUSPENDED (e.g., "fraud", "tos_violation").
    #[prost(string, optional, tag = "3")]
    pub suspension_reason: ::core::option::Option<::prost::alloc::string::String>,
    /// PAYG on-demand spending status.
    #[prost(enumeration = "OnDemandStatus", tag = "4")]
    pub ondemand_status: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Status {
    Unspecified = 0,
    Active = 1,
    Closed = 2,
    PastDue = 3,
    Suspended = 4,
}
impl Status {
    /// 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 => "STATUS_UNSPECIFIED",
            Self::Active => "STATUS_ACTIVE",
            Self::Closed => "STATUS_CLOSED",
            Self::PastDue => "STATUS_PAST_DUE",
            Self::Suspended => "STATUS_SUSPENDED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "STATUS_ACTIVE" => Some(Self::Active),
            "STATUS_CLOSED" => Some(Self::Closed),
            "STATUS_PAST_DUE" => Some(Self::PastDue),
            "STATUS_SUSPENDED" => Some(Self::Suspended),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OnDemandStatus {
    Unspecified = 0,
    Enabled = 1,
    Disabled = 2,
}
impl OnDemandStatus {
    /// 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 => "ON_DEMAND_STATUS_UNSPECIFIED",
            Self::Enabled => "ON_DEMAND_STATUS_ENABLED",
            Self::Disabled => "ON_DEMAND_STATUS_DISABLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ON_DEMAND_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "ON_DEMAND_STATUS_ENABLED" => Some(Self::Enabled),
            "ON_DEMAND_STATUS_DISABLED" => Some(Self::Disabled),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAccountStatusRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAccountStatusResponse {
    #[prost(message, optional, tag = "1")]
    pub account_status: ::core::option::Option<AccountStatus>,
}
/// Creates or updates the account status for an organization. If no record
/// exists for the given organization_id, one is created. If a record already
/// exists, it is updated with the provided fields.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpsertAccountStatusRequest {
    #[prost(uint64, tag = "1")]
    pub organization_id: u64,
    #[prost(enumeration = "Status", optional, tag = "2")]
    pub status: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "3")]
    pub suspension_reason: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "OnDemandStatus", optional, tag = "4")]
    pub ondemand_status: ::core::option::Option<i32>,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpsertAccountStatusResponse {
    /// True if a new record was created or an existing record was modified.
    /// False if the record already existed with identical field values.
    #[prost(bool, tag = "1")]
    pub updated: bool,
}