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
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
// This file is @generated by prost-build.
/// Cloud Firestore indexes enable simple and complex queries against
/// documents in a database.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Index {
    /// Output only. A server defined name for this index.
    /// The form of this name for composite indexes will be:
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{composite_index_id}`
    /// For single field indexes, this field will be empty.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Indexes with a collection query scope specified allow queries
    /// against a collection that is the child of a specific document, specified at
    /// query time, and that has the same collection ID.
    ///
    /// Indexes with a collection group query scope specified allow queries against
    /// all collections descended from a specific document, specified at query
    /// time, and that have the same collection ID as this index.
    #[prost(enumeration = "index::QueryScope", tag = "2")]
    pub query_scope: i32,
    /// The API scope supported by this index.
    #[prost(enumeration = "index::ApiScope", tag = "5")]
    pub api_scope: i32,
    /// The fields supported by this index.
    ///
    /// For composite indexes, this requires a minimum of 2 and a maximum of 100
    /// fields. The last field entry is always for the field path `__name__`. If,
    /// on creation, `__name__` was not specified as the last field, it will be
    /// added automatically with the same direction as that of the last field
    /// defined. If the final field in a composite index is not directional, the
    /// `__name__` will be ordered ASCENDING (unless explicitly specified).
    ///
    /// For single field indexes, this will always be exactly one entry with a
    /// field path equal to the field path of the associated field.
    #[prost(message, repeated, tag = "3")]
    pub fields: ::prost::alloc::vec::Vec<index::IndexField>,
    /// Output only. The serving state of the index.
    #[prost(enumeration = "index::State", tag = "4")]
    pub state: i32,
}
/// Nested message and enum types in `Index`.
pub mod index {
    /// A field in an index.
    /// The field_path describes which field is indexed, the value_mode describes
    /// how the field value is indexed.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndexField {
        /// Can be __name__.
        /// For single field indexes, this must match the name of the field or may
        /// be omitted.
        #[prost(string, tag = "1")]
        pub field_path: ::prost::alloc::string::String,
        /// How the field value is indexed.
        #[prost(oneof = "index_field::ValueMode", tags = "2, 3, 4")]
        pub value_mode: ::core::option::Option<index_field::ValueMode>,
    }
    /// Nested message and enum types in `IndexField`.
    pub mod index_field {
        /// The index configuration to support vector search operations
        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
        pub struct VectorConfig {
            /// Required. The vector dimension this configuration applies to.
            ///
            /// The resulting index will only include vectors of this dimension, and
            /// can be used for vector search with the same dimension.
            #[prost(int32, tag = "1")]
            pub dimension: i32,
            /// The type of index used.
            #[prost(oneof = "vector_config::Type", tags = "2")]
            pub r#type: ::core::option::Option<vector_config::Type>,
        }
        /// Nested message and enum types in `VectorConfig`.
        pub mod vector_config {
            /// An index that stores vectors in a flat data structure, and supports
            /// exhaustive search.
            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
            pub struct FlatIndex {}
            /// The type of index used.
            #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
            pub enum Type {
                /// Indicates the vector index is a flat index.
                #[prost(message, tag = "2")]
                Flat(FlatIndex),
            }
        }
        /// The supported orderings.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum Order {
            /// The ordering is unspecified. Not a valid option.
            Unspecified = 0,
            /// The field is ordered by ascending field value.
            Ascending = 1,
            /// The field is ordered by descending field value.
            Descending = 2,
        }
        impl Order {
            /// 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 {
                    Order::Unspecified => "ORDER_UNSPECIFIED",
                    Order::Ascending => "ASCENDING",
                    Order::Descending => "DESCENDING",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "ORDER_UNSPECIFIED" => Some(Self::Unspecified),
                    "ASCENDING" => Some(Self::Ascending),
                    "DESCENDING" => Some(Self::Descending),
                    _ => None,
                }
            }
        }
        /// The supported array value configurations.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum ArrayConfig {
            /// The index does not support additional array queries.
            Unspecified = 0,
            /// The index supports array containment queries.
            Contains = 1,
        }
        impl ArrayConfig {
            /// 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 {
                    ArrayConfig::Unspecified => "ARRAY_CONFIG_UNSPECIFIED",
                    ArrayConfig::Contains => "CONTAINS",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "ARRAY_CONFIG_UNSPECIFIED" => Some(Self::Unspecified),
                    "CONTAINS" => Some(Self::Contains),
                    _ => None,
                }
            }
        }
        /// How the field value is indexed.
        #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
        pub enum ValueMode {
            /// Indicates that this field supports ordering by the specified order or
            /// comparing using =, !=, <, <=, >, >=.
            #[prost(enumeration = "Order", tag = "2")]
            Order(i32),
            /// Indicates that this field supports operations on `array_value`s.
            #[prost(enumeration = "ArrayConfig", tag = "3")]
            ArrayConfig(i32),
            /// Indicates that this field supports nearest neighbor and distance
            /// operations on vector.
            #[prost(message, tag = "4")]
            VectorConfig(VectorConfig),
        }
    }
    /// Query Scope defines the scope at which a query is run. This is specified on
    /// a StructuredQuery's `from` field.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum QueryScope {
        /// The query scope is unspecified. Not a valid option.
        Unspecified = 0,
        /// Indexes with a collection query scope specified allow queries
        /// against a collection that is the child of a specific document, specified
        /// at query time, and that has the collection ID specified by the index.
        Collection = 1,
        /// Indexes with a collection group query scope specified allow queries
        /// against all collections that has the collection ID specified by the
        /// index.
        CollectionGroup = 2,
        /// Include all the collections's ancestor in the index. Only available for
        /// Datastore Mode databases.
        CollectionRecursive = 3,
    }
    impl QueryScope {
        /// 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 {
                QueryScope::Unspecified => "QUERY_SCOPE_UNSPECIFIED",
                QueryScope::Collection => "COLLECTION",
                QueryScope::CollectionGroup => "COLLECTION_GROUP",
                QueryScope::CollectionRecursive => "COLLECTION_RECURSIVE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "QUERY_SCOPE_UNSPECIFIED" => Some(Self::Unspecified),
                "COLLECTION" => Some(Self::Collection),
                "COLLECTION_GROUP" => Some(Self::CollectionGroup),
                "COLLECTION_RECURSIVE" => Some(Self::CollectionRecursive),
                _ => None,
            }
        }
    }
    /// API Scope defines the APIs (Firestore Native, or Firestore in
    /// Datastore Mode) that are supported for queries.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ApiScope {
        /// The index can only be used by the Firestore Native query API.
        /// This is the default.
        AnyApi = 0,
        /// The index can only be used by the Firestore in Datastore Mode query API.
        DatastoreModeApi = 1,
    }
    impl ApiScope {
        /// 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 {
                ApiScope::AnyApi => "ANY_API",
                ApiScope::DatastoreModeApi => "DATASTORE_MODE_API",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ANY_API" => Some(Self::AnyApi),
                "DATASTORE_MODE_API" => Some(Self::DatastoreModeApi),
                _ => None,
            }
        }
    }
    /// The state of an index. During index creation, an index will be in the
    /// `CREATING` state. If the index is created successfully, it will transition
    /// to the `READY` state. If the index creation encounters a problem, the index
    /// will transition to the `NEEDS_REPAIR` state.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The state is unspecified.
        Unspecified = 0,
        /// The index is being created.
        /// There is an active long-running operation for the index.
        /// The index is updated when writing a document.
        /// Some index data may exist.
        Creating = 1,
        /// The index is ready to be used.
        /// The index is updated when writing a document.
        /// The index is fully populated from all stored documents it applies to.
        Ready = 2,
        /// The index was being created, but something went wrong.
        /// There is no active long-running operation for the index,
        /// and the most recently finished long-running operation failed.
        /// The index is not updated when writing a document.
        /// Some index data may exist.
        /// Use the google.longrunning.Operations API to determine why the operation
        /// that last attempted to create this index failed, then re-create the
        /// index.
        NeedsRepair = 3,
    }
    impl State {
        /// 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 {
                State::Unspecified => "STATE_UNSPECIFIED",
                State::Creating => "CREATING",
                State::Ready => "READY",
                State::NeedsRepair => "NEEDS_REPAIR",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "CREATING" => Some(Self::Creating),
                "READY" => Some(Self::Ready),
                "NEEDS_REPAIR" => Some(Self::NeedsRepair),
                _ => None,
            }
        }
    }
}
/// A backup schedule for a Cloud Firestore Database.
///
/// This resource is owned by the database it is backing up, and is deleted along
/// with the database. The actual backups are not though.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BackupSchedule {
    /// Output only. The unique backup schedule identifier across all locations and
    /// databases for the given project.
    ///
    /// This will be auto-assigned.
    ///
    /// Format is
    /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The timestamp at which this backup schedule was created and
    /// effective since.
    ///
    /// No backups will be created for this schedule before this time.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The timestamp at which this backup schedule was most recently
    /// updated. When a backup schedule is first created, this is the same as
    /// create_time.
    #[prost(message, optional, tag = "10")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// At what relative time in the future, compared to its creation time,
    /// the backup should be deleted, e.g. keep backups for 7 days.
    ///
    /// The maximum supported retention period is 14 weeks.
    #[prost(message, optional, tag = "6")]
    pub retention: ::core::option::Option<::prost_types::Duration>,
    /// A oneof field to represent when backups will be taken.
    #[prost(oneof = "backup_schedule::Recurrence", tags = "7, 8")]
    pub recurrence: ::core::option::Option<backup_schedule::Recurrence>,
}
/// Nested message and enum types in `BackupSchedule`.
pub mod backup_schedule {
    /// A oneof field to represent when backups will be taken.
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Recurrence {
        /// For a schedule that runs daily.
        #[prost(message, tag = "7")]
        DailyRecurrence(super::DailyRecurrence),
        /// For a schedule that runs weekly on a specific day.
        #[prost(message, tag = "8")]
        WeeklyRecurrence(super::WeeklyRecurrence),
    }
}
/// Represents a recurring schedule that runs every day.
///
/// The time zone is UTC.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DailyRecurrence {}
/// Represents a recurring schedule that runs on a specified day of the week.
///
/// The time zone is UTC.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WeeklyRecurrence {
    /// The day of week to run.
    ///
    /// DAY_OF_WEEK_UNSPECIFIED is not allowed.
    #[prost(enumeration = "super::super::super::r#type::DayOfWeek", tag = "2")]
    pub day: i32,
}
/// A Backup of a Cloud Firestore Database.
///
/// The backup contains all documents and index configurations for the given
/// database at a specific point in time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Backup {
    /// Output only. The unique resource name of the Backup.
    ///
    /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. Name of the Firestore database that the backup is from.
    ///
    /// Format is `projects/{project}/databases/{database}`.
    #[prost(string, tag = "2")]
    pub database: ::prost::alloc::string::String,
    /// Output only. The system-generated UUID4 for the Firestore database that the
    /// backup is from.
    #[prost(string, tag = "7")]
    pub database_uid: ::prost::alloc::string::String,
    /// Output only. The backup contains an externally consistent copy of the
    /// database at this time.
    #[prost(message, optional, tag = "3")]
    pub snapshot_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The timestamp at which this backup expires.
    #[prost(message, optional, tag = "4")]
    pub expire_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Statistics about the backup.
    ///
    /// This data only becomes available after the backup is fully materialized to
    /// secondary storage. This field will be empty till then.
    #[prost(message, optional, tag = "6")]
    pub stats: ::core::option::Option<backup::Stats>,
    /// Output only. The current state of the backup.
    #[prost(enumeration = "backup::State", tag = "8")]
    pub state: i32,
}
/// Nested message and enum types in `Backup`.
pub mod backup {
    /// Backup specific statistics.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct Stats {
        /// Output only. Summation of the size of all documents and index entries in
        /// the backup, measured in bytes.
        #[prost(int64, tag = "1")]
        pub size_bytes: i64,
        /// Output only. The total number of documents contained in the backup.
        #[prost(int64, tag = "2")]
        pub document_count: i64,
        /// Output only. The total number of index entries contained in the backup.
        #[prost(int64, tag = "3")]
        pub index_count: i64,
    }
    /// Indicate the current state of the backup.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The state is unspecified.
        Unspecified = 0,
        /// The pending backup is still being created. Operations on the
        /// backup will be rejected in this state.
        Creating = 1,
        /// The backup is complete and ready to use.
        Ready = 2,
        /// The backup is not available at this moment.
        NotAvailable = 3,
    }
    impl State {
        /// 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 {
                State::Unspecified => "STATE_UNSPECIFIED",
                State::Creating => "CREATING",
                State::Ready => "READY",
                State::NotAvailable => "NOT_AVAILABLE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "CREATING" => Some(Self::Creating),
                "READY" => Some(Self::Ready),
                "NOT_AVAILABLE" => Some(Self::NotAvailable),
                _ => None,
            }
        }
    }
}
/// A Cloud Firestore Database.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Database {
    /// The resource name of the Database.
    /// Format: `projects/{project}/databases/{database}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The system-generated UUID4 for this Database.
    #[prost(string, tag = "3")]
    pub uid: ::prost::alloc::string::String,
    /// Output only. The timestamp at which this database was created. Databases
    /// created before 2016 do not populate create_time.
    #[prost(message, optional, tag = "5")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The timestamp at which this database was most recently
    /// updated. Note this only includes updates to the database resource and not
    /// data contained by the database.
    #[prost(message, optional, tag = "6")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The location of the database. Available locations are listed at
    /// <https://cloud.google.com/firestore/docs/locations.>
    #[prost(string, tag = "9")]
    pub location_id: ::prost::alloc::string::String,
    /// The type of the database.
    /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
    /// information about how to choose.
    #[prost(enumeration = "database::DatabaseType", tag = "10")]
    pub r#type: i32,
    /// The concurrency control mode to use for this database.
    #[prost(enumeration = "database::ConcurrencyMode", tag = "15")]
    pub concurrency_mode: i32,
    /// Output only. The period during which past versions of data are retained in
    /// the database.
    ///
    /// Any [read][google.firestore.v1.GetDocumentRequest.read_time]
    /// or [query][google.firestore.v1.ListDocumentsRequest.read_time] can specify
    /// a `read_time` within this window, and will read the state of the database
    /// at that time.
    ///
    /// If the PITR feature is enabled, the retention period is 7 days. Otherwise,
    /// the retention period is 1 hour.
    #[prost(message, optional, tag = "17")]
    pub version_retention_period: ::core::option::Option<::prost_types::Duration>,
    /// Output only. The earliest timestamp at which older versions of the data can
    /// be read from the database. See \[version_retention_period\] above; this field
    /// is populated with `now - version_retention_period`.
    ///
    /// This value is continuously updated, and becomes stale the moment it is
    /// queried. If you are using this value to recover data, make sure to account
    /// for the time from the moment when the value is queried to the moment when
    /// you initiate the recovery.
    #[prost(message, optional, tag = "18")]
    pub earliest_version_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Whether to enable the PITR feature on this database.
    #[prost(enumeration = "database::PointInTimeRecoveryEnablement", tag = "21")]
    pub point_in_time_recovery_enablement: i32,
    /// The App Engine integration mode to use for this database.
    #[prost(enumeration = "database::AppEngineIntegrationMode", tag = "19")]
    pub app_engine_integration_mode: i32,
    /// Output only. The key_prefix for this database. This key_prefix is used, in
    /// combination with the project id ("<key prefix>~<project id>") to construct
    /// the application id that is returned from the Cloud Datastore APIs in Google
    /// App Engine first generation runtimes.
    ///
    /// This value may be empty in which case the appid to use for URL-encoded keys
    /// is the project_id (eg: foo instead of v~foo).
    #[prost(string, tag = "20")]
    pub key_prefix: ::prost::alloc::string::String,
    /// State of delete protection for the database.
    #[prost(enumeration = "database::DeleteProtectionState", tag = "22")]
    pub delete_protection_state: i32,
    /// This checksum is computed by the server based on the value of other
    /// fields, and may be sent on update and delete requests to ensure the
    /// client has an up-to-date value before proceeding.
    #[prost(string, tag = "99")]
    pub etag: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Database`.
pub mod database {
    /// The type of the database.
    /// See <https://cloud.google.com/datastore/docs/firestore-or-datastore> for
    /// information about how to choose.
    ///
    /// Mode changes are only allowed if the database is empty.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DatabaseType {
        /// The default value. This value is used if the database type is omitted.
        Unspecified = 0,
        /// Firestore Native Mode
        FirestoreNative = 1,
        /// Firestore in Datastore Mode.
        DatastoreMode = 2,
    }
    impl DatabaseType {
        /// 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 {
                DatabaseType::Unspecified => "DATABASE_TYPE_UNSPECIFIED",
                DatabaseType::FirestoreNative => "FIRESTORE_NATIVE",
                DatabaseType::DatastoreMode => "DATASTORE_MODE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DATABASE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "FIRESTORE_NATIVE" => Some(Self::FirestoreNative),
                "DATASTORE_MODE" => Some(Self::DatastoreMode),
                _ => None,
            }
        }
    }
    /// The type of concurrency control mode for transactions.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ConcurrencyMode {
        /// Not used.
        Unspecified = 0,
        /// Use optimistic concurrency control by default. This mode is available
        /// for Cloud Firestore databases.
        Optimistic = 1,
        /// Use pessimistic concurrency control by default. This mode is available
        /// for Cloud Firestore databases.
        ///
        /// This is the default setting for Cloud Firestore.
        Pessimistic = 2,
        /// Use optimistic concurrency control with entity groups by default.
        ///
        /// This is the only available mode for Cloud Datastore.
        ///
        /// This mode is also available for Cloud Firestore with Datastore Mode but
        /// is not recommended.
        OptimisticWithEntityGroups = 3,
    }
    impl ConcurrencyMode {
        /// 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 {
                ConcurrencyMode::Unspecified => "CONCURRENCY_MODE_UNSPECIFIED",
                ConcurrencyMode::Optimistic => "OPTIMISTIC",
                ConcurrencyMode::Pessimistic => "PESSIMISTIC",
                ConcurrencyMode::OptimisticWithEntityGroups => {
                    "OPTIMISTIC_WITH_ENTITY_GROUPS"
                }
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CONCURRENCY_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "OPTIMISTIC" => Some(Self::Optimistic),
                "PESSIMISTIC" => Some(Self::Pessimistic),
                "OPTIMISTIC_WITH_ENTITY_GROUPS" => Some(Self::OptimisticWithEntityGroups),
                _ => None,
            }
        }
    }
    /// Point In Time Recovery feature enablement.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum PointInTimeRecoveryEnablement {
        /// Not used.
        Unspecified = 0,
        /// Reads are supported on selected versions of the data from within the past
        /// 7 days:
        ///
        /// * Reads against any timestamp within the past hour
        /// * Reads against 1-minute snapshots beyond 1 hour and within 7 days
        ///
        /// `version_retention_period` and `earliest_version_time` can be
        /// used to determine the supported versions.
        PointInTimeRecoveryEnabled = 1,
        /// Reads are supported on any version of the data from within the past 1
        /// hour.
        PointInTimeRecoveryDisabled = 2,
    }
    impl PointInTimeRecoveryEnablement {
        /// 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 {
                PointInTimeRecoveryEnablement::Unspecified => {
                    "POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED"
                }
                PointInTimeRecoveryEnablement::PointInTimeRecoveryEnabled => {
                    "POINT_IN_TIME_RECOVERY_ENABLED"
                }
                PointInTimeRecoveryEnablement::PointInTimeRecoveryDisabled => {
                    "POINT_IN_TIME_RECOVERY_DISABLED"
                }
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "POINT_IN_TIME_RECOVERY_ENABLEMENT_UNSPECIFIED" => {
                    Some(Self::Unspecified)
                }
                "POINT_IN_TIME_RECOVERY_ENABLED" => {
                    Some(Self::PointInTimeRecoveryEnabled)
                }
                "POINT_IN_TIME_RECOVERY_DISABLED" => {
                    Some(Self::PointInTimeRecoveryDisabled)
                }
                _ => None,
            }
        }
    }
    /// The type of App Engine integration mode.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum AppEngineIntegrationMode {
        /// Not used.
        Unspecified = 0,
        /// If an App Engine application exists in the same region as this database,
        /// App Engine configuration will impact this database. This includes
        /// disabling of the application & database, as well as disabling writes to
        /// the database.
        Enabled = 1,
        /// App Engine has no effect on the ability of this database to serve
        /// requests.
        ///
        /// This is the default setting for databases created with the Firestore API.
        Disabled = 2,
    }
    impl AppEngineIntegrationMode {
        /// 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 {
                AppEngineIntegrationMode::Unspecified => {
                    "APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED"
                }
                AppEngineIntegrationMode::Enabled => "ENABLED",
                AppEngineIntegrationMode::Disabled => "DISABLED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "APP_ENGINE_INTEGRATION_MODE_UNSPECIFIED" => Some(Self::Unspecified),
                "ENABLED" => Some(Self::Enabled),
                "DISABLED" => Some(Self::Disabled),
                _ => None,
            }
        }
    }
    /// The delete protection state of the database.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DeleteProtectionState {
        /// The default value. Delete protection type is not specified
        Unspecified = 0,
        /// Delete protection is disabled
        DeleteProtectionDisabled = 1,
        /// Delete protection is enabled
        DeleteProtectionEnabled = 2,
    }
    impl DeleteProtectionState {
        /// 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 {
                DeleteProtectionState::Unspecified => {
                    "DELETE_PROTECTION_STATE_UNSPECIFIED"
                }
                DeleteProtectionState::DeleteProtectionDisabled => {
                    "DELETE_PROTECTION_DISABLED"
                }
                DeleteProtectionState::DeleteProtectionEnabled => {
                    "DELETE_PROTECTION_ENABLED"
                }
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DELETE_PROTECTION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "DELETE_PROTECTION_DISABLED" => Some(Self::DeleteProtectionDisabled),
                "DELETE_PROTECTION_ENABLED" => Some(Self::DeleteProtectionEnabled),
                _ => None,
            }
        }
    }
}
/// Represents a single field in the database.
///
/// Fields are grouped by their "Collection Group", which represent all
/// collections in the database with the same ID.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Field {
    /// Required. A field name of the form:
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
    ///
    /// A field path can be a simple field name, e.g. `address` or a path to fields
    /// within `map_value` , e.g. `address.city`,
    /// or a special field path. The only valid special field is `*`, which
    /// represents any field.
    ///
    /// Field paths can be quoted using `` ` `` (backtick). The only character that
    /// must be escaped within a quoted field path is the backtick character
    /// itself, escaped using a backslash. Special characters in field paths that
    /// must be quoted include: `*`, `.`,
    /// `` ` `` (backtick), `\[`, `\]`, as well as any ascii symbolic characters.
    ///
    /// Examples:
    /// `` `address.city` `` represents a field named `address.city`, not the map
    /// key `city` in the field `address`. `` `*` `` represents a field named `*`,
    /// not any field.
    ///
    /// A special `Field` contains the default indexing settings for all fields.
    /// This field's resource name is:
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`
    /// Indexes defined on this `Field` will be applied to all fields which do not
    /// have their own `Field` index configuration.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The index configuration for this field. If unset, field indexing will
    /// revert to the configuration defined by the `ancestor_field`. To
    /// explicitly remove all indexes for this field, specify an index config
    /// with an empty list of indexes.
    #[prost(message, optional, tag = "2")]
    pub index_config: ::core::option::Option<field::IndexConfig>,
    /// The TTL configuration for this `Field`.
    /// Setting or unsetting this will enable or disable the TTL for
    /// documents that have this `Field`.
    #[prost(message, optional, tag = "3")]
    pub ttl_config: ::core::option::Option<field::TtlConfig>,
}
/// Nested message and enum types in `Field`.
pub mod field {
    /// The index configuration for this field.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndexConfig {
        /// The indexes supported for this field.
        #[prost(message, repeated, tag = "1")]
        pub indexes: ::prost::alloc::vec::Vec<super::Index>,
        /// Output only. When true, the `Field`'s index configuration is set from the
        /// configuration specified by the `ancestor_field`.
        /// When false, the `Field`'s index configuration is defined explicitly.
        #[prost(bool, tag = "2")]
        pub uses_ancestor_config: bool,
        /// Output only. Specifies the resource name of the `Field` from which this
        /// field's index configuration is set (when `uses_ancestor_config` is true),
        /// or from which it *would* be set if this field had no index configuration
        /// (when `uses_ancestor_config` is false).
        #[prost(string, tag = "3")]
        pub ancestor_field: ::prost::alloc::string::String,
        /// Output only
        /// When true, the `Field`'s index configuration is in the process of being
        /// reverted. Once complete, the index config will transition to the same
        /// state as the field specified by `ancestor_field`, at which point
        /// `uses_ancestor_config` will be `true` and `reverting` will be `false`.
        #[prost(bool, tag = "4")]
        pub reverting: bool,
    }
    /// The TTL (time-to-live) configuration for documents that have this `Field`
    /// set.
    ///
    /// Storing a timestamp value into a TTL-enabled field will be treated as
    /// the document's absolute expiration time. Timestamp values in the past
    /// indicate that the document is eligible for immediate expiration. Using any
    /// other data type or leaving the field absent will disable expiration for the
    /// individual document.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct TtlConfig {
        /// Output only. The state of the TTL configuration.
        #[prost(enumeration = "ttl_config::State", tag = "1")]
        pub state: i32,
    }
    /// Nested message and enum types in `TtlConfig`.
    pub mod ttl_config {
        /// The state of applying the TTL configuration to all documents.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum State {
            /// The state is unspecified or unknown.
            Unspecified = 0,
            /// The TTL is being applied. There is an active long-running operation to
            /// track the change. Newly written documents will have TTLs applied as
            /// requested. Requested TTLs on existing documents are still being
            /// processed. When TTLs on all existing documents have been processed, the
            /// state will move to 'ACTIVE'.
            Creating = 1,
            /// The TTL is active for all documents.
            Active = 2,
            /// The TTL configuration could not be enabled for all existing documents.
            /// Newly written documents will continue to have their TTL applied.
            /// The LRO returned when last attempting to enable TTL for this `Field`
            /// has failed, and may have more details.
            NeedsRepair = 3,
        }
        impl State {
            /// 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 {
                    State::Unspecified => "STATE_UNSPECIFIED",
                    State::Creating => "CREATING",
                    State::Active => "ACTIVE",
                    State::NeedsRepair => "NEEDS_REPAIR",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                    "CREATING" => Some(Self::Creating),
                    "ACTIVE" => Some(Self::Active),
                    "NEEDS_REPAIR" => Some(Self::NeedsRepair),
                    _ => None,
                }
            }
        }
    }
}
/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
/// results from
/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IndexOperationMetadata {
    /// The time this operation started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time this operation completed. Will be unset if operation still in
    /// progress.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The index resource that this operation is acting on. For example:
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
    #[prost(string, tag = "3")]
    pub index: ::prost::alloc::string::String,
    /// The state of the operation.
    #[prost(enumeration = "OperationState", tag = "4")]
    pub state: i32,
    /// The progress, in documents, of this operation.
    #[prost(message, optional, tag = "5")]
    pub progress_documents: ::core::option::Option<Progress>,
    /// The progress, in bytes, of this operation.
    #[prost(message, optional, tag = "6")]
    pub progress_bytes: ::core::option::Option<Progress>,
}
/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
/// results from
/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldOperationMetadata {
    /// The time this operation started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time this operation completed. Will be unset if operation still in
    /// progress.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The field resource that this operation is acting on. For example:
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
    #[prost(string, tag = "3")]
    pub field: ::prost::alloc::string::String,
    /// A list of
    /// [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta],
    /// which describe the intent of this operation.
    #[prost(message, repeated, tag = "4")]
    pub index_config_deltas: ::prost::alloc::vec::Vec<
        field_operation_metadata::IndexConfigDelta,
    >,
    /// The state of the operation.
    #[prost(enumeration = "OperationState", tag = "5")]
    pub state: i32,
    /// The progress, in documents, of this operation.
    #[prost(message, optional, tag = "6")]
    pub progress_documents: ::core::option::Option<Progress>,
    /// The progress, in bytes, of this operation.
    #[prost(message, optional, tag = "7")]
    pub progress_bytes: ::core::option::Option<Progress>,
    /// Describes the deltas of TTL configuration.
    #[prost(message, optional, tag = "8")]
    pub ttl_config_delta: ::core::option::Option<
        field_operation_metadata::TtlConfigDelta,
    >,
}
/// Nested message and enum types in `FieldOperationMetadata`.
pub mod field_operation_metadata {
    /// Information about an index configuration change.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndexConfigDelta {
        /// Specifies how the index is changing.
        #[prost(enumeration = "index_config_delta::ChangeType", tag = "1")]
        pub change_type: i32,
        /// The index being changed.
        #[prost(message, optional, tag = "2")]
        pub index: ::core::option::Option<super::Index>,
    }
    /// Nested message and enum types in `IndexConfigDelta`.
    pub mod index_config_delta {
        /// Specifies how the index is changing.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum ChangeType {
            /// The type of change is not specified or known.
            Unspecified = 0,
            /// The single field index is being added.
            Add = 1,
            /// The single field index is being removed.
            Remove = 2,
        }
        impl ChangeType {
            /// 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 {
                    ChangeType::Unspecified => "CHANGE_TYPE_UNSPECIFIED",
                    ChangeType::Add => "ADD",
                    ChangeType::Remove => "REMOVE",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "CHANGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                    "ADD" => Some(Self::Add),
                    "REMOVE" => Some(Self::Remove),
                    _ => None,
                }
            }
        }
    }
    /// Information about a TTL configuration change.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct TtlConfigDelta {
        /// Specifies how the TTL configuration is changing.
        #[prost(enumeration = "ttl_config_delta::ChangeType", tag = "1")]
        pub change_type: i32,
    }
    /// Nested message and enum types in `TtlConfigDelta`.
    pub mod ttl_config_delta {
        /// Specifies how the TTL config is changing.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum ChangeType {
            /// The type of change is not specified or known.
            Unspecified = 0,
            /// The TTL config is being added.
            Add = 1,
            /// The TTL config is being removed.
            Remove = 2,
        }
        impl ChangeType {
            /// 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 {
                    ChangeType::Unspecified => "CHANGE_TYPE_UNSPECIFIED",
                    ChangeType::Add => "ADD",
                    ChangeType::Remove => "REMOVE",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "CHANGE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                    "ADD" => Some(Self::Add),
                    "REMOVE" => Some(Self::Remove),
                    _ => None,
                }
            }
        }
    }
}
/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
/// results from
/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDocumentsMetadata {
    /// The time this operation started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time this operation completed. Will be unset if operation still in
    /// progress.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The state of the export operation.
    #[prost(enumeration = "OperationState", tag = "3")]
    pub operation_state: i32,
    /// The progress, in documents, of this operation.
    #[prost(message, optional, tag = "4")]
    pub progress_documents: ::core::option::Option<Progress>,
    /// The progress, in bytes, of this operation.
    #[prost(message, optional, tag = "5")]
    pub progress_bytes: ::core::option::Option<Progress>,
    /// Which collection IDs are being exported.
    #[prost(string, repeated, tag = "6")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Where the documents are being exported to.
    #[prost(string, tag = "7")]
    pub output_uri_prefix: ::prost::alloc::string::String,
    /// Which namespace IDs are being exported.
    #[prost(string, repeated, tag = "8")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The timestamp that corresponds to the version of the database that is being
    /// exported. If unspecified, there are no guarantees about the consistency of
    /// the documents being exported.
    #[prost(message, optional, tag = "9")]
    pub snapshot_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
/// results from
/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDocumentsMetadata {
    /// The time this operation started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time this operation completed. Will be unset if operation still in
    /// progress.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The state of the import operation.
    #[prost(enumeration = "OperationState", tag = "3")]
    pub operation_state: i32,
    /// The progress, in documents, of this operation.
    #[prost(message, optional, tag = "4")]
    pub progress_documents: ::core::option::Option<Progress>,
    /// The progress, in bytes, of this operation.
    #[prost(message, optional, tag = "5")]
    pub progress_bytes: ::core::option::Option<Progress>,
    /// Which collection IDs are being imported.
    #[prost(string, repeated, tag = "6")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The location of the documents being imported.
    #[prost(string, tag = "7")]
    pub input_uri_prefix: ::prost::alloc::string::String,
    /// Which namespace IDs are being imported.
    #[prost(string, repeated, tag = "8")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Metadata for [google.longrunning.Operation][google.longrunning.Operation]
/// results from
/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkDeleteDocumentsMetadata {
    /// The time this operation started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time this operation completed. Will be unset if operation still in
    /// progress.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The state of the operation.
    #[prost(enumeration = "OperationState", tag = "3")]
    pub operation_state: i32,
    /// The progress, in documents, of this operation.
    #[prost(message, optional, tag = "4")]
    pub progress_documents: ::core::option::Option<Progress>,
    /// The progress, in bytes, of this operation.
    #[prost(message, optional, tag = "5")]
    pub progress_bytes: ::core::option::Option<Progress>,
    /// The IDs of the collection groups that are being deleted.
    #[prost(string, repeated, tag = "6")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Which namespace IDs are being deleted.
    #[prost(string, repeated, tag = "7")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The timestamp that corresponds to the version of the database that is being
    /// read to get the list of documents to delete. This time can also be used as
    /// the timestamp of PITR in case of disaster recovery (subject to PITR window
    /// limit).
    #[prost(message, optional, tag = "8")]
    pub snapshot_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Returned in the [google.longrunning.Operation][google.longrunning.Operation]
/// response field.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDocumentsResponse {
    /// Location of the output files. This can be used to begin an import
    /// into Cloud Firestore (this project or another project) after the operation
    /// completes successfully.
    #[prost(string, tag = "1")]
    pub output_uri_prefix: ::prost::alloc::string::String,
}
/// Metadata for the [long-running operation][google.longrunning.Operation] from
/// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreDatabaseMetadata {
    /// The time the restore was started.
    #[prost(message, optional, tag = "1")]
    pub start_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The time the restore finished, unset for ongoing restores.
    #[prost(message, optional, tag = "2")]
    pub end_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The operation state of the restore.
    #[prost(enumeration = "OperationState", tag = "3")]
    pub operation_state: i32,
    /// The name of the database being restored to.
    #[prost(string, tag = "4")]
    pub database: ::prost::alloc::string::String,
    /// The name of the backup restoring from.
    #[prost(string, tag = "5")]
    pub backup: ::prost::alloc::string::String,
    /// How far along the restore is as an estimated percentage of remaining time.
    #[prost(message, optional, tag = "8")]
    pub progress_percentage: ::core::option::Option<Progress>,
}
/// Describes the progress of the operation.
/// Unit of work is generic and must be interpreted based on where
/// [Progress][google.firestore.admin.v1.Progress] is used.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Progress {
    /// The amount of work estimated.
    #[prost(int64, tag = "1")]
    pub estimated_work: i64,
    /// The amount of work completed.
    #[prost(int64, tag = "2")]
    pub completed_work: i64,
}
/// Describes the state of the operation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OperationState {
    /// Unspecified.
    Unspecified = 0,
    /// Request is being prepared for processing.
    Initializing = 1,
    /// Request is actively being processed.
    Processing = 2,
    /// Request is in the process of being cancelled after user called
    /// google.longrunning.Operations.CancelOperation on the operation.
    Cancelling = 3,
    /// Request has been processed and is in its finalization stage.
    Finalizing = 4,
    /// Request has completed successfully.
    Successful = 5,
    /// Request has finished being processed, but encountered an error.
    Failed = 6,
    /// Request has finished being cancelled after user called
    /// google.longrunning.Operations.CancelOperation.
    Cancelled = 7,
}
impl OperationState {
    /// 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 {
            OperationState::Unspecified => "OPERATION_STATE_UNSPECIFIED",
            OperationState::Initializing => "INITIALIZING",
            OperationState::Processing => "PROCESSING",
            OperationState::Cancelling => "CANCELLING",
            OperationState::Finalizing => "FINALIZING",
            OperationState::Successful => "SUCCESSFUL",
            OperationState::Failed => "FAILED",
            OperationState::Cancelled => "CANCELLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OPERATION_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "INITIALIZING" => Some(Self::Initializing),
            "PROCESSING" => Some(Self::Processing),
            "CANCELLING" => Some(Self::Cancelling),
            "FINALIZING" => Some(Self::Finalizing),
            "SUCCESSFUL" => Some(Self::Successful),
            "FAILED" => Some(Self::Failed),
            "CANCELLED" => Some(Self::Cancelled),
            _ => None,
        }
    }
}
/// A request to list the Firestore Databases in all locations for a project.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatabasesRequest {
    /// Required. A parent name of the form
    /// `projects/{project_id}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// If true, also returns deleted resources.
    #[prost(bool, tag = "4")]
    pub show_deleted: bool,
}
/// The request for
/// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateDatabaseRequest {
    /// Required. A parent name of the form
    /// `projects/{project_id}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The Database to create.
    #[prost(message, optional, tag = "2")]
    pub database: ::core::option::Option<Database>,
    /// Required. The ID to use for the database, which will become the final
    /// component of the database's resource name.
    ///
    /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
    /// with first character a letter and the last a letter or a number. Must not
    /// be UUID-like /\[0-9a-f\]{8}(-\[0-9a-f\]{4}){3}-\[0-9a-f\]{12}/.
    ///
    /// "(default)" database id is also valid.
    #[prost(string, tag = "3")]
    pub database_id: ::prost::alloc::string::String,
}
/// Metadata related to the create database operation.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreateDatabaseMetadata {}
/// The list of databases for a project.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDatabasesResponse {
    /// The databases in the project.
    #[prost(message, repeated, tag = "1")]
    pub databases: ::prost::alloc::vec::Vec<Database>,
    /// In the event that data about individual databases cannot be listed they
    /// will be recorded here.
    ///
    /// An example entry might be: projects/some_project/locations/some_location
    /// This can happen if the Cloud Region that the Database resides in is
    /// currently unavailable.  In this case we can't fetch all the details about
    /// the database. You may be able to get a more detailed error message
    /// (or possibly fetch the resource) by sending a 'Get' request for the
    /// resource or a 'List' request for the specific location.
    #[prost(string, repeated, tag = "3")]
    pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request for
/// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDatabaseRequest {
    /// Required. A name of the form
    /// `projects/{project_id}/databases/{database_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDatabaseRequest {
    /// Required. The database to update.
    #[prost(message, optional, tag = "1")]
    pub database: ::core::option::Option<Database>,
    /// The list of fields to be updated.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Metadata related to the update database operation.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateDatabaseMetadata {}
/// The request for
/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteDatabaseRequest {
    /// Required. A name of the form
    /// `projects/{project_id}/databases/{database_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The current etag of the Database.
    /// If an etag is provided and does not match the current etag of the database,
    /// deletion will be blocked and a FAILED_PRECONDITION error will be returned.
    #[prost(string, tag = "3")]
    pub etag: ::prost::alloc::string::String,
}
/// Metadata related to the delete database operation.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteDatabaseMetadata {}
/// The request for
/// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateBackupScheduleRequest {
    /// Required. The parent database.
    ///
    ///   Format `projects/{project}/databases/{database}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The backup schedule to create.
    #[prost(message, optional, tag = "2")]
    pub backup_schedule: ::core::option::Option<BackupSchedule>,
}
/// The request for
/// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackupScheduleRequest {
    /// Required. The name of the backup schedule.
    ///
    /// Format
    /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateBackupScheduleRequest {
    /// Required. The backup schedule to update.
    #[prost(message, optional, tag = "1")]
    pub backup_schedule: ::core::option::Option<BackupSchedule>,
    /// The list of fields to be updated.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request for
/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupSchedulesRequest {
    /// Required. The parent database.
    ///
    /// Format is `projects/{project}/databases/{database}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
}
/// The response for
/// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupSchedulesResponse {
    /// List of all backup schedules.
    #[prost(message, repeated, tag = "1")]
    pub backup_schedules: ::prost::alloc::vec::Vec<BackupSchedule>,
}
/// The request for [FirestoreAdmin.DeleteBackupSchedules][].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBackupScheduleRequest {
    /// Required. The name of the backup schedule.
    ///
    /// Format
    /// `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateIndexRequest {
    /// Required. A parent name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The composite index to create.
    #[prost(message, optional, tag = "2")]
    pub index: ::core::option::Option<Index>,
}
/// The request for
/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesRequest {
    /// Required. A parent name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The filter to apply to list results.
    #[prost(string, tag = "2")]
    pub filter: ::prost::alloc::string::String,
    /// The number of results to return.
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    /// A page token, returned from a previous call to
    /// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
    /// that may be used to get the next page of results.
    #[prost(string, tag = "4")]
    pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListIndexesResponse {
    /// The requested indexes.
    #[prost(message, repeated, tag = "1")]
    pub indexes: ::prost::alloc::vec::Vec<Index>,
    /// A page token that may be used to request another page of results. If blank,
    /// this is the last page.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetIndexRequest {
    /// Required. A name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteIndexRequest {
    /// Required. A name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFieldRequest {
    /// Required. The field to be updated.
    #[prost(message, optional, tag = "1")]
    pub field: ::core::option::Option<Field>,
    /// A mask, relative to the field. If specified, only configuration specified
    /// by this field_mask will be updated in the field.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The request for
/// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetFieldRequest {
    /// Required. A name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFieldsRequest {
    /// Required. A parent name of the form
    /// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The filter to apply to list results. Currently,
    /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
    /// only supports listing fields that have been explicitly overridden. To issue
    /// this query, call
    /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
    /// with a filter that includes `indexConfig.usesAncestorConfig:false` or
    /// `ttlConfig:*`.
    #[prost(string, tag = "2")]
    pub filter: ::prost::alloc::string::String,
    /// The number of results to return.
    #[prost(int32, tag = "3")]
    pub page_size: i32,
    /// A page token, returned from a previous call to
    /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
    /// that may be used to get the next page of results.
    #[prost(string, tag = "4")]
    pub page_token: ::prost::alloc::string::String,
}
/// The response for
/// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListFieldsResponse {
    /// The requested fields.
    #[prost(message, repeated, tag = "1")]
    pub fields: ::prost::alloc::vec::Vec<Field>,
    /// A page token that may be used to request another page of results. If blank,
    /// this is the last page.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportDocumentsRequest {
    /// Required. Database to export. Should be of the form:
    /// `projects/{project_id}/databases/{database_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Which collection ids to export. Unspecified means all collections. Each
    /// collection id in this list must be unique.
    #[prost(string, repeated, tag = "2")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The output URI. Currently only supports Google Cloud Storage URIs of the
    /// form: `gs://BUCKET_NAME\[/NAMESPACE_PATH\]`, where `BUCKET_NAME` is the name
    /// of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
    /// Google Cloud Storage namespace path. When
    /// choosing a name, be sure to consider Google Cloud Storage naming
    /// guidelines: <https://cloud.google.com/storage/docs/naming.>
    /// If the URI is a bucket (without a namespace path), a prefix will be
    /// generated based on the start time.
    #[prost(string, tag = "3")]
    pub output_uri_prefix: ::prost::alloc::string::String,
    /// An empty list represents all namespaces. This is the preferred
    /// usage for databases that don't use namespaces.
    ///
    /// An empty string element represents the default namespace. This should be
    /// used if the database has data in non-default namespaces, but doesn't want
    /// to include them. Each namespace in this list must be unique.
    #[prost(string, repeated, tag = "4")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// The timestamp that corresponds to the version of the database to be
    /// exported. The timestamp must be in the past, rounded to the minute and not
    /// older than
    /// [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
    /// If specified, then the exported documents will represent a consistent view
    /// of the database at the provided time. Otherwise, there are no guarantees
    /// about the consistency of the exported documents.
    #[prost(message, optional, tag = "5")]
    pub snapshot_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// The request for
/// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDocumentsRequest {
    /// Required. Database to import into. Should be of the form:
    /// `projects/{project_id}/databases/{database_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Which collection ids to import. Unspecified means all collections included
    /// in the import. Each collection id in this list must be unique.
    #[prost(string, repeated, tag = "2")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Location of the exported files.
    /// This must match the output_uri_prefix of an ExportDocumentsResponse from
    /// an export that has completed successfully.
    /// See:
    /// [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
    #[prost(string, tag = "3")]
    pub input_uri_prefix: ::prost::alloc::string::String,
    /// An empty list represents all namespaces. This is the preferred
    /// usage for databases that don't use namespaces.
    ///
    /// An empty string element represents the default namespace. This should be
    /// used if the database has data in non-default namespaces, but doesn't want
    /// to include them. Each namespace in this list must be unique.
    #[prost(string, repeated, tag = "4")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request for
/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
///
/// When both collection_ids and namespace_ids are set, only documents satisfying
/// both conditions will be deleted.
///
/// Requests with namespace_ids and collection_ids both empty will be rejected.
/// Please use
/// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase]
/// instead.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkDeleteDocumentsRequest {
    /// Required. Database to operate. Should be of the form:
    /// `projects/{project_id}/databases/{database_id}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. IDs of the collection groups to delete. Unspecified means all
    /// collection groups.
    ///
    /// Each collection group in this list must be unique.
    #[prost(string, repeated, tag = "2")]
    pub collection_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. Namespaces to delete.
    ///
    /// An empty list means all namespaces. This is the recommended
    /// usage for databases that don't use namespaces.
    ///
    /// An empty string element represents the default namespace. This should be
    /// used if the database has data in non-default namespaces, but doesn't want
    /// to delete from them.
    ///
    /// Each namespace in this list must be unique.
    #[prost(string, repeated, tag = "3")]
    pub namespace_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The response for
/// [FirestoreAdmin.BulkDeleteDocuments][google.firestore.admin.v1.FirestoreAdmin.BulkDeleteDocuments].
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BulkDeleteDocumentsResponse {}
/// The request for
/// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBackupRequest {
    /// Required. Name of the backup to fetch.
    ///
    /// Format is `projects/{project}/locations/{location}/backups/{backup}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request for
/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsRequest {
    /// Required. The location to list backups from.
    ///
    /// Format is `projects/{project}/locations/{location}`.
    /// Use `{location} = '-'` to list backups from all locations for the given
    /// project. This allows listing backups from a single location or from all
    /// locations.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
}
/// The response for
/// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListBackupsResponse {
    /// List of all backups for the project.
    #[prost(message, repeated, tag = "1")]
    pub backups: ::prost::alloc::vec::Vec<Backup>,
    /// List of locations that existing backups were not able to be fetched from.
    ///
    /// Instead of failing the entire requests when a single location is
    /// unreachable, this response returns a partial result set and list of
    /// locations unable to be reached here. The request can be retried against a
    /// single location to get a concrete error.
    #[prost(string, repeated, tag = "3")]
    pub unreachable: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// The request for
/// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteBackupRequest {
    /// Required. Name of the backup to delete.
    ///
    /// format is `projects/{project}/locations/{location}/backups/{backup}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request message for
/// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreDatabaseRequest {
    /// Required. The project to restore the database in. Format is
    /// `projects/{project_id}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The ID to use for the database, which will become the final
    /// component of the database's resource name. This database id must not be
    /// associated with an existing database.
    ///
    /// This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
    /// with first character a letter and the last a letter or a number. Must not
    /// be UUID-like /\[0-9a-f\]{8}(-\[0-9a-f\]{4}){3}-\[0-9a-f\]{12}/.
    ///
    /// "(default)" database id is also valid.
    #[prost(string, tag = "2")]
    pub database_id: ::prost::alloc::string::String,
    /// Required. Backup to restore from. Must be from the same project as the
    /// parent.
    ///
    /// Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
    #[prost(string, tag = "3")]
    pub backup: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod firestore_admin_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// The Cloud Firestore Admin API.
    ///
    /// This API provides several administrative services for Cloud Firestore.
    ///
    /// Project, Database, Namespace, Collection, Collection Group, and Document are
    /// used as defined in the Google Cloud Firestore API.
    ///
    /// Operation: An Operation represents work being performed in the background.
    ///
    /// The index service manages Cloud Firestore indexes.
    ///
    /// Index creation is performed asynchronously.
    /// An Operation resource is created for each such asynchronous operation.
    /// The state of the operation (including any errors encountered)
    /// may be queried via the Operation resource.
    ///
    /// The Operations collection provides a record of actions performed for the
    /// specified Project (including any Operations in progress). Operations are not
    /// created directly but through calls on other collections or resources.
    ///
    /// An Operation that is done may be deleted so that it is no longer listed as
    /// part of the Operation collection. Operations are garbage collected after
    /// 30 days. By default, ListOperations will only return in progress and failed
    /// operations. To list completed operation, issue a ListOperations request with
    /// the filter `done: true`.
    ///
    /// Operations are created by service `FirestoreAdmin`, but are accessed via
    /// service `google.longrunning.Operations`.
    #[derive(Debug, Clone)]
    pub struct FirestoreAdminClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> FirestoreAdminClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> FirestoreAdminClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            FirestoreAdminClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Creates a composite index. This returns a
        /// [google.longrunning.Operation][google.longrunning.Operation] which may be
        /// used to track the status of the creation. The metadata for the operation
        /// will be the type
        /// [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
        pub async fn create_index(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateIndexRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/CreateIndex",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "CreateIndex",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists composite indexes.
        pub async fn list_indexes(
            &mut self,
            request: impl tonic::IntoRequest<super::ListIndexesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListIndexesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ListIndexes",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ListIndexes",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets a composite index.
        pub async fn get_index(
            &mut self,
            request: impl tonic::IntoRequest<super::GetIndexRequest>,
        ) -> std::result::Result<tonic::Response<super::Index>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/GetIndex",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "GetIndex",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a composite index.
        pub async fn delete_index(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteIndexRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/DeleteIndex",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "DeleteIndex",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the metadata and configuration for a Field.
        pub async fn get_field(
            &mut self,
            request: impl tonic::IntoRequest<super::GetFieldRequest>,
        ) -> std::result::Result<tonic::Response<super::Field>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/GetField",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "GetField",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a field configuration. Currently, field updates apply only to
        /// single field index configuration. However, calls to
        /// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]
        /// should provide a field mask to avoid changing any configuration that the
        /// caller isn't aware of. The field mask should be specified as: `{ paths:
        /// "index_config" }`.
        ///
        /// This call returns a
        /// [google.longrunning.Operation][google.longrunning.Operation] which may be
        /// used to track the status of the field update. The metadata for the
        /// operation will be the type
        /// [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
        ///
        /// To configure the default field settings for the database, use
        /// the special `Field` with resource name:
        /// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
        pub async fn update_field(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateFieldRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/UpdateField",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "UpdateField",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists the field configuration and metadata for this database.
        ///
        /// Currently,
        /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
        /// only supports listing fields that have been explicitly overridden. To issue
        /// this query, call
        /// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
        /// with the filter set to `indexConfig.usesAncestorConfig:false` or
        /// `ttlConfig:*`.
        pub async fn list_fields(
            &mut self,
            request: impl tonic::IntoRequest<super::ListFieldsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListFieldsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ListFields",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ListFields",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Exports a copy of all or a subset of documents from Google Cloud Firestore
        /// to another storage system, such as Google Cloud Storage. Recent updates to
        /// documents may not be reflected in the export. The export occurs in the
        /// background and its progress can be monitored and managed via the
        /// Operation resource that is created. The output of an export may only be
        /// used once the associated operation is done. If an export operation is
        /// cancelled before completion it may leave partial data behind in Google
        /// Cloud Storage.
        ///
        /// For more details on export behavior and output format, refer to:
        /// https://cloud.google.com/firestore/docs/manage-data/export-import
        pub async fn export_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::ExportDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ExportDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ExportDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Imports documents into Google Cloud Firestore. Existing documents with the
        /// same name are overwritten. The import occurs in the background and its
        /// progress can be monitored and managed via the Operation resource that is
        /// created. If an ImportDocuments operation is cancelled, it is possible
        /// that a subset of the data has already been imported to Cloud Firestore.
        pub async fn import_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::ImportDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ImportDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ImportDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Bulk deletes a subset of documents from Google Cloud Firestore.
        /// Documents created or updated after the underlying system starts to process
        /// the request will not be deleted. The bulk delete occurs in the background
        /// and its progress can be monitored and managed via the Operation resource
        /// that is created.
        ///
        /// For more details on bulk delete behavior, refer to:
        /// https://cloud.google.com/firestore/docs/manage-data/bulk-delete
        pub async fn bulk_delete_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::BulkDeleteDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/BulkDeleteDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "BulkDeleteDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Create a database.
        pub async fn create_database(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateDatabaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/CreateDatabase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "CreateDatabase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets information about a database.
        pub async fn get_database(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDatabaseRequest>,
        ) -> std::result::Result<tonic::Response<super::Database>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/GetDatabase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "GetDatabase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// List all the databases in the project.
        pub async fn list_databases(
            &mut self,
            request: impl tonic::IntoRequest<super::ListDatabasesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListDatabasesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ListDatabases",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ListDatabases",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a database.
        pub async fn update_database(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateDatabaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/UpdateDatabase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "UpdateDatabase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a database.
        pub async fn delete_database(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteDatabaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/DeleteDatabase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "DeleteDatabase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets information about a backup.
        pub async fn get_backup(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBackupRequest>,
        ) -> std::result::Result<tonic::Response<super::Backup>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/GetBackup",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "GetBackup",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all the backups.
        pub async fn list_backups(
            &mut self,
            request: impl tonic::IntoRequest<super::ListBackupsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListBackupsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ListBackups",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ListBackups",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a backup.
        pub async fn delete_backup(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteBackupRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/DeleteBackup",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "DeleteBackup",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a new database by restoring from an existing backup.
        ///
        /// The new database must be in the same cloud region or multi-region location
        /// as the existing backup. This behaves similar to
        /// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase]
        /// except instead of creating a new empty database, a new database is created
        /// with the database type, index configuration, and documents from an existing
        /// backup.
        ///
        /// The [long-running operation][google.longrunning.Operation] can be used to
        /// track the progress of the restore, with the Operation's
        /// [metadata][google.longrunning.Operation.metadata] field type being the
        /// [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
        /// The [response][google.longrunning.Operation.response] type is the
        /// [Database][google.firestore.admin.v1.Database] if the restore was
        /// successful. The new database is not readable or writeable until the LRO has
        /// completed.
        pub async fn restore_database(
            &mut self,
            request: impl tonic::IntoRequest<super::RestoreDatabaseRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/RestoreDatabase",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "RestoreDatabase",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a backup schedule on a database.
        /// At most two backup schedules can be configured on a database, one daily
        /// backup schedule and one weekly backup schedule.
        pub async fn create_backup_schedule(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateBackupScheduleRequest>,
        ) -> std::result::Result<tonic::Response<super::BackupSchedule>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/CreateBackupSchedule",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "CreateBackupSchedule",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets information about a backup schedule.
        pub async fn get_backup_schedule(
            &mut self,
            request: impl tonic::IntoRequest<super::GetBackupScheduleRequest>,
        ) -> std::result::Result<tonic::Response<super::BackupSchedule>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/GetBackupSchedule",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "GetBackupSchedule",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// List backup schedules.
        pub async fn list_backup_schedules(
            &mut self,
            request: impl tonic::IntoRequest<super::ListBackupSchedulesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListBackupSchedulesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/ListBackupSchedules",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "ListBackupSchedules",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a backup schedule.
        pub async fn update_backup_schedule(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateBackupScheduleRequest>,
        ) -> std::result::Result<tonic::Response<super::BackupSchedule>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/UpdateBackupSchedule",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "UpdateBackupSchedule",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a backup schedule.
        pub async fn delete_backup_schedule(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteBackupScheduleRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.firestore.admin.v1.FirestoreAdmin/DeleteBackupSchedule",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.firestore.admin.v1.FirestoreAdmin",
                        "DeleteBackupSchedule",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
/// The metadata message for
/// [google.cloud.location.Location.metadata][google.cloud.location.Location.metadata].
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LocationMetadata {}