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
|
// @generated
// This file is @generated by prost-build.
/// Relationship specifies how a resource relates to a subject. Relationships
/// form the data for the graph over which all permissions questions are
/// answered.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Relationship {
/// resource is the resource to which the subject is related, in some manner
#[prost(message, optional, tag="1")]
pub resource: ::core::option::Option<ObjectReference>,
/// relation is how the resource and subject are related.
#[prost(string, tag="2")]
pub relation: ::prost::alloc::string::String,
/// subject is the subject to which the resource is related, in some manner.
#[prost(message, optional, tag="3")]
pub subject: ::core::option::Option<SubjectReference>,
/// optional_caveat is a reference to a the caveat that must be enforced over the relationship
#[prost(message, optional, tag="4")]
pub optional_caveat: ::core::option::Option<ContextualizedCaveat>,
/// optional_expires_at is the time at which the relationship expires, if any.
#[prost(message, optional, tag="5")]
pub optional_expires_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
/// ContextualizedCaveat represents a reference to a caveat to be used by caveated relationships.
/// The context consists of key-value pairs that will be injected at evaluation time.
/// The keys must match the arguments defined on the caveat in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ContextualizedCaveat {
/// caveat_name is the name of the caveat expression to use, as defined in the schema
#[prost(string, tag="1")]
pub caveat_name: ::prost::alloc::string::String,
/// context consists of any named values that are defined at write time for the caveat expression
#[prost(message, optional, tag="2")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
}
/// SubjectReference is used for referring to the subject portion of a
/// Relationship. The relation component is optional and is used for defining a
/// sub-relation on the subject, e.g. group:123#members
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubjectReference {
#[prost(message, optional, tag="1")]
pub object: ::core::option::Option<ObjectReference>,
#[prost(string, tag="2")]
pub optional_relation: ::prost::alloc::string::String,
}
/// ObjectReference is used to refer to a specific object in the system.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ObjectReference {
#[prost(string, tag="1")]
pub object_type: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub object_id: ::prost::alloc::string::String,
}
/// ZedToken is used to provide causality metadata between Write and Check
/// requests.
///
/// See the authzed.api.v1.Consistency message for more information.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ZedToken {
#[prost(string, tag="1")]
pub token: ::prost::alloc::string::String,
}
/// Cursor is used to provide resumption of listing between calls to APIs
/// such as LookupResources.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Cursor {
#[prost(string, tag="1")]
pub token: ::prost::alloc::string::String,
}
/// RelationshipUpdate is used for mutating a single relationship within the
/// service.
///
/// CREATE will create the relationship only if it doesn't exist, and error
/// otherwise.
///
/// TOUCH will upsert the relationship, and will not error if it
/// already exists.
///
/// DELETE will delete the relationship. If the relationship does not exist,
/// this operation will no-op.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelationshipUpdate {
#[prost(enumeration="relationship_update::Operation", tag="1")]
pub operation: i32,
#[prost(message, optional, tag="2")]
pub relationship: ::core::option::Option<Relationship>,
}
/// Nested message and enum types in `RelationshipUpdate`.
pub mod relationship_update {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operation {
Unspecified = 0,
Create = 1,
Touch = 2,
Delete = 3,
}
impl Operation {
/// 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 {
Operation::Unspecified => "OPERATION_UNSPECIFIED",
Operation::Create => "OPERATION_CREATE",
Operation::Touch => "OPERATION_TOUCH",
Operation::Delete => "OPERATION_DELETE",
}
}
/// 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_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_CREATE" => Some(Self::Create),
"OPERATION_TOUCH" => Some(Self::Touch),
"OPERATION_DELETE" => Some(Self::Delete),
_ => None,
}
}
}
}
/// PermissionRelationshipTree is used for representing a tree of a resource and
/// its permission relationships with other objects.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PermissionRelationshipTree {
#[prost(message, optional, tag="3")]
pub expanded_object: ::core::option::Option<ObjectReference>,
#[prost(string, tag="4")]
pub expanded_relation: ::prost::alloc::string::String,
#[prost(oneof="permission_relationship_tree::TreeType", tags="1, 2")]
pub tree_type: ::core::option::Option<permission_relationship_tree::TreeType>,
}
/// Nested message and enum types in `PermissionRelationshipTree`.
pub mod permission_relationship_tree {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum TreeType {
#[prost(message, tag="1")]
Intermediate(super::AlgebraicSubjectSet),
#[prost(message, tag="2")]
Leaf(super::DirectSubjectSet),
}
}
/// AlgebraicSubjectSet is a subject set which is computed based on applying the
/// specified operation to the operands according to the algebra of sets.
///
/// UNION is a logical set containing the subject members from all operands.
///
/// INTERSECTION is a logical set containing only the subject members which are
/// present in all operands.
///
/// EXCLUSION is a logical set containing only the subject members which are
/// present in the first operand, and none of the other operands.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AlgebraicSubjectSet {
#[prost(enumeration="algebraic_subject_set::Operation", tag="1")]
pub operation: i32,
#[prost(message, repeated, tag="2")]
pub children: ::prost::alloc::vec::Vec<PermissionRelationshipTree>,
}
/// Nested message and enum types in `AlgebraicSubjectSet`.
pub mod algebraic_subject_set {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operation {
Unspecified = 0,
Union = 1,
Intersection = 2,
Exclusion = 3,
}
impl Operation {
/// 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 {
Operation::Unspecified => "OPERATION_UNSPECIFIED",
Operation::Union => "OPERATION_UNION",
Operation::Intersection => "OPERATION_INTERSECTION",
Operation::Exclusion => "OPERATION_EXCLUSION",
}
}
/// 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_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_UNION" => Some(Self::Union),
"OPERATION_INTERSECTION" => Some(Self::Intersection),
"OPERATION_EXCLUSION" => Some(Self::Exclusion),
_ => None,
}
}
}
}
/// DirectSubjectSet is a subject set which is simply a collection of subjects.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DirectSubjectSet {
#[prost(message, repeated, tag="1")]
pub subjects: ::prost::alloc::vec::Vec<SubjectReference>,
}
/// PartialCaveatInfo carries information necessary for the client to take action
/// in the event a response contains a partially evaluated caveat
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PartialCaveatInfo {
/// missing_required_context is a list of one or more fields that were missing and prevented caveats
/// from being fully evaluated
#[prost(string, repeated, tag="1")]
pub missing_required_context: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// DebugInformation defines debug information returned by an API call in a footer when
/// requested with a specific debugging header.
///
/// The specific debug information returned will depend on the type of the API call made.
///
/// See the github.com/authzed/authzed-go project for the specific header and footer names.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugInformation {
/// check holds debug information about a check request.
#[prost(message, optional, tag="1")]
pub check: ::core::option::Option<CheckDebugTrace>,
/// schema_used holds the schema used for the request.
#[prost(string, tag="2")]
pub schema_used: ::prost::alloc::string::String,
}
/// CheckDebugTrace is a recursive trace of the requests made for resolving a CheckPermission
/// API call.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckDebugTrace {
/// resource holds the resource on which the Check was performed.
/// for batched calls, the object_id field contains a comma-separated list of object IDs
/// for all the resources checked in the batch.
#[prost(message, optional, tag="1")]
pub resource: ::core::option::Option<ObjectReference>,
/// permission holds the name of the permission or relation on which the Check was performed.
#[prost(string, tag="2")]
pub permission: ::prost::alloc::string::String,
/// permission_type holds information indicating whether it was a permission or relation.
#[prost(enumeration="check_debug_trace::PermissionType", tag="3")]
pub permission_type: i32,
/// subject holds the subject on which the Check was performed. This will be static across all calls within
/// the same Check tree.
#[prost(message, optional, tag="4")]
pub subject: ::core::option::Option<SubjectReference>,
/// result holds the result of the Check call.
#[prost(enumeration="check_debug_trace::Permissionship", tag="5")]
pub result: i32,
/// caveat_evaluation_info holds information about the caveat evaluated for this step of the trace.
#[prost(message, optional, tag="8")]
pub caveat_evaluation_info: ::core::option::Option<CaveatEvalInfo>,
/// duration holds the time spent executing this Check operation.
#[prost(message, optional, tag="9")]
pub duration: ::core::option::Option<super::super::super::google::protobuf::Duration>,
/// optional_expires_at is the time at which at least one of the relationships used to
/// compute this result, expires (if any). This is *not* related to the caching window.
#[prost(message, optional, tag="10")]
pub optional_expires_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
/// trace_operation_id is a unique identifier for this trace's operation, that will
/// be shared for all traces created for the same check operation in SpiceDB.
///
/// In cases where SpiceDB performs automatic batching of subproblems, this ID can be used
/// to correlate work that was shared across multiple traces.
///
/// This identifier is generated by SpiceDB, is to be considered opaque to the caller
/// and only guaranteed to be unique within the same overall Check or CheckBulk operation.
#[prost(string, tag="11")]
pub trace_operation_id: ::prost::alloc::string::String,
/// source holds the source of the result. It is of the form:
/// `<sourcetype>:<sourceid>`, where sourcetype can be, among others:
/// `spicedb`, `materialize`, etc.
#[prost(string, tag="12")]
pub source: ::prost::alloc::string::String,
/// resolution holds information about how the problem was resolved.
#[prost(oneof="check_debug_trace::Resolution", tags="6, 7")]
pub resolution: ::core::option::Option<check_debug_trace::Resolution>,
}
/// Nested message and enum types in `CheckDebugTrace`.
pub mod check_debug_trace {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubProblems {
#[prost(message, repeated, tag="1")]
pub traces: ::prost::alloc::vec::Vec<super::CheckDebugTrace>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PermissionType {
Unspecified = 0,
Relation = 1,
Permission = 2,
}
impl PermissionType {
/// 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 {
PermissionType::Unspecified => "PERMISSION_TYPE_UNSPECIFIED",
PermissionType::Relation => "PERMISSION_TYPE_RELATION",
PermissionType::Permission => "PERMISSION_TYPE_PERMISSION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERMISSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"PERMISSION_TYPE_RELATION" => Some(Self::Relation),
"PERMISSION_TYPE_PERMISSION" => Some(Self::Permission),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Permissionship {
Unspecified = 0,
NoPermission = 1,
HasPermission = 2,
ConditionalPermission = 3,
}
impl Permissionship {
/// 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 {
Permissionship::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
Permissionship::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
Permissionship::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
Permissionship::ConditionalPermission => "PERMISSIONSHIP_CONDITIONAL_PERMISSION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
"PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
"PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
"PERMISSIONSHIP_CONDITIONAL_PERMISSION" => Some(Self::ConditionalPermission),
_ => None,
}
}
}
/// resolution holds information about how the problem was resolved.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Resolution {
/// was_cached_result, if true, indicates that the result was found in the cache and returned directly.
#[prost(bool, tag="6")]
WasCachedResult(bool),
/// sub_problems holds the sub problems that were executed to resolve the answer to this Check. An empty list
/// and a permissionship of PERMISSIONSHIP_HAS_PERMISSION indicates the subject was found within this relation.
#[prost(message, tag="7")]
SubProblems(SubProblems),
}
}
/// CaveatEvalInfo holds information about a caveat expression that was evaluated.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CaveatEvalInfo {
/// expression is the expression that was evaluated.
#[prost(string, tag="1")]
pub expression: ::prost::alloc::string::String,
/// result is the result of the evaluation.
#[prost(enumeration="caveat_eval_info::Result", tag="2")]
pub result: i32,
/// context consists of any named values that were used for evaluating the caveat expression.
#[prost(message, optional, tag="3")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
/// partial_caveat_info holds information of a partially-evaluated caveated response, if applicable.
#[prost(message, optional, tag="4")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
/// caveat_name is the name of the caveat that was executed, if applicable.
#[prost(string, tag="5")]
pub caveat_name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `CaveatEvalInfo`.
pub mod caveat_eval_info {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Result {
Unspecified = 0,
Unevaluated = 1,
False = 2,
True = 3,
MissingSomeContext = 4,
}
impl Result {
/// 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 {
Result::Unspecified => "RESULT_UNSPECIFIED",
Result::Unevaluated => "RESULT_UNEVALUATED",
Result::False => "RESULT_FALSE",
Result::True => "RESULT_TRUE",
Result::MissingSomeContext => "RESULT_MISSING_SOME_CONTEXT",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"RESULT_UNSPECIFIED" => Some(Self::Unspecified),
"RESULT_UNEVALUATED" => Some(Self::Unevaluated),
"RESULT_FALSE" => Some(Self::False),
"RESULT_TRUE" => Some(Self::True),
"RESULT_MISSING_SOME_CONTEXT" => Some(Self::MissingSomeContext),
_ => None,
}
}
}
}
/// Defines the supported values for `google.rpc.ErrorInfo.reason` for the
/// `authzed.com` error domain.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ErrorReason {
/// Do not use this default value.
Unspecified = 0,
/// The request gave a schema that could not be parsed.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_SCHEMA_PARSE_ERROR",
/// "domain": "authzed.com",
/// "metadata": {
/// "start_line_number": "1",
/// "start_column_position": "19",
/// "end_line_number": "1",
/// "end_column_position": "19",
/// "source_code": "somedefinition",
/// }
/// }
///
/// The line numbers and column positions are 0-indexed and may not be present.
SchemaParseError = 1,
/// The request contains a schema with a type error.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_SCHEMA_TYPE_ERROR",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// ... additional keys based on the kind of type error ...
/// }
/// }
SchemaTypeError = 2,
/// The request referenced an unknown object definition in the schema.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_UNKNOWN_DEFINITION",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition"
/// }
/// }
UnknownDefinition = 3,
/// The request referenced an unknown relation or permission under a definition in the schema.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_UNKNOWN_RELATION_OR_PERMISSION",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// "relation_or_permission_name": "somepermission"
/// }
/// }
UnknownRelationOrPermission = 4,
/// The WriteRelationships request contained more updates than the maximum configured.
///
/// Example of an ErrorInfo:
///
/// { "reason": "ERROR_REASON_TOO_MANY_UPDATES_IN_REQUEST",
/// "domain": "authzed.com",
/// "metadata": {
/// "update_count": "525",
/// "maximum_updates_allowed": "500",
/// }
/// }
TooManyUpdatesInRequest = 5,
/// The request contained more preconditions than the maximum configured.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_TOO_MANY_PRECONDITIONS_IN_REQUEST",
/// "domain": "authzed.com",
/// "metadata": {
/// "precondition_count": "525",
/// "maximum_preconditions_allowed": "500",
/// }
/// }
TooManyPreconditionsInRequest = 6,
/// The request contained a precondition that failed.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_WRITE_OR_DELETE_PRECONDITION_FAILURE",
/// "domain": "authzed.com",
/// "metadata": {
/// "precondition_resource_type": "document",
/// ... other fields for the filter ...
/// "precondition_operation": "MUST_EXIST",
/// }
/// }
WriteOrDeletePreconditionFailure = 7,
/// A write or delete request was made to an instance that is deployed in read-only mode.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_SERVICE_READ_ONLY",
/// "domain": "authzed.com"
/// }
ServiceReadOnly = 8,
/// The request referenced an unknown caveat in the schema.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_UNKNOWN_CAVEAT",
/// "domain": "authzed.com",
/// "metadata": {
/// "caveat_name": "somecaveat"
/// }
/// }
UnknownCaveat = 9,
/// The request tries to use a subject type that was not valid for a relation.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_INVALID_SUBJECT_TYPE",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// "relation_name": "somerelation",
/// "subject_type": "user:*"
/// }
/// }
InvalidSubjectType = 10,
/// The request tries to specify a caveat parameter value with the wrong type.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_CAVEAT_PARAMETER_TYPE_ERROR",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// "relation_name": "somerelation",
/// "caveat_name": "somecaveat",
/// "parameter_name": "someparameter",
/// "expected_type": "int",
/// }
/// }
CaveatParameterTypeError = 11,
/// The request tries to perform two or more updates on the same relationship in the same WriteRelationships call.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_UPDATES_ON_SAME_RELATIONSHIP",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// "relationship": "somerelationship",
/// }
/// }
UpdatesOnSameRelationship = 12,
/// The request tries to write a relationship on a permission instead of a relation.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_CANNOT_UPDATE_PERMISSION",
/// "domain": "authzed.com",
/// "metadata": {
/// "definition_name": "somedefinition",
/// "permission_name": "somerelation",
/// }
/// }
CannotUpdatePermission = 13,
/// The request failed to evaluate a caveat expression due to an error.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_CAVEAT_EVALUATION_ERROR",
/// "domain": "authzed.com",
/// "metadata": {
/// "caveat_name": "somecaveat",
/// }
/// }
CaveatEvaluationError = 14,
/// The request failed because the provided cursor was invalid in some way.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_INVALID_CURSOR",
/// "domain": "authzed.com",
/// "metadata": {
/// ... additional keys based on the kind of cursor error ...
/// }
/// }
InvalidCursor = 15,
/// The request failed because there are too many matching relationships to be
/// deleted within a single transactional deletion call. To avoid, set
/// `optional_allow_partial_deletions` to true on the DeleteRelationships call.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE",
/// "domain": "authzed.com",
/// "metadata": {
/// ... fields for the filter ...
/// }
/// }
TooManyRelationshipsForTransactionalDelete = 16,
/// The request failed because the client attempted to write a relationship
/// with a context that exceeded the configured server limit.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE",
/// "domain": "authzed.com",
/// "metadata": {
/// "relationship": "relationship_exceeding_the_limit",
/// "max_allowed_size": "server_max_allowed_context_size",
/// "context_size": "actual_relationship_context_size" ,
/// }
/// }
MaxRelationshipContextSize = 17,
/// The request failed because a relationship marked to be CREATEd
/// was already present within the datastore.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP",
/// "domain": "authzed.com",
/// "metadata": {
/// "relationship": "relationship_that_already_existed",
/// "resource_type": "resource type",
/// "resource_object_id": "resource object id",
/// ... additional decomposed relationship fields ...
/// }
/// }
AttemptToRecreateRelationship = 18,
/// The request failed because it caused the maximum depth allowed to be
/// exceeded. This typically indicates that there is a circular data traversal
/// somewhere in the schema, but can also be raised if the data traversal is simply
/// too deep.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_MAXIMUM_DEPTH_EXCEEDED",
/// "domain": "authzed.com",
/// "metadata": {
/// "maximum_depth_allowed": "50",
/// ... additional fields based on request type ...
/// }
/// }
MaximumDepthExceeded = 19,
/// The request failed due to a serialization error in the backend database.
/// This typically indicates that various in flight transactions conflicted with each other
/// and the database had to abort one or more of them. SpiceDB will retry a few times before returning
/// the error to the client.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_SERIALIZATION_FAILURE",
/// "domain": "authzed.com",
/// "metadata": {}
/// }
SerializationFailure = 20,
/// The request contained more check items than the maximum configured.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_TOO_MANY_CHECKS_IN_REQUEST",
/// "domain": "authzed.com",
/// "metadata": {
/// "check_count": "525",
/// "maximum_checks_allowed": "500",
/// }
/// }
TooManyChecksInRequest = 21,
/// The request's specified limit is too large.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_EXCEEDS_MAXIMUM_ALLOWABLE_LIMIT",
/// "domain": "authzed.com",
/// "metadata": {
/// "limit_provided": "525",
/// "maximum_limit_allowed": "500",
/// }
/// }
ExceedsMaximumAllowableLimit = 22,
/// The request failed because the provided filter was invalid in some way.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_INVALID_FILTER",
/// "domain": "authzed.com",
/// "metadata": {
/// "filter": "...",
/// }
/// }
InvalidFilter = 23,
/// The request failed because too many concurrent updates were attempted
/// against the in-memory datastore.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_INMEMORY_TOO_MANY_CONCURRENT_UPDATES",
/// "domain": "authzed.com",
/// "metadata": {}
/// }
InmemoryTooManyConcurrentUpdates = 24,
/// The request failed because the precondition specified is empty.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_EMPTY_PRECONDITION",
/// "domain": "authzed.com",
/// "metadata": {}
/// }
EmptyPrecondition = 25,
/// The request failed because the counter was already registered.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_COUNTER_ALREADY_REGISTERED",
/// "domain": "authzed.com",
/// "metadata": { "counter_name": "name" }
/// }
CounterAlreadyRegistered = 26,
/// The request failed because the counter was not registered.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_COUNTER_NOT_REGISTERED",
/// "domain": "authzed.com",
/// "metadata": { "counter_name": "name" }
/// }
CounterNotRegistered = 27,
/// The request failed because a wildcard was not allowed. For CheckPermission,
/// this means that the subject or resource ID was a wildcard. For LookupResources,
/// this means that the subject ID was a wildcard.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_WILDCARD_NOT_ALLOWED",
/// "domain": "authzed.com",
/// "metadata": { "disallowed_field": "subject_id" }
/// }
WildcardNotAllowed = 28,
/// The request failed because the transaction metadata was too large.
///
/// Example of an ErrorInfo:
///
/// {
/// "reason": "ERROR_REASON_TRANSACTION_METADATA_TOO_LARGE",
/// "domain": "authzed.com",
/// "metadata": {
/// "metadata_byte_size": "1024",
/// "maximum_allowed_metadata_byte_size": "512",
/// }
/// }
TransactionMetadataTooLarge = 29,
}
impl ErrorReason {
/// 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 {
ErrorReason::Unspecified => "ERROR_REASON_UNSPECIFIED",
ErrorReason::SchemaParseError => "ERROR_REASON_SCHEMA_PARSE_ERROR",
ErrorReason::SchemaTypeError => "ERROR_REASON_SCHEMA_TYPE_ERROR",
ErrorReason::UnknownDefinition => "ERROR_REASON_UNKNOWN_DEFINITION",
ErrorReason::UnknownRelationOrPermission => "ERROR_REASON_UNKNOWN_RELATION_OR_PERMISSION",
ErrorReason::TooManyUpdatesInRequest => "ERROR_REASON_TOO_MANY_UPDATES_IN_REQUEST",
ErrorReason::TooManyPreconditionsInRequest => "ERROR_REASON_TOO_MANY_PRECONDITIONS_IN_REQUEST",
ErrorReason::WriteOrDeletePreconditionFailure => "ERROR_REASON_WRITE_OR_DELETE_PRECONDITION_FAILURE",
ErrorReason::ServiceReadOnly => "ERROR_REASON_SERVICE_READ_ONLY",
ErrorReason::UnknownCaveat => "ERROR_REASON_UNKNOWN_CAVEAT",
ErrorReason::InvalidSubjectType => "ERROR_REASON_INVALID_SUBJECT_TYPE",
ErrorReason::CaveatParameterTypeError => "ERROR_REASON_CAVEAT_PARAMETER_TYPE_ERROR",
ErrorReason::UpdatesOnSameRelationship => "ERROR_REASON_UPDATES_ON_SAME_RELATIONSHIP",
ErrorReason::CannotUpdatePermission => "ERROR_REASON_CANNOT_UPDATE_PERMISSION",
ErrorReason::CaveatEvaluationError => "ERROR_REASON_CAVEAT_EVALUATION_ERROR",
ErrorReason::InvalidCursor => "ERROR_REASON_INVALID_CURSOR",
ErrorReason::TooManyRelationshipsForTransactionalDelete => "ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE",
ErrorReason::MaxRelationshipContextSize => "ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE",
ErrorReason::AttemptToRecreateRelationship => "ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP",
ErrorReason::MaximumDepthExceeded => "ERROR_REASON_MAXIMUM_DEPTH_EXCEEDED",
ErrorReason::SerializationFailure => "ERROR_REASON_SERIALIZATION_FAILURE",
ErrorReason::TooManyChecksInRequest => "ERROR_REASON_TOO_MANY_CHECKS_IN_REQUEST",
ErrorReason::ExceedsMaximumAllowableLimit => "ERROR_REASON_EXCEEDS_MAXIMUM_ALLOWABLE_LIMIT",
ErrorReason::InvalidFilter => "ERROR_REASON_INVALID_FILTER",
ErrorReason::InmemoryTooManyConcurrentUpdates => "ERROR_REASON_INMEMORY_TOO_MANY_CONCURRENT_UPDATES",
ErrorReason::EmptyPrecondition => "ERROR_REASON_EMPTY_PRECONDITION",
ErrorReason::CounterAlreadyRegistered => "ERROR_REASON_COUNTER_ALREADY_REGISTERED",
ErrorReason::CounterNotRegistered => "ERROR_REASON_COUNTER_NOT_REGISTERED",
ErrorReason::WildcardNotAllowed => "ERROR_REASON_WILDCARD_NOT_ALLOWED",
ErrorReason::TransactionMetadataTooLarge => "ERROR_REASON_TRANSACTION_METADATA_TOO_LARGE",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"ERROR_REASON_UNSPECIFIED" => Some(Self::Unspecified),
"ERROR_REASON_SCHEMA_PARSE_ERROR" => Some(Self::SchemaParseError),
"ERROR_REASON_SCHEMA_TYPE_ERROR" => Some(Self::SchemaTypeError),
"ERROR_REASON_UNKNOWN_DEFINITION" => Some(Self::UnknownDefinition),
"ERROR_REASON_UNKNOWN_RELATION_OR_PERMISSION" => Some(Self::UnknownRelationOrPermission),
"ERROR_REASON_TOO_MANY_UPDATES_IN_REQUEST" => Some(Self::TooManyUpdatesInRequest),
"ERROR_REASON_TOO_MANY_PRECONDITIONS_IN_REQUEST" => Some(Self::TooManyPreconditionsInRequest),
"ERROR_REASON_WRITE_OR_DELETE_PRECONDITION_FAILURE" => Some(Self::WriteOrDeletePreconditionFailure),
"ERROR_REASON_SERVICE_READ_ONLY" => Some(Self::ServiceReadOnly),
"ERROR_REASON_UNKNOWN_CAVEAT" => Some(Self::UnknownCaveat),
"ERROR_REASON_INVALID_SUBJECT_TYPE" => Some(Self::InvalidSubjectType),
"ERROR_REASON_CAVEAT_PARAMETER_TYPE_ERROR" => Some(Self::CaveatParameterTypeError),
"ERROR_REASON_UPDATES_ON_SAME_RELATIONSHIP" => Some(Self::UpdatesOnSameRelationship),
"ERROR_REASON_CANNOT_UPDATE_PERMISSION" => Some(Self::CannotUpdatePermission),
"ERROR_REASON_CAVEAT_EVALUATION_ERROR" => Some(Self::CaveatEvaluationError),
"ERROR_REASON_INVALID_CURSOR" => Some(Self::InvalidCursor),
"ERROR_REASON_TOO_MANY_RELATIONSHIPS_FOR_TRANSACTIONAL_DELETE" => Some(Self::TooManyRelationshipsForTransactionalDelete),
"ERROR_REASON_MAX_RELATIONSHIP_CONTEXT_SIZE" => Some(Self::MaxRelationshipContextSize),
"ERROR_REASON_ATTEMPT_TO_RECREATE_RELATIONSHIP" => Some(Self::AttemptToRecreateRelationship),
"ERROR_REASON_MAXIMUM_DEPTH_EXCEEDED" => Some(Self::MaximumDepthExceeded),
"ERROR_REASON_SERIALIZATION_FAILURE" => Some(Self::SerializationFailure),
"ERROR_REASON_TOO_MANY_CHECKS_IN_REQUEST" => Some(Self::TooManyChecksInRequest),
"ERROR_REASON_EXCEEDS_MAXIMUM_ALLOWABLE_LIMIT" => Some(Self::ExceedsMaximumAllowableLimit),
"ERROR_REASON_INVALID_FILTER" => Some(Self::InvalidFilter),
"ERROR_REASON_INMEMORY_TOO_MANY_CONCURRENT_UPDATES" => Some(Self::InmemoryTooManyConcurrentUpdates),
"ERROR_REASON_EMPTY_PRECONDITION" => Some(Self::EmptyPrecondition),
"ERROR_REASON_COUNTER_ALREADY_REGISTERED" => Some(Self::CounterAlreadyRegistered),
"ERROR_REASON_COUNTER_NOT_REGISTERED" => Some(Self::CounterNotRegistered),
"ERROR_REASON_WILDCARD_NOT_ALLOWED" => Some(Self::WildcardNotAllowed),
"ERROR_REASON_TRANSACTION_METADATA_TOO_LARGE" => Some(Self::TransactionMetadataTooLarge),
_ => None,
}
}
}
/// Consistency will define how a request is handled by the backend.
/// By defining a consistency requirement, and a token at which those
/// requirements should be applied, where applicable.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Consistency {
#[prost(oneof="consistency::Requirement", tags="1, 2, 3, 4")]
pub requirement: ::core::option::Option<consistency::Requirement>,
}
/// Nested message and enum types in `Consistency`.
pub mod consistency {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Requirement {
/// minimize_latency indicates that the latency for the call should be
/// minimized by having the system select the fastest snapshot available.
#[prost(bool, tag="1")]
MinimizeLatency(bool),
/// at_least_as_fresh indicates that all data used in the API call must be
/// *at least as fresh* as that found in the ZedToken; more recent data might
/// be used if available or faster.
#[prost(message, tag="2")]
AtLeastAsFresh(super::ZedToken),
/// at_exact_snapshot indicates that all data used in the API call must be
/// *at the given* snapshot in time; if the snapshot is no longer available,
/// an error will be returned to the caller.
#[prost(message, tag="3")]
AtExactSnapshot(super::ZedToken),
/// fully_consistent indicates that all data used in the API call *must* be
/// at the most recent snapshot found.
///
/// NOTE: using this method can be *quite slow*, so unless there is a need to
/// do so, it is recommended to use `at_least_as_fresh` with a stored
/// ZedToken.
#[prost(bool, tag="4")]
FullyConsistent(bool),
}
}
/// RelationshipFilter is a collection of filters which when applied to a
/// relationship will return relationships that have exactly matching fields.
///
/// All fields are optional and if left unspecified will not filter relationships,
/// but at least one field must be specified.
///
/// NOTE: The performance of the API will be affected by the selection of fields
/// on which to filter. If a field is not indexed, the performance of the API
/// can be significantly slower.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelationshipFilter {
/// resource_type is the *optional* resource type of the relationship.
/// NOTE: It is not prefixed with "optional_" for legacy compatibility.
#[prost(string, tag="1")]
pub resource_type: ::prost::alloc::string::String,
/// optional_resource_id is the *optional* resource ID of the relationship.
/// If specified, optional_resource_id_prefix cannot be specified.
#[prost(string, tag="2")]
pub optional_resource_id: ::prost::alloc::string::String,
/// optional_resource_id_prefix is the *optional* prefix for the resource ID of the relationship.
/// If specified, optional_resource_id cannot be specified.
#[prost(string, tag="5")]
pub optional_resource_id_prefix: ::prost::alloc::string::String,
/// relation is the *optional* relation of the relationship.
#[prost(string, tag="3")]
pub optional_relation: ::prost::alloc::string::String,
/// optional_subject_filter is the optional filter for the subjects of the relationships.
#[prost(message, optional, tag="4")]
pub optional_subject_filter: ::core::option::Option<SubjectFilter>,
}
/// SubjectFilter specifies a filter on the subject of a relationship.
///
/// subject_type is required and all other fields are optional, and will not
/// impose any additional requirements if left unspecified.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubjectFilter {
#[prost(string, tag="1")]
pub subject_type: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub optional_subject_id: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub optional_relation: ::core::option::Option<subject_filter::RelationFilter>,
}
/// Nested message and enum types in `SubjectFilter`.
pub mod subject_filter {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RelationFilter {
#[prost(string, tag="1")]
pub relation: ::prost::alloc::string::String,
}
}
/// ReadRelationshipsRequest specifies one or more filters used to read matching
/// relationships within the system.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadRelationshipsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// relationship_filter defines the filter to be applied to the relationships
/// to be returned.
#[prost(message, optional, tag="2")]
pub relationship_filter: ::core::option::Option<RelationshipFilter>,
/// optional_limit, if non-zero, specifies the limit on the number of relationships to return
/// before the stream is closed on the server side. By default, the stream will continue
/// resolving relationships until exhausted or the stream is closed due to the client or a
/// network issue.
#[prost(uint32, tag="3")]
pub optional_limit: u32,
/// optional_cursor, if specified, indicates the cursor after which results should resume being returned.
/// The cursor can be found on the ReadRelationshipsResponse object.
#[prost(message, optional, tag="4")]
pub optional_cursor: ::core::option::Option<Cursor>,
}
/// ReadRelationshipsResponse contains a Relationship found that matches the
/// specified relationship filter(s). A instance of this response message will
/// be streamed to the client for each relationship found.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadRelationshipsResponse {
/// read_at is the ZedToken at which the relationship was found.
#[prost(message, optional, tag="1")]
pub read_at: ::core::option::Option<ZedToken>,
/// relationship is the found relationship.
#[prost(message, optional, tag="2")]
pub relationship: ::core::option::Option<Relationship>,
/// after_result_cursor holds a cursor that can be used to resume the ReadRelationships stream after this
/// result.
#[prost(message, optional, tag="3")]
pub after_result_cursor: ::core::option::Option<Cursor>,
}
/// Precondition specifies how and the existence or absence of certain
/// relationships as expressed through the accompanying filter should affect
/// whether or not the operation proceeds.
///
/// MUST_NOT_MATCH will fail the parent request if any relationships match the
/// relationships filter.
/// MUST_MATCH will fail the parent request if there are no
/// relationships that match the filter.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Precondition {
#[prost(enumeration="precondition::Operation", tag="1")]
pub operation: i32,
#[prost(message, optional, tag="2")]
pub filter: ::core::option::Option<RelationshipFilter>,
}
/// Nested message and enum types in `Precondition`.
pub mod precondition {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Operation {
Unspecified = 0,
MustNotMatch = 1,
MustMatch = 2,
}
impl Operation {
/// 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 {
Operation::Unspecified => "OPERATION_UNSPECIFIED",
Operation::MustNotMatch => "OPERATION_MUST_NOT_MATCH",
Operation::MustMatch => "OPERATION_MUST_MATCH",
}
}
/// 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_UNSPECIFIED" => Some(Self::Unspecified),
"OPERATION_MUST_NOT_MATCH" => Some(Self::MustNotMatch),
"OPERATION_MUST_MATCH" => Some(Self::MustMatch),
_ => None,
}
}
}
}
/// WriteRelationshipsRequest contains a list of Relationship mutations that
/// should be applied to the service. If the optional_preconditions parameter
/// is included, all of the specified preconditions must also be satisfied before
/// the write will be committed. All updates will be applied transactionally,
/// and if any preconditions fail, the entire transaction will be reverted.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRelationshipsRequest {
#[prost(message, repeated, tag="1")]
pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
/// To be bounded by configuration
#[prost(message, repeated, tag="2")]
pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
/// optional_transaction_metadata is an optional field that can be used to store metadata about the transaction.
/// If specified, this metadata will be supplied in the WatchResponse for the updates associated with this
/// transaction.
#[prost(message, optional, tag="3")]
pub optional_transaction_metadata: ::core::option::Option<super::super::super::google::protobuf::Struct>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteRelationshipsResponse {
#[prost(message, optional, tag="1")]
pub written_at: ::core::option::Option<ZedToken>,
}
/// DeleteRelationshipsRequest specifies which Relationships should be deleted,
/// requesting the delete of *ALL* relationships that match the specified
/// filters. If the optional_preconditions parameter is included, all of the
/// specified preconditions must also be satisfied before the delete will be
/// executed.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRelationshipsRequest {
#[prost(message, optional, tag="1")]
pub relationship_filter: ::core::option::Option<RelationshipFilter>,
/// To be bounded by configuration
#[prost(message, repeated, tag="2")]
pub optional_preconditions: ::prost::alloc::vec::Vec<Precondition>,
/// optional_limit, if non-zero, specifies the limit on the number of relationships to be deleted.
/// If there are more matching relationships found to be deleted than the limit specified here,
/// the deletion call will fail with an error to prevent partial deletion. If partial deletion
/// is needed, specify below that partial deletion is allowed. Partial deletions can be used
/// in a loop to delete large amounts of relationships in a *non-transactional* manner.
#[prost(uint32, tag="3")]
pub optional_limit: u32,
/// optional_allow_partial_deletions, if true and a limit is specified, will delete matching found
/// relationships up to the count specified in optional_limit, and no more.
#[prost(bool, tag="4")]
pub optional_allow_partial_deletions: bool,
/// optional_transaction_metadata is an optional field that can be used to store metadata about the transaction.
/// If specified, this metadata will be supplied in the WatchResponse for the deletions associated with
/// this transaction.
#[prost(message, optional, tag="5")]
pub optional_transaction_metadata: ::core::option::Option<super::super::super::google::protobuf::Struct>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteRelationshipsResponse {
/// deleted_at is the revision at which the relationships were deleted.
#[prost(message, optional, tag="1")]
pub deleted_at: ::core::option::Option<ZedToken>,
/// deletion_progress is an enumeration of the possible outcomes that occurred when attempting to delete the specified relationships.
#[prost(enumeration="delete_relationships_response::DeletionProgress", tag="2")]
pub deletion_progress: i32,
/// relationships_deleted_count is the number of relationships that were deleted.
#[prost(uint64, tag="3")]
pub relationships_deleted_count: u64,
}
/// Nested message and enum types in `DeleteRelationshipsResponse`.
pub mod delete_relationships_response {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DeletionProgress {
Unspecified = 0,
/// DELETION_PROGRESS_COMPLETE indicates that all remaining relationships matching the filter
/// were deleted. Will be returned even if no relationships were deleted.
Complete = 1,
/// DELETION_PROGRESS_PARTIAL indicates that a subset of the relationships matching the filter
/// were deleted. Only returned if optional_allow_partial_deletions was true, an optional_limit was
/// specified, and there existed more relationships matching the filter than optional_limit would allow.
/// Once all remaining relationships have been deleted, DELETION_PROGRESS_COMPLETE will be returned.
Partial = 2,
}
impl DeletionProgress {
/// 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 {
DeletionProgress::Unspecified => "DELETION_PROGRESS_UNSPECIFIED",
DeletionProgress::Complete => "DELETION_PROGRESS_COMPLETE",
DeletionProgress::Partial => "DELETION_PROGRESS_PARTIAL",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DELETION_PROGRESS_UNSPECIFIED" => Some(Self::Unspecified),
"DELETION_PROGRESS_COMPLETE" => Some(Self::Complete),
"DELETION_PROGRESS_PARTIAL" => Some(Self::Partial),
_ => None,
}
}
}
}
/// CheckPermissionRequest issues a check on whether a subject has a permission
/// or is a member of a relation, on a specific resource.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckPermissionRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// resource is the resource on which to check the permission or relation.
#[prost(message, optional, tag="2")]
pub resource: ::core::option::Option<ObjectReference>,
/// permission is the name of the permission (or relation) on which to execute
/// the check.
#[prost(string, tag="3")]
pub permission: ::prost::alloc::string::String,
/// subject is the subject that will be checked for the permission or relation.
#[prost(message, optional, tag="4")]
pub subject: ::core::option::Option<SubjectReference>,
/// context consists of named values that are injected into the caveat evaluation context
#[prost(message, optional, tag="5")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
/// with_tracing, if true, indicates that the response should include a debug trace.
/// This can be useful for debugging and performance analysis, but adds a small amount
/// of compute overhead to the request.
#[prost(bool, tag="6")]
pub with_tracing: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckPermissionResponse {
#[prost(message, optional, tag="1")]
pub checked_at: ::core::option::Option<ZedToken>,
/// Permissionship communicates whether or not the subject has the requested
/// permission or has a relationship with the given resource, over the given
/// relation.
///
/// This value will be authzed.api.v1.PERMISSIONSHIP_HAS_PERMISSION if the
/// requested subject is a member of the computed permission set or there
/// exists a relationship with the requested relation from the given resource
/// to the given subject.
#[prost(enumeration="check_permission_response::Permissionship", tag="2")]
pub permissionship: i32,
/// partial_caveat_info holds information of a partially-evaluated caveated response
#[prost(message, optional, tag="3")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
/// debug_trace is the debugging trace of this check, if requested.
#[prost(message, optional, tag="4")]
pub debug_trace: ::core::option::Option<DebugInformation>,
/// optional_expires_at is the time at which at least one of the relationships used to
/// compute this result, expires (if any). This is *not* related to the caching window.
#[prost(message, optional, tag="5")]
pub optional_expires_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
/// Nested message and enum types in `CheckPermissionResponse`.
pub mod check_permission_response {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Permissionship {
Unspecified = 0,
NoPermission = 1,
HasPermission = 2,
ConditionalPermission = 3,
}
impl Permissionship {
/// 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 {
Permissionship::Unspecified => "PERMISSIONSHIP_UNSPECIFIED",
Permissionship::NoPermission => "PERMISSIONSHIP_NO_PERMISSION",
Permissionship::HasPermission => "PERMISSIONSHIP_HAS_PERMISSION",
Permissionship::ConditionalPermission => "PERMISSIONSHIP_CONDITIONAL_PERMISSION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
"PERMISSIONSHIP_NO_PERMISSION" => Some(Self::NoPermission),
"PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
"PERMISSIONSHIP_CONDITIONAL_PERMISSION" => Some(Self::ConditionalPermission),
_ => None,
}
}
}
}
/// CheckBulkPermissionsRequest issues a check on whether a subject has permission
/// or is a member of a relation on a specific resource for each item in the list.
///
/// The ordering of the items in the response is maintained in the response.
/// Checks with the same subject/permission will automatically be batched for performance optimization.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckBulkPermissionsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(message, repeated, tag="2")]
pub items: ::prost::alloc::vec::Vec<CheckBulkPermissionsRequestItem>,
/// with_tracing, if true, indicates that each response should include a debug trace.
/// This can be useful for debugging and performance analysis, but adds a small amount
/// of compute overhead to the request.
#[prost(bool, tag="3")]
pub with_tracing: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckBulkPermissionsRequestItem {
#[prost(message, optional, tag="1")]
pub resource: ::core::option::Option<ObjectReference>,
#[prost(string, tag="2")]
pub permission: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub subject: ::core::option::Option<SubjectReference>,
#[prost(message, optional, tag="4")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckBulkPermissionsResponse {
#[prost(message, optional, tag="1")]
pub checked_at: ::core::option::Option<ZedToken>,
#[prost(message, repeated, tag="2")]
pub pairs: ::prost::alloc::vec::Vec<CheckBulkPermissionsPair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckBulkPermissionsPair {
#[prost(message, optional, tag="1")]
pub request: ::core::option::Option<CheckBulkPermissionsRequestItem>,
#[prost(oneof="check_bulk_permissions_pair::Response", tags="2, 3")]
pub response: ::core::option::Option<check_bulk_permissions_pair::Response>,
}
/// Nested message and enum types in `CheckBulkPermissionsPair`.
pub mod check_bulk_permissions_pair {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag="2")]
Item(super::CheckBulkPermissionsResponseItem),
#[prost(message, tag="3")]
Error(super::super::super::super::google::rpc::Status),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckBulkPermissionsResponseItem {
#[prost(enumeration="check_permission_response::Permissionship", tag="1")]
pub permissionship: i32,
#[prost(message, optional, tag="2")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
/// debug_trace is the debugging trace of this check, if requested.
#[prost(message, optional, tag="3")]
pub debug_trace: ::core::option::Option<DebugInformation>,
}
/// ExpandPermissionTreeRequest returns a tree representing the expansion of all
/// relationships found accessible from a permission or relation on a particular
/// resource.
///
/// ExpandPermissionTreeRequest is typically used to determine the full set of
/// subjects with a permission, along with the relationships that grant said
/// access.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandPermissionTreeRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// resource is the resource over which to run the expansion.
#[prost(message, optional, tag="2")]
pub resource: ::core::option::Option<ObjectReference>,
/// permission is the name of the permission or relation over which to run the
/// expansion for the resource.
#[prost(string, tag="3")]
pub permission: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpandPermissionTreeResponse {
#[prost(message, optional, tag="1")]
pub expanded_at: ::core::option::Option<ZedToken>,
/// tree_root is a tree structure whose leaf nodes are subjects, and
/// intermediate nodes represent the various operations (union, intersection,
/// exclusion) to reach those subjects.
#[prost(message, optional, tag="2")]
pub tree_root: ::core::option::Option<PermissionRelationshipTree>,
}
/// LookupResourcesRequest performs a lookup of all resources of a particular
/// kind on which the subject has the specified permission or the relation in
/// which the subject exists, streaming back the IDs of those resources.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupResourcesRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// resource_object_type is the type of resource object for which the IDs will
/// be returned.
#[prost(string, tag="2")]
pub resource_object_type: ::prost::alloc::string::String,
/// permission is the name of the permission or relation for which the subject
/// must Check.
#[prost(string, tag="3")]
pub permission: ::prost::alloc::string::String,
/// subject is the subject with access to the resources.
#[prost(message, optional, tag="4")]
pub subject: ::core::option::Option<SubjectReference>,
/// context consists of named values that are injected into the caveat evaluation context
#[prost(message, optional, tag="5")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
/// optional_limit, if non-zero, specifies the limit on the number of resources to return
/// before the stream is closed on the server side. By default, the stream will continue
/// resolving resources until exhausted or the stream is closed due to the client or a
/// network issue.
#[prost(uint32, tag="6")]
pub optional_limit: u32,
/// optional_cursor, if specified, indicates the cursor after which results should resume being returned.
/// The cursor can be found on the LookupResourcesResponse object.
#[prost(message, optional, tag="7")]
pub optional_cursor: ::core::option::Option<Cursor>,
}
/// LookupResourcesResponse contains a single matching resource object ID for the
/// requested object type, permission, and subject.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupResourcesResponse {
/// looked_up_at is the ZedToken at which the resource was found.
#[prost(message, optional, tag="1")]
pub looked_up_at: ::core::option::Option<ZedToken>,
/// resource_object_id is the object ID of the found resource.
#[prost(string, tag="2")]
pub resource_object_id: ::prost::alloc::string::String,
/// permissionship indicates whether the response was partially evaluated or not
#[prost(enumeration="LookupPermissionship", tag="3")]
pub permissionship: i32,
/// partial_caveat_info holds information of a partially-evaluated caveated response
#[prost(message, optional, tag="4")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
/// after_result_cursor holds a cursor that can be used to resume the LookupResources stream after this
/// result.
#[prost(message, optional, tag="5")]
pub after_result_cursor: ::core::option::Option<Cursor>,
}
/// LookupSubjectsRequest performs a lookup of all subjects of a particular
/// kind for which the subject has the specified permission or the relation in
/// which the subject exists, streaming back the IDs of those subjects.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupSubjectsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// resource is the resource for which all matching subjects for the permission
/// or relation will be returned.
#[prost(message, optional, tag="2")]
pub resource: ::core::option::Option<ObjectReference>,
/// permission is the name of the permission (or relation) for which to find
/// the subjects.
#[prost(string, tag="3")]
pub permission: ::prost::alloc::string::String,
/// subject_object_type is the type of subject object for which the IDs will
/// be returned.
#[prost(string, tag="4")]
pub subject_object_type: ::prost::alloc::string::String,
/// optional_subject_relation is the optional relation for the subject.
#[prost(string, tag="5")]
pub optional_subject_relation: ::prost::alloc::string::String,
/// context consists of named values that are injected into the caveat evaluation context
#[prost(message, optional, tag="6")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
/// optional_concrete_limit is currently unimplemented for LookupSubjects
/// and will return an error as of SpiceDB version 1.40.1. This will
/// be implemented in a future version of SpiceDB.
#[prost(uint32, tag="7")]
pub optional_concrete_limit: u32,
/// optional_cursor is currently unimplemented for LookupSubjects
/// and will be ignored as of SpiceDB version 1.40.1. This will
/// be implemented in a future version of SpiceDB.
#[prost(message, optional, tag="8")]
pub optional_cursor: ::core::option::Option<Cursor>,
/// wildcard_option specifies whether wildcards should be returned by LookupSubjects.
/// For backwards compatibility, defaults to WILDCARD_OPTION_INCLUDE_WILDCARDS if unspecified.
#[prost(enumeration="lookup_subjects_request::WildcardOption", tag="9")]
pub wildcard_option: i32,
}
/// Nested message and enum types in `LookupSubjectsRequest`.
pub mod lookup_subjects_request {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WildcardOption {
Unspecified = 0,
IncludeWildcards = 1,
ExcludeWildcards = 2,
}
impl WildcardOption {
/// 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 {
WildcardOption::Unspecified => "WILDCARD_OPTION_UNSPECIFIED",
WildcardOption::IncludeWildcards => "WILDCARD_OPTION_INCLUDE_WILDCARDS",
WildcardOption::ExcludeWildcards => "WILDCARD_OPTION_EXCLUDE_WILDCARDS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"WILDCARD_OPTION_UNSPECIFIED" => Some(Self::Unspecified),
"WILDCARD_OPTION_INCLUDE_WILDCARDS" => Some(Self::IncludeWildcards),
"WILDCARD_OPTION_EXCLUDE_WILDCARDS" => Some(Self::ExcludeWildcards),
_ => None,
}
}
}
}
/// LookupSubjectsResponse contains a single matching subject object ID for the
/// requested subject object type on the permission or relation.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LookupSubjectsResponse {
#[prost(message, optional, tag="1")]
pub looked_up_at: ::core::option::Option<ZedToken>,
/// subject_object_id is the Object ID of the subject found. May be a `*` if
/// a wildcard was found.
/// deprecated: use `subject`
#[deprecated]
#[prost(string, tag="2")]
pub subject_object_id: ::prost::alloc::string::String,
/// excluded_subject_ids are the Object IDs of the subjects excluded. This list
/// will only contain object IDs if `subject_object_id` is a wildcard (`*`) and
/// will only be populated if exclusions exist from the wildcard.
/// deprecated: use `excluded_subjects`
#[deprecated]
#[prost(string, repeated, tag="3")]
pub excluded_subject_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// permissionship indicates whether the response was partially evaluated or not
/// deprecated: use `subject.permissionship`
#[deprecated]
#[prost(enumeration="LookupPermissionship", tag="4")]
pub permissionship: i32,
/// partial_caveat_info holds information of a partially-evaluated caveated response
/// deprecated: use `subject.partial_caveat_info`
#[deprecated]
#[prost(message, optional, tag="5")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
/// subject is the subject found, along with its permissionship.
#[prost(message, optional, tag="6")]
pub subject: ::core::option::Option<ResolvedSubject>,
/// excluded_subjects are the subjects excluded. This list
/// will only contain subjects if `subject.subject_object_id` is a wildcard (`*`) and
/// will only be populated if exclusions exist from the wildcard.
#[prost(message, repeated, tag="7")]
pub excluded_subjects: ::prost::alloc::vec::Vec<ResolvedSubject>,
/// after_result_cursor holds a cursor that can be used to resume the LookupSubjects stream after this
/// result.
#[prost(message, optional, tag="8")]
pub after_result_cursor: ::core::option::Option<Cursor>,
}
/// ResolvedSubject is a single subject resolved within LookupSubjects.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResolvedSubject {
/// subject_object_id is the Object ID of the subject found. May be a `*` if
/// a wildcard was found.
#[prost(string, tag="1")]
pub subject_object_id: ::prost::alloc::string::String,
/// permissionship indicates whether the response was partially evaluated or not
#[prost(enumeration="LookupPermissionship", tag="2")]
pub permissionship: i32,
/// partial_caveat_info holds information of a partially-evaluated caveated response
#[prost(message, optional, tag="3")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
}
/// ImportBulkRelationshipsRequest represents one batch of the streaming
/// ImportBulkRelationships API. The maximum size is only limited by the backing
/// datastore, and optimal size should be determined by the calling client
/// experimentally. When ImportBulk is invoked and receives its first request message,
/// a transaction is opened to import the relationships. All requests sent to the same
/// invocation are executed under this single transaction. If a relationship already
/// exists within the datastore, the entire transaction will fail with an error.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportBulkRelationshipsRequest {
#[prost(message, repeated, tag="1")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
}
/// ImportBulkRelationshipsResponse is returned on successful completion of the
/// bulk load stream, and contains the total number of relationships loaded.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ImportBulkRelationshipsResponse {
#[prost(uint64, tag="1")]
pub num_loaded: u64,
}
/// ExportBulkRelationshipsRequest represents a resumable request for
/// all relationships from the server.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportBulkRelationshipsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// optional_limit, if non-zero, specifies the limit on the number of
/// relationships the server can return in one page. By default, the server
/// will pick a page size, and the server is free to choose a smaller size
/// at will.
#[prost(uint32, tag="2")]
pub optional_limit: u32,
/// optional_cursor, if specified, indicates the cursor after which results
/// should resume being returned. The cursor can be found on the
/// BulkExportRelationshipsResponse object.
#[prost(message, optional, tag="3")]
pub optional_cursor: ::core::option::Option<Cursor>,
/// optional_relationship_filter, if specified, indicates the
/// filter to apply to each relationship to be exported.
#[prost(message, optional, tag="4")]
pub optional_relationship_filter: ::core::option::Option<RelationshipFilter>,
}
/// ExportBulkRelationshipsResponse is one page in a stream of relationship
/// groups that meet the criteria specified by the originating request. The
/// server will continue to stream back relationship groups as quickly as it can
/// until all relationships have been transmitted back.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportBulkRelationshipsResponse {
#[prost(message, optional, tag="1")]
pub after_result_cursor: ::core::option::Option<Cursor>,
#[prost(message, repeated, tag="2")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
}
/// LookupPermissionship represents whether a Lookup response was partially evaluated or not
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum LookupPermissionship {
Unspecified = 0,
HasPermission = 1,
ConditionalPermission = 2,
}
impl LookupPermissionship {
/// 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 {
LookupPermissionship::Unspecified => "LOOKUP_PERMISSIONSHIP_UNSPECIFIED",
LookupPermissionship::HasPermission => "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
LookupPermissionship::ConditionalPermission => "LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"LOOKUP_PERMISSIONSHIP_UNSPECIFIED" => Some(Self::Unspecified),
"LOOKUP_PERMISSIONSHIP_HAS_PERMISSION" => Some(Self::HasPermission),
"LOOKUP_PERMISSIONSHIP_CONDITIONAL_PERMISSION" => Some(Self::ConditionalPermission),
_ => None,
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalRegisterRelationshipCounterRequest {
/// name is the name of the counter being registered.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// relationship_filter defines the filter to be applied to the relationships
/// to be counted.
#[prost(message, optional, tag="2")]
pub relationship_filter: ::core::option::Option<RelationshipFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExperimentalRegisterRelationshipCounterResponse {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalCountRelationshipsRequest {
/// name is the name of the counter whose count is being requested.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalCountRelationshipsResponse {
#[prost(oneof="experimental_count_relationships_response::CounterResult", tags="1, 2")]
pub counter_result: ::core::option::Option<experimental_count_relationships_response::CounterResult>,
}
/// Nested message and enum types in `ExperimentalCountRelationshipsResponse`.
pub mod experimental_count_relationships_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum CounterResult {
/// counter_still_calculating is true if the counter is still calculating the count.
#[prost(bool, tag="1")]
CounterStillCalculating(bool),
/// read_counter_value is the value of the counter at the time of the read.
#[prost(message, tag="2")]
ReadCounterValue(super::ReadCounterValue),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadCounterValue {
/// relationship_count is the count of relationships that match the filter.
#[prost(uint64, tag="1")]
pub relationship_count: u64,
/// read_at is the ZedToken at which the relationship count applies.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalUnregisterRelationshipCounterRequest {
/// name is the name of the counter being unregistered.
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExperimentalUnregisterRelationshipCounterResponse {
}
/// NOTE: Deprecated now that BulkCheckPermission has been promoted to the stable API as "CheckBulkPermission".
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkCheckPermissionRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[deprecated]
#[prost(message, repeated, tag="2")]
pub items: ::prost::alloc::vec::Vec<BulkCheckPermissionRequestItem>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkCheckPermissionRequestItem {
#[prost(message, optional, tag="1")]
pub resource: ::core::option::Option<ObjectReference>,
#[prost(string, tag="2")]
pub permission: ::prost::alloc::string::String,
#[prost(message, optional, tag="3")]
pub subject: ::core::option::Option<SubjectReference>,
#[prost(message, optional, tag="4")]
pub context: ::core::option::Option<super::super::super::google::protobuf::Struct>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkCheckPermissionResponse {
#[prost(message, optional, tag="1")]
pub checked_at: ::core::option::Option<ZedToken>,
#[prost(message, repeated, tag="2")]
pub pairs: ::prost::alloc::vec::Vec<BulkCheckPermissionPair>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkCheckPermissionPair {
#[prost(message, optional, tag="1")]
pub request: ::core::option::Option<BulkCheckPermissionRequestItem>,
#[prost(oneof="bulk_check_permission_pair::Response", tags="2, 3")]
pub response: ::core::option::Option<bulk_check_permission_pair::Response>,
}
/// Nested message and enum types in `BulkCheckPermissionPair`.
pub mod bulk_check_permission_pair {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Response {
#[prost(message, tag="2")]
Item(super::BulkCheckPermissionResponseItem),
#[prost(message, tag="3")]
Error(super::super::super::super::google::rpc::Status),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkCheckPermissionResponseItem {
#[prost(enumeration="check_permission_response::Permissionship", tag="1")]
pub permissionship: i32,
#[prost(message, optional, tag="2")]
pub partial_caveat_info: ::core::option::Option<PartialCaveatInfo>,
}
/// BulkImportRelationshipsRequest represents one batch of the streaming
/// BulkImportRelationships API. The maximum size is only limited by the backing
/// datastore, and optimal size should be determined by the calling client
/// experimentally. When BulkImport is invoked and receives its first request message,
/// a transaction is opened to import the relationships. All requests sent to the same
/// invocation are executed under this single transaction. If a relationship already
/// exists within the datastore, the entire transaction will fail with an error.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkImportRelationshipsRequest {
#[prost(message, repeated, tag="1")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
}
/// BulkImportRelationshipsResponse is returned on successful completion of the
/// bulk load stream, and contains the total number of relationships loaded.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BulkImportRelationshipsResponse {
#[prost(uint64, tag="1")]
pub num_loaded: u64,
}
/// BulkExportRelationshipsRequest represents a resumable request for
/// all relationships from the server.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkExportRelationshipsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// optional_limit, if non-zero, specifies the limit on the number of
/// relationships the server can return in one page. By default, the server
/// will pick a page size, and the server is free to choose a smaller size
/// at will.
#[prost(uint32, tag="2")]
pub optional_limit: u32,
/// optional_cursor, if specified, indicates the cursor after which results
/// should resume being returned. The cursor can be found on the
/// BulkExportRelationshipsResponse object.
#[prost(message, optional, tag="3")]
pub optional_cursor: ::core::option::Option<Cursor>,
/// optional_relationship_filter, if specified, indicates the
/// filter to apply to each relationship to be exported.
#[prost(message, optional, tag="4")]
pub optional_relationship_filter: ::core::option::Option<RelationshipFilter>,
}
/// BulkExportRelationshipsResponse is one page in a stream of relationship
/// groups that meet the criteria specified by the originating request. The
/// server will continue to stream back relationship groups as quickly as it can
/// until all relationships have been transmitted back.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BulkExportRelationshipsResponse {
#[prost(message, optional, tag="1")]
pub after_result_cursor: ::core::option::Option<Cursor>,
#[prost(message, repeated, tag="2")]
pub relationships: ::prost::alloc::vec::Vec<Relationship>,
}
// Reflection types ////////////////////////////////////////////
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalReflectSchemaRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// optional_filters defines optional filters that are applied in
/// an OR fashion to the schema, before being returned
#[prost(message, repeated, tag="2")]
pub optional_filters: ::prost::alloc::vec::Vec<ExpSchemaFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalReflectSchemaResponse {
/// definitions are the definitions defined in the schema.
#[prost(message, repeated, tag="1")]
pub definitions: ::prost::alloc::vec::Vec<ExpDefinition>,
/// caveats are the caveats defined in the schema.
#[prost(message, repeated, tag="2")]
pub caveats: ::prost::alloc::vec::Vec<ExpCaveat>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="3")]
pub read_at: ::core::option::Option<ZedToken>,
}
/// ExpSchemaFilter is a filter that can be applied to the schema on reflection.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpSchemaFilter {
/// optional_definition_name_filter is a prefix that is matched against the definition name.
#[prost(string, tag="1")]
pub optional_definition_name_filter: ::prost::alloc::string::String,
/// optional_caveat_name_filter is a prefix that is matched against the caveat name.
#[prost(string, tag="2")]
pub optional_caveat_name_filter: ::prost::alloc::string::String,
/// optional_relation_name_filter is a prefix that is matched against the relation name.
#[prost(string, tag="3")]
pub optional_relation_name_filter: ::prost::alloc::string::String,
/// optional_permission_name_filter is a prefix that is matched against the permission name.
#[prost(string, tag="4")]
pub optional_permission_name_filter: ::prost::alloc::string::String,
}
/// ExpDefinition is the representation of a definition in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpDefinition {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the definition. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub relations: ::prost::alloc::vec::Vec<ExpRelation>,
#[prost(message, repeated, tag="4")]
pub permissions: ::prost::alloc::vec::Vec<ExpPermission>,
}
/// ExpCaveat is the representation of a caveat in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpCaveat {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the caveat. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub parameters: ::prost::alloc::vec::Vec<ExpCaveatParameter>,
#[prost(string, tag="4")]
pub expression: ::prost::alloc::string::String,
}
/// ExpCaveatParameter is the representation of a parameter in a caveat.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpCaveatParameter {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// type is the type of the parameter. Will be a string representing the
/// type, e.g. `int` or `list<string>`
#[prost(string, tag="2")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_caveat_name: ::prost::alloc::string::String,
}
/// ExpRelation is the representation of a relation in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpRelation {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_definition_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag="4")]
pub subject_types: ::prost::alloc::vec::Vec<ExpTypeReference>,
}
/// ExpTypeReference is the representation of a type reference in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpTypeReference {
/// subject_definition_name is the name of the subject's definition.
#[prost(string, tag="1")]
pub subject_definition_name: ::prost::alloc::string::String,
/// optional_caveat_name is the name of the caveat that is applied to the subject, if any.
#[prost(string, tag="2")]
pub optional_caveat_name: ::prost::alloc::string::String,
#[prost(oneof="exp_type_reference::Typeref", tags="3, 4, 5")]
pub typeref: ::core::option::Option<exp_type_reference::Typeref>,
}
/// Nested message and enum types in `ExpTypeReference`.
pub mod exp_type_reference {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Typeref {
/// is_terminal_subject is true if the subject is terminal, meaning it is referenced directly vs a sub-relation.
#[prost(bool, tag="3")]
IsTerminalSubject(bool),
/// optional_relation_name is the name of the relation that is applied to the subject, if any.
#[prost(string, tag="4")]
OptionalRelationName(::prost::alloc::string::String),
/// is_public_wildcard is true if the subject is a public wildcard.
#[prost(bool, tag="5")]
IsPublicWildcard(bool),
}
}
/// ExpPermission is the representation of a permission in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpPermission {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the permission. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_definition_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalComputablePermissionsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub relation_name: ::prost::alloc::string::String,
/// optional_definition_name_match is a prefix that is matched against the definition name(s)
/// for the permissions returned.
/// If not specified, will be ignored.
#[prost(string, tag="4")]
pub optional_definition_name_filter: ::prost::alloc::string::String,
}
/// ExpRelationReference is a reference to a relation or permission in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpRelationReference {
#[prost(string, tag="1")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub relation_name: ::prost::alloc::string::String,
#[prost(bool, tag="3")]
pub is_permission: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalComputablePermissionsResponse {
#[prost(message, repeated, tag="1")]
pub permissions: ::prost::alloc::vec::Vec<ExpRelationReference>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalDependentRelationsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub permission_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalDependentRelationsResponse {
#[prost(message, repeated, tag="1")]
pub relations: ::prost::alloc::vec::Vec<ExpRelationReference>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalDiffSchemaRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub comparison_schema: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExperimentalDiffSchemaResponse {
#[prost(message, repeated, tag="1")]
pub diffs: ::prost::alloc::vec::Vec<ExpSchemaDiff>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpRelationSubjectTypeChange {
#[prost(message, optional, tag="1")]
pub relation: ::core::option::Option<ExpRelation>,
#[prost(message, optional, tag="2")]
pub changed_subject_type: ::core::option::Option<ExpTypeReference>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpCaveatParameterTypeChange {
#[prost(message, optional, tag="1")]
pub parameter: ::core::option::Option<ExpCaveatParameter>,
#[prost(string, tag="2")]
pub previous_type: ::prost::alloc::string::String,
}
/// ExpSchemaDiff is the representation of a diff between two schemas.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExpSchemaDiff {
#[prost(oneof="exp_schema_diff::Diff", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19")]
pub diff: ::core::option::Option<exp_schema_diff::Diff>,
}
/// Nested message and enum types in `ExpSchemaDiff`.
pub mod exp_schema_diff {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Diff {
#[prost(message, tag="1")]
DefinitionAdded(super::ExpDefinition),
#[prost(message, tag="2")]
DefinitionRemoved(super::ExpDefinition),
#[prost(message, tag="3")]
DefinitionDocCommentChanged(super::ExpDefinition),
#[prost(message, tag="4")]
RelationAdded(super::ExpRelation),
#[prost(message, tag="5")]
RelationRemoved(super::ExpRelation),
#[prost(message, tag="6")]
RelationDocCommentChanged(super::ExpRelation),
#[prost(message, tag="7")]
RelationSubjectTypeAdded(super::ExpRelationSubjectTypeChange),
#[prost(message, tag="8")]
RelationSubjectTypeRemoved(super::ExpRelationSubjectTypeChange),
#[prost(message, tag="9")]
PermissionAdded(super::ExpPermission),
#[prost(message, tag="10")]
PermissionRemoved(super::ExpPermission),
#[prost(message, tag="11")]
PermissionDocCommentChanged(super::ExpPermission),
#[prost(message, tag="12")]
PermissionExprChanged(super::ExpPermission),
#[prost(message, tag="13")]
CaveatAdded(super::ExpCaveat),
#[prost(message, tag="14")]
CaveatRemoved(super::ExpCaveat),
#[prost(message, tag="15")]
CaveatDocCommentChanged(super::ExpCaveat),
#[prost(message, tag="16")]
CaveatExprChanged(super::ExpCaveat),
#[prost(message, tag="17")]
CaveatParameterAdded(super::ExpCaveatParameter),
#[prost(message, tag="18")]
CaveatParameterRemoved(super::ExpCaveatParameter),
#[prost(message, tag="19")]
CaveatParameterTypeChanged(super::ExpCaveatParameterTypeChange),
}
}
/// ReadSchemaRequest returns the schema from the database.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReadSchemaRequest {
}
/// ReadSchemaResponse is the resulting data after having read the Object
/// Definitions from a Schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadSchemaResponse {
/// schema_text is the textual form of the current schema in the system
#[prost(string, tag="1")]
pub schema_text: ::prost::alloc::string::String,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
/// WriteSchemaRequest is the required data used to "upsert" the Schema of a
/// Permissions System.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteSchemaRequest {
/// The Schema containing one or more Object Definitions that will be written
/// to the Permissions System.
///
/// 4MiB
#[prost(string, tag="1")]
pub schema: ::prost::alloc::string::String,
}
/// WriteSchemaResponse is the resulting data after having written a Schema to
/// a Permissions System.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteSchemaResponse {
/// written_at is the ZedToken at which the schema was written.
#[prost(message, optional, tag="1")]
pub written_at: ::core::option::Option<ZedToken>,
}
// Reflection types ////////////////////////////////////////////
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectSchemaRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
/// optional_filters defines optional filters that are applied in
/// an OR fashion to the schema, before being returned
#[prost(message, repeated, tag="2")]
pub optional_filters: ::prost::alloc::vec::Vec<ReflectionSchemaFilter>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectSchemaResponse {
/// definitions are the definitions defined in the schema.
#[prost(message, repeated, tag="1")]
pub definitions: ::prost::alloc::vec::Vec<ReflectionDefinition>,
/// caveats are the caveats defined in the schema.
#[prost(message, repeated, tag="2")]
pub caveats: ::prost::alloc::vec::Vec<ReflectionCaveat>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="3")]
pub read_at: ::core::option::Option<ZedToken>,
}
/// ReflectionSchemaFilter is a filter that can be applied to the schema on reflection.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionSchemaFilter {
/// optional_definition_name_filter is a prefix that is matched against the definition name.
#[prost(string, tag="1")]
pub optional_definition_name_filter: ::prost::alloc::string::String,
/// optional_caveat_name_filter is a prefix that is matched against the caveat name.
#[prost(string, tag="2")]
pub optional_caveat_name_filter: ::prost::alloc::string::String,
/// optional_relation_name_filter is a prefix that is matched against the relation name.
#[prost(string, tag="3")]
pub optional_relation_name_filter: ::prost::alloc::string::String,
/// optional_permission_name_filter is a prefix that is matched against the permission name.
#[prost(string, tag="4")]
pub optional_permission_name_filter: ::prost::alloc::string::String,
}
/// ReflectionDefinition is the representation of a definition in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionDefinition {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the definition. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub relations: ::prost::alloc::vec::Vec<ReflectionRelation>,
#[prost(message, repeated, tag="4")]
pub permissions: ::prost::alloc::vec::Vec<ReflectionPermission>,
}
/// ReflectionCaveat is the representation of a caveat in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionCaveat {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the caveat. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(message, repeated, tag="3")]
pub parameters: ::prost::alloc::vec::Vec<ReflectionCaveatParameter>,
#[prost(string, tag="4")]
pub expression: ::prost::alloc::string::String,
}
/// ReflectionCaveatParameter is the representation of a parameter in a caveat.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionCaveatParameter {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// type is the type of the parameter. Will be a string representing the
/// type, e.g. `int` or `list<string>`
#[prost(string, tag="2")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_caveat_name: ::prost::alloc::string::String,
}
/// ReflectionRelation is the representation of a relation in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionRelation {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_definition_name: ::prost::alloc::string::String,
#[prost(message, repeated, tag="4")]
pub subject_types: ::prost::alloc::vec::Vec<ReflectionTypeReference>,
}
/// ReflectionTypeReference is the representation of a type reference in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionTypeReference {
/// subject_definition_name is the name of the subject's definition.
#[prost(string, tag="1")]
pub subject_definition_name: ::prost::alloc::string::String,
/// optional_caveat_name is the name of the caveat that is applied to the subject, if any.
#[prost(string, tag="2")]
pub optional_caveat_name: ::prost::alloc::string::String,
#[prost(oneof="reflection_type_reference::Typeref", tags="3, 4, 5")]
pub typeref: ::core::option::Option<reflection_type_reference::Typeref>,
}
/// Nested message and enum types in `ReflectionTypeReference`.
pub mod reflection_type_reference {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Typeref {
/// is_terminal_subject is true if the subject is terminal, meaning it is referenced directly vs a sub-relation.
#[prost(bool, tag="3")]
IsTerminalSubject(bool),
/// optional_relation_name is the name of the relation that is applied to the subject, if any.
#[prost(string, tag="4")]
OptionalRelationName(::prost::alloc::string::String),
/// is_public_wildcard is true if the subject is a public wildcard.
#[prost(bool, tag="5")]
IsPublicWildcard(bool),
}
}
/// ReflectionPermission is the representation of a permission in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionPermission {
#[prost(string, tag="1")]
pub name: ::prost::alloc::string::String,
/// comment is a human-readable comments on the permission. Will include
/// delimiter characters.
#[prost(string, tag="2")]
pub comment: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub parent_definition_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComputablePermissionsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub relation_name: ::prost::alloc::string::String,
/// optional_definition_name_match is a prefix that is matched against the definition name(s)
/// for the permissions returned.
/// If not specified, will be ignored.
#[prost(string, tag="4")]
pub optional_definition_name_filter: ::prost::alloc::string::String,
}
/// ReflectionRelationReference is a reference to a relation or permission in the schema.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionRelationReference {
#[prost(string, tag="1")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub relation_name: ::prost::alloc::string::String,
#[prost(bool, tag="3")]
pub is_permission: bool,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ComputablePermissionsResponse {
#[prost(message, repeated, tag="1")]
pub permissions: ::prost::alloc::vec::Vec<ReflectionRelationReference>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DependentRelationsRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub definition_name: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub permission_name: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DependentRelationsResponse {
#[prost(message, repeated, tag="1")]
pub relations: ::prost::alloc::vec::Vec<ReflectionRelationReference>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiffSchemaRequest {
#[prost(message, optional, tag="1")]
pub consistency: ::core::option::Option<Consistency>,
#[prost(string, tag="2")]
pub comparison_schema: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiffSchemaResponse {
#[prost(message, repeated, tag="1")]
pub diffs: ::prost::alloc::vec::Vec<ReflectionSchemaDiff>,
/// read_at is the ZedToken at which the schema was read.
#[prost(message, optional, tag="2")]
pub read_at: ::core::option::Option<ZedToken>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionRelationSubjectTypeChange {
#[prost(message, optional, tag="1")]
pub relation: ::core::option::Option<ReflectionRelation>,
#[prost(message, optional, tag="2")]
pub changed_subject_type: ::core::option::Option<ReflectionTypeReference>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionCaveatParameterTypeChange {
#[prost(message, optional, tag="1")]
pub parameter: ::core::option::Option<ReflectionCaveatParameter>,
#[prost(string, tag="2")]
pub previous_type: ::prost::alloc::string::String,
}
/// ReflectionSchemaDiff is the representation of a diff between two schemas.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReflectionSchemaDiff {
#[prost(oneof="reflection_schema_diff::Diff", tags="1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19")]
pub diff: ::core::option::Option<reflection_schema_diff::Diff>,
}
/// Nested message and enum types in `ReflectionSchemaDiff`.
pub mod reflection_schema_diff {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Diff {
#[prost(message, tag="1")]
DefinitionAdded(super::ReflectionDefinition),
#[prost(message, tag="2")]
DefinitionRemoved(super::ReflectionDefinition),
#[prost(message, tag="3")]
DefinitionDocCommentChanged(super::ReflectionDefinition),
#[prost(message, tag="4")]
RelationAdded(super::ReflectionRelation),
#[prost(message, tag="5")]
RelationRemoved(super::ReflectionRelation),
#[prost(message, tag="6")]
RelationDocCommentChanged(super::ReflectionRelation),
#[prost(message, tag="7")]
RelationSubjectTypeAdded(super::ReflectionRelationSubjectTypeChange),
#[prost(message, tag="8")]
RelationSubjectTypeRemoved(super::ReflectionRelationSubjectTypeChange),
#[prost(message, tag="9")]
PermissionAdded(super::ReflectionPermission),
#[prost(message, tag="10")]
PermissionRemoved(super::ReflectionPermission),
#[prost(message, tag="11")]
PermissionDocCommentChanged(super::ReflectionPermission),
#[prost(message, tag="12")]
PermissionExprChanged(super::ReflectionPermission),
#[prost(message, tag="13")]
CaveatAdded(super::ReflectionCaveat),
#[prost(message, tag="14")]
CaveatRemoved(super::ReflectionCaveat),
#[prost(message, tag="15")]
CaveatDocCommentChanged(super::ReflectionCaveat),
#[prost(message, tag="16")]
CaveatExprChanged(super::ReflectionCaveat),
#[prost(message, tag="17")]
CaveatParameterAdded(super::ReflectionCaveatParameter),
#[prost(message, tag="18")]
CaveatParameterRemoved(super::ReflectionCaveatParameter),
#[prost(message, tag="19")]
CaveatParameterTypeChanged(super::ReflectionCaveatParameterTypeChange),
}
}
/// WatchRequest specifies what mutations to watch for, and an optional start snapshot for when to start
/// watching.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchRequest {
/// optional_object_types is a filter of resource object types to watch for relationship changes.
/// If specified, only changes to the specified object types will be returned and
/// optional_relationship_filters cannot be used.
#[prost(string, repeated, tag="1")]
pub optional_object_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// optional_start_cursor is the ZedToken holding the point-in-time at
/// which to start watching for changes.
/// If not specified, the watch will begin at the current head revision
/// of the datastore, returning any updates that occur after the caller
/// makes the request.
/// Note that if this cursor references a point-in-time containing data
/// that has been garbage collected, an error will be returned.
#[prost(message, optional, tag="2")]
pub optional_start_cursor: ::core::option::Option<ZedToken>,
/// optional_relationship_filters, if specified, indicates the
/// filter(s) to apply to each relationship to be returned by watch.
/// The relationship will be returned as long as at least one filter matches,
/// this allows clients to match relationships on multiple filters on a single watch call.
/// If specified, optional_object_types cannot be used.
#[prost(message, repeated, tag="3")]
pub optional_relationship_filters: ::prost::alloc::vec::Vec<RelationshipFilter>,
/// optional_update_kinds, if specified, indicates what kinds of mutations to include.
#[prost(enumeration="WatchKind", repeated, tag="4")]
pub optional_update_kinds: ::prost::alloc::vec::Vec<i32>,
}
/// WatchResponse contains all mutation events in ascending timestamp order,
/// from the requested start snapshot to a snapshot
/// encoded in the watch response. The client can use the snapshot to resume
/// watching where the previous watch response left off.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WatchResponse {
/// updates are the RelationshipUpdate events that have occurred since the
/// last watch response.
#[prost(message, repeated, tag="1")]
pub updates: ::prost::alloc::vec::Vec<RelationshipUpdate>,
/// changes_through is the ZedToken that represents the point in time
/// that the watch response is current through. This token can be used
/// in a subsequent WatchRequest to resume watching from this point.
#[prost(message, optional, tag="2")]
pub changes_through: ::core::option::Option<ZedToken>,
/// optional_transaction_metadata is an optional field that returns the transaction metadata
/// given to SpiceDB during the transaction that produced the changes in this response.
/// This field may not exist if no transaction metadata was provided.
#[prost(message, optional, tag="3")]
pub optional_transaction_metadata: ::core::option::Option<super::super::super::google::protobuf::Struct>,
/// schema_updated, if true, indicates that the schema was changed in this revision.
#[prost(bool, tag="4")]
pub schema_updated: bool,
/// is_checkpoint, if true, indicates that a checkpoint was reached.
/// A checkpoint indicates that the server guarantees that the client
/// will not observe any changes at a revision below or equal to the revision in this response.
#[prost(bool, tag="5")]
pub is_checkpoint: bool,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum WatchKind {
/// Default, just relationship updates (for backwards compatibility)
Unspecified = 0,
IncludeRelationshipUpdates = 1,
IncludeSchemaUpdates = 2,
IncludeCheckpoints = 3,
}
impl WatchKind {
/// 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 {
WatchKind::Unspecified => "WATCH_KIND_UNSPECIFIED",
WatchKind::IncludeRelationshipUpdates => "WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES",
WatchKind::IncludeSchemaUpdates => "WATCH_KIND_INCLUDE_SCHEMA_UPDATES",
WatchKind::IncludeCheckpoints => "WATCH_KIND_INCLUDE_CHECKPOINTS",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"WATCH_KIND_UNSPECIFIED" => Some(Self::Unspecified),
"WATCH_KIND_INCLUDE_RELATIONSHIP_UPDATES" => Some(Self::IncludeRelationshipUpdates),
"WATCH_KIND_INCLUDE_SCHEMA_UPDATES" => Some(Self::IncludeSchemaUpdates),
"WATCH_KIND_INCLUDE_CHECKPOINTS" => Some(Self::IncludeCheckpoints),
_ => None,
}
}
}
// @@protoc_insertion_point(module)
|