ydb_grpc/generated/
ydb.topic.rs

1// This file is @generated by prost-build.
2/// Description of supported codecs.
3#[derive(serde::Serialize, serde::Deserialize)]
4#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct SupportedCodecs {
6    /// List of supported codecs.
7    /// See enum Codec above for values.
8    #[prost(int32, repeated, packed = "false", tag = "1")]
9    pub codecs: ::prost::alloc::vec::Vec<i32>,
10}
11/// Represents range \[start, end).
12/// I.e. (end - 1) is the greatest of offsets, included in non-empty range.
13#[derive(serde::Serialize, serde::Deserialize)]
14#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
15pub struct OffsetsRange {
16    #[prost(int64, tag = "1")]
17    pub start: i64,
18    #[prost(int64, tag = "2")]
19    pub end: i64,
20}
21/// In-session reauthentication and reauthorization, lets user increase session lifetime.
22/// Client should wait for UpdateTokenResponse before sending next UpdateTokenRequest.
23#[derive(serde::Serialize, serde::Deserialize)]
24#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
25pub struct UpdateTokenRequest {
26    #[prost(string, tag = "1")]
27    pub token: ::prost::alloc::string::String,
28}
29#[derive(serde::Serialize, serde::Deserialize)]
30#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
31pub struct UpdateTokenResponse {}
32#[derive(serde::Serialize, serde::Deserialize)]
33#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
34pub struct PartitionWithGeneration {
35    /// Partition identifier.
36    #[prost(int64, tag = "1")]
37    pub partition_id: i64,
38    /// Partition generation.
39    #[prost(int64, tag = "2")]
40    pub generation: i64,
41}
42#[derive(serde::Serialize, serde::Deserialize)]
43#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
44pub struct MetadataItem {
45    #[prost(string, tag = "1")]
46    pub key: ::prost::alloc::string::String,
47    #[prost(bytes = "vec", tag = "2")]
48    pub value: ::prost::alloc::vec::Vec<u8>,
49}
50/// Messages for bidirectional streaming rpc StreamWrite
51#[derive(serde::Serialize, serde::Deserialize)]
52#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
53pub struct StreamWriteMessage {}
54/// Nested message and enum types in `StreamWriteMessage`.
55pub mod stream_write_message {
56    /// Client-server message for write session. Contains one of:
57    /// InitRequest - handshake request.
58    /// WriteRequest - portion of data to be written.
59    /// UpdateTokenRequest - user credentials if update is needed.
60    #[derive(serde::Serialize, serde::Deserialize)]
61    #[derive(Clone, PartialEq, ::prost::Message)]
62    pub struct FromClient {
63        #[prost(oneof = "from_client::ClientMessage", tags = "1, 2, 3")]
64        pub client_message: ::core::option::Option<from_client::ClientMessage>,
65    }
66    /// Nested message and enum types in `FromClient`.
67    pub mod from_client {
68        #[derive(serde::Serialize, serde::Deserialize)]
69        #[derive(Clone, PartialEq, ::prost::Oneof)]
70        pub enum ClientMessage {
71            #[prost(message, tag = "1")]
72            InitRequest(super::InitRequest),
73            #[prost(message, tag = "2")]
74            WriteRequest(super::WriteRequest),
75            #[prost(message, tag = "3")]
76            UpdateTokenRequest(super::super::UpdateTokenRequest),
77        }
78    }
79    /// Server-client message for write session. Contains either non-success status, or one of:
80    /// InitResponse - correct handshake response.
81    /// WriteResponse - acknowledgment of storing client messages.
82    /// UpdateTokenResponse - acknowledgment of reauthentication and reauthorization.
83    #[derive(serde::Serialize, serde::Deserialize)]
84    #[derive(Clone, PartialEq, ::prost::Message)]
85    pub struct FromServer {
86        /// Server status of response.
87        #[prost(enumeration = "super::super::status_ids::StatusCode", tag = "1")]
88        pub status: i32,
89        /// Issues if any.
90        #[prost(message, repeated, tag = "2")]
91        pub issues: ::prost::alloc::vec::Vec<super::super::issue::IssueMessage>,
92        #[prost(oneof = "from_server::ServerMessage", tags = "3, 4, 5")]
93        pub server_message: ::core::option::Option<from_server::ServerMessage>,
94    }
95    /// Nested message and enum types in `FromServer`.
96    pub mod from_server {
97        #[derive(serde::Serialize, serde::Deserialize)]
98        #[derive(Clone, PartialEq, ::prost::Oneof)]
99        pub enum ServerMessage {
100            #[prost(message, tag = "3")]
101            InitResponse(super::InitResponse),
102            #[prost(message, tag = "4")]
103            WriteResponse(super::WriteResponse),
104            #[prost(message, tag = "5")]
105            UpdateTokenResponse(super::super::UpdateTokenResponse),
106        }
107    }
108    /// Handshake request that must be sent to server first.
109    #[derive(serde::Serialize, serde::Deserialize)]
110    #[derive(Clone, PartialEq, ::prost::Message)]
111    pub struct InitRequest {
112        /// Full path of topic to write to.
113        #[prost(string, tag = "1")]
114        pub path: ::prost::alloc::string::String,
115        /// Producer identifier of client data stream.
116        /// Used for message deduplication by sequence numbers.
117        #[prost(string, tag = "2")]
118        pub producer_id: ::prost::alloc::string::String,
119        /// User metadata attached to this write session.
120        /// Reader will get this session meta data with each message read.
121        #[prost(map = "string, string", tag = "3")]
122        pub write_session_meta: ::std::collections::HashMap<
123            ::prost::alloc::string::String,
124            ::prost::alloc::string::String,
125        >,
126        /// Explicitly request for last sequential number
127        /// It may be expensive, if producer wrote to many partitions before.
128        #[prost(bool, tag = "6")]
129        pub get_last_seq_no: bool,
130        /// Option for setting order on messages.
131        /// If neither is set, no guarantees on ordering or partitions to write to.
132        #[prost(oneof = "init_request::Partitioning", tags = "4, 5, 7")]
133        pub partitioning: ::core::option::Option<init_request::Partitioning>,
134    }
135    /// Nested message and enum types in `InitRequest`.
136    pub mod init_request {
137        /// Option for setting order on messages.
138        /// If neither is set, no guarantees on ordering or partitions to write to.
139        #[derive(serde::Serialize, serde::Deserialize)]
140        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
141        pub enum Partitioning {
142            /// All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
143            #[prost(string, tag = "4")]
144            MessageGroupId(::prost::alloc::string::String),
145            /// Explicit partition id to write to.
146            #[prost(int64, tag = "5")]
147            PartitionId(i64),
148            /// Explicit partition location to write to.
149            #[prost(message, tag = "7")]
150            PartitionWithGeneration(super::super::PartitionWithGeneration),
151        }
152    }
153    /// Response to the handshake.
154    #[derive(serde::Serialize, serde::Deserialize)]
155    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
156    pub struct InitResponse {
157        /// Last persisted message's sequence number for this producer.
158        /// Zero for new producer.
159        #[prost(int64, tag = "1")]
160        pub last_seq_no: i64,
161        /// Unique identifier of write session. Used for debug purposes.
162        #[prost(string, tag = "2")]
163        pub session_id: ::prost::alloc::string::String,
164        /// Identifier of partition that is matched for this write session.
165        #[prost(int64, tag = "3")]
166        pub partition_id: i64,
167        /// Client can only use compression codecs from this set to write messages to topic.
168        /// Otherwise session will be closed with BAD_REQUEST.
169        #[prost(message, optional, tag = "4")]
170        pub supported_codecs: ::core::option::Option<super::SupportedCodecs>,
171    }
172    /// Represents portion of client messages.
173    #[derive(serde::Serialize, serde::Deserialize)]
174    #[derive(Clone, PartialEq, ::prost::Message)]
175    pub struct WriteRequest {
176        #[prost(message, repeated, tag = "1")]
177        pub messages: ::prost::alloc::vec::Vec<write_request::MessageData>,
178        /// Codec that is used for data compression.
179        /// See enum Codec above for values.
180        #[prost(int32, tag = "2")]
181        pub codec: i32,
182        #[prost(message, optional, tag = "3")]
183        pub tx: ::core::option::Option<super::TransactionIdentity>,
184    }
185    /// Nested message and enum types in `WriteRequest`.
186    pub mod write_request {
187        #[derive(serde::Serialize, serde::Deserialize)]
188        #[derive(Clone, PartialEq, ::prost::Message)]
189        pub struct MessageData {
190            /// Message sequence number, provided by client for deduplication.
191            /// Starts at 1
192            #[prost(int64, tag = "1")]
193            pub seq_no: i64,
194            /// Creation timestamp
195            #[prost(message, optional, tag = "2")]
196            pub created_at: ::core::option::Option<
197                super::super::super::super::google::protobuf::Timestamp,
198            >,
199            /// Compressed client message body.
200            #[prost(bytes = "vec", tag = "3")]
201            pub data: ::prost::alloc::vec::Vec<u8>,
202            /// Uncompressed size of client message body.
203            #[prost(int64, tag = "4")]
204            pub uncompressed_size: i64,
205            /// Message metadata. Overall size is limited to 4096 symbols (all keys and values combined).
206            #[prost(message, repeated, tag = "7")]
207            pub metadata_items: ::prost::alloc::vec::Vec<super::super::MetadataItem>,
208            /// Per-message override for respective write session settings.
209            #[prost(oneof = "message_data::Partitioning", tags = "5, 6, 8")]
210            pub partitioning: ::core::option::Option<message_data::Partitioning>,
211        }
212        /// Nested message and enum types in `MessageData`.
213        pub mod message_data {
214            /// Per-message override for respective write session settings.
215            #[derive(serde::Serialize, serde::Deserialize)]
216            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
217            pub enum Partitioning {
218                /// All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
219                #[prost(string, tag = "5")]
220                MessageGroupId(::prost::alloc::string::String),
221                /// Explicit partition id to write to.
222                #[prost(int64, tag = "6")]
223                PartitionId(i64),
224                /// Explicit partition location to write to.
225                #[prost(message, tag = "8")]
226                PartitionWithGeneration(super::super::super::PartitionWithGeneration),
227            }
228        }
229    }
230    /// Message that represents acknowledgment for sequence of client messages.
231    /// This sequence is persisted together so write statistics is for messages batch.
232    #[derive(serde::Serialize, serde::Deserialize)]
233    #[derive(Clone, PartialEq, ::prost::Message)]
234    pub struct WriteResponse {
235        /// Number of acks is equal to number of messages in the corresponding WriteRequests.
236        #[prost(message, repeated, tag = "1")]
237        pub acks: ::prost::alloc::vec::Vec<write_response::WriteAck>,
238        /// Assigned partition for all client messages inside this batch.
239        /// This actual partition may differ from that returned in InitResponse
240        /// or other WriteResponses in this write session.
241        #[prost(int64, tag = "2")]
242        pub partition_id: i64,
243        /// Write statistics for this sequence of client messages.
244        #[prost(message, optional, tag = "3")]
245        pub write_statistics: ::core::option::Option<write_response::WriteStatistics>,
246    }
247    /// Nested message and enum types in `WriteResponse`.
248    pub mod write_response {
249        /// Acknowledgment for one persistently written message.
250        #[derive(serde::Serialize, serde::Deserialize)]
251        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
252        pub struct WriteAck {
253            /// Sequence number as in WriteRequest.
254            #[prost(int64, tag = "1")]
255            pub seq_no: i64,
256            /// Either message is written for the first time or duplicate.
257            #[prost(oneof = "write_ack::MessageWriteStatus", tags = "2, 3, 4")]
258            pub message_write_status: ::core::option::Option<
259                write_ack::MessageWriteStatus,
260            >,
261        }
262        /// Nested message and enum types in `WriteAck`.
263        pub mod write_ack {
264            #[derive(serde::Serialize, serde::Deserialize)]
265            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
266            pub struct Written {
267                /// Assigned partition offset.
268                #[prost(int64, tag = "1")]
269                pub offset: i64,
270            }
271            #[derive(serde::Serialize, serde::Deserialize)]
272            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
273            pub struct Skipped {
274                #[prost(enumeration = "skipped::Reason", tag = "1")]
275                pub reason: i32,
276            }
277            /// Nested message and enum types in `Skipped`.
278            pub mod skipped {
279                #[derive(serde::Serialize, serde::Deserialize)]
280                #[derive(
281                    Clone,
282                    Copy,
283                    Debug,
284                    PartialEq,
285                    Eq,
286                    Hash,
287                    PartialOrd,
288                    Ord,
289                    ::prost::Enumeration
290                )]
291                #[repr(i32)]
292                pub enum Reason {
293                    Unspecified = 0,
294                    AlreadyWritten = 1,
295                }
296                impl Reason {
297                    /// String value of the enum field names used in the ProtoBuf definition.
298                    /// The values are not transformed in any way and thus are considered stable
299                    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
300                    pub fn as_str_name(&self) -> &'static str {
301                        match self {
302                            Self::Unspecified => "REASON_UNSPECIFIED",
303                            Self::AlreadyWritten => "REASON_ALREADY_WRITTEN",
304                        }
305                    }
306                    /// Creates an enum from field names used in the ProtoBuf definition.
307                    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
308                        match value {
309                            "REASON_UNSPECIFIED" => Some(Self::Unspecified),
310                            "REASON_ALREADY_WRITTEN" => Some(Self::AlreadyWritten),
311                            _ => None,
312                        }
313                    }
314                }
315            }
316            #[derive(serde::Serialize, serde::Deserialize)]
317            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
318            pub struct WrittenInTx {}
319            /// Either message is written for the first time or duplicate.
320            #[derive(serde::Serialize, serde::Deserialize)]
321            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
322            pub enum MessageWriteStatus {
323                #[prost(message, tag = "2")]
324                Written(Written),
325                #[prost(message, tag = "3")]
326                Skipped(Skipped),
327                #[prost(message, tag = "4")]
328                WrittenInTx(WrittenInTx),
329            }
330        }
331        /// Message with write statistics.
332        #[derive(serde::Serialize, serde::Deserialize)]
333        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
334        pub struct WriteStatistics {
335            /// Time spent in persisting of data. Same for each message in response.
336            #[prost(message, optional, tag = "1")]
337            pub persisting_time: ::core::option::Option<
338                super::super::super::super::google::protobuf::Duration,
339            >,
340            /// Time spent in queue before persisting, minimal of all messages in response.
341            #[prost(message, optional, tag = "2")]
342            pub min_queue_wait_time: ::core::option::Option<
343                super::super::super::super::google::protobuf::Duration,
344            >,
345            /// Time spent in queue before persisting, maximal of all messages in response.
346            #[prost(message, optional, tag = "3")]
347            pub max_queue_wait_time: ::core::option::Option<
348                super::super::super::super::google::protobuf::Duration,
349            >,
350            /// Time spent awaiting for partition write quota. Same for each message in response.
351            #[prost(message, optional, tag = "4")]
352            pub partition_quota_wait_time: ::core::option::Option<
353                super::super::super::super::google::protobuf::Duration,
354            >,
355            /// Time spent awaiting for topic write quota. Same for each message in response.
356            #[prost(message, optional, tag = "5")]
357            pub topic_quota_wait_time: ::core::option::Option<
358                super::super::super::super::google::protobuf::Duration,
359            >,
360        }
361    }
362}
363/// Messages for bidirectional streaming rpc StreamRead
364#[derive(serde::Serialize, serde::Deserialize)]
365#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
366pub struct StreamReadMessage {}
367/// Nested message and enum types in `StreamReadMessage`.
368pub mod stream_read_message {
369    /// Within a StreamRead session delivered messages are separated by partition.
370    /// Reads from a single partition are represented by a partition session.
371    #[derive(serde::Serialize, serde::Deserialize)]
372    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
373    pub struct PartitionSession {
374        /// Identifier of partition session. Unique inside one RPC call.
375        #[prost(int64, tag = "1")]
376        pub partition_session_id: i64,
377        /// Topic path of partition.
378        #[prost(string, tag = "2")]
379        pub path: ::prost::alloc::string::String,
380        /// Partition identifier.
381        #[prost(int64, tag = "3")]
382        pub partition_id: i64,
383    }
384    /// Client-server message for read session. Contains one of:
385    /// InitRequest - handshake request.
386    /// ReadRequest - request for data.
387    /// CommitOffsetRequest - request for commit of some read data.
388    /// PartitionSessionStatusRequest - request for session status
389    /// UpdateTokenRequest - request to update auth token
390    /// DirectReadAck - client signals it has finished direct reading from the partition node.
391    /// ```text
392    /// StartPartitionSessionResponse - Response to StreamReadServerMessage.StartPartitionSessionRequest.
393    ///      Client signals it is ready to get data from partition.
394    /// StopPartitionSessionResponse - Response to StreamReadServerMessage.StopPartitionSessionRequest.
395    ///      Client signals it has finished working with partition. Mandatory for graceful stop, optional otherwise.
396    /// ```
397    #[derive(serde::Serialize, serde::Deserialize)]
398    #[derive(Clone, PartialEq, ::prost::Message)]
399    pub struct FromClient {
400        #[prost(oneof = "from_client::ClientMessage", tags = "1, 2, 3, 4, 5, 8, 6, 7")]
401        pub client_message: ::core::option::Option<from_client::ClientMessage>,
402    }
403    /// Nested message and enum types in `FromClient`.
404    pub mod from_client {
405        #[derive(serde::Serialize, serde::Deserialize)]
406        #[derive(Clone, PartialEq, ::prost::Oneof)]
407        pub enum ClientMessage {
408            /// Client requests.
409            #[prost(message, tag = "1")]
410            InitRequest(super::InitRequest),
411            #[prost(message, tag = "2")]
412            ReadRequest(super::ReadRequest),
413            #[prost(message, tag = "3")]
414            CommitOffsetRequest(super::CommitOffsetRequest),
415            #[prost(message, tag = "4")]
416            PartitionSessionStatusRequest(super::PartitionSessionStatusRequest),
417            #[prost(message, tag = "5")]
418            UpdateTokenRequest(super::super::UpdateTokenRequest),
419            #[prost(message, tag = "8")]
420            DirectReadAck(super::DirectReadAck),
421            /// Responses to respective server commands.
422            #[prost(message, tag = "6")]
423            StartPartitionSessionResponse(super::StartPartitionSessionResponse),
424            #[prost(message, tag = "7")]
425            StopPartitionSessionResponse(super::StopPartitionSessionResponse),
426        }
427    }
428    /// Server-client message for read session. Contains one of:
429    /// InitResponse - handshake response from server.
430    /// ReadResponse - portion of data.
431    /// CommitOffsetResponse - acknowledgment for commit.
432    /// PartitionSessionStatusResponse - server response with partition session status.
433    /// UpdateTokenResponse - acknowledgment of token update.
434    /// ```text
435    /// StartPartitionSessionRequest - command from server to create a partition session.
436    /// StopPartitionSessionRequest - command from server to destroy a partition session.
437    /// UpdatePartitionSession - command from server to update a partition session.
438    /// ```
439    #[derive(serde::Serialize, serde::Deserialize)]
440    #[derive(Clone, PartialEq, ::prost::Message)]
441    pub struct FromServer {
442        /// Server status of response.
443        #[prost(enumeration = "super::super::status_ids::StatusCode", tag = "1")]
444        pub status: i32,
445        /// Issues if any.
446        #[prost(message, repeated, tag = "2")]
447        pub issues: ::prost::alloc::vec::Vec<super::super::issue::IssueMessage>,
448        #[prost(
449            oneof = "from_server::ServerMessage",
450            tags = "3, 4, 5, 6, 7, 8, 9, 10, 11"
451        )]
452        pub server_message: ::core::option::Option<from_server::ServerMessage>,
453    }
454    /// Nested message and enum types in `FromServer`.
455    pub mod from_server {
456        #[derive(serde::Serialize, serde::Deserialize)]
457        #[derive(Clone, PartialEq, ::prost::Oneof)]
458        pub enum ServerMessage {
459            /// Responses to respective client requests.
460            #[prost(message, tag = "3")]
461            InitResponse(super::InitResponse),
462            #[prost(message, tag = "4")]
463            ReadResponse(super::ReadResponse),
464            #[prost(message, tag = "5")]
465            CommitOffsetResponse(super::CommitOffsetResponse),
466            #[prost(message, tag = "6")]
467            PartitionSessionStatusResponse(super::PartitionSessionStatusResponse),
468            #[prost(message, tag = "7")]
469            UpdateTokenResponse(super::super::UpdateTokenResponse),
470            /// Server commands.
471            #[prost(message, tag = "8")]
472            StartPartitionSessionRequest(super::StartPartitionSessionRequest),
473            #[prost(message, tag = "9")]
474            StopPartitionSessionRequest(super::StopPartitionSessionRequest),
475            #[prost(message, tag = "10")]
476            UpdatePartitionSession(super::UpdatePartitionSession),
477            #[prost(message, tag = "11")]
478            EndPartitionSession(super::EndPartitionSession),
479        }
480    }
481    /// Handshake request.
482    #[derive(serde::Serialize, serde::Deserialize)]
483    #[derive(Clone, PartialEq, ::prost::Message)]
484    pub struct InitRequest {
485        /// Message that describes topic to read.
486        /// Topics that will be read by this session.
487        #[prost(message, repeated, tag = "1")]
488        pub topics_read_settings: ::prost::alloc::vec::Vec<
489            init_request::TopicReadSettings,
490        >,
491        /// Path of consumer that is used for reading by this session.
492        #[prost(string, tag = "2")]
493        pub consumer: ::prost::alloc::string::String,
494        /// Optional name. Will be shown in debug stat.
495        #[prost(string, tag = "3")]
496        pub reader_name: ::prost::alloc::string::String,
497        /// Direct reading from a partition node.
498        #[prost(bool, tag = "4")]
499        pub direct_read: bool,
500        /// Indicates that the SDK supports auto partitioning.
501        #[prost(bool, tag = "5")]
502        pub auto_partitioning_support: bool,
503    }
504    /// Nested message and enum types in `InitRequest`.
505    pub mod init_request {
506        #[derive(serde::Serialize, serde::Deserialize)]
507        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
508        pub struct TopicReadSettings {
509            /// Topic path.
510            #[prost(string, tag = "1")]
511            pub path: ::prost::alloc::string::String,
512            /// Partitions that will be read by this session.
513            /// If list is empty - then session will read all partitions.
514            #[prost(int64, repeated, tag = "2")]
515            pub partition_ids: ::prost::alloc::vec::Vec<i64>,
516            /// Skip all messages that has write timestamp smaller than now - max_lag.
517            /// Zero means infinite lag.
518            #[prost(message, optional, tag = "3")]
519            pub max_lag: ::core::option::Option<
520                super::super::super::super::google::protobuf::Duration,
521            >,
522            /// Read data only after this timestamp from this topic.
523            /// Read only messages with 'written_at' value greater or equal than this timestamp.
524            #[prost(message, optional, tag = "4")]
525            pub read_from: ::core::option::Option<
526                super::super::super::super::google::protobuf::Timestamp,
527            >,
528        }
529    }
530    /// Handshake response.
531    #[derive(serde::Serialize, serde::Deserialize)]
532    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
533    pub struct InitResponse {
534        /// Read session identifier.
535        #[prost(string, tag = "1")]
536        pub session_id: ::prost::alloc::string::String,
537    }
538    /// Message that represents client readiness for receiving more data.
539    #[derive(serde::Serialize, serde::Deserialize)]
540    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
541    pub struct ReadRequest {
542        /// Server and client each keep track of total bytes size of all ReadResponses.
543        /// When client is ready to receive N more bytes in responses (to increment possible total by N),
544        /// it sends a ReadRequest with bytes_size = N.
545        /// bytes_size value must be positive.
546        /// So in expression 'A = (sum of bytes_size in all ReadRequests) - (sum of bytes_size in all ReadResponses)'
547        /// server will keep A (available size for responses) non-negative.
548        /// But there is an exception. If server receives ReadRequest, and the first message in response exceeds A -
549        /// then it will still be delivered, and A will become negative until enough additional ReadRequests.
550        /// Example:
551        /// 1. Let client have 200 bytes buffer. It sends ReadRequest with bytes_size = 200;
552        /// 1. Server may return one ReadResponse with bytes_size = 70 and than another 80 bytes response;
553        ///    now client buffer has 50 free bytes, server is free to send up to 50 bytes in responses.
554        /// 1. Client processes 100 bytes from buffer, now buffer free space is 150 bytes,
555        ///    so client sends ReadRequest with bytes_size = 100;
556        /// 1. Server is free to send up to 50 + 100 = 150 bytes. But the next read message is too big,
557        ///    and it sends 160 bytes ReadResponse.
558        /// 1. Let's assume client somehow processes it, and its 200 bytes buffer is free again.
559        ///    It should account for excess 10 bytes and send ReadRequest with bytes_size = 210.
560        #[prost(int64, tag = "1")]
561        pub bytes_size: i64,
562    }
563    /// Data read.
564    #[derive(serde::Serialize, serde::Deserialize)]
565    #[derive(Clone, PartialEq, ::prost::Message)]
566    pub struct ReadResponse {
567        /// Client messages, divided by partitions.
568        #[prost(message, repeated, tag = "1")]
569        pub partition_data: ::prost::alloc::vec::Vec<read_response::PartitionData>,
570        /// Total size in bytes of this response as calculated by server.
571        /// See ReadRequest comment above.
572        #[prost(int64, tag = "2")]
573        pub bytes_size: i64,
574    }
575    /// Nested message and enum types in `ReadResponse`.
576    pub mod read_response {
577        /// One client message representation.
578        #[derive(serde::Serialize, serde::Deserialize)]
579        #[derive(Clone, PartialEq, ::prost::Message)]
580        pub struct MessageData {
581            /// Partition offset in partition that assigned for message.
582            /// unique value for client side deduplication - Topic:Partition:Offset
583            #[prost(int64, tag = "1")]
584            pub offset: i64,
585            /// Sequence number that provided with message on write from client.
586            #[prost(int64, tag = "2")]
587            pub seq_no: i64,
588            /// Timestamp of creation of message provided on write from client.
589            #[prost(message, optional, tag = "3")]
590            pub created_at: ::core::option::Option<
591                super::super::super::super::google::protobuf::Timestamp,
592            >,
593            /// Compressed client message body.
594            #[prost(bytes = "vec", tag = "5")]
595            pub data: ::prost::alloc::vec::Vec<u8>,
596            /// Uncompressed size of client message body.
597            /// sent as is from WriteRequest, without check on server side. May be empty (for writes from old client) or wrong (if bug in writer).
598            /// Use it for optimization purposes only, don't trust it.
599            #[prost(int64, tag = "6")]
600            pub uncompressed_size: i64,
601            /// Filled if message_group_id was set on message write.
602            #[prost(string, tag = "7")]
603            pub message_group_id: ::prost::alloc::string::String,
604            #[prost(message, repeated, tag = "8")]
605            pub metadata_items: ::prost::alloc::vec::Vec<super::super::MetadataItem>,
606        }
607        /// Representation of sequence of client messages from one write session.
608        #[derive(serde::Serialize, serde::Deserialize)]
609        #[derive(Clone, PartialEq, ::prost::Message)]
610        pub struct Batch {
611            /// List of client messages.
612            #[prost(message, repeated, tag = "1")]
613            pub message_data: ::prost::alloc::vec::Vec<MessageData>,
614            /// Producer identifier provided by client for this batch of client messages.
615            #[prost(string, tag = "2")]
616            pub producer_id: ::prost::alloc::string::String,
617            /// Client metadata attached to write session, the same for all messages in batch.
618            #[prost(map = "string, string", tag = "3")]
619            pub write_session_meta: ::std::collections::HashMap<
620                ::prost::alloc::string::String,
621                ::prost::alloc::string::String,
622            >,
623            /// Codec that is used for data compression.
624            /// See enum Codec above for values.
625            #[prost(int32, tag = "4")]
626            pub codec: i32,
627            /// Persist timestamp on server for batch.
628            #[prost(message, optional, tag = "5")]
629            pub written_at: ::core::option::Option<
630                super::super::super::super::google::protobuf::Timestamp,
631            >,
632        }
633        /// Representation of sequence of messages from one partition.
634        #[derive(serde::Serialize, serde::Deserialize)]
635        #[derive(Clone, PartialEq, ::prost::Message)]
636        pub struct PartitionData {
637            #[prost(int64, tag = "1")]
638            pub partition_session_id: i64,
639            /// Client messages, divided by write sessions.
640            #[prost(message, repeated, tag = "2")]
641            pub batches: ::prost::alloc::vec::Vec<Batch>,
642        }
643    }
644    /// Signal for server that client processed some read data.
645    #[derive(serde::Serialize, serde::Deserialize)]
646    #[derive(Clone, PartialEq, ::prost::Message)]
647    pub struct CommitOffsetRequest {
648        /// Partition offsets that indicates processed data.
649        #[prost(message, repeated, tag = "1")]
650        pub commit_offsets: ::prost::alloc::vec::Vec<
651            commit_offset_request::PartitionCommitOffset,
652        >,
653    }
654    /// Nested message and enum types in `CommitOffsetRequest`.
655    pub mod commit_offset_request {
656        /// Message that is used for describing commit.
657        #[derive(serde::Serialize, serde::Deserialize)]
658        #[derive(Clone, PartialEq, ::prost::Message)]
659        pub struct PartitionCommitOffset {
660            /// Identifier of partition session with data to commit.
661            #[prost(int64, tag = "1")]
662            pub partition_session_id: i64,
663            /// Processed offsets ranges, repeated in case of disjoint ranges.
664            #[prost(message, repeated, tag = "2")]
665            pub offsets: ::prost::alloc::vec::Vec<super::super::OffsetsRange>,
666        }
667    }
668    /// Acknowledgement for commits.
669    #[derive(serde::Serialize, serde::Deserialize)]
670    #[derive(Clone, PartialEq, ::prost::Message)]
671    pub struct CommitOffsetResponse {
672        /// Partitions with progress.
673        #[prost(message, repeated, tag = "1")]
674        pub partitions_committed_offsets: ::prost::alloc::vec::Vec<
675            commit_offset_response::PartitionCommittedOffset,
676        >,
677    }
678    /// Nested message and enum types in `CommitOffsetResponse`.
679    pub mod commit_offset_response {
680        /// Per-partition commit representation.
681        #[derive(serde::Serialize, serde::Deserialize)]
682        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
683        pub struct PartitionCommittedOffset {
684            /// Partition session identifier.
685            #[prost(int64, tag = "1")]
686            pub partition_session_id: i64,
687            /// Upper bound for committed offsets.
688            #[prost(int64, tag = "2")]
689            pub committed_offset: i64,
690        }
691    }
692    #[derive(serde::Serialize, serde::Deserialize)]
693    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
694    pub struct PartitionSessionStatusRequest {
695        #[prost(int64, tag = "1")]
696        pub partition_session_id: i64,
697    }
698    /// Response to status request.
699    #[derive(serde::Serialize, serde::Deserialize)]
700    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
701    pub struct PartitionSessionStatusResponse {
702        /// Identifier of partition session whose status was requested.
703        #[prost(int64, tag = "1")]
704        pub partition_session_id: i64,
705        /// Partition contains messages with offsets in range \[start, end).
706        #[prost(message, optional, tag = "2")]
707        pub partition_offsets: ::core::option::Option<super::OffsetsRange>,
708        /// Each offset up to and including (committed_offset - 1) was fully processed.
709        #[prost(int64, tag = "3")]
710        pub committed_offset: i64,
711        /// Write timestamp of next message written to this partition will be no less than write_time_high_watermark.
712        #[prost(message, optional, tag = "4")]
713        pub write_time_high_watermark: ::core::option::Option<
714            super::super::super::google::protobuf::Timestamp,
715        >,
716    }
717    /// Command from server to create and start a partition session.
718    /// Client must respond with StartPartitionSessionResponse when ready to receive data from this partition.
719    #[derive(serde::Serialize, serde::Deserialize)]
720    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
721    pub struct StartPartitionSessionRequest {
722        /// Partition session description.
723        #[prost(message, optional, tag = "1")]
724        pub partition_session: ::core::option::Option<PartitionSession>,
725        /// Each offset up to and including (committed_offset - 1) was fully processed.
726        #[prost(int64, tag = "2")]
727        pub committed_offset: i64,
728        /// Partition contains messages with offsets in range \[start, end).
729        #[prost(message, optional, tag = "3")]
730        pub partition_offsets: ::core::option::Option<super::OffsetsRange>,
731        /// Partition location, filled only when InitRequest.direct_read is true.
732        #[prost(message, optional, tag = "4")]
733        pub partition_location: ::core::option::Option<super::PartitionLocation>,
734    }
735    /// Signal for server that client is ready to recive data for partition.
736    #[derive(serde::Serialize, serde::Deserialize)]
737    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
738    pub struct StartPartitionSessionResponse {
739        /// Partition session identifier of partition to start read.
740        #[prost(int64, tag = "1")]
741        pub partition_session_id: i64,
742        /// Reads in this partition session will start from offset no less than read_offset.
743        /// If read_offset is set, server will check that read_offset is no less that actual committed offset.
744        /// If check fails then server will send an error message (status != SUCCESS) and close stream.
745        /// If read_offset is not set, no check will be made.
746        /// InitRequest.max_lag and InitRequest.read_from could lead to skip of more messages.
747        /// Server will return data starting from offset that is maximum of actual committed offset, read_offset (if set)
748        /// and offsets calculated from InitRequest.max_lag and InitRequest.read_from.
749        #[prost(int64, optional, tag = "2")]
750        pub read_offset: ::core::option::Option<i64>,
751        /// All messages with offset less than commit_offset are processed by client.
752        /// Server will commit this position if this is not done yet.
753        #[prost(int64, optional, tag = "3")]
754        pub commit_offset: ::core::option::Option<i64>,
755    }
756    /// Command from server to stop and destroy concrete partition session.
757    #[derive(serde::Serialize, serde::Deserialize)]
758    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
759    pub struct StopPartitionSessionRequest {
760        /// Identifier of partition session that is ready to be closed by server.
761        #[prost(int64, tag = "1")]
762        pub partition_session_id: i64,
763        /// Flag of graceful stop.
764        /// If set, server will wait for response from client before giving this partition to other read session.
765        /// Server will not send more data from this partition.
766        /// Client can process all received data and wait for commit and only after send response.
767        /// If False then server gives partition for other session right now.
768        /// All further commits for this partition session has no effect. Server is not waiting for response.
769        #[prost(bool, tag = "2")]
770        pub graceful: bool,
771        /// Upper bound for committed offsets.
772        #[prost(int64, tag = "3")]
773        pub committed_offset: i64,
774        /// Upper bound for read request identifiers, filled only when InitRequest.direct_read is true and graceful is true.
775        #[prost(int64, tag = "4")]
776        pub last_direct_read_id: i64,
777    }
778    /// Signal for server that client finished working with this partition.
779    /// Must be sent only after corresponding StopPartitionSessionRequest from server.
780    /// Server will give this partition to other read session only after StopPartitionSessionResponse signal.
781    #[derive(serde::Serialize, serde::Deserialize)]
782    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
783    pub struct StopPartitionSessionResponse {
784        /// Partition session identifier of partition session that is released by client.
785        #[prost(int64, tag = "1")]
786        pub partition_session_id: i64,
787        /// Flag of graceful stop, used only when InitRequest.direct_read is true
788        /// Client must pass this value unchanged from the StopPartitionSessionRequest.
789        /// Server can sent two StopPartitionSessionRequests, the first with graceful=true, the second with graceful=false. The client must answer both of them.
790        #[prost(bool, tag = "2")]
791        pub graceful: bool,
792    }
793    /// Command from server to notify about a partition session update.
794    /// Client should not send a response to the command.
795    #[derive(serde::Serialize, serde::Deserialize)]
796    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
797    pub struct UpdatePartitionSession {
798        /// Partition session identifier.
799        #[prost(int64, tag = "1")]
800        pub partition_session_id: i64,
801        /// Partition location, filled only when InitRequest.direct_read is true.
802        #[prost(message, optional, tag = "2")]
803        pub partition_location: ::core::option::Option<super::PartitionLocation>,
804    }
805    /// Signal for server that client has finished direct reading.
806    /// Server should not send a response to the command.
807    #[derive(serde::Serialize, serde::Deserialize)]
808    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
809    pub struct DirectReadAck {
810        /// Partition session identifier.
811        #[prost(int64, tag = "1")]
812        pub partition_session_id: i64,
813        /// Identifier of the successfully completed read request.
814        #[prost(int64, tag = "2")]
815        pub direct_read_id: i64,
816    }
817    /// Signal from server that client has finished reading the partition and all messages have been read.
818    /// Once a partition has been finished no further messages will ever arrive to that partition.
819    /// This command is a hint to the client to commit offsets, after which the child partitions will be balanced independently in different reading sessions.
820    /// Unlike StopPartitionSessionRequest, the client does not have to close the reading session.
821    /// Client should not send a response to the command.
822    #[derive(serde::Serialize, serde::Deserialize)]
823    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
824    pub struct EndPartitionSession {
825        /// Partition session identifier.
826        #[prost(int64, tag = "1")]
827        pub partition_session_id: i64,
828        /// Ids of partitions which were merged with the ended partition.
829        #[prost(int64, repeated, tag = "2")]
830        pub adjacent_partition_ids: ::prost::alloc::vec::Vec<i64>,
831        /// Ids of partitions which was formed when the ended partition was split or merged.
832        #[prost(int64, repeated, tag = "3")]
833        pub child_partition_ids: ::prost::alloc::vec::Vec<i64>,
834    }
835}
836/// Messages for bidirectional streaming rpc StreamDirectRead
837#[derive(serde::Serialize, serde::Deserialize)]
838#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
839pub struct StreamDirectReadMessage {}
840/// Nested message and enum types in `StreamDirectReadMessage`.
841pub mod stream_direct_read_message {
842    /// Client-server message for direct read session.
843    /// InitRequest - command from client to create and start a direct read session.
844    /// StartDirectReadPartitionSessionRequest - command from client to create and start a direct read partition session.
845    /// Client signals it is ready to get data from partition.
846    /// UpdateTokenRequest - request to update auth token
847    #[derive(serde::Serialize, serde::Deserialize)]
848    #[derive(Clone, PartialEq, ::prost::Message)]
849    pub struct FromClient {
850        #[prost(oneof = "from_client::ClientMessage", tags = "1, 2, 3")]
851        pub client_message: ::core::option::Option<from_client::ClientMessage>,
852    }
853    /// Nested message and enum types in `FromClient`.
854    pub mod from_client {
855        #[derive(serde::Serialize, serde::Deserialize)]
856        #[derive(Clone, PartialEq, ::prost::Oneof)]
857        pub enum ClientMessage {
858            #[prost(message, tag = "1")]
859            InitRequest(super::InitRequest),
860            #[prost(message, tag = "2")]
861            StartDirectReadPartitionSessionRequest(
862                super::StartDirectReadPartitionSessionRequest,
863            ),
864            #[prost(message, tag = "3")]
865            UpdateTokenRequest(super::super::UpdateTokenRequest),
866        }
867    }
868    /// Server-client message for direct read session.
869    /// InitResponse - correct handshake response.
870    /// StartDirectReadPartitionSessionResponse - Response to StartDirectReadPartitionSessionRequest.
871    /// DirectReadResponse - portion of message data.
872    /// StopDirectReadPartitionSession - command from server to stop a direct read partition session.
873    /// UpdateTokenResponse - acknowledgment of token update.
874    #[derive(serde::Serialize, serde::Deserialize)]
875    #[derive(Clone, PartialEq, ::prost::Message)]
876    pub struct FromServer {
877        /// Server status of response.
878        #[prost(enumeration = "super::super::status_ids::StatusCode", tag = "1")]
879        pub status: i32,
880        /// Issues if any.
881        #[prost(message, repeated, tag = "2")]
882        pub issues: ::prost::alloc::vec::Vec<super::super::issue::IssueMessage>,
883        #[prost(oneof = "from_server::ServerMessage", tags = "6, 7, 3, 4, 5")]
884        pub server_message: ::core::option::Option<from_server::ServerMessage>,
885    }
886    /// Nested message and enum types in `FromServer`.
887    pub mod from_server {
888        #[derive(serde::Serialize, serde::Deserialize)]
889        #[derive(Clone, PartialEq, ::prost::Oneof)]
890        pub enum ServerMessage {
891            #[prost(message, tag = "6")]
892            InitResponse(super::InitResponse),
893            #[prost(message, tag = "7")]
894            StartDirectReadPartitionSessionResponse(
895                super::StartDirectReadPartitionSessionResponse,
896            ),
897            #[prost(message, tag = "3")]
898            StopDirectReadPartitionSession(super::StopDirectReadPartitionSession),
899            #[prost(message, tag = "4")]
900            DirectReadResponse(super::DirectReadResponse),
901            #[prost(message, tag = "5")]
902            UpdateTokenResponse(super::super::UpdateTokenResponse),
903        }
904    }
905    /// Command from client to create and start a direct read session.
906    /// Server should not send a response to the command.
907    #[derive(serde::Serialize, serde::Deserialize)]
908    #[derive(Clone, PartialEq, ::prost::Message)]
909    pub struct InitRequest {
910        /// Read session identifier.
911        #[prost(string, tag = "1")]
912        pub session_id: ::prost::alloc::string::String,
913        /// Topics that will be read by this session.
914        #[prost(message, repeated, tag = "2")]
915        pub topics_read_settings: ::prost::alloc::vec::Vec<
916            init_request::TopicReadSettings,
917        >,
918        /// Path of consumer that is used for reading by this session.
919        #[prost(string, tag = "3")]
920        pub consumer: ::prost::alloc::string::String,
921    }
922    /// Nested message and enum types in `InitRequest`.
923    pub mod init_request {
924        #[derive(serde::Serialize, serde::Deserialize)]
925        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
926        pub struct TopicReadSettings {
927            /// Topic path.
928            #[prost(string, tag = "1")]
929            pub path: ::prost::alloc::string::String,
930        }
931    }
932    /// Response to the handshake.
933    #[derive(serde::Serialize, serde::Deserialize)]
934    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
935    pub struct InitResponse {}
936    /// Command from client to create and start a direct read partition session.
937    #[derive(serde::Serialize, serde::Deserialize)]
938    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
939    pub struct StartDirectReadPartitionSessionRequest {
940        /// Partition session identifier.
941        #[prost(int64, tag = "1")]
942        pub partition_session_id: i64,
943        /// Upper bound for read request identifiers.
944        #[prost(int64, tag = "2")]
945        pub last_direct_read_id: i64,
946        /// Partition generation.
947        #[prost(int64, tag = "3")]
948        pub generation: i64,
949    }
950    /// Signal for server that client is ready to receive data for partition.
951    #[derive(serde::Serialize, serde::Deserialize)]
952    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
953    pub struct StartDirectReadPartitionSessionResponse {
954        /// Partition session identifier of partition to start read.
955        #[prost(int64, tag = "1")]
956        pub partition_session_id: i64,
957        /// Partition generation.
958        #[prost(int64, tag = "2")]
959        pub generation: i64,
960    }
961    /// Command from server to stop a direct read partition session.
962    /// Client should not send a response to the command.
963    #[derive(serde::Serialize, serde::Deserialize)]
964    #[derive(Clone, PartialEq, ::prost::Message)]
965    pub struct StopDirectReadPartitionSession {
966        /// The reason for the stop.
967        #[prost(enumeration = "super::super::status_ids::StatusCode", tag = "1")]
968        pub status: i32,
969        /// Issues if any.
970        #[prost(message, repeated, tag = "2")]
971        pub issues: ::prost::alloc::vec::Vec<super::super::issue::IssueMessage>,
972        /// Partition session identifier.
973        #[prost(int64, tag = "3")]
974        pub partition_session_id: i64,
975        /// Partition generation.
976        #[prost(int64, tag = "4")]
977        pub generation: i64,
978    }
979    /// Messages that have been read directly from the partition node.
980    /// It's a response to StreamRead.ReadRequest
981    #[derive(serde::Serialize, serde::Deserialize)]
982    #[derive(Clone, PartialEq, ::prost::Message)]
983    pub struct DirectReadResponse {
984        /// Partition session identifier.
985        #[prost(int64, tag = "1")]
986        pub partition_session_id: i64,
987        /// Read request identifier.
988        #[prost(int64, tag = "2")]
989        pub direct_read_id: i64,
990        /// Messages data
991        #[prost(message, optional, tag = "3")]
992        pub partition_data: ::core::option::Option<
993            super::stream_read_message::read_response::PartitionData,
994        >,
995        /// Total size in bytes of this response as calculated by server.
996        /// See ReadRequest comment above.
997        #[prost(int64, tag = "4")]
998        pub bytes_size: i64,
999    }
1000}
1001#[derive(serde::Serialize, serde::Deserialize)]
1002#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1003pub struct TransactionIdentity {
1004    /// Transaction identifier from TableService.
1005    #[prost(string, tag = "1")]
1006    pub id: ::prost::alloc::string::String,
1007    /// Session identifier from TableService.
1008    #[prost(string, tag = "2")]
1009    pub session: ::prost::alloc::string::String,
1010}
1011/// Add offsets to transaction request sent from client to server.
1012#[derive(serde::Serialize, serde::Deserialize)]
1013#[derive(Clone, PartialEq, ::prost::Message)]
1014pub struct UpdateOffsetsInTransactionRequest {
1015    #[prost(message, optional, tag = "1")]
1016    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1017    #[prost(message, optional, tag = "2")]
1018    pub tx: ::core::option::Option<TransactionIdentity>,
1019    /// Ranges of offsets by topics.
1020    #[prost(message, repeated, tag = "3")]
1021    pub topics: ::prost::alloc::vec::Vec<
1022        update_offsets_in_transaction_request::TopicOffsets,
1023    >,
1024    #[prost(string, tag = "4")]
1025    pub consumer: ::prost::alloc::string::String,
1026}
1027/// Nested message and enum types in `UpdateOffsetsInTransactionRequest`.
1028pub mod update_offsets_in_transaction_request {
1029    #[derive(serde::Serialize, serde::Deserialize)]
1030    #[derive(Clone, PartialEq, ::prost::Message)]
1031    pub struct TopicOffsets {
1032        /// Topic path.
1033        #[prost(string, tag = "1")]
1034        pub path: ::prost::alloc::string::String,
1035        /// Ranges of offsets by partitions.
1036        #[prost(message, repeated, tag = "2")]
1037        pub partitions: ::prost::alloc::vec::Vec<topic_offsets::PartitionOffsets>,
1038    }
1039    /// Nested message and enum types in `TopicOffsets`.
1040    pub mod topic_offsets {
1041        #[derive(serde::Serialize, serde::Deserialize)]
1042        #[derive(Clone, PartialEq, ::prost::Message)]
1043        pub struct PartitionOffsets {
1044            /// Partition identifier.
1045            #[prost(int64, tag = "1")]
1046            pub partition_id: i64,
1047            /// List of offset ranges.
1048            #[prost(message, repeated, tag = "2")]
1049            pub partition_offsets: ::prost::alloc::vec::Vec<super::super::OffsetsRange>,
1050        }
1051    }
1052}
1053/// Add offsets to transaction response sent from server to client.
1054#[derive(serde::Serialize, serde::Deserialize)]
1055#[derive(Clone, PartialEq, ::prost::Message)]
1056pub struct UpdateOffsetsInTransactionResponse {
1057    /// Result of request will be inside operation.
1058    #[prost(message, optional, tag = "1")]
1059    pub operation: ::core::option::Option<super::operations::Operation>,
1060}
1061/// Add offsets to transaction result message that will be inside UpdateOffsetsInTransactionResponse.operation.
1062#[derive(serde::Serialize, serde::Deserialize)]
1063#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1064pub struct UpdateOffsetsInTransactionResult {}
1065/// Commit offset request sent from client to server.
1066#[derive(serde::Serialize, serde::Deserialize)]
1067#[derive(Clone, PartialEq, ::prost::Message)]
1068pub struct CommitOffsetRequest {
1069    #[prost(message, optional, tag = "1")]
1070    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1071    /// Topic path of partition.
1072    #[prost(string, tag = "2")]
1073    pub path: ::prost::alloc::string::String,
1074    /// Partition identifier.
1075    #[prost(int64, tag = "3")]
1076    pub partition_id: i64,
1077    /// Path of consumer.
1078    #[prost(string, tag = "4")]
1079    pub consumer: ::prost::alloc::string::String,
1080    /// Processed offset.
1081    #[prost(int64, tag = "5")]
1082    pub offset: i64,
1083    /// Read session identifier from StreamRead RPC.
1084    #[prost(string, tag = "6")]
1085    pub read_session_id: ::prost::alloc::string::String,
1086}
1087/// Commit offset response sent from server to client.
1088#[derive(serde::Serialize, serde::Deserialize)]
1089#[derive(Clone, PartialEq, ::prost::Message)]
1090pub struct CommitOffsetResponse {
1091    /// Result of request will be inside operation.
1092    #[prost(message, optional, tag = "1")]
1093    pub operation: ::core::option::Option<super::operations::Operation>,
1094}
1095/// Commit offset result message inside CommitOffsetResponse.operation.
1096#[derive(serde::Serialize, serde::Deserialize)]
1097#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1098pub struct CommitOffsetResult {}
1099/// message representing statistics by several windows
1100#[derive(serde::Serialize, serde::Deserialize)]
1101#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1102pub struct MultipleWindowsStat {
1103    #[prost(int64, tag = "1")]
1104    pub per_minute: i64,
1105    #[prost(int64, tag = "2")]
1106    pub per_hour: i64,
1107    #[prost(int64, tag = "3")]
1108    pub per_day: i64,
1109}
1110/// Consumer description.
1111#[derive(serde::Serialize, serde::Deserialize)]
1112#[derive(Clone, PartialEq, ::prost::Message)]
1113pub struct Consumer {
1114    /// Must have valid not empty name as a key.
1115    #[prost(string, tag = "1")]
1116    pub name: ::prost::alloc::string::String,
1117    /// Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
1118    /// User should take care that such consumer never stalls, to prevent running out of disk space.
1119    /// Flag that this consumer is important.
1120    #[prost(bool, tag = "2")]
1121    pub important: bool,
1122    /// All messages with smaller server written_at timestamp will be skipped.
1123    #[prost(message, optional, tag = "3")]
1124    pub read_from: ::core::option::Option<super::super::google::protobuf::Timestamp>,
1125    /// List of supported codecs by this consumer.
1126    /// supported_codecs on topic must be contained inside this list.
1127    /// If empty, codec compatibility check for the consumer is disabled.
1128    #[prost(message, optional, tag = "5")]
1129    pub supported_codecs: ::core::option::Option<SupportedCodecs>,
1130    /// Attributes of consumer
1131    #[prost(map = "string, string", tag = "6")]
1132    pub attributes: ::std::collections::HashMap<
1133        ::prost::alloc::string::String,
1134        ::prost::alloc::string::String,
1135    >,
1136    /// Filled only when requested statistics in Describe\*Request.
1137    #[prost(message, optional, tag = "7")]
1138    pub consumer_stats: ::core::option::Option<consumer::ConsumerStats>,
1139}
1140/// Nested message and enum types in `Consumer`.
1141pub mod consumer {
1142    #[derive(serde::Serialize, serde::Deserialize)]
1143    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1144    pub struct ConsumerStats {
1145        /// Minimal timestamp of last read from partitions.
1146        #[prost(message, optional, tag = "1")]
1147        pub min_partitions_last_read_time: ::core::option::Option<
1148            super::super::super::google::protobuf::Timestamp,
1149        >,
1150        /// Maximum of differences between timestamp of read and write timestamp for all messages, read during last minute.
1151        #[prost(message, optional, tag = "2")]
1152        pub max_read_time_lag: ::core::option::Option<
1153            super::super::super::google::protobuf::Duration,
1154        >,
1155        /// Maximum of differences between write timestamp and create timestamp for all messages, read during last minute.
1156        #[prost(message, optional, tag = "3")]
1157        pub max_write_time_lag: ::core::option::Option<
1158            super::super::super::google::protobuf::Duration,
1159        >,
1160        /// The difference between the write timestamp of the last commited message and the current time.
1161        #[prost(message, optional, tag = "5")]
1162        pub max_committed_time_lag: ::core::option::Option<
1163            super::super::super::google::protobuf::Duration,
1164        >,
1165        /// Bytes read statistics.
1166        #[prost(message, optional, tag = "4")]
1167        pub bytes_read: ::core::option::Option<super::MultipleWindowsStat>,
1168    }
1169}
1170/// Consumer alter description.
1171#[derive(serde::Serialize, serde::Deserialize)]
1172#[derive(Clone, PartialEq, ::prost::Message)]
1173pub struct AlterConsumer {
1174    /// Must have valid not empty name as a key.
1175    #[prost(string, tag = "1")]
1176    pub name: ::prost::alloc::string::String,
1177    /// Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
1178    /// User should take care that such consumer never stalls, to prevent running out of disk space.
1179    /// Flag that this consumer is important.
1180    #[prost(bool, optional, tag = "2")]
1181    pub set_important: ::core::option::Option<bool>,
1182    /// All messages with smaller server written_at timestamp will be skipped.
1183    #[prost(message, optional, tag = "3")]
1184    pub set_read_from: ::core::option::Option<super::super::google::protobuf::Timestamp>,
1185    /// List of supported codecs by this consumer.
1186    /// supported_codecs on topic must be contained inside this list.
1187    /// If empty, codec compatibility check for the consumer is disabled.
1188    #[prost(message, optional, tag = "5")]
1189    pub set_supported_codecs: ::core::option::Option<SupportedCodecs>,
1190    /// User and server attributes of consumer. Server attributes starts from "\_" and will be validated by server.
1191    /// Leave the value blank to drop an attribute.
1192    #[prost(map = "string, string", tag = "6")]
1193    pub alter_attributes: ::std::collections::HashMap<
1194        ::prost::alloc::string::String,
1195        ::prost::alloc::string::String,
1196    >,
1197}
1198/// Partitioning settings for topic.
1199#[derive(serde::Serialize, serde::Deserialize)]
1200#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1201pub struct PartitioningSettings {
1202    /// Auto merge would stop working when the partitions count reaches min_active_partitions
1203    /// Zero value means default - 1.
1204    #[prost(int64, tag = "1")]
1205    pub min_active_partitions: i64,
1206    /// Auto split would stop working when the partitions count reaches max_active_partitions
1207    /// Zero value means default - 1.
1208    #[prost(int64, tag = "3")]
1209    pub max_active_partitions: i64,
1210    /// Limit for total partition count, including active (open for write) and read-only partitions.
1211    /// Zero value means default - 100.
1212    /// Use max_active_partitions
1213    #[deprecated]
1214    #[prost(int64, tag = "2")]
1215    pub partition_count_limit: i64,
1216    /// Settings for the partitions count auto partitioning.
1217    #[prost(message, optional, tag = "4")]
1218    pub auto_partitioning_settings: ::core::option::Option<AutoPartitioningSettings>,
1219}
1220#[derive(serde::Serialize, serde::Deserialize)]
1221#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1222pub struct AutoPartitioningSettings {
1223    /// Strategy of auto partitioning.
1224    #[prost(enumeration = "AutoPartitioningStrategy", tag = "1")]
1225    pub strategy: i32,
1226    /// Partition write speed auto partitioning options.
1227    #[prost(message, optional, tag = "2")]
1228    pub partition_write_speed: ::core::option::Option<
1229        AutoPartitioningWriteSpeedStrategy,
1230    >,
1231}
1232/// Partition will be auto partitioned up (divided into 2 partitions)
1233/// after write speed to the partition exceeds up_utilization_percent (in percentage of maximum write speed to the partition) for the period of time stabilization_window
1234#[derive(serde::Serialize, serde::Deserialize)]
1235#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1236pub struct AutoPartitioningWriteSpeedStrategy {
1237    /// Zero value means default - 300.
1238    #[prost(message, optional, tag = "1")]
1239    pub stabilization_window: ::core::option::Option<
1240        super::super::google::protobuf::Duration,
1241    >,
1242    /// Zero value means default - 90.
1243    #[prost(int32, tag = "2")]
1244    pub up_utilization_percent: i32,
1245    /// Zero value means default - 30.
1246    #[prost(int32, tag = "3")]
1247    pub down_utilization_percent: i32,
1248}
1249/// Partitioning settings for topic.
1250#[derive(serde::Serialize, serde::Deserialize)]
1251#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1252pub struct AlterPartitioningSettings {
1253    /// Minimum partition count auto merge would stop working at.
1254    /// Zero value means default - 1.
1255    #[prost(int64, optional, tag = "1")]
1256    pub set_min_active_partitions: ::core::option::Option<i64>,
1257    /// Maximum partition count auto merge would stop working at.
1258    /// Zero value means default - 1.
1259    #[prost(int64, optional, tag = "3")]
1260    pub set_max_active_partitions: ::core::option::Option<i64>,
1261    /// Limit for total partition count, including active (open for write) and read-only partitions.
1262    /// Zero value means default - 100.
1263    /// Use set_max_active_partitions
1264    #[deprecated]
1265    #[prost(int64, optional, tag = "2")]
1266    pub set_partition_count_limit: ::core::option::Option<i64>,
1267    /// Settings for auto partitioning the partition number
1268    #[prost(message, optional, tag = "4")]
1269    pub alter_auto_partitioning_settings: ::core::option::Option<
1270        AlterAutoPartitioningSettings,
1271    >,
1272}
1273#[derive(serde::Serialize, serde::Deserialize)]
1274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1275pub struct AlterAutoPartitioningSettings {
1276    /// Strategy of auto partitioning
1277    #[prost(enumeration = "AutoPartitioningStrategy", optional, tag = "1")]
1278    pub set_strategy: ::core::option::Option<i32>,
1279    /// Auto partitioning write speed options.
1280    #[prost(message, optional, tag = "2")]
1281    pub set_partition_write_speed: ::core::option::Option<
1282        AlterAutoPartitioningWriteSpeedStrategy,
1283    >,
1284}
1285#[derive(serde::Serialize, serde::Deserialize)]
1286#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1287pub struct AlterAutoPartitioningWriteSpeedStrategy {
1288    /// The time of exceeding the threshold value, after which the partition will be
1289    /// auto partitioning.
1290    /// Zero value means default - 300.
1291    #[prost(message, optional, tag = "1")]
1292    pub set_stabilization_window: ::core::option::Option<
1293        super::super::google::protobuf::Duration,
1294    >,
1295    /// The threshold value of the write speed to the partition as a percentage, when exceeded,
1296    /// the partition will be auto split.
1297    /// Zero value means default - 90.
1298    #[prost(int32, optional, tag = "2")]
1299    pub set_up_utilization_percent: ::core::option::Option<i32>,
1300    /// The threshold value of the write speed to the partition as a percentage, if it is not reached,
1301    /// the partition will be auto merged.
1302    /// Zero value means default - 30.
1303    #[prost(int32, optional, tag = "3")]
1304    pub set_down_utilization_percent: ::core::option::Option<i32>,
1305}
1306/// Create topic request sent from client to server.
1307#[derive(serde::Serialize, serde::Deserialize)]
1308#[derive(Clone, PartialEq, ::prost::Message)]
1309pub struct CreateTopicRequest {
1310    #[prost(message, optional, tag = "1")]
1311    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1312    /// Topic path.
1313    #[prost(string, tag = "2")]
1314    pub path: ::prost::alloc::string::String,
1315    /// Settings for partitioning
1316    #[prost(message, optional, tag = "3")]
1317    pub partitioning_settings: ::core::option::Option<PartitioningSettings>,
1318    /// Retention settings.
1319    /// Currently, only one limit may be set, so other should not be set.
1320    /// How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
1321    /// Default limit - 36 hours.
1322    #[prost(message, optional, tag = "4")]
1323    pub retention_period: ::core::option::Option<
1324        super::super::google::protobuf::Duration,
1325    >,
1326    /// How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
1327    /// Zero value means infinite limit.
1328    #[prost(int64, tag = "5")]
1329    pub retention_storage_mb: i64,
1330    /// List of allowed codecs for writers.
1331    /// Writes with codec not from this list are forbidden.
1332    /// If empty, codec compatibility check for the topic is disabled.
1333    #[prost(message, optional, tag = "7")]
1334    pub supported_codecs: ::core::option::Option<SupportedCodecs>,
1335    /// Partition write speed in bytes per second. Must be less than database limit.
1336    /// Zero value means default limit: 1 MB per second.
1337    #[prost(int64, tag = "8")]
1338    pub partition_write_speed_bytes_per_second: i64,
1339    /// Burst size for write in partition, in bytes. Must be less than database limit.
1340    /// Zero value means default limit: 1 MB.
1341    #[prost(int64, tag = "9")]
1342    pub partition_write_burst_bytes: i64,
1343    /// User and server attributes of topic. Server attributes starts from "\_" and will be validated by server.
1344    #[prost(map = "string, string", tag = "10")]
1345    pub attributes: ::std::collections::HashMap<
1346        ::prost::alloc::string::String,
1347        ::prost::alloc::string::String,
1348    >,
1349    /// List of consumers for this topic.
1350    #[prost(message, repeated, tag = "11")]
1351    pub consumers: ::prost::alloc::vec::Vec<Consumer>,
1352    /// Metering mode for the topic in a serverless database.
1353    #[prost(enumeration = "MeteringMode", tag = "12")]
1354    pub metering_mode: i32,
1355}
1356/// Create topic response sent from server to client.
1357/// If topic is already exists then response status will be "ALREADY_EXISTS".
1358#[derive(serde::Serialize, serde::Deserialize)]
1359#[derive(Clone, PartialEq, ::prost::Message)]
1360pub struct CreateTopicResponse {
1361    /// Result of request will be inside operation.
1362    #[prost(message, optional, tag = "1")]
1363    pub operation: ::core::option::Option<super::operations::Operation>,
1364}
1365/// Create topic result message that will be inside CreateTopicResponse.operation.
1366#[derive(serde::Serialize, serde::Deserialize)]
1367#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1368pub struct CreateTopicResult {}
1369/// Topic partition location
1370#[derive(serde::Serialize, serde::Deserialize)]
1371#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1372pub struct PartitionLocation {
1373    /// Node identificator.
1374    #[prost(int32, tag = "1")]
1375    pub node_id: i32,
1376    /// Partition generation.
1377    #[prost(int64, tag = "2")]
1378    pub generation: i64,
1379}
1380/// Describe topic request sent from client to server.
1381#[derive(serde::Serialize, serde::Deserialize)]
1382#[derive(Clone, PartialEq, ::prost::Message)]
1383pub struct DescribeTopicRequest {
1384    #[prost(message, optional, tag = "1")]
1385    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1386    /// Topic path.
1387    #[prost(string, tag = "2")]
1388    pub path: ::prost::alloc::string::String,
1389    /// Include topic statistics.
1390    #[prost(bool, tag = "3")]
1391    pub include_stats: bool,
1392    /// Include partition location.
1393    #[prost(bool, tag = "4")]
1394    pub include_location: bool,
1395}
1396/// Describe topic response sent from server to client.
1397/// If topic is not existed then response status will be "SCHEME_ERROR".
1398#[derive(serde::Serialize, serde::Deserialize)]
1399#[derive(Clone, PartialEq, ::prost::Message)]
1400pub struct DescribeTopicResponse {
1401    /// Result of request will be inside operation.
1402    #[prost(message, optional, tag = "1")]
1403    pub operation: ::core::option::Option<super::operations::Operation>,
1404}
1405#[derive(serde::Serialize, serde::Deserialize)]
1406#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1407pub struct PartitionKeyRange {
1408    /// Inclusive left border. Emptiness means -inf.
1409    #[prost(bytes = "vec", optional, tag = "1")]
1410    pub from_bound: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1411    /// Exclusive right border. Emptiness means +inf.
1412    #[prost(bytes = "vec", optional, tag = "2")]
1413    pub to_bound: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
1414}
1415/// Describe topic result message that will be inside DescribeTopicResponse.operation.
1416#[derive(serde::Serialize, serde::Deserialize)]
1417#[derive(Clone, PartialEq, ::prost::Message)]
1418pub struct DescribeTopicResult {
1419    /// Description of scheme object.
1420    #[prost(message, optional, tag = "1")]
1421    pub self_: ::core::option::Option<super::scheme::Entry>,
1422    /// Settings for partitioning
1423    #[prost(message, optional, tag = "2")]
1424    pub partitioning_settings: ::core::option::Option<PartitioningSettings>,
1425    /// Partitions description.
1426    #[prost(message, repeated, tag = "3")]
1427    pub partitions: ::prost::alloc::vec::Vec<describe_topic_result::PartitionInfo>,
1428    /// Retention settings.
1429    /// Currently, only one limit may be set, so other should not be set.
1430    /// How long data in partition should be stored.
1431    #[prost(message, optional, tag = "4")]
1432    pub retention_period: ::core::option::Option<
1433        super::super::google::protobuf::Duration,
1434    >,
1435    /// How much data in partition should be stored.
1436    /// Zero value means infinite limit.
1437    #[prost(int64, tag = "5")]
1438    pub retention_storage_mb: i64,
1439    /// List of allowed codecs for writers.
1440    /// Writes with codec not from this list are forbidden.
1441    /// If empty, codec compatibility check for the topic is disabled.
1442    #[prost(message, optional, tag = "7")]
1443    pub supported_codecs: ::core::option::Option<SupportedCodecs>,
1444    /// Partition write speed in bytes per second.
1445    /// Zero value means default limit: 1 MB per second.
1446    #[prost(int64, tag = "8")]
1447    pub partition_write_speed_bytes_per_second: i64,
1448    #[prost(int64, tag = "14")]
1449    pub partition_total_read_speed_bytes_per_second: i64,
1450    #[prost(int64, tag = "15")]
1451    pub partition_consumer_read_speed_bytes_per_second: i64,
1452    /// Burst size for write in partition, in bytes.
1453    /// Zero value means default limit: 1 MB.
1454    #[prost(int64, tag = "9")]
1455    pub partition_write_burst_bytes: i64,
1456    /// User and server attributes of topic. Server attributes starts from "\_" and will be validated by server.
1457    #[prost(map = "string, string", tag = "10")]
1458    pub attributes: ::std::collections::HashMap<
1459        ::prost::alloc::string::String,
1460        ::prost::alloc::string::String,
1461    >,
1462    /// List of consumers for this topic.
1463    #[prost(message, repeated, tag = "11")]
1464    pub consumers: ::prost::alloc::vec::Vec<Consumer>,
1465    /// Metering settings.
1466    #[prost(enumeration = "MeteringMode", tag = "12")]
1467    pub metering_mode: i32,
1468    /// Statistics of topic.
1469    #[prost(message, optional, tag = "13")]
1470    pub topic_stats: ::core::option::Option<describe_topic_result::TopicStats>,
1471}
1472/// Nested message and enum types in `DescribeTopicResult`.
1473pub mod describe_topic_result {
1474    #[derive(serde::Serialize, serde::Deserialize)]
1475    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1476    pub struct PartitionInfo {
1477        /// Partition identifier.
1478        #[prost(int64, tag = "1")]
1479        pub partition_id: i64,
1480        /// Is partition open for write.
1481        #[prost(bool, tag = "2")]
1482        pub active: bool,
1483        /// Ids of partitions which was formed when this partition was split or merged.
1484        #[prost(int64, repeated, tag = "3")]
1485        pub child_partition_ids: ::prost::alloc::vec::Vec<i64>,
1486        /// Ids of partitions from which this partition was formed by split or merge.
1487        #[prost(int64, repeated, tag = "4")]
1488        pub parent_partition_ids: ::prost::alloc::vec::Vec<i64>,
1489        /// Stats for partition, filled only when include_stats in request is true.
1490        #[prost(message, optional, tag = "5")]
1491        pub partition_stats: ::core::option::Option<super::PartitionStats>,
1492        /// Partition location, filled only when include_location in request is true.
1493        #[prost(message, optional, tag = "6")]
1494        pub partition_location: ::core::option::Option<super::PartitionLocation>,
1495        #[prost(message, optional, tag = "7")]
1496        pub key_range: ::core::option::Option<super::PartitionKeyRange>,
1497    }
1498    #[derive(serde::Serialize, serde::Deserialize)]
1499    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1500    pub struct TopicStats {
1501        /// Approximate size of topic.
1502        #[prost(int64, tag = "1")]
1503        pub store_size_bytes: i64,
1504        /// Minimum of timestamps of last write among all partitions.
1505        #[prost(message, optional, tag = "2")]
1506        pub min_last_write_time: ::core::option::Option<
1507            super::super::super::google::protobuf::Timestamp,
1508        >,
1509        /// Maximum of differences between write timestamp and create timestamp for all messages, written during last minute.
1510        #[prost(message, optional, tag = "3")]
1511        pub max_write_time_lag: ::core::option::Option<
1512            super::super::super::google::protobuf::Duration,
1513        >,
1514        /// How much bytes were written statistics.
1515        #[prost(message, optional, tag = "4")]
1516        pub bytes_written: ::core::option::Option<super::MultipleWindowsStat>,
1517    }
1518}
1519/// Describe partition request sent from client to server.
1520#[derive(serde::Serialize, serde::Deserialize)]
1521#[derive(Clone, PartialEq, ::prost::Message)]
1522pub struct DescribePartitionRequest {
1523    #[prost(message, optional, tag = "1")]
1524    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1525    /// Topic path.
1526    #[prost(string, tag = "2")]
1527    pub path: ::prost::alloc::string::String,
1528    /// Partition identifier.
1529    #[prost(int64, tag = "3")]
1530    pub partition_id: i64,
1531    /// Include partition statistics.
1532    #[prost(bool, tag = "4")]
1533    pub include_stats: bool,
1534    /// Include partition location.
1535    #[prost(bool, tag = "5")]
1536    pub include_location: bool,
1537}
1538/// Describe partition response sent from server to client.
1539/// If topic is not existed then response status will be "SCHEME_ERROR".
1540#[derive(serde::Serialize, serde::Deserialize)]
1541#[derive(Clone, PartialEq, ::prost::Message)]
1542pub struct DescribePartitionResponse {
1543    /// Result of request will be inside operation.
1544    #[prost(message, optional, tag = "1")]
1545    pub operation: ::core::option::Option<super::operations::Operation>,
1546}
1547/// Describe partition result message that will be inside DescribePartitionResponse.operation.
1548#[derive(serde::Serialize, serde::Deserialize)]
1549#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1550pub struct DescribePartitionResult {
1551    /// Partitions description.
1552    #[prost(message, optional, tag = "1")]
1553    pub partition: ::core::option::Option<describe_topic_result::PartitionInfo>,
1554}
1555/// Describe topic's consumer request sent from client to server.
1556#[derive(serde::Serialize, serde::Deserialize)]
1557#[derive(Clone, PartialEq, ::prost::Message)]
1558pub struct DescribeConsumerRequest {
1559    #[prost(message, optional, tag = "1")]
1560    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1561    /// Topic path.
1562    #[prost(string, tag = "2")]
1563    pub path: ::prost::alloc::string::String,
1564    /// Consumer name;
1565    #[prost(string, tag = "3")]
1566    pub consumer: ::prost::alloc::string::String,
1567    /// Include consumer statistics.
1568    #[prost(bool, tag = "4")]
1569    pub include_stats: bool,
1570    /// Include partition location.
1571    #[prost(bool, tag = "5")]
1572    pub include_location: bool,
1573}
1574/// Describe topic's consumer response sent from server to client.
1575/// If topic is not existed then response status will be "SCHEME_ERROR".
1576#[derive(serde::Serialize, serde::Deserialize)]
1577#[derive(Clone, PartialEq, ::prost::Message)]
1578pub struct DescribeConsumerResponse {
1579    /// Result of request will be inside operation.
1580    #[prost(message, optional, tag = "1")]
1581    pub operation: ::core::option::Option<super::operations::Operation>,
1582}
1583/// Describe topic's consumer result message that will be inside DescribeConsumerResponse.operation.
1584#[derive(serde::Serialize, serde::Deserialize)]
1585#[derive(Clone, PartialEq, ::prost::Message)]
1586pub struct DescribeConsumerResult {
1587    /// Description of scheme object.
1588    #[prost(message, optional, tag = "1")]
1589    pub self_: ::core::option::Option<super::scheme::Entry>,
1590    #[prost(message, optional, tag = "2")]
1591    pub consumer: ::core::option::Option<Consumer>,
1592    #[prost(message, repeated, tag = "3")]
1593    pub partitions: ::prost::alloc::vec::Vec<describe_consumer_result::PartitionInfo>,
1594}
1595/// Nested message and enum types in `DescribeConsumerResult`.
1596pub mod describe_consumer_result {
1597    #[derive(serde::Serialize, serde::Deserialize)]
1598    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1599    pub struct PartitionInfo {
1600        /// Partition identifier.
1601        #[prost(int64, tag = "1")]
1602        pub partition_id: i64,
1603        /// Is partition open for write.
1604        #[prost(bool, tag = "2")]
1605        pub active: bool,
1606        /// Ids of partitions which was formed when this partition was split or merged.
1607        #[prost(int64, repeated, tag = "3")]
1608        pub child_partition_ids: ::prost::alloc::vec::Vec<i64>,
1609        /// Ids of partitions from which this partition was formed by split or merge.
1610        #[prost(int64, repeated, tag = "4")]
1611        pub parent_partition_ids: ::prost::alloc::vec::Vec<i64>,
1612        /// Stats for partition, filled only when include_stats in request is true.
1613        #[prost(message, optional, tag = "5")]
1614        pub partition_stats: ::core::option::Option<super::PartitionStats>,
1615        /// Stats for consumer of this partition, filled only when include_stats in request is true.
1616        #[prost(message, optional, tag = "6")]
1617        pub partition_consumer_stats: ::core::option::Option<PartitionConsumerStats>,
1618        /// Partition location, filled only when include_location in request is true.
1619        #[prost(message, optional, tag = "7")]
1620        pub partition_location: ::core::option::Option<super::PartitionLocation>,
1621    }
1622    #[derive(serde::Serialize, serde::Deserialize)]
1623    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1624    pub struct PartitionConsumerStats {
1625        /// Last read offset from this partition.
1626        #[prost(int64, tag = "1")]
1627        pub last_read_offset: i64,
1628        /// Committed offset for this partition.
1629        #[prost(int64, tag = "2")]
1630        pub committed_offset: i64,
1631        /// Reading this partition read session identifier.
1632        #[prost(string, tag = "3")]
1633        pub read_session_id: ::prost::alloc::string::String,
1634        /// Timestamp of providing this partition to this session by server.
1635        #[prost(message, optional, tag = "4")]
1636        pub partition_read_session_create_time: ::core::option::Option<
1637            super::super::super::google::protobuf::Timestamp,
1638        >,
1639        /// Timestamp of last read from this partition.
1640        #[prost(message, optional, tag = "5")]
1641        pub last_read_time: ::core::option::Option<
1642            super::super::super::google::protobuf::Timestamp,
1643        >,
1644        /// Maximum of differences between timestamp of read and write timestamp for all messages, read during last minute.
1645        #[prost(message, optional, tag = "6")]
1646        pub max_read_time_lag: ::core::option::Option<
1647            super::super::super::google::protobuf::Duration,
1648        >,
1649        /// Maximum of differences between write timestamp and create timestamp for all messages, read during last minute.
1650        #[prost(message, optional, tag = "7")]
1651        pub max_write_time_lag: ::core::option::Option<
1652            super::super::super::google::protobuf::Duration,
1653        >,
1654        /// The difference between the write timestamp of the last commited message and the current time.
1655        #[prost(message, optional, tag = "13")]
1656        pub max_committed_time_lag: ::core::option::Option<
1657            super::super::super::google::protobuf::Duration,
1658        >,
1659        /// How much bytes were read during several windows statistics from this partition.
1660        #[prost(message, optional, tag = "8")]
1661        pub bytes_read: ::core::option::Option<super::MultipleWindowsStat>,
1662        /// Read session name, provided by client.
1663        #[prost(string, tag = "11")]
1664        pub reader_name: ::prost::alloc::string::String,
1665        /// Host where read session connected.
1666        #[prost(int32, tag = "12")]
1667        pub connection_node_id: i32,
1668    }
1669}
1670#[derive(serde::Serialize, serde::Deserialize)]
1671#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1672pub struct PartitionStats {
1673    /// Partition contains messages with offsets in range \[start, end).
1674    #[prost(message, optional, tag = "1")]
1675    pub partition_offsets: ::core::option::Option<OffsetsRange>,
1676    /// Approximate size of partition.
1677    #[prost(int64, tag = "2")]
1678    pub store_size_bytes: i64,
1679    /// Timestamp of last write.
1680    #[prost(message, optional, tag = "3")]
1681    pub last_write_time: ::core::option::Option<
1682        super::super::google::protobuf::Timestamp,
1683    >,
1684    /// Maximum of differences between write timestamp and create timestamp for all messages, written during last minute.
1685    #[prost(message, optional, tag = "4")]
1686    pub max_write_time_lag: ::core::option::Option<
1687        super::super::google::protobuf::Duration,
1688    >,
1689    /// How much bytes were written during several windows in this partition.
1690    #[prost(message, optional, tag = "5")]
1691    pub bytes_written: ::core::option::Option<MultipleWindowsStat>,
1692    /// Partition host. Useful for debugging purposes.
1693    /// Use PartitionLocation
1694    #[deprecated]
1695    #[prost(int32, tag = "8")]
1696    pub partition_node_id: i32,
1697}
1698/// Update existing topic request sent from client to server.
1699#[derive(serde::Serialize, serde::Deserialize)]
1700#[derive(Clone, PartialEq, ::prost::Message)]
1701pub struct AlterTopicRequest {
1702    #[prost(message, optional, tag = "1")]
1703    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1704    /// Topic path.
1705    #[prost(string, tag = "2")]
1706    pub path: ::prost::alloc::string::String,
1707    /// partitioning_settings
1708    #[prost(message, optional, tag = "3")]
1709    pub alter_partitioning_settings: ::core::option::Option<AlterPartitioningSettings>,
1710    /// Retention settings.
1711    /// Currently, only one limit may be set, so other should not be set.
1712    /// How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
1713    /// Default limit - 36 hours.
1714    #[prost(message, optional, tag = "4")]
1715    pub set_retention_period: ::core::option::Option<
1716        super::super::google::protobuf::Duration,
1717    >,
1718    /// How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
1719    #[prost(int64, optional, tag = "5")]
1720    pub set_retention_storage_mb: ::core::option::Option<i64>,
1721    /// List of allowed codecs for writers.
1722    /// Writes with codec not from this list are forbidden.
1723    /// If empty, codec compatibility check for the topic is disabled.
1724    #[prost(message, optional, tag = "7")]
1725    pub set_supported_codecs: ::core::option::Option<SupportedCodecs>,
1726    /// Partition write speed in bytes per second. Must be less than database limit. Default limit - 1 MB/s.
1727    #[prost(int64, optional, tag = "8")]
1728    pub set_partition_write_speed_bytes_per_second: ::core::option::Option<i64>,
1729    /// Burst size for write in partition, in bytes. Must be less than database limit. Default limit - 1 MB.
1730    #[prost(int64, optional, tag = "9")]
1731    pub set_partition_write_burst_bytes: ::core::option::Option<i64>,
1732    /// User and server attributes of topic. Server attributes starts from "\_" and will be validated by server.
1733    /// Leave the value blank to drop an attribute.
1734    #[prost(map = "string, string", tag = "10")]
1735    pub alter_attributes: ::std::collections::HashMap<
1736        ::prost::alloc::string::String,
1737        ::prost::alloc::string::String,
1738    >,
1739    /// Add consumers.
1740    #[prost(message, repeated, tag = "11")]
1741    pub add_consumers: ::prost::alloc::vec::Vec<Consumer>,
1742    /// Remove consumers (by their names)
1743    #[prost(string, repeated, tag = "12")]
1744    pub drop_consumers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1745    /// Alter consumers
1746    #[prost(message, repeated, tag = "13")]
1747    pub alter_consumers: ::prost::alloc::vec::Vec<AlterConsumer>,
1748    /// Set metering mode for topic in serverless database.
1749    #[prost(enumeration = "MeteringMode", tag = "14")]
1750    pub set_metering_mode: i32,
1751}
1752/// Update topic response sent from server to client.
1753#[derive(serde::Serialize, serde::Deserialize)]
1754#[derive(Clone, PartialEq, ::prost::Message)]
1755pub struct AlterTopicResponse {
1756    /// Result of request will be inside operation.
1757    #[prost(message, optional, tag = "1")]
1758    pub operation: ::core::option::Option<super::operations::Operation>,
1759}
1760/// Update topic result message that will be inside UpdateTopicResponse.operation.
1761#[derive(serde::Serialize, serde::Deserialize)]
1762#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1763pub struct AlterTopicResult {}
1764/// Drop topic request sent from client to server.
1765#[derive(serde::Serialize, serde::Deserialize)]
1766#[derive(Clone, PartialEq, ::prost::Message)]
1767pub struct DropTopicRequest {
1768    #[prost(message, optional, tag = "1")]
1769    pub operation_params: ::core::option::Option<super::operations::OperationParams>,
1770    /// Topic path.
1771    #[prost(string, tag = "2")]
1772    pub path: ::prost::alloc::string::String,
1773}
1774/// Drop topic response sent from server to client.
1775/// If topic not exists then response status will be "SCHEME_ERROR".
1776#[derive(serde::Serialize, serde::Deserialize)]
1777#[derive(Clone, PartialEq, ::prost::Message)]
1778pub struct DropTopicResponse {
1779    /// Result of request will be inside operation.
1780    #[prost(message, optional, tag = "1")]
1781    pub operation: ::core::option::Option<super::operations::Operation>,
1782}
1783/// Drop topic result message that will be inside DropTopicResponse.operation.
1784#[derive(serde::Serialize, serde::Deserialize)]
1785#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1786pub struct DropTopicResult {}
1787#[derive(serde::Serialize, serde::Deserialize)]
1788#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1789#[repr(i32)]
1790pub enum Codec {
1791    Unspecified = 0,
1792    Raw = 1,
1793    Gzip = 2,
1794    Lzop = 3,
1795    Zstd = 4,
1796    /// User-defined codecs from 10000 to 19999
1797    Custom = 10000,
1798}
1799impl Codec {
1800    /// String value of the enum field names used in the ProtoBuf definition.
1801    /// The values are not transformed in any way and thus are considered stable
1802    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1803    pub fn as_str_name(&self) -> &'static str {
1804        match self {
1805            Self::Unspecified => "CODEC_UNSPECIFIED",
1806            Self::Raw => "CODEC_RAW",
1807            Self::Gzip => "CODEC_GZIP",
1808            Self::Lzop => "CODEC_LZOP",
1809            Self::Zstd => "CODEC_ZSTD",
1810            Self::Custom => "CODEC_CUSTOM",
1811        }
1812    }
1813    /// Creates an enum from field names used in the ProtoBuf definition.
1814    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1815        match value {
1816            "CODEC_UNSPECIFIED" => Some(Self::Unspecified),
1817            "CODEC_RAW" => Some(Self::Raw),
1818            "CODEC_GZIP" => Some(Self::Gzip),
1819            "CODEC_LZOP" => Some(Self::Lzop),
1820            "CODEC_ZSTD" => Some(Self::Zstd),
1821            "CODEC_CUSTOM" => Some(Self::Custom),
1822            _ => None,
1823        }
1824    }
1825}
1826#[derive(serde::Serialize, serde::Deserialize)]
1827#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1828#[repr(i32)]
1829pub enum AutoPartitioningStrategy {
1830    /// The auto partitioning algorithm is not specified. The default value will be used.
1831    Unspecified = 0,
1832    /// The auto partitioning is disabled.
1833    Disabled = 1,
1834    /// The auto partitioning algorithm will increase partitions count depending on the load characteristics.
1835    /// The auto partitioning algorithm will never decrease the number of partitions.
1836    ScaleUp = 2,
1837    /// The auto partitioning algorithm will both increase and decrease partitions count depending on the load characteristics.
1838    ScaleUpAndDown = 3,
1839    /// The auto partitioning is paused.
1840    Paused = 4,
1841}
1842impl AutoPartitioningStrategy {
1843    /// String value of the enum field names used in the ProtoBuf definition.
1844    /// The values are not transformed in any way and thus are considered stable
1845    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1846    pub fn as_str_name(&self) -> &'static str {
1847        match self {
1848            Self::Unspecified => "AUTO_PARTITIONING_STRATEGY_UNSPECIFIED",
1849            Self::Disabled => "AUTO_PARTITIONING_STRATEGY_DISABLED",
1850            Self::ScaleUp => "AUTO_PARTITIONING_STRATEGY_SCALE_UP",
1851            Self::ScaleUpAndDown => "AUTO_PARTITIONING_STRATEGY_SCALE_UP_AND_DOWN",
1852            Self::Paused => "AUTO_PARTITIONING_STRATEGY_PAUSED",
1853        }
1854    }
1855    /// Creates an enum from field names used in the ProtoBuf definition.
1856    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1857        match value {
1858            "AUTO_PARTITIONING_STRATEGY_UNSPECIFIED" => Some(Self::Unspecified),
1859            "AUTO_PARTITIONING_STRATEGY_DISABLED" => Some(Self::Disabled),
1860            "AUTO_PARTITIONING_STRATEGY_SCALE_UP" => Some(Self::ScaleUp),
1861            "AUTO_PARTITIONING_STRATEGY_SCALE_UP_AND_DOWN" => Some(Self::ScaleUpAndDown),
1862            "AUTO_PARTITIONING_STRATEGY_PAUSED" => Some(Self::Paused),
1863            _ => None,
1864        }
1865    }
1866}
1867/// Metering mode specifies the method used to determine consumption of resources by the topic.
1868/// This settings will have an effect only in a serverless database.
1869#[derive(serde::Serialize, serde::Deserialize)]
1870#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1871#[repr(i32)]
1872pub enum MeteringMode {
1873    /// Use default
1874    Unspecified = 0,
1875    /// Metering based on resource reservation
1876    ReservedCapacity = 1,
1877    /// Metering based on actual consumption. Default.
1878    RequestUnits = 2,
1879}
1880impl MeteringMode {
1881    /// String value of the enum field names used in the ProtoBuf definition.
1882    /// The values are not transformed in any way and thus are considered stable
1883    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1884    pub fn as_str_name(&self) -> &'static str {
1885        match self {
1886            Self::Unspecified => "METERING_MODE_UNSPECIFIED",
1887            Self::ReservedCapacity => "METERING_MODE_RESERVED_CAPACITY",
1888            Self::RequestUnits => "METERING_MODE_REQUEST_UNITS",
1889        }
1890    }
1891    /// Creates an enum from field names used in the ProtoBuf definition.
1892    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1893        match value {
1894            "METERING_MODE_UNSPECIFIED" => Some(Self::Unspecified),
1895            "METERING_MODE_RESERVED_CAPACITY" => Some(Self::ReservedCapacity),
1896            "METERING_MODE_REQUEST_UNITS" => Some(Self::RequestUnits),
1897            _ => None,
1898        }
1899    }
1900}