noie-nds-api 3.0.5

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

/// \[Semantic\] Represents any identity in the system (player/system/AI/external).
/// \[Behavior\] Designed as a lightweight value object (no IO required to construct).
/// \[SearchTag\] identity, actor, principal
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NdsIdentity {
    /// Globally unique identity ID.
    /// Format is determined by `type` (see IdentityType docs).
    #[prost(string, tag="1")]
    pub id: ::prost::alloc::string::String,
    /// Identity type.
    #[prost(enumeration="IdentityType", tag="2")]
    pub r#type: i32,
    /// Optional metadata (e.g. display name, avatar URL).
    #[prost(map="string, string", tag="3")]
    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Attached policy IDs (optional; policy resolution is implementation-defined).
    /// \[Since\] 2.2.0
    #[prost(string, repeated, tag="10")]
    pub attached_policy_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
// \[Index\] NDS-PROTO-IDENTITY-001
// \[Trace\] Common types are not currently used here.
// \[Trace\] Reserved import for future expansions (e.g. identity service responses).
// import "nds/common/common.proto";

// ============================================================================
// \[Index\] NDS-PROTO-IDENTITY-010 IdentityType
// ============================================================================

/// \[Semantic\] Standard identity type taxonomy.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum IdentityType {
    /// Unknown type (default; for backward compatibility).
    Unspecified = 0,
    /// Player identity.
    /// Recommended ID format: UUID (e.g. "550e8400-e29b-41d4-a716-446655440000").
    Player = 1,
    /// System identity.
    /// Recommended ID format: system-defined string (e.g. "system:admin", "system:event").
    System = 2,
    /// AI identity.
    /// Recommended ID format: AI-service-defined string (e.g. "ai:gpt-4", "ai:claude").
    Ai = 3,
    /// External service identity.
    /// Recommended ID format: service-defined string (e.g. "external:payment:stripe").
    External = 4,
}
impl IdentityType {
    /// 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 => "IDENTITY_TYPE_UNSPECIFIED",
            Self::Player => "IDENTITY_TYPE_PLAYER",
            Self::System => "IDENTITY_TYPE_SYSTEM",
            Self::Ai => "IDENTITY_TYPE_AI",
            Self::External => "IDENTITY_TYPE_EXTERNAL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "IDENTITY_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "IDENTITY_TYPE_PLAYER" => Some(Self::Player),
            "IDENTITY_TYPE_SYSTEM" => Some(Self::System),
            "IDENTITY_TYPE_AI" => Some(Self::Ai),
            "IDENTITY_TYPE_EXTERNAL" => Some(Self::External),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)