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
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseHeader {
    /// cluster_id is the ID of the cluster which sent the response.
    #[prost(uint64, tag = "1")]
    pub cluster_id: u64,
    /// member_id is the ID of the member which sent the response.
    #[prost(uint64, tag = "2")]
    pub member_id: u64,
    /// revision is the key-value store revision when the request was applied.
    /// For watch progress responses, the header.revision indicates progress. All future events
    /// recieved in this stream are guaranteed to have a higher revision number than the
    /// header.revision number.
    #[prost(int64, tag = "3")]
    pub revision: i64,
    /// raft_term is the raft term when the request was applied.
    #[prost(uint64, tag = "4")]
    pub raft_term: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RangeRequest {
    /// key is the first key for the range. If range_end is not given, the request only looks up key.
    #[prost(bytes, tag = "1")]
    pub key: std::vec::Vec<u8>,
    /// range_end is the upper bound on the requested range [key, range_end).
    /// If range_end is '\0', the range is all keys >= key.
    /// If range_end is key plus one (e.g., "aa"+1 == "ab", "a\xff"+1 == "b"),
    /// then the range request gets all keys prefixed with key.
    /// If both key and range_end are '\0', then the range request returns all keys.
    #[prost(bytes, tag = "2")]
    pub range_end: std::vec::Vec<u8>,
    /// limit is a limit on the number of keys returned for the request. When limit is set to 0,
    /// it is treated as no limit.
    #[prost(int64, tag = "3")]
    pub limit: i64,
    /// revision is the point-in-time of the key-value store to use for the range.
    /// If revision is less or equal to zero, the range is over the newest key-value store.
    /// If the revision has been compacted, ErrCompacted is returned as a response.
    #[prost(int64, tag = "4")]
    pub revision: i64,
    /// sort_order is the order for returned sorted results.
    #[prost(enumeration = "range_request::SortOrder", tag = "5")]
    pub sort_order: i32,
    /// sort_target is the key-value field to use for sorting.
    #[prost(enumeration = "range_request::SortTarget", tag = "6")]
    pub sort_target: i32,
    /// serializable sets the range request to use serializable member-local reads.
    /// Range requests are linearizable by default; linearizable requests have higher
    /// latency and lower throughput than serializable requests but reflect the current
    /// consensus of the cluster. For better performance, in exchange for possible stale reads,
    /// a serializable range request is served locally without needing to reach consensus
    /// with other nodes in the cluster.
    #[prost(bool, tag = "7")]
    pub serializable: bool,
    /// keys_only when set returns only the keys and not the values.
    #[prost(bool, tag = "8")]
    pub keys_only: bool,
    /// count_only when set returns only the count of the keys in the range.
    #[prost(bool, tag = "9")]
    pub count_only: bool,
    /// min_mod_revision is the lower bound for returned key mod revisions; all keys with
    /// lesser mod revisions will be filtered away.
    #[prost(int64, tag = "10")]
    pub min_mod_revision: i64,
    /// max_mod_revision is the upper bound for returned key mod revisions; all keys with
    /// greater mod revisions will be filtered away.
    #[prost(int64, tag = "11")]
    pub max_mod_revision: i64,
    /// min_create_revision is the lower bound for returned key create revisions; all keys with
    /// lesser create revisions will be filtered away.
    #[prost(int64, tag = "12")]
    pub min_create_revision: i64,
    /// max_create_revision is the upper bound for returned key create revisions; all keys with
    /// greater create revisions will be filtered away.
    #[prost(int64, tag = "13")]
    pub max_create_revision: i64,
}
pub mod range_request {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum SortOrder {
        /// default, no sorting
        None = 0,
        /// lowest target value first
        Ascend = 1,
        /// highest target value first
        Descend = 2,
    }
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum SortTarget {
        Key = 0,
        Version = 1,
        Create = 2,
        Mod = 3,
        Value = 4,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RangeResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// kvs is the list of key-value pairs matched by the range request.
    /// kvs is empty when count is requested.
    #[prost(message, repeated, tag = "2")]
    pub kvs: ::std::vec::Vec<super::mvccpb::KeyValue>,
    /// more indicates if there are more keys to return in the requested range.
    #[prost(bool, tag = "3")]
    pub more: bool,
    /// count is set to the number of keys within the range when requested.
    #[prost(int64, tag = "4")]
    pub count: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutRequest {
    /// key is the key, in bytes, to put into the key-value store.
    #[prost(bytes, tag = "1")]
    pub key: std::vec::Vec<u8>,
    /// value is the value, in bytes, to associate with the key in the key-value store.
    #[prost(bytes, tag = "2")]
    pub value: std::vec::Vec<u8>,
    /// lease is the lease ID to associate with the key in the key-value store. A lease
    /// value of 0 indicates no lease.
    #[prost(int64, tag = "3")]
    pub lease: i64,
    /// If prev_kv is set, etcd gets the previous key-value pair before changing it.
    /// The previous key-value pair will be returned in the put response.
    #[prost(bool, tag = "4")]
    pub prev_kv: bool,
    /// If ignore_value is set, etcd updates the key using its current value.
    /// Returns an error if the key does not exist.
    #[prost(bool, tag = "5")]
    pub ignore_value: bool,
    /// If ignore_lease is set, etcd updates the key using its current lease.
    /// Returns an error if the key does not exist.
    #[prost(bool, tag = "6")]
    pub ignore_lease: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PutResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// if prev_kv is set in the request, the previous key-value pair will be returned.
    #[prost(message, optional, tag = "2")]
    pub prev_kv: ::std::option::Option<super::mvccpb::KeyValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRangeRequest {
    /// key is the first key to delete in the range.
    #[prost(bytes, tag = "1")]
    pub key: std::vec::Vec<u8>,
    /// range_end is the key following the last key to delete for the range [key, range_end).
    /// If range_end is not given, the range is defined to contain only the key argument.
    /// If range_end is one bit larger than the given key, then the range is all the keys
    /// with the prefix (the given key).
    /// If range_end is '\0', the range is all keys greater than or equal to the key argument.
    #[prost(bytes, tag = "2")]
    pub range_end: std::vec::Vec<u8>,
    /// If prev_kv is set, etcd gets the previous key-value pairs before deleting it.
    /// The previous key-value pairs will be returned in the delete response.
    #[prost(bool, tag = "3")]
    pub prev_kv: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRangeResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// deleted is the number of keys deleted by the delete range request.
    #[prost(int64, tag = "2")]
    pub deleted: i64,
    /// if prev_kv is set in the request, the previous key-value pairs will be returned.
    #[prost(message, repeated, tag = "3")]
    pub prev_kvs: ::std::vec::Vec<super::mvccpb::KeyValue>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestOp {
    /// request is a union of request types accepted by a transaction.
    #[prost(oneof = "request_op::Request", tags = "1, 2, 3, 4")]
    pub request: ::std::option::Option<request_op::Request>,
}
pub mod request_op {
    /// request is a union of request types accepted by a transaction.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Request {
        #[prost(message, tag = "1")]
        RequestRange(super::RangeRequest),
        #[prost(message, tag = "2")]
        RequestPut(super::PutRequest),
        #[prost(message, tag = "3")]
        RequestDeleteRange(super::DeleteRangeRequest),
        #[prost(message, tag = "4")]
        RequestTxn(super::TxnRequest),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseOp {
    /// response is a union of response types returned by a transaction.
    #[prost(oneof = "response_op::Response", tags = "1, 2, 3, 4")]
    pub response: ::std::option::Option<response_op::Response>,
}
pub mod response_op {
    /// response is a union of response types returned by a transaction.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        ResponseRange(super::RangeResponse),
        #[prost(message, tag = "2")]
        ResponsePut(super::PutResponse),
        #[prost(message, tag = "3")]
        ResponseDeleteRange(super::DeleteRangeResponse),
        #[prost(message, tag = "4")]
        ResponseTxn(super::TxnResponse),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Compare {
    /// result is logical comparison operation for this comparison.
    #[prost(enumeration = "compare::CompareResult", tag = "1")]
    pub result: i32,
    /// target is the key-value field to inspect for the comparison.
    #[prost(enumeration = "compare::CompareTarget", tag = "2")]
    pub target: i32,
    /// key is the subject key for the comparison operation.
    #[prost(bytes, tag = "3")]
    pub key: std::vec::Vec<u8>,
    /// range_end compares the given target to all keys in the range [key, range_end).
    /// See RangeRequest for more details on key ranges.
    ///
    /// TODO: fill out with most of the rest of RangeRequest fields when needed.
    #[prost(bytes, tag = "64")]
    pub range_end: std::vec::Vec<u8>,
    #[prost(oneof = "compare::TargetUnion", tags = "4, 5, 6, 7, 8")]
    pub target_union: ::std::option::Option<compare::TargetUnion>,
}
pub mod compare {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum CompareResult {
        Equal = 0,
        Greater = 1,
        Less = 2,
        NotEqual = 3,
    }
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum CompareTarget {
        Version = 0,
        Create = 1,
        Mod = 2,
        Value = 3,
        Lease = 4,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum TargetUnion {
        /// version is the version of the given key
        #[prost(int64, tag = "4")]
        Version(i64),
        /// create_revision is the creation revision of the given key
        #[prost(int64, tag = "5")]
        CreateRevision(i64),
        /// mod_revision is the last modified revision of the given key.
        #[prost(int64, tag = "6")]
        ModRevision(i64),
        /// value is the value of the given key, in bytes.
        #[prost(bytes, tag = "7")]
        Value(std::vec::Vec<u8>),
        /// lease is the lease id of the given key.
        ///
        /// leave room for more target_union field tags, jump to 64
        #[prost(int64, tag = "8")]
        Lease(i64),
    }
}
/// From google paxosdb paper:
/// Our implementation hinges around a powerful primitive which we call MultiOp. All other database
/// operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically
/// and consists of three components:
/// 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check
/// for the absence or presence of a value, or compare with a given value. Two different tests in the guard
/// may apply to the same or different entries in the database. All tests in the guard are applied and
/// MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise
/// it executes f op (see item 3 below).
/// 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or
/// lookup operation, and applies to a single database entry. Two different operations in the list may apply
/// to the same or different entries in the database. These operations are executed
/// if guard evaluates to
/// true.
/// 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxnRequest {
    /// compare is a list of predicates representing a conjunction of terms.
    /// If the comparisons succeed, then the success requests will be processed in order,
    /// and the response will contain their respective responses in order.
    /// If the comparisons fail, then the failure requests will be processed in order,
    /// and the response will contain their respective responses in order.
    #[prost(message, repeated, tag = "1")]
    pub compare: ::std::vec::Vec<Compare>,
    /// success is a list of requests which will be applied when compare evaluates to true.
    #[prost(message, repeated, tag = "2")]
    pub success: ::std::vec::Vec<RequestOp>,
    /// failure is a list of requests which will be applied when compare evaluates to false.
    #[prost(message, repeated, tag = "3")]
    pub failure: ::std::vec::Vec<RequestOp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TxnResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// succeeded is set to true if the compare evaluated to true or false otherwise.
    #[prost(bool, tag = "2")]
    pub succeeded: bool,
    /// responses is a list of responses corresponding to the results from applying
    /// success if succeeded is true or failure if succeeded is false.
    #[prost(message, repeated, tag = "3")]
    pub responses: ::std::vec::Vec<ResponseOp>,
}
/// CompactionRequest compacts the key-value store up to a given revision. All superseded keys
/// with a revision less than the compaction revision will be removed.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactionRequest {
    /// revision is the key-value store revision for the compaction operation.
    #[prost(int64, tag = "1")]
    pub revision: i64,
    /// physical is set so the RPC will wait until the compaction is physically
    /// applied to the local database such that compacted entries are totally
    /// removed from the backend database.
    #[prost(bool, tag = "2")]
    pub physical: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactionResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashKvRequest {
    /// revision is the key-value store revision for the hash operation.
    #[prost(int64, tag = "1")]
    pub revision: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashKvResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// hash is the hash value computed from the responding member's MVCC keys up to a given revision.
    #[prost(uint32, tag = "2")]
    pub hash: u32,
    /// compact_revision is the compacted revision of key-value store when hash begins.
    #[prost(int64, tag = "3")]
    pub compact_revision: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HashResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// hash is the hash value computed from the responding member's KV's backend.
    #[prost(uint32, tag = "2")]
    pub hash: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SnapshotResponse {
    /// header has the current key-value store information. The first header in the snapshot
    /// stream indicates the point in time of the snapshot.
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// remaining_bytes is the number of blob bytes to be sent after this message
    #[prost(uint64, tag = "2")]
    pub remaining_bytes: u64,
    /// blob contains the next chunk of the snapshot in the snapshot stream.
    #[prost(bytes, tag = "3")]
    pub blob: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchRequest {
    /// request_union is a request to either create a new watcher or cancel an existing watcher.
    #[prost(oneof = "watch_request::RequestUnion", tags = "1, 2, 3")]
    pub request_union: ::std::option::Option<watch_request::RequestUnion>,
}
pub mod watch_request {
    /// request_union is a request to either create a new watcher or cancel an existing watcher.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum RequestUnion {
        #[prost(message, tag = "1")]
        CreateRequest(super::WatchCreateRequest),
        #[prost(message, tag = "2")]
        CancelRequest(super::WatchCancelRequest),
        #[prost(message, tag = "3")]
        ProgressRequest(super::WatchProgressRequest),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchCreateRequest {
    /// key is the key to register for watching.
    #[prost(bytes, tag = "1")]
    pub key: std::vec::Vec<u8>,
    /// range_end is the end of the range [key, range_end) to watch. If range_end is not given,
    /// only the key argument is watched. If range_end is equal to '\0', all keys greater than
    /// or equal to the key argument are watched.
    /// If the range_end is one bit larger than the given key,
    /// then all keys with the prefix (the given key) will be watched.
    #[prost(bytes, tag = "2")]
    pub range_end: std::vec::Vec<u8>,
    /// start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
    #[prost(int64, tag = "3")]
    pub start_revision: i64,
    /// progress_notify is set so that the etcd server will periodically send a WatchResponse with
    /// no events to the new watcher if there are no recent events. It is useful when clients
    /// wish to recover a disconnected watcher starting from a recent known revision.
    /// The etcd server may decide how often it will send notifications based on current load.
    #[prost(bool, tag = "4")]
    pub progress_notify: bool,
    /// filters filter the events at server side before it sends back to the watcher.
    #[prost(enumeration = "watch_create_request::FilterType", repeated, tag = "5")]
    pub filters: ::std::vec::Vec<i32>,
    /// If prev_kv is set, created watcher gets the previous KV before the event happens.
    /// If the previous KV is already compacted, nothing will be returned.
    #[prost(bool, tag = "6")]
    pub prev_kv: bool,
    /// If watch_id is provided and non-zero, it will be assigned to this watcher.
    /// Since creating a watcher in etcd is not a synchronous operation,
    /// this can be used ensure that ordering is correct when creating multiple
    /// watchers on the same stream. Creating a watcher with an ID already in
    /// use on the stream will cause an error to be returned.
    #[prost(int64, tag = "7")]
    pub watch_id: i64,
    /// fragment enables splitting large revisions into multiple watch responses.
    #[prost(bool, tag = "8")]
    pub fragment: bool,
}
pub mod watch_create_request {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum FilterType {
        /// filter out put event.
        Noput = 0,
        /// filter out delete event.
        Nodelete = 1,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchCancelRequest {
    /// watch_id is the watcher id to cancel so that no more events are transmitted.
    #[prost(int64, tag = "1")]
    pub watch_id: i64,
}
/// Requests the a watch stream progress status be sent in the watch response stream as soon as
/// possible.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchProgressRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// watch_id is the ID of the watcher that corresponds to the response.
    #[prost(int64, tag = "2")]
    pub watch_id: i64,
    /// created is set to true if the response is for a create watch request.
    /// The client should record the watch_id and expect to receive events for
    /// the created watcher from the same stream.
    /// All events sent to the created watcher will attach with the same watch_id.
    #[prost(bool, tag = "3")]
    pub created: bool,
    /// canceled is set to true if the response is for a cancel watch request.
    /// No further events will be sent to the canceled watcher.
    #[prost(bool, tag = "4")]
    pub canceled: bool,
    /// compact_revision is set to the minimum index if a watcher tries to watch
    /// at a compacted index.
    ///
    /// This happens when creating a watcher at a compacted revision or the watcher cannot
    /// catch up with the progress of the key-value store.
    ///
    /// The client should treat the watcher as canceled and should not try to create any
    /// watcher with the same start_revision again.
    #[prost(int64, tag = "5")]
    pub compact_revision: i64,
    /// cancel_reason indicates the reason for canceling the watcher.
    #[prost(string, tag = "6")]
    pub cancel_reason: std::string::String,
    /// framgment is true if large watch response was split over multiple responses.
    #[prost(bool, tag = "7")]
    pub fragment: bool,
    #[prost(message, repeated, tag = "11")]
    pub events: ::std::vec::Vec<super::mvccpb::Event>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseGrantRequest {
    /// TTL is the advisory time-to-live in seconds. Expired lease will return -1.
    #[prost(int64, tag = "1")]
    pub ttl: i64,
    /// ID is the requested ID for the lease. If ID is set to 0, the lessor chooses an ID.
    #[prost(int64, tag = "2")]
    pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseGrantResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// ID is the lease ID for the granted lease.
    #[prost(int64, tag = "2")]
    pub id: i64,
    /// TTL is the server chosen lease time-to-live in seconds.
    #[prost(int64, tag = "3")]
    pub ttl: i64,
    #[prost(string, tag = "4")]
    pub error: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseRevokeRequest {
    /// ID is the lease ID to revoke. When the ID is revoked, all associated keys will be deleted.
    #[prost(int64, tag = "1")]
    pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseRevokeResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpoint {
    /// ID is the lease ID to checkpoint.
    #[prost(int64, tag = "1")]
    pub id: i64,
    /// Remaining_TTL is the remaining time until expiry of the lease.
    #[prost(int64, tag = "2")]
    pub remaining_ttl: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpointRequest {
    #[prost(message, repeated, tag = "1")]
    pub checkpoints: ::std::vec::Vec<LeaseCheckpoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseCheckpointResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseKeepAliveRequest {
    /// ID is the lease ID for the lease to keep alive.
    #[prost(int64, tag = "1")]
    pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseKeepAliveResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// ID is the lease ID from the keep alive request.
    #[prost(int64, tag = "2")]
    pub id: i64,
    /// TTL is the new time-to-live for the lease.
    #[prost(int64, tag = "3")]
    pub ttl: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseTimeToLiveRequest {
    /// ID is the lease ID for the lease.
    #[prost(int64, tag = "1")]
    pub id: i64,
    /// keys is true to query all the keys attached to this lease.
    #[prost(bool, tag = "2")]
    pub keys: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseTimeToLiveResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// ID is the lease ID from the keep alive request.
    #[prost(int64, tag = "2")]
    pub id: i64,
    /// TTL is the remaining TTL in seconds for the lease; the lease will expire in under TTL+1 seconds.
    #[prost(int64, tag = "3")]
    pub ttl: i64,
    /// GrantedTTL is the initial granted time in seconds upon lease creation/renewal.
    #[prost(int64, tag = "4")]
    pub granted_ttl: i64,
    /// Keys is the list of keys attached to this lease.
    #[prost(bytes, repeated, tag = "5")]
    pub keys: ::std::vec::Vec<std::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseLeasesRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseStatus {
    /// TODO: int64 TTL = 2;
    #[prost(int64, tag = "1")]
    pub id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LeaseLeasesResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    #[prost(message, repeated, tag = "2")]
    pub leases: ::std::vec::Vec<LeaseStatus>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Member {
    /// ID is the member ID for this member.
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// name is the human-readable name of the member. If the member is not started, the name will be an empty string.
    #[prost(string, tag = "2")]
    pub name: std::string::String,
    /// peerURLs is the list of URLs the member exposes to the cluster for communication.
    #[prost(string, repeated, tag = "3")]
    pub peer_ur_ls: ::std::vec::Vec<std::string::String>,
    /// clientURLs is the list of URLs the member exposes to clients for communication. If the member is not started, clientURLs will be empty.
    #[prost(string, repeated, tag = "4")]
    pub client_ur_ls: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberAddRequest {
    /// peerURLs is the list of URLs the added member will use to communicate with the cluster.
    #[prost(string, repeated, tag = "1")]
    pub peer_ur_ls: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberAddResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// member is the member information for the added member.
    #[prost(message, optional, tag = "2")]
    pub member: ::std::option::Option<Member>,
    /// members is a list of all members after adding the new member.
    #[prost(message, repeated, tag = "3")]
    pub members: ::std::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberRemoveRequest {
    /// ID is the member ID of the member to remove.
    #[prost(uint64, tag = "1")]
    pub id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberRemoveResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// members is a list of all members after removing the member.
    #[prost(message, repeated, tag = "2")]
    pub members: ::std::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberUpdateRequest {
    /// ID is the member ID of the member to update.
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// peerURLs is the new list of URLs the member will use to communicate with the cluster.
    #[prost(string, repeated, tag = "2")]
    pub peer_ur_ls: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberUpdateResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// members is a list of all members after updating the member.
    #[prost(message, repeated, tag = "2")]
    pub members: ::std::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberListRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MemberListResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// members is a list of all members associated with the cluster.
    #[prost(message, repeated, tag = "2")]
    pub members: ::std::vec::Vec<Member>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DefragmentRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DefragmentResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLeaderRequest {
    /// targetID is the node ID for the new leader.
    #[prost(uint64, tag = "1")]
    pub target_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MoveLeaderResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmRequest {
    /// action is the kind of alarm request to issue. The action
    /// may GET alarm statuses, ACTIVATE an alarm, or DEACTIVATE a
    /// raised alarm.
    #[prost(enumeration = "alarm_request::AlarmAction", tag = "1")]
    pub action: i32,
    /// memberID is the ID of the member associated with the alarm. If memberID is 0, the
    /// alarm request covers all members.
    #[prost(uint64, tag = "2")]
    pub member_id: u64,
    /// alarm is the type of alarm to consider for this request.
    #[prost(enumeration = "AlarmType", tag = "3")]
    pub alarm: i32,
}
pub mod alarm_request {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum AlarmAction {
        Get = 0,
        Activate = 1,
        Deactivate = 2,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmMember {
    /// memberID is the ID of the member associated with the raised alarm.
    #[prost(uint64, tag = "1")]
    pub member_id: u64,
    /// alarm is the type of alarm which has been raised.
    #[prost(enumeration = "AlarmType", tag = "2")]
    pub alarm: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlarmResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// alarms is a list of alarms associated with the alarm request.
    #[prost(message, repeated, tag = "2")]
    pub alarms: ::std::vec::Vec<AlarmMember>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatusRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatusResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// version is the cluster protocol version used by the responding member.
    #[prost(string, tag = "2")]
    pub version: std::string::String,
    /// dbSize is the size of the backend database physically allocated, in bytes, of the responding member.
    #[prost(int64, tag = "3")]
    pub db_size: i64,
    /// leader is the member ID which the responding member believes is the current leader.
    #[prost(uint64, tag = "4")]
    pub leader: u64,
    /// raftIndex is the current raft committed index of the responding member.
    #[prost(uint64, tag = "5")]
    pub raft_index: u64,
    /// raftTerm is the current raft term of the responding member.
    #[prost(uint64, tag = "6")]
    pub raft_term: u64,
    /// raftAppliedIndex is the current raft applied index of the responding member.
    #[prost(uint64, tag = "7")]
    pub raft_applied_index: u64,
    /// errors contains alarm/health information and status.
    #[prost(string, repeated, tag = "8")]
    pub errors: ::std::vec::Vec<std::string::String>,
    /// dbSizeInUse is the size of the backend database logically in use, in bytes, of the responding member.
    #[prost(int64, tag = "9")]
    pub db_size_in_use: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthEnableRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthDisableRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticateRequest {
    #[prost(string, tag = "1")]
    pub name: std::string::String,
    #[prost(string, tag = "2")]
    pub password: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserAddRequest {
    #[prost(string, tag = "1")]
    pub name: std::string::String,
    #[prost(string, tag = "2")]
    pub password: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGetRequest {
    #[prost(string, tag = "1")]
    pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserDeleteRequest {
    /// name is the name of the user to delete.
    #[prost(string, tag = "1")]
    pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserChangePasswordRequest {
    /// name is the name of the user whose password is being changed.
    #[prost(string, tag = "1")]
    pub name: std::string::String,
    /// password is the new password for the user.
    #[prost(string, tag = "2")]
    pub password: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGrantRoleRequest {
    /// user is the name of the user which should be granted a given role.
    #[prost(string, tag = "1")]
    pub user: std::string::String,
    /// role is the name of the role to grant to the user.
    #[prost(string, tag = "2")]
    pub role: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserRevokeRoleRequest {
    #[prost(string, tag = "1")]
    pub name: std::string::String,
    #[prost(string, tag = "2")]
    pub role: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleAddRequest {
    /// name is the name of the role to add to the authentication system.
    #[prost(string, tag = "1")]
    pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGetRequest {
    #[prost(string, tag = "1")]
    pub role: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserListRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleListRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleDeleteRequest {
    #[prost(string, tag = "1")]
    pub role: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGrantPermissionRequest {
    /// name is the name of the role which will be granted the permission.
    #[prost(string, tag = "1")]
    pub name: std::string::String,
    /// perm is the permission to grant to the role.
    #[prost(message, optional, tag = "2")]
    pub perm: ::std::option::Option<super::authpb::Permission>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleRevokePermissionRequest {
    #[prost(string, tag = "1")]
    pub role: std::string::String,
    #[prost(bytes, tag = "2")]
    pub key: std::vec::Vec<u8>,
    #[prost(bytes, tag = "3")]
    pub range_end: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthEnableResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthDisableResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthenticateResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    /// token is an authorized token that can be used in succeeding RPCs
    #[prost(string, tag = "2")]
    pub token: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserAddResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGetResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    #[prost(string, repeated, tag = "2")]
    pub roles: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserDeleteResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserChangePasswordResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserGrantRoleResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserRevokeRoleResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleAddResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGetResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    #[prost(message, repeated, tag = "2")]
    pub perm: ::std::vec::Vec<super::authpb::Permission>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleListResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    #[prost(string, repeated, tag = "2")]
    pub roles: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthUserListResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
    #[prost(string, repeated, tag = "2")]
    pub users: ::std::vec::Vec<std::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleDeleteResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleGrantPermissionResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthRoleRevokePermissionResponse {
    #[prost(message, optional, tag = "1")]
    pub header: ::std::option::Option<ResponseHeader>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AlarmType {
    /// default, used to query if any alarm is active
    None = 0,
    /// space quota is exhausted
    Nospace = 1,
    /// kv store corruption detected
    Corrupt = 2,
}
#[doc = r" Generated client implementations."]
pub mod client {
    #![allow(unused_variables, dead_code, missing_docs)]
    use tonic::codegen::*;
    pub struct KvClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl KvClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> KvClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " Range gets the keys in the range from the key-value store."]
        pub async fn range(
            &mut self,
            request: impl tonic::IntoRequest<super::RangeRequest>,
        ) -> Result<tonic::Response<super::RangeResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Range");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Put puts the given key into the key-value store."]
        #[doc = " A put request increments the revision of the key-value store"]
        #[doc = " and generates one event in the event history."]
        pub async fn put(
            &mut self,
            request: impl tonic::IntoRequest<super::PutRequest>,
        ) -> Result<tonic::Response<super::PutResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Put");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " DeleteRange deletes the given range from the key-value store."]
        #[doc = " A delete request increments the revision of the key-value store"]
        #[doc = " and generates a delete event in the event history for every deleted key."]
        pub async fn delete_range(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteRangeRequest>,
        ) -> Result<tonic::Response<super::DeleteRangeResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/DeleteRange");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Txn processes multiple requests in a single transaction."]
        #[doc = " A txn request increments the revision of the key-value store"]
        #[doc = " and generates events with the same revision for every completed request."]
        #[doc = " It is not allowed to modify the same key several times within one txn."]
        pub async fn txn(
            &mut self,
            request: impl tonic::IntoRequest<super::TxnRequest>,
        ) -> Result<tonic::Response<super::TxnResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Txn");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Compact compacts the event history in the etcd key-value store. The key-value"]
        #[doc = " store should be periodically compacted or the event history will continue to grow"]
        #[doc = " indefinitely."]
        pub async fn compact(
            &mut self,
            request: impl tonic::IntoRequest<super::CompactionRequest>,
        ) -> Result<tonic::Response<super::CompactionResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.KV/Compact");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
    impl<T: Clone> Clone for KvClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
    pub struct WatchClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl WatchClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> WatchClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " Watch watches for events happening or that have happened. Both input and output"]
        #[doc = " are streams; the input stream is for creating and canceling watchers and the output"]
        #[doc = " stream sends events. One watch RPC can watch on multiple key ranges, streaming events"]
        #[doc = " for several watches at once. The entire event history can be watched starting from the"]
        #[doc = " last compaction revision."]
        pub async fn watch(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::WatchRequest>,
        ) -> Result<tonic::Response<tonic::codec::Streaming<super::WatchResponse>>, tonic::Status>
        {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Watch/Watch");
            self.inner
                .streaming(request.into_streaming_request(), path, codec)
                .await
        }
    }
    impl<T: Clone> Clone for WatchClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
    pub struct LeaseClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl LeaseClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> LeaseClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " LeaseGrant creates a lease which expires if the server does not receive a keepAlive"]
        #[doc = " within a given time to live period. All keys attached to the lease will be expired and"]
        #[doc = " deleted if the lease expires. Each expired key generates a delete event in the event history."]
        pub async fn lease_grant(
            &mut self,
            request: impl tonic::IntoRequest<super::LeaseGrantRequest>,
        ) -> Result<tonic::Response<super::LeaseGrantResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Lease/LeaseGrant");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted."]
        pub async fn lease_revoke(
            &mut self,
            request: impl tonic::IntoRequest<super::LeaseRevokeRequest>,
        ) -> Result<tonic::Response<super::LeaseRevokeResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Lease/LeaseRevoke");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client"]
        #[doc = " to the server and streaming keep alive responses from the server to the client."]
        pub async fn lease_keep_alive(
            &mut self,
            request: impl tonic::IntoStreamingRequest<Message = super::LeaseKeepAliveRequest>,
        ) -> Result<
            tonic::Response<tonic::codec::Streaming<super::LeaseKeepAliveResponse>>,
            tonic::Status,
        > {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Lease/LeaseKeepAlive");
            self.inner
                .streaming(request.into_streaming_request(), path, codec)
                .await
        }
        #[doc = " LeaseTimeToLive retrieves lease information."]
        pub async fn lease_time_to_live(
            &mut self,
            request: impl tonic::IntoRequest<super::LeaseTimeToLiveRequest>,
        ) -> Result<tonic::Response<super::LeaseTimeToLiveResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Lease/LeaseTimeToLive");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " LeaseLeases lists all existing leases."]
        pub async fn lease_leases(
            &mut self,
            request: impl tonic::IntoRequest<super::LeaseLeasesRequest>,
        ) -> Result<tonic::Response<super::LeaseLeasesResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Lease/LeaseLeases");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
    impl<T: Clone> Clone for LeaseClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
    pub struct ClusterClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ClusterClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ClusterClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " MemberAdd adds a member into the cluster."]
        pub async fn member_add(
            &mut self,
            request: impl tonic::IntoRequest<super::MemberAddRequest>,
        ) -> Result<tonic::Response<super::MemberAddResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Cluster/MemberAdd");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " MemberRemove removes an existing member from the cluster."]
        pub async fn member_remove(
            &mut self,
            request: impl tonic::IntoRequest<super::MemberRemoveRequest>,
        ) -> Result<tonic::Response<super::MemberRemoveResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Cluster/MemberRemove");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " MemberUpdate updates the member configuration."]
        pub async fn member_update(
            &mut self,
            request: impl tonic::IntoRequest<super::MemberUpdateRequest>,
        ) -> Result<tonic::Response<super::MemberUpdateResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Cluster/MemberUpdate");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " MemberList lists all the members in the cluster."]
        pub async fn member_list(
            &mut self,
            request: impl tonic::IntoRequest<super::MemberListRequest>,
        ) -> Result<tonic::Response<super::MemberListResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Cluster/MemberList");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
    impl<T: Clone> Clone for ClusterClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
    pub struct MaintenanceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl MaintenanceClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> MaintenanceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " Alarm activates, deactivates, and queries alarms regarding cluster health."]
        pub async fn alarm(
            &mut self,
            request: impl tonic::IntoRequest<super::AlarmRequest>,
        ) -> Result<tonic::Response<super::AlarmResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/Alarm");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Status gets the status of the member."]
        pub async fn status(
            &mut self,
            request: impl tonic::IntoRequest<super::StatusRequest>,
        ) -> Result<tonic::Response<super::StatusResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/Status");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Defragment defragments a member's backend database to recover storage space."]
        pub async fn defragment(
            &mut self,
            request: impl tonic::IntoRequest<super::DefragmentRequest>,
        ) -> Result<tonic::Response<super::DefragmentResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/Defragment");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Hash computes the hash of whole backend keyspace,"]
        #[doc = " including key, lease, and other buckets in storage."]
        #[doc = " This is designed for testing ONLY!"]
        #[doc = " Do not rely on this in production with ongoing transactions,"]
        #[doc = " since Hash operation does not hold MVCC locks."]
        #[doc = " Use \"HashKV\" API instead for \"key\" bucket consistency checks."]
        pub async fn hash(
            &mut self,
            request: impl tonic::IntoRequest<super::HashRequest>,
        ) -> Result<tonic::Response<super::HashResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/Hash");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " HashKV computes the hash of all MVCC keys up to a given revision."]
        #[doc = " It only iterates \"key\" bucket in backend storage."]
        pub async fn hash_kv(
            &mut self,
            request: impl tonic::IntoRequest<super::HashKvRequest>,
        ) -> Result<tonic::Response<super::HashKvResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/HashKV");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Snapshot sends a snapshot of the entire backend from a member over a stream to a client."]
        pub async fn snapshot(
            &mut self,
            request: impl tonic::IntoRequest<super::SnapshotRequest>,
        ) -> Result<tonic::Response<tonic::codec::Streaming<super::SnapshotResponse>>, tonic::Status>
        {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/Snapshot");
            self.inner
                .server_streaming(request.into_request(), path, codec)
                .await
        }
        #[doc = " MoveLeader requests current leader node to transfer its leadership to transferee."]
        pub async fn move_leader(
            &mut self,
            request: impl tonic::IntoRequest<super::MoveLeaderRequest>,
        ) -> Result<tonic::Response<super::MoveLeaderResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Maintenance/MoveLeader");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
    impl<T: Clone> Clone for MaintenanceClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
    pub struct AuthClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl AuthClient<tonic::transport::Channel> {
        #[doc = r" Attempt to create a new client by connecting to a given endpoint."]
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: std::convert::TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> AuthClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::ResponseBody: Body + HttpBody + Send + 'static,
        T::Error: Into<StdError>,
        <T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
        <T::ResponseBody as HttpBody>::Data: Into<bytes::Bytes> + Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        #[doc = r" Check if the service is ready."]
        pub async fn ready(&mut self) -> Result<(), tonic::Status> {
            self.inner.ready().await.map_err(|e| {
                tonic::Status::new(
                    tonic::Code::Unknown,
                    format!("Service was not ready: {}", e.into()),
                )
            })
        }
        #[doc = " AuthEnable enables authentication."]
        pub async fn auth_enable(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthEnableRequest>,
        ) -> Result<tonic::Response<super::AuthEnableResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/AuthEnable");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " AuthDisable disables authentication."]
        pub async fn auth_disable(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthDisableRequest>,
        ) -> Result<tonic::Response<super::AuthDisableResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/AuthDisable");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " Authenticate processes an authenticate request."]
        pub async fn authenticate(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthenticateRequest>,
        ) -> Result<tonic::Response<super::AuthenticateResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/Authenticate");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserAdd adds a new user."]
        pub async fn user_add(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserAddRequest>,
        ) -> Result<tonic::Response<super::AuthUserAddResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserAdd");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserGet gets detailed user information."]
        pub async fn user_get(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserGetRequest>,
        ) -> Result<tonic::Response<super::AuthUserGetResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserGet");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserList gets a list of all users."]
        pub async fn user_list(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserListRequest>,
        ) -> Result<tonic::Response<super::AuthUserListResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserList");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserDelete deletes a specified user."]
        pub async fn user_delete(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserDeleteRequest>,
        ) -> Result<tonic::Response<super::AuthUserDeleteResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserDelete");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserChangePassword changes the password of a specified user."]
        pub async fn user_change_password(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserChangePasswordRequest>,
        ) -> Result<tonic::Response<super::AuthUserChangePasswordResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserChangePassword");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserGrant grants a role to a specified user."]
        pub async fn user_grant_role(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserGrantRoleRequest>,
        ) -> Result<tonic::Response<super::AuthUserGrantRoleResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserGrantRole");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " UserRevokeRole revokes a role of specified user."]
        pub async fn user_revoke_role(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthUserRevokeRoleRequest>,
        ) -> Result<tonic::Response<super::AuthUserRevokeRoleResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/UserRevokeRole");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleAdd adds a new role."]
        pub async fn role_add(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleAddRequest>,
        ) -> Result<tonic::Response<super::AuthRoleAddResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleAdd");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleGet gets detailed role information."]
        pub async fn role_get(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleGetRequest>,
        ) -> Result<tonic::Response<super::AuthRoleGetResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleGet");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleList gets lists of all roles."]
        pub async fn role_list(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleListRequest>,
        ) -> Result<tonic::Response<super::AuthRoleListResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleList");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleDelete deletes a specified role."]
        pub async fn role_delete(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleDeleteRequest>,
        ) -> Result<tonic::Response<super::AuthRoleDeleteResponse>, tonic::Status> {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleDelete");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleGrantPermission grants a permission of a specified key or range to a specified role."]
        pub async fn role_grant_permission(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleGrantPermissionRequest>,
        ) -> Result<tonic::Response<super::AuthRoleGrantPermissionResponse>, tonic::Status>
        {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleGrantPermission");
            self.inner.unary(request.into_request(), path, codec).await
        }
        #[doc = " RoleRevokePermission revokes a key or range permission of a specified role."]
        pub async fn role_revoke_permission(
            &mut self,
            request: impl tonic::IntoRequest<super::AuthRoleRevokePermissionRequest>,
        ) -> Result<tonic::Response<super::AuthRoleRevokePermissionResponse>, tonic::Status>
        {
            self.ready().await?;
            let codec = tonic::codec::ProstCodec::default();
            let path =
                http::uri::PathAndQuery::from_static("/etcdserverpb.Auth/RoleRevokePermission");
            self.inner.unary(request.into_request(), path, codec).await
        }
    }
    impl<T: Clone> Clone for AuthClient<T> {
        fn clone(&self) -> Self {
            Self {
                inner: self.inner.clone(),
            }
        }
    }
}