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-COMMON-V1-010 RequestContext
// ============================================================================

/// \[Semantic\] Cross-cutting request context used for tracing + correctness.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RequestContext {
    /// Machine-generated request identifier for tracing/correlation.
    /// \[Example\] "req_01J2Z8..." or UUID.
    #[prost(string, tag="1")]
    pub request_id: ::prost::alloc::string::String,
    /// Idempotency key for state-changing operations.
    /// \[Behavior\] Server MUST treat retries with the same key as the same intent within retention.
    #[prost(string, tag="2")]
    pub idempotency_key: ::prost::alloc::string::String,
    /// Optional correlation id (client-defined, opaque).
    #[prost(bytes="vec", tag="3")]
    pub correlation_id: ::prost::alloc::vec::Vec<u8>,
}
/// \[Semantic\] Structured error object designed for machine handling.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorStatus {
    /// Machine-readable error code (stable identifier).
    #[prost(string, tag="1")]
    pub code: ::prost::alloc::string::String,
    /// Human-readable message (not stable; for logs/UX).
    #[prost(string, tag="2")]
    pub message: ::prost::alloc::string::String,
    /// Retry category.
    #[prost(enumeration="ErrorCategory", tag="3")]
    pub category: i32,
    /// Optional debugging details. MUST NOT contain secrets/PII.
    #[prost(map="string, string", tag="4")]
    pub details: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Optional backoff hint (flow control / overload).
    #[prost(int32, optional, tag="5")]
    pub retry_after_seconds: ::core::option::Option<i32>,
}
// ============================================================================
// \[Index\] NDS-PROTO-COMMON-V1-020 Error semantics
// ============================================================================

/// \[Semantic\] Error category taxonomy for mechanical retry decisions.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorCategory {
    Unspecified = 0,
    Retryable = 1,
    Conflict = 2,
    Policy = 3,
    Validation = 4,
    Fatal = 5,
}
impl ErrorCategory {
    /// 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 => "ERROR_CATEGORY_UNSPECIFIED",
            Self::Retryable => "ERROR_CATEGORY_RETRYABLE",
            Self::Conflict => "ERROR_CATEGORY_CONFLICT",
            Self::Policy => "ERROR_CATEGORY_POLICY",
            Self::Validation => "ERROR_CATEGORY_VALIDATION",
            Self::Fatal => "ERROR_CATEGORY_FATAL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ERROR_CATEGORY_UNSPECIFIED" => Some(Self::Unspecified),
            "ERROR_CATEGORY_RETRYABLE" => Some(Self::Retryable),
            "ERROR_CATEGORY_CONFLICT" => Some(Self::Conflict),
            "ERROR_CATEGORY_POLICY" => Some(Self::Policy),
            "ERROR_CATEGORY_VALIDATION" => Some(Self::Validation),
            "ERROR_CATEGORY_FATAL" => Some(Self::Fatal),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)