use std::fmt; #[derive(Clone, PartialEq, ::prost::Message)] pub struct Error { #[prost(int32, tag = "1")] pub code: i32, #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, #[prost(bytes = "vec", optional, tag = "3")] pub data: ::core::option::Option<::prost::alloc::vec::Vec>, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "Error code: {}, message: {:?}, data: {:?}", self.code, self.message, self.data ) } } #[derive(Clone, PartialEq, ::prost::Message)] pub struct InvalidParamsDetail { #[prost(string, tag = "1")] pub location: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub param: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub value: ::prost::alloc::string::String, #[prost(enumeration = "InvalidParamsType", tag = "4")] pub error_type: i32, #[prost(string, tag = "5")] pub message: ::prost::alloc::string::String, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum InvalidParamsType { None = 0, DateTime = 1, Decimal = 2, EqualsTo = 3, Float = 4, Integer = 5, Range = 6, RegEx = 7, Required = 8, StringLength = 9, Url = 10, } impl From for InvalidParamsType { fn from(s: i32) -> Self { match s { s if s == InvalidParamsType::DateTime as i32 => InvalidParamsType::DateTime, s if s == InvalidParamsType::Decimal as i32 => InvalidParamsType::Decimal, s if s == InvalidParamsType::EqualsTo as i32 => InvalidParamsType::EqualsTo, s if s == InvalidParamsType::Float as i32 => InvalidParamsType::Float, s if s == InvalidParamsType::Integer as i32 => InvalidParamsType::Integer, s if s == InvalidParamsType::Range as i32 => InvalidParamsType::Range, s if s == InvalidParamsType::RegEx as i32 => InvalidParamsType::RegEx, s if s == InvalidParamsType::Required as i32 => InvalidParamsType::Required, s if s == InvalidParamsType::StringLength as i32 => InvalidParamsType::StringLength, s if s == InvalidParamsType::Url as i32 => InvalidParamsType::Url, _ => InvalidParamsType::None, } } }