noie-nds-api 3.0.6

NDS Protocol Buffers types for Rust (generated from nds-api/spec).
Documentation
// @generated
// This file is @generated by prost-build.
// ============================================================================
// \[Index\] NDS-PROTO-PROJECTION-010 ProjectionId
// ============================================================================

/// \[Semantic\] Unique identifier for a projection.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProjectionId {
    /// Projection name (e.g. "balance", "transaction_history").
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Projection version (for versioned projection definitions).
    #[prost(int32, tag="2")]
    pub version: i32,
}
// ============================================================================
// \[Index\] NDS-PROTO-PROJECTION-030 NdsProjection
// ============================================================================

/// \[Semantic\] Derived view aggregated from the event stream.
/// \[Behavior\] Projections are rebuildable and can be recomputed at any time.
/// \[SearchTag\] projection, derived-state, replay, query-optimization
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NdsProjection {
    /// Projection ID.
    #[prost(message, optional, tag="1")]
    pub id: ::core::option::Option<ProjectionId>,
    /// Projection status.
    #[prost(enumeration="ProjectionStatus", tag="2")]
    pub status: i32,
    /// Last processed event ID.
    #[prost(string, tag="3")]
    pub last_event_id: ::prost::alloc::string::String,
    /// Last updated time.
    #[prost(message, optional, tag="4")]
    pub last_updated: ::core::option::Option<::prost_types::Timestamp>,
    /// Projection data (uses Any to support arbitrary types).
    #[prost(message, optional, tag="5")]
    pub data: ::core::option::Option<::prost_types::Any>,
    /// Projection metadata.
    #[prost(map="string, string", tag="6")]
    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
// ============================================================================
// \[Index\] NDS-PROTO-PROJECTION-100 Projection Payload Messages
// ============================================================================

/// \[Index\] NDS-PROTO-PROJECTION-110 BalanceProjection
/// \[Semantic\] Specialized projection payload for balances.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BalanceProjection {
    /// Balance value (string representation of a decimal).
    #[prost(string, tag="1")]
    pub balance: ::prost::alloc::string::String,
    /// Asset ID.
    #[prost(string, tag="2")]
    pub asset_id: ::prost::alloc::string::String,
    /// Owner identity ID.
    #[prost(string, tag="3")]
    pub owner_id: ::prost::alloc::string::String,
    /// Last updated time.
    #[prost(message, optional, tag="4")]
    pub last_updated: ::core::option::Option<::prost_types::Timestamp>,
}
/// \[Index\] NDS-PROTO-PROJECTION-120 LeaderboardEntry
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaderboardEntry {
    /// Rank.
    #[prost(int32, tag="1")]
    pub rank: i32,
    /// Identity ID.
    #[prost(string, tag="2")]
    pub identity_id: ::prost::alloc::string::String,
    /// Value.
    #[prost(string, tag="3")]
    pub value: ::prost::alloc::string::String,
    /// Extra metadata.
    #[prost(map="string, string", tag="4")]
    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// \[Index\] NDS-PROTO-PROJECTION-130 LeaderboardProjection
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaderboardProjection {
    /// Leaderboard name.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// Asset ID.
    #[prost(string, tag="2")]
    pub asset_id: ::prost::alloc::string::String,
    /// Entries.
    #[prost(message, repeated, tag="3")]
    pub entries: ::prost::alloc::vec::Vec<LeaderboardEntry>,
    /// Last updated time.
    #[prost(message, optional, tag="4")]
    pub last_updated: ::core::option::Option<::prost_types::Timestamp>,
}
// ============================================================================
// \[Index\] NDS-PROTO-PROJECTION-020 ProjectionStatus
// ============================================================================

/// \[Semantic\] Projection lifecycle status.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ProjectionStatus {
    /// Unspecified.
    Unspecified = 0,
    /// Active.
    Active = 1,
    /// Rebuilding.
    Rebuilding = 2,
    /// Disabled.
    Disabled = 3,
    /// Error.
    Error = 4,
}
impl ProjectionStatus {
    /// 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 => "PROJECTION_STATUS_UNSPECIFIED",
            Self::Active => "PROJECTION_STATUS_ACTIVE",
            Self::Rebuilding => "PROJECTION_STATUS_REBUILDING",
            Self::Disabled => "PROJECTION_STATUS_DISABLED",
            Self::Error => "PROJECTION_STATUS_ERROR",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PROJECTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "PROJECTION_STATUS_ACTIVE" => Some(Self::Active),
            "PROJECTION_STATUS_REBUILDING" => Some(Self::Rebuilding),
            "PROJECTION_STATUS_DISABLED" => Some(Self::Disabled),
            "PROJECTION_STATUS_ERROR" => Some(Self::Error),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)