ydb-grpc 0.2.2

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