@@ -194,36 +194,38 @@ pub mod read_resp {
194194 /// The $all or stream subscription has caught up and become live.
195195 #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
196196 pub struct CaughtUp {
197- /// Current time in the server when the subscription caught up
198- #[ prost( message, optional, tag = "1" ) ]
199- pub timestamp : :: core:: option:: Option < :: prost_types:: Timestamp > ,
200- /// Checkpoint for resuming a stream subscription.
201- /// For stream subscriptions it is populated unless the stream is empty.
202- /// For $all subscriptions it is not populated.
203- #[ prost( int64, optional, tag = "2" ) ]
204- pub stream_revision : :: core:: option:: Option < i64 > ,
205- /// Checkpoint for resuming a $all subscription.
206- /// For stream subscriptions it is not populated.
207- /// For $all subscriptions it is populated unless the database is empty.
208- #[ prost( message, optional, tag = "3" ) ]
209- pub position : :: core:: option:: Option < Position > ,
197+ #[ prost( oneof = "caught_up::Position" , tags = "1, 2, 3" ) ]
198+ pub position : :: core:: option:: Option < caught_up:: Position > ,
199+ }
200+ /// Nested message and enum types in `CaughtUp`.
201+ pub mod caught_up {
202+ #[ derive( Clone , Copy , PartialEq , :: prost:: Oneof ) ]
203+ pub enum Position {
204+ #[ prost( uint64, tag = "1" ) ]
205+ StreamPosition ( u64 ) ,
206+ #[ prost( message, tag = "2" ) ]
207+ AllStreamPosition ( crate :: event_store:: generated:: common:: AllStreamPosition ) ,
208+ #[ prost( message, tag = "3" ) ]
209+ NoPosition ( ( ) ) ,
210+ }
210211 }
211212 /// The $all or stream subscription has fallen back into catchup mode and is no longer live.
212213 #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
213214 pub struct FellBehind {
214- /// Current time in the server when the subscription fell behind
215- #[ prost( message, optional, tag = "1" ) ]
216- pub timestamp : :: core:: option:: Option < :: prost_types:: Timestamp > ,
217- /// Checkpoint for resuming a stream subscription.
218- /// For stream subscriptions it is populated unless the stream is empty.
219- /// For $all subscriptions it is not populated.
220- #[ prost( int64, optional, tag = "2" ) ]
221- pub stream_revision : :: core:: option:: Option < i64 > ,
222- /// Checkpoint for resuming a $all subscription.
223- /// For stream subscriptions it is not populated.
224- /// For $all subscriptions it is populated unless the database is empty.
225- #[ prost( message, optional, tag = "3" ) ]
226- pub position : :: core:: option:: Option < Position > ,
215+ #[ prost( oneof = "fell_behind::Position" , tags = "1, 2, 3" ) ]
216+ pub position : :: core:: option:: Option < fell_behind:: Position > ,
217+ }
218+ /// Nested message and enum types in `FellBehind`.
219+ pub mod fell_behind {
220+ #[ derive( Clone , Copy , PartialEq , :: prost:: Oneof ) ]
221+ pub enum Position {
222+ #[ prost( uint64, tag = "1" ) ]
223+ StreamPosition ( u64 ) ,
224+ #[ prost( message, tag = "2" ) ]
225+ AllStreamPosition ( crate :: event_store:: generated:: common:: AllStreamPosition ) ,
226+ #[ prost( message, tag = "3" ) ]
227+ NoPosition ( ( ) ) ,
228+ }
227229 }
228230 #[ derive( Clone , PartialEq , :: prost:: Message ) ]
229231 pub struct ReadEvent {
@@ -283,13 +285,6 @@ pub mod read_resp {
283285 #[ prost( message, optional, tag = "3" ) ]
284286 pub timestamp : :: core:: option:: Option < :: prost_types:: Timestamp > ,
285287 }
286- #[ derive( Clone , Copy , PartialEq , :: prost:: Message ) ]
287- pub struct Position {
288- #[ prost( uint64, tag = "1" ) ]
289- pub commit_position : u64 ,
290- #[ prost( uint64, tag = "2" ) ]
291- pub prepare_position : u64 ,
292- }
293288 #[ derive( Clone , PartialEq , :: prost:: Message ) ]
294289 pub struct StreamNotFound {
295290 #[ prost( message, optional, tag = "1" ) ]
0 commit comments