#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RequestContext {
#[prost(string, tag="1")]
pub request_id: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub idempotency_key: ::prost::alloc::string::String,
#[prost(bytes="vec", tag="3")]
pub correlation_id: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ErrorStatus {
#[prost(string, tag="1")]
pub code: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub message: ::prost::alloc::string::String,
#[prost(enumeration="ErrorCategory", tag="3")]
pub category: i32,
#[prost(map="string, string", tag="4")]
pub details: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(int32, optional, tag="5")]
pub retry_after_seconds: ::core::option::Option<i32>,
}
#[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 {
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",
}
}
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,
}
}
}