1#[derive(serde::Serialize, serde::Deserialize)]
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Meta {
6 #[prost(enumeration = "meta::Protocol", tag = "1")]
8 pub protocol: i32,
9 #[prost(string, tag = "2")]
13 pub timestamp: ::prost::alloc::string::String,
14 #[prost(string, tag = "3")]
16 pub proof_type: ::prost::alloc::string::String,
17 #[prost(string, tag = "4")]
19 pub serialization_format: ::prost::alloc::string::String,
20}
21pub mod meta {
23 #[derive(serde::Serialize, serde::Deserialize)]
24 #[derive(
25 Clone,
26 Copy,
27 Debug,
28 PartialEq,
29 Eq,
30 Hash,
31 PartialOrd,
32 Ord,
33 ::prost::Enumeration
34 )]
35 #[repr(i32)]
36 pub enum Protocol {
37 Bitcoin = 0,
38 Ethereum = 1,
39 Fabric = 3,
40 Corda = 4,
41 }
42 impl Protocol {
43 pub fn as_str_name(&self) -> &'static str {
48 match self {
49 Protocol::Bitcoin => "BITCOIN",
50 Protocol::Ethereum => "ETHEREUM",
51 Protocol::Fabric => "FABRIC",
52 Protocol::Corda => "CORDA",
53 }
54 }
55 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
57 match value {
58 "BITCOIN" => Some(Self::Bitcoin),
59 "ETHEREUM" => Some(Self::Ethereum),
60 "FABRIC" => Some(Self::Fabric),
61 "CORDA" => Some(Self::Corda),
62 _ => None,
63 }
64 }
65 }
66}
67#[derive(serde::Serialize, serde::Deserialize)]
68#[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct View {
71 #[prost(message, optional, tag = "1")]
72 pub meta: ::core::option::Option<Meta>,
73 #[prost(bytes = "vec", tag = "2")]
77 pub data: ::prost::alloc::vec::Vec<u8>,
78}
79#[derive(serde::Serialize, serde::Deserialize)]
81#[allow(clippy::derive_partial_eq_without_eq)]
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct ViewPayload {
84 #[prost(string, tag = "1")]
85 pub request_id: ::prost::alloc::string::String,
86 #[prost(oneof = "view_payload::State", tags = "2, 3")]
87 pub state: ::core::option::Option<view_payload::State>,
88}
89pub mod view_payload {
91 #[derive(serde::Serialize, serde::Deserialize)]
92 #[allow(clippy::derive_partial_eq_without_eq)]
93 #[derive(Clone, PartialEq, ::prost::Oneof)]
94 pub enum State {
95 #[prost(message, tag = "2")]
96 View(super::View),
97 #[prost(string, tag = "3")]
98 Error(::prost::alloc::string::String),
99 }
100}
101#[derive(serde::Serialize, serde::Deserialize)]
104#[allow(clippy::derive_partial_eq_without_eq)]
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct RequestState {
107 #[prost(string, tag = "1")]
108 pub request_id: ::prost::alloc::string::String,
109 #[prost(enumeration = "request_state::Status", tag = "2")]
110 pub status: i32,
111 #[prost(oneof = "request_state::State", tags = "3, 4")]
112 pub state: ::core::option::Option<request_state::State>,
113}
114pub mod request_state {
116 #[derive(serde::Serialize, serde::Deserialize)]
117 #[derive(
118 Clone,
119 Copy,
120 Debug,
121 PartialEq,
122 Eq,
123 Hash,
124 PartialOrd,
125 Ord,
126 ::prost::Enumeration
127 )]
128 #[repr(i32)]
129 pub enum Status {
130 PendingAck = 0,
132 Pending = 1,
134 Error = 2,
136 Completed = 3,
138 EventReceived = 4,
140 EventWritten = 5,
142 EventWriteError = 6,
144 Deleted = 7,
146 }
147 impl Status {
148 pub fn as_str_name(&self) -> &'static str {
153 match self {
154 Status::PendingAck => "PENDING_ACK",
155 Status::Pending => "PENDING",
156 Status::Error => "ERROR",
157 Status::Completed => "COMPLETED",
158 Status::EventReceived => "EVENT_RECEIVED",
159 Status::EventWritten => "EVENT_WRITTEN",
160 Status::EventWriteError => "EVENT_WRITE_ERROR",
161 Status::Deleted => "DELETED",
162 }
163 }
164 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
166 match value {
167 "PENDING_ACK" => Some(Self::PendingAck),
168 "PENDING" => Some(Self::Pending),
169 "ERROR" => Some(Self::Error),
170 "COMPLETED" => Some(Self::Completed),
171 "EVENT_RECEIVED" => Some(Self::EventReceived),
172 "EVENT_WRITTEN" => Some(Self::EventWritten),
173 "EVENT_WRITE_ERROR" => Some(Self::EventWriteError),
174 "DELETED" => Some(Self::Deleted),
175 _ => None,
176 }
177 }
178 }
179 #[derive(serde::Serialize, serde::Deserialize)]
180 #[allow(clippy::derive_partial_eq_without_eq)]
181 #[derive(Clone, PartialEq, ::prost::Oneof)]
182 pub enum State {
183 #[prost(message, tag = "3")]
184 View(super::View),
185 #[prost(string, tag = "4")]
186 Error(::prost::alloc::string::String),
187 }
188}