49 lines
1.3 KiB
Rust
Raw Normal View History

2022-08-03 06:19:47 +00:00
use std::fmt;
2022-07-12 06:43:07 +00:00
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Error {
2022-08-03 06:19:47 +00:00
#[prost(int32, tag = "1")]
pub code: i32,
#[prost(string, optional, tag = "2")]
pub message: ::core::option::Option<::prost::alloc::string::String>,
#[prost(bytes = "vec", optional, tag = "3")]
pub data: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
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
2022-08-03 06:47:15 +00:00
)
2022-08-03 06:19:47 +00:00
}
2022-07-12 06:43:07 +00:00
}
2022-08-04 08:45:34 +00:00
#[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 {
DateTime = 0,
Decimal = 1,
EqualsTo = 2,
Float = 3,
Integer = 4,
Range = 5,
RegEx = 6,
Required = 7,
StringLength = 8,
Url = 9,
}