trust-tasks-rs 0.34.2

Reference Rust library for the Trust Tasks framework — transport-agnostic, JSON-based descriptions of verifiable work between parties.
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
//! Generated by `trust-tasks-codegen` — do not edit by hand.
//!
//! Spec slug: `vtc/storage/credentials/set`. Version: `0.2`.
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
/// Error types.
pub mod error {
    /// Error from a `TryFrom` or `FromStr` implementation.
    pub struct ConversionError(::std::borrow::Cow<'static, str>);
    impl ::std::error::Error for ConversionError {}
    impl ::std::fmt::Display for ConversionError {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
            ::std::fmt::Display::fmt(&self.0, f)
        }
    }
    impl ::std::fmt::Debug for ConversionError {
        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
            ::std::fmt::Debug::fmt(&self.0, f)
        }
    }
    impl From<&'static str> for ConversionError {
        fn from(value: &'static str) -> Self {
            Self(value.into())
        }
    }
    impl From<String> for ConversionError {
        fn from(value: String) -> Self {
            Self(value.into())
        }
    }
}
///Whether a config can authenticate now, and how — never the credential. `status`: `vta-account`, `ambient` and `sealed` are usable; `required` means the config cannot store until a credential is provided (a `sealed` config never set, or set before a restore, which carries no credential); `notAllowed` means the config's mode is one the community's host configuration no longer permits, so it cannot store until its `auth` is changed; `none` is a `local` config.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "CredentialState",
///  "description": "Whether a config can authenticate now, and how — never the credential. `status`: `vta-account`, `ambient` and `sealed` are usable; `required` means the config cannot store until a credential is provided (a `sealed` config never set, or set before a restore, which carries no credential); `notAllowed` means the config's mode is one the community's host configuration no longer permits, so it cannot store until its `auth` is changed; `none` is a `local` config.",
///  "type": "object",
///  "required": [
///    "status"
///  ],
///  "properties": {
///    "account": {
///      "description": "Present with `vta-account`.",
///      "$ref": "#/definitions/ExternalAccountId"
///    },
///    "context": {
///      "description": "Present with `vta-account`.",
///      "$ref": "#/definitions/ExternalAccountContextId"
///    },
///    "fingerprint": {
///      "description": "Present with `sealed`: a digest identifying the stored credential, so an administrator can tell which one is set without anyone being able to read it. Computed over the credential with a community-held key, never a bare hash of a low-entropy secret.",
///      "$ref": "#/definitions/DigestMultibase"
///    },
///    "roomsHoldingCredentials": {
///      "description": "Present with `vta-account`, `ambient` and `sealed`: how many rooms the community currently holds a live room-scoped credential for.",
///      "type": "integer",
///      "minimum": 0.0
///    },
///    "setAt": {
///      "description": "Present with `sealed`: when the stored credential was last set.",
///      "type": "string",
///      "format": "date-time"
///    },
///    "status": {
///      "type": "string",
///      "enum": [
///        "vta-account",
///        "ambient",
///        "sealed",
///        "required",
///        "notAllowed",
///        "none"
///      ]
///    }
///  },
///  "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct CredentialState {
    ///Present with `vta-account`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub account: ::std::option::Option<ExternalAccountId>,
    ///Present with `vta-account`.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub context: ::std::option::Option<ExternalAccountContextId>,
    ///Present with `sealed`: a digest identifying the stored credential, so an administrator can tell which one is set without anyone being able to read it. Computed over the credential with a community-held key, never a bare hash of a low-entropy secret.
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub fingerprint: ::std::option::Option<DigestMultibase>,
    ///Present with `vta-account`, `ambient` and `sealed`: how many rooms the community currently holds a live room-scoped credential for.
    #[serde(
        rename = "roomsHoldingCredentials",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub rooms_holding_credentials: ::std::option::Option<u64>,
    ///Present with `sealed`: when the stored credential was last set.
    #[serde(
        rename = "setAt",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub set_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
    pub status: CredentialStateStatus,
}
impl CredentialState {
    pub fn builder() -> builder::CredentialState {
        Default::default()
    }
}
///`CredentialStateStatus`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "enum": [
///    "vta-account",
///    "ambient",
///    "sealed",
///    "required",
///    "notAllowed",
///    "none"
///  ]
///}
/// ```
/// </details>
#[derive(
    ::serde::Deserialize,
    ::serde::Serialize,
    Clone,
    Copy,
    Debug,
    Eq,
    Hash,
    Ord,
    PartialEq,
    PartialOrd,
)]
#[non_exhaustive]
pub enum CredentialStateStatus {
    #[serde(rename = "vta-account")]
    VtaAccount,
    #[serde(rename = "ambient")]
    Ambient,
    #[serde(rename = "sealed")]
    Sealed,
    #[serde(rename = "required")]
    Required,
    #[serde(rename = "notAllowed")]
    NotAllowed,
    #[serde(rename = "none")]
    None,
}
impl ::std::fmt::Display for CredentialStateStatus {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        match *self {
            Self::VtaAccount => f.write_str("vta-account"),
            Self::Ambient => f.write_str("ambient"),
            Self::Sealed => f.write_str("sealed"),
            Self::Required => f.write_str("required"),
            Self::NotAllowed => f.write_str("notAllowed"),
            Self::None => f.write_str("none"),
        }
    }
}
impl ::std::str::FromStr for CredentialStateStatus {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        match value {
            "vta-account" => Ok(Self::VtaAccount),
            "ambient" => Ok(Self::Ambient),
            "sealed" => Ok(Self::Sealed),
            "required" => Ok(Self::Required),
            "notAllowed" => Ok(Self::NotAllowed),
            "none" => Ok(Self::None),
            _ => Err("invalid value".into()),
        }
    }
}
impl ::std::convert::TryFrom<&str> for CredentialStateStatus {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for CredentialStateStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for CredentialStateStatus {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
/**
A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.

Multihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.

This definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.

Restricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that "interoperability is not guaranteed between implementations using such values", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.*/
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "DigestMultibase",
///  "description": "A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\n\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\n\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\n\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \"interoperability is not guaranteed between implementations using such values\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.",
///  "examples": [
///    "zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR"
///  ],
///  "type": "string",
///  "minLength": 16,
///  "pattern": "^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct DigestMultibase(::std::string::String);
impl ::std::ops::Deref for DigestMultibase {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<DigestMultibase> for ::std::string::String {
    fn from(value: DigestMultibase) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for DigestMultibase {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() < 16usize {
            return Err("shorter than 16 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err(
                "doesn't match pattern \"^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$\"".into(),
            );
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for DigestMultibase {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for DigestMultibase {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for DigestMultibase {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for DigestMultibase {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Ext",
///  "description": "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.",
///  "type": "object",
///  "minProperties": 1,
///  "additionalProperties": true,
///  "propertyNames": {
///    "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
///  }
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct Ext(pub ::std::collections::HashMap<ExtKey, ::serde_json::Value>);
impl ::std::ops::Deref for Ext {
    type Target = ::std::collections::HashMap<ExtKey, ::serde_json::Value>;
    fn deref(&self) -> &::std::collections::HashMap<ExtKey, ::serde_json::Value> {
        &self.0
    }
}
impl ::std::convert::From<Ext> for ::std::collections::HashMap<ExtKey, ::serde_json::Value> {
    fn from(value: Ext) -> Self {
        value.0
    }
}
impl ::std::convert::From<::std::collections::HashMap<ExtKey, ::serde_json::Value>> for Ext {
    fn from(value: ::std::collections::HashMap<ExtKey, ::serde_json::Value>) -> Self {
        Self(value)
    }
}
///`ExtKey`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExtKey(::std::string::String);
impl ::std::ops::Deref for ExtKey {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExtKey> for ::std::string::String {
    fn from(value: ExtKey) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ExtKey {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ExtKey {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ExtKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ExtKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ExtKey {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The context at the community's VTA that owns an external account. The VTA names an account by its context and its identifier, and decides who may use it by act scope in that context: the community must hold `external-auth-use` there, and be bound to the account, for the account to issue it anything. Naming a context grants nothing; the VTA's binding is the gate.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "ExternalAccountContextId",
///  "description": "The context at the community's VTA that owns an external account. The VTA names an account by its context and its identifier, and decides who may use it by act scope in that context: the community must hold `external-auth-use` there, and be bound to the account, for the account to issue it anything. Naming a context grants nothing; the VTA's binding is the gate.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExternalAccountContextId(::std::string::String);
impl ::std::ops::Deref for ExternalAccountContextId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExternalAccountContextId> for ::std::string::String {
    fn from(value: ExternalAccountContextId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ExternalAccountContextId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ExternalAccountContextId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ExternalAccountContextId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ExternalAccountContextId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ExternalAccountContextId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The identifier of an external account held by the community's VTA (the external/accounts/* family), which issues the community short-lived, room-scoped credentials and holds the long-lived authority itself.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "ExternalAccountId",
///  "description": "The identifier of an external account held by the community's VTA (the external/accounts/* family), which issues the community short-lived, room-scoped credentials and holds the long-lived authority itself.",
///  "type": "string",
///  "maxLength": 64,
///  "minLength": 1,
///  "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct ExternalAccountId(::std::string::String);
impl ::std::ops::Deref for ExternalAccountId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<ExternalAccountId> for ::std::string::String {
    fn from(value: ExternalAccountId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for ExternalAccountId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 64usize {
            return Err("longer than 64 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for ExternalAccountId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for ExternalAccountId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for ExternalAccountId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for ExternalAccountId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Store a `sealed` storage config's long-lived credential, sealed end to end to the community. Write-only: no task returns it. The outer document members are owned by the framework — SPEC §6.3.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "$id": "https://trusttasks.org/spec/vtc/storage/credentials/set/0.2",
///  "title": "Payload",
///  "description": "Store a `sealed` storage config's long-lived credential, sealed end to end to the community. Write-only: no task returns it. The outer document members are owned by the framework — SPEC §6.3.",
///  "type": "object",
///  "required": [
///    "configId",
///    "digestMultibase",
///    "reason",
///    "sealed"
///  ],
///  "properties": {
///    "configId": {
///      "$ref": "#/definitions/StorageConfigId"
///    },
///    "digestMultibase": {
///      "description": "Digest over the armored bytes exactly as carried in `sealed`. Covered by the document's proof, and shown to approvers in place of the credential.",
///      "$ref": "#/definitions/DigestMultibase"
///    },
///    "ext": {
///      "$ref": "#/definitions/Ext"
///    },
///    "reason": {
///      "description": "Why the administrator is making this change. Recorded with the change in the audit trail and shown to approvers. Attributed to its author on every surface and untrusted: it MUST NOT carry personal data or a credential, and a reader MUST NOT treat it as instructions.",
///      "type": "string",
///      "maxLength": 500,
///      "minLength": 1
///    },
///    "sealed": {
///      "description": "OpenPGP-style ASCII-armored `sealed_transfer` ciphertext of the credential. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`; recipient the X25519 derivation of the community DID's Ed25519 key.",
///      "type": "string",
///      "maxLength": 16384,
///      "minLength": 64,
///      "pattern": "^-----BEGIN VTA SEALED BUNDLE-----"
///    }
///  },
///  "additionalProperties": false
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Payload {
    #[serde(rename = "configId")]
    pub config_id: StorageConfigId,
    ///Digest over the armored bytes exactly as carried in `sealed`. Covered by the document's proof, and shown to approvers in place of the credential.
    #[serde(rename = "digestMultibase")]
    pub digest_multibase: DigestMultibase,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ext: ::std::option::Option<Ext>,
    ///Why the administrator is making this change. Recorded with the change in the audit trail and shown to approvers. Attributed to its author on every surface and untrusted: it MUST NOT carry personal data or a credential, and a reader MUST NOT treat it as instructions.
    pub reason: PayloadReason,
    ///OpenPGP-style ASCII-armored `sealed_transfer` ciphertext of the credential. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`; recipient the X25519 derivation of the community DID's Ed25519 key.
    pub sealed: PayloadSealed,
}
impl Payload {
    pub fn builder() -> builder::Payload {
        Default::default()
    }
}
///Why the administrator is making this change. Recorded with the change in the audit trail and shown to approvers. Attributed to its author on every surface and untrusted: it MUST NOT carry personal data or a credential, and a reader MUST NOT treat it as instructions.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Why the administrator is making this change. Recorded with the change in the audit trail and shown to approvers. Attributed to its author on every surface and untrusted: it MUST NOT carry personal data or a credential, and a reader MUST NOT treat it as instructions.",
///  "type": "string",
///  "maxLength": 500,
///  "minLength": 1
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadReason(::std::string::String);
impl ::std::ops::Deref for PayloadReason {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayloadReason> for ::std::string::String {
    fn from(value: PayloadReason) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for PayloadReason {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 500usize {
            return Err("longer than 500 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for PayloadReason {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PayloadReason {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PayloadReason {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for PayloadReason {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///OpenPGP-style ASCII-armored `sealed_transfer` ciphertext of the credential. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`; recipient the X25519 derivation of the community DID's Ed25519 key.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "OpenPGP-style ASCII-armored `sealed_transfer` ciphertext of the credential. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`; recipient the X25519 derivation of the community DID's Ed25519 key.",
///  "type": "string",
///  "maxLength": 16384,
///  "minLength": 64,
///  "pattern": "^-----BEGIN VTA SEALED BUNDLE-----"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct PayloadSealed(::std::string::String);
impl ::std::ops::Deref for PayloadSealed {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<PayloadSealed> for ::std::string::String {
    fn from(value: PayloadSealed) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for PayloadSealed {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 16384usize {
            return Err("longer than 16384 characters".into());
        }
        if value.chars().count() < 64usize {
            return Err("shorter than 64 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^-----BEGIN VTA SEALED BUNDLE-----").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^-----BEGIN VTA SEALED BUNDLE-----\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for PayloadSealed {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for PayloadSealed {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for PayloadSealed {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for PayloadSealed {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`Response`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "Response",
///  "type": "object",
///  "required": [
///    "configId",
///    "credentialState"
///  ],
///  "properties": {
///    "configId": {
///      "$ref": "#/definitions/StorageConfigId"
///    },
///    "credentialState": {
///      "$ref": "#/definitions/CredentialState"
///    },
///    "ext": {
///      "$ref": "#/definitions/Ext"
///    },
///    "probeOk": {
///      "description": "Present when the community probed the config with the new credential.",
///      "type": "boolean"
///    }
///  },
///  "additionalProperties": false,
///  "$anchor": "response"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(deny_unknown_fields)]
#[non_exhaustive]
pub struct Response {
    #[serde(rename = "configId")]
    pub config_id: StorageConfigId,
    #[serde(rename = "credentialState")]
    pub credential_state: CredentialState,
    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
    pub ext: ::std::option::Option<Ext>,
    ///Present when the community probed the config with the new credential.
    #[serde(
        rename = "probeOk",
        default,
        skip_serializing_if = "::std::option::Option::is_none"
    )]
    pub probe_ok: ::std::option::Option<bool>,
}
impl Response {
    pub fn builder() -> builder::Response {
        Default::default()
    }
}
///Not a member of the payload: the cleartext inside `sealed`, declared here so that every generated binding carries the type a producer seals and a community opens. Never appears on the wire outside a seal.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Not a member of the payload: the cleartext inside `sealed`, declared here so that every generated binding carries the type a producer seals and a community opens. Never appears on the wire outside a seal.",
///  "$ref": "#/definitions/SealedStorageCredential"
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(transparent)]
pub struct SealedCredentialCleartext(pub SealedStorageCredential);
impl ::std::ops::Deref for SealedCredentialCleartext {
    type Target = SealedStorageCredential;
    fn deref(&self) -> &SealedStorageCredential {
        &self.0
    }
}
impl ::std::convert::From<SealedCredentialCleartext> for SealedStorageCredential {
    fn from(value: SealedCredentialCleartext) -> Self {
        value.0
    }
}
impl ::std::convert::From<SealedStorageCredential> for SealedCredentialCleartext {
    fn from(value: SealedStorageCredential) -> Self {
        Self(value)
    }
}
///The cleartext inside the sealed block of vtc/storage/credentials/set/0.2, discriminated by `kind`, which must equal the config's kind. It names the config it is for inside the seal, so that a block captured on its way to one config cannot be replayed into another: a community MUST refuse a block whose `configId` differs from the request's. Never appears on the wire outside a seal, and is never returned. A `local` config has no credential.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "SealedStorageCredential",
///  "description": "The cleartext inside the sealed block of vtc/storage/credentials/set/0.2, discriminated by `kind`, which must equal the config's kind. It names the config it is for inside the seal, so that a block captured on its way to one config cannot be replayed into another: a community MUST refuse a block whose `configId` differs from the request's. Never appears on the wire outside a seal, and is never returned. A `local` config has no credential.",
///  "oneOf": [
///    {
///      "description": "An S3 access-key pair: an AWS IAM user's key, or an S3-compatible store's (R2, B2, MinIO).",
///      "type": "object",
///      "required": [
///        "accessKeyId",
///        "configId",
///        "kind",
///        "secretAccessKey"
///      ],
///      "properties": {
///        "accessKeyId": {
///          "description": "The access key's identifier.",
///          "type": "string",
///          "maxLength": 128,
///          "minLength": 1,
///          "pattern": "^[A-Za-z0-9]+$"
///        },
///        "configId": {
///          "$ref": "#/definitions/StorageConfigId"
///        },
///        "kind": {
///          "const": "s3"
///        },
///        "secretAccessKey": {
///          "description": "The secret half.",
///          "type": "string",
///          "maxLength": 256,
///          "minLength": 1,
///          "pattern": "^[!-~]+$"
///        },
///        "sessionToken": {
///          "description": "Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.",
///          "type": "string",
///          "maxLength": 8192,
///          "minLength": 1,
///          "pattern": "^[!-~]+$"
///        }
///      },
///      "additionalProperties": false
///    },
///    {
///      "description": "A Google Cloud service-account key.",
///      "type": "object",
///      "required": [
///        "configId",
///        "kind",
///        "serviceAccountKey"
///      ],
///      "properties": {
///        "configId": {
///          "$ref": "#/definitions/StorageConfigId"
///        },
///        "kind": {
///          "const": "gcs"
///        },
///        "serviceAccountKey": {
///          "description": "The service-account key exactly as Google issues it — the JSON key file, as an object, its member names carried verbatim in Google's own snake_case. Members beyond the four required (`project_id`, `client_id`, `token_uri`, `universe_domain` and the rest) are permitted, and a community MAY discard them: it authenticates with `client_email`, `private_key_id` and `private_key` alone, against Google's own token endpoint, and never against a `token_uri` the key file names.",
///          "type": "object",
///          "required": [
///            "client_email",
///            "private_key",
///            "private_key_id",
///            "type"
///          ],
///          "properties": {
///            "client_email": {
///              "type": "string",
///              "maxLength": 320,
///              "minLength": 3,
///              "pattern": "^[^@\\s]+@[^@\\s]+$"
///            },
///            "private_key": {
///              "description": "The PKCS #8 PEM private key.",
///              "type": "string",
///              "maxLength": 8192,
///              "minLength": 64,
///              "pattern": "^-----BEGIN PRIVATE KEY-----"
///            },
///            "private_key_id": {
///              "type": "string",
///              "maxLength": 128,
///              "minLength": 1,
///              "pattern": "^[A-Za-z0-9]+$"
///            },
///            "type": {
///              "const": "service_account"
///            }
///          },
///          "additionalProperties": true
///        }
///      },
///      "additionalProperties": false
///    },
///    {
///      "description": "The Sui key that pays for a `walrus` config's storage.",
///      "type": "object",
///      "required": [
///        "configId",
///        "kind",
///        "suiPrivateKey"
///      ],
///      "properties": {
///        "configId": {
///          "$ref": "#/definitions/StorageConfigId"
///        },
///        "kind": {
///          "const": "walrus"
///        },
///        "suiPrivateKey": {
///          "description": "The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.",
///          "type": "string",
///          "maxLength": 256,
///          "minLength": 20,
///          "pattern": "^suiprivkey1[02-9ac-hj-np-z]+$"
///        }
///      },
///      "additionalProperties": false
///    }
///  ]
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[serde(tag = "kind", deny_unknown_fields)]
#[non_exhaustive]
pub enum SealedStorageCredential {
    ///An S3 access-key pair: an AWS IAM user's key, or an S3-compatible store's (R2, B2, MinIO).
    #[serde(rename = "s3")]
    S3 {
        ///The access key's identifier.
        #[serde(rename = "accessKeyId")]
        access_key_id: SealedStorageCredentialAccessKeyId,
        #[serde(rename = "configId")]
        config_id: StorageConfigId,
        ///The secret half.
        #[serde(rename = "secretAccessKey")]
        secret_access_key: SealedStorageCredentialSecretAccessKey,
        ///Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.
        #[serde(
            rename = "sessionToken",
            default,
            skip_serializing_if = "::std::option::Option::is_none"
        )]
        session_token: ::std::option::Option<SealedStorageCredentialSessionToken>,
    },
    ///A Google Cloud service-account key.
    #[serde(rename = "gcs")]
    Gcs {
        #[serde(rename = "configId")]
        config_id: StorageConfigId,
        #[serde(rename = "serviceAccountKey")]
        service_account_key: SealedStorageCredentialServiceAccountKey,
    },
    ///The Sui key that pays for a `walrus` config's storage.
    #[serde(rename = "walrus")]
    Walrus {
        #[serde(rename = "configId")]
        config_id: StorageConfigId,
        ///The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.
        #[serde(rename = "suiPrivateKey")]
        sui_private_key: SealedStorageCredentialSuiPrivateKey,
    },
}
///The access key's identifier.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The access key's identifier.",
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1,
///  "pattern": "^[A-Za-z0-9]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialAccessKeyId(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialAccessKeyId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialAccessKeyId> for ::std::string::String {
    fn from(value: SealedStorageCredentialAccessKeyId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialAccessKeyId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Za-z0-9]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Za-z0-9]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialAccessKeyId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SealedStorageCredentialAccessKeyId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SealedStorageCredentialAccessKeyId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialAccessKeyId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The secret half.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The secret half.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 1,
///  "pattern": "^[!-~]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialSecretAccessKey(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialSecretAccessKey {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialSecretAccessKey> for ::std::string::String {
    fn from(value: SealedStorageCredentialSecretAccessKey) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialSecretAccessKey {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[!-~]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[!-~]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialSecretAccessKey {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SealedStorageCredentialSecretAccessKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SealedStorageCredentialSecretAccessKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialSecretAccessKey {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The service-account key exactly as Google issues it — the JSON key file, as an object, its member names carried verbatim in Google's own snake_case. Members beyond the four required (`project_id`, `client_id`, `token_uri`, `universe_domain` and the rest) are permitted, and a community MAY discard them: it authenticates with `client_email`, `private_key_id` and `private_key` alone, against Google's own token endpoint, and never against a `token_uri` the key file names.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The service-account key exactly as Google issues it — the JSON key file, as an object, its member names carried verbatim in Google's own snake_case. Members beyond the four required (`project_id`, `client_id`, `token_uri`, `universe_domain` and the rest) are permitted, and a community MAY discard them: it authenticates with `client_email`, `private_key_id` and `private_key` alone, against Google's own token endpoint, and never against a `token_uri` the key file names.",
///  "type": "object",
///  "required": [
///    "client_email",
///    "private_key",
///    "private_key_id",
///    "type"
///  ],
///  "properties": {
///    "client_email": {
///      "type": "string",
///      "maxLength": 320,
///      "minLength": 3,
///      "pattern": "^[^@\\s]+@[^@\\s]+$"
///    },
///    "private_key": {
///      "description": "The PKCS #8 PEM private key.",
///      "type": "string",
///      "maxLength": 8192,
///      "minLength": 64,
///      "pattern": "^-----BEGIN PRIVATE KEY-----"
///    },
///    "private_key_id": {
///      "type": "string",
///      "maxLength": 128,
///      "minLength": 1,
///      "pattern": "^[A-Za-z0-9]+$"
///    },
///    "type": {
///      "const": "service_account"
///    }
///  },
///  "additionalProperties": true
///}
/// ```
/// </details>
#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
#[non_exhaustive]
pub struct SealedStorageCredentialServiceAccountKey {
    pub client_email: SealedStorageCredentialServiceAccountKeyClientEmail,
    ///The PKCS #8 PEM private key.
    pub private_key: SealedStorageCredentialServiceAccountKeyPrivateKey,
    pub private_key_id: SealedStorageCredentialServiceAccountKeyPrivateKeyId,
    #[serde(rename = "type")]
    pub type_: ::serde_json::Value,
}
impl SealedStorageCredentialServiceAccountKey {
    pub fn builder() -> builder::SealedStorageCredentialServiceAccountKey {
        Default::default()
    }
}
///`SealedStorageCredentialServiceAccountKeyClientEmail`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "maxLength": 320,
///  "minLength": 3,
///  "pattern": "^[^@\\s]+@[^@\\s]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialServiceAccountKeyClientEmail(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialServiceAccountKeyClientEmail {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialServiceAccountKeyClientEmail>
    for ::std::string::String
{
    fn from(value: SealedStorageCredentialServiceAccountKeyClientEmail) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialServiceAccountKeyClientEmail {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 320usize {
            return Err("longer than 320 characters".into());
        }
        if value.chars().count() < 3usize {
            return Err("shorter than 3 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[^@\\s]+@[^@\\s]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[^@\\s]+@[^@\\s]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialServiceAccountKeyClientEmail {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for SealedStorageCredentialServiceAccountKeyClientEmail
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for SealedStorageCredentialServiceAccountKeyClientEmail
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialServiceAccountKeyClientEmail {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The PKCS #8 PEM private key.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The PKCS #8 PEM private key.",
///  "type": "string",
///  "maxLength": 8192,
///  "minLength": 64,
///  "pattern": "^-----BEGIN PRIVATE KEY-----"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialServiceAccountKeyPrivateKey(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialServiceAccountKeyPrivateKey {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialServiceAccountKeyPrivateKey>
    for ::std::string::String
{
    fn from(value: SealedStorageCredentialServiceAccountKeyPrivateKey) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialServiceAccountKeyPrivateKey {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 8192usize {
            return Err("longer than 8192 characters".into());
        }
        if value.chars().count() < 64usize {
            return Err("shorter than 64 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^-----BEGIN PRIVATE KEY-----").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^-----BEGIN PRIVATE KEY-----\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialServiceAccountKeyPrivateKey {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for SealedStorageCredentialServiceAccountKeyPrivateKey
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for SealedStorageCredentialServiceAccountKeyPrivateKey
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialServiceAccountKeyPrivateKey {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///`SealedStorageCredentialServiceAccountKeyPrivateKeyId`
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "type": "string",
///  "maxLength": 128,
///  "minLength": 1,
///  "pattern": "^[A-Za-z0-9]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialServiceAccountKeyPrivateKeyId(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialServiceAccountKeyPrivateKeyId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialServiceAccountKeyPrivateKeyId>
    for ::std::string::String
{
    fn from(value: SealedStorageCredentialServiceAccountKeyPrivateKeyId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialServiceAccountKeyPrivateKeyId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 128usize {
            return Err("longer than 128 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[A-Za-z0-9]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[A-Za-z0-9]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialServiceAccountKeyPrivateKeyId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String>
    for SealedStorageCredentialServiceAccountKeyPrivateKeyId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String>
    for SealedStorageCredentialServiceAccountKeyPrivateKeyId
{
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialServiceAccountKeyPrivateKeyId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.",
///  "type": "string",
///  "maxLength": 8192,
///  "minLength": 1,
///  "pattern": "^[!-~]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialSessionToken(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialSessionToken {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialSessionToken> for ::std::string::String {
    fn from(value: SealedStorageCredentialSessionToken) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialSessionToken {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 8192usize {
            return Err("longer than 8192 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| ::regress::Regex::new("^[!-~]+$").unwrap());
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[!-~]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialSessionToken {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SealedStorageCredentialSessionToken {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SealedStorageCredentialSessionToken {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialSessionToken {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "description": "The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.",
///  "type": "string",
///  "maxLength": 256,
///  "minLength": 20,
///  "pattern": "^suiprivkey1[02-9ac-hj-np-z]+$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct SealedStorageCredentialSuiPrivateKey(::std::string::String);
impl ::std::ops::Deref for SealedStorageCredentialSuiPrivateKey {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<SealedStorageCredentialSuiPrivateKey> for ::std::string::String {
    fn from(value: SealedStorageCredentialSuiPrivateKey) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for SealedStorageCredentialSuiPrivateKey {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 256usize {
            return Err("longer than 256 characters".into());
        }
        if value.chars().count() < 20usize {
            return Err("shorter than 20 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^suiprivkey1[02-9ac-hj-np-z]+$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^suiprivkey1[02-9ac-hj-np-z]+$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for SealedStorageCredentialSuiPrivateKey {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for SealedStorageCredentialSuiPrivateKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for SealedStorageCredentialSuiPrivateKey {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for SealedStorageCredentialSuiPrivateKey {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
///A storage config's identifier, chosen by the administrator who creates it and immutable thereafter: lowercase letters, digits and inner hyphens, at most 64 characters (`eu-s3-primary`, `walrus-main`). Unique within the community. Never reused after a config is retired, because blobs name their config by this value.
///
/// <details><summary>JSON schema</summary>
///
/// ```json
///{
///  "title": "StorageConfigId",
///  "description": "A storage config's identifier, chosen by the administrator who creates it and immutable thereafter: lowercase letters, digits and inner hyphens, at most 64 characters (`eu-s3-primary`, `walrus-main`). Unique within the community. Never reused after a config is retired, because blobs name their config by this value.",
///  "type": "string",
///  "maxLength": 64,
///  "minLength": 1,
///  "pattern": "^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$"
///}
/// ```
/// </details>
#[derive(::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[serde(transparent)]
pub struct StorageConfigId(::std::string::String);
impl ::std::ops::Deref for StorageConfigId {
    type Target = ::std::string::String;
    fn deref(&self) -> &::std::string::String {
        &self.0
    }
}
impl ::std::convert::From<StorageConfigId> for ::std::string::String {
    fn from(value: StorageConfigId) -> Self {
        value.0
    }
}
impl ::std::str::FromStr for StorageConfigId {
    type Err = self::error::ConversionError;
    fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        if value.chars().count() > 64usize {
            return Err("longer than 64 characters".into());
        }
        if value.chars().count() < 1usize {
            return Err("shorter than 1 characters".into());
        }
        static PATTERN: ::std::sync::LazyLock<::regress::Regex> =
            ::std::sync::LazyLock::new(|| {
                ::regress::Regex::new("^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$").unwrap()
            });
        if PATTERN.find(value).is_none() {
            return Err("doesn't match pattern \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\"".into());
        }
        Ok(Self(value.to_string()))
    }
}
impl ::std::convert::TryFrom<&str> for StorageConfigId {
    type Error = self::error::ConversionError;
    fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<&::std::string::String> for StorageConfigId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: &::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl ::std::convert::TryFrom<::std::string::String> for StorageConfigId {
    type Error = self::error::ConversionError;
    fn try_from(
        value: ::std::string::String,
    ) -> ::std::result::Result<Self, self::error::ConversionError> {
        value.parse()
    }
}
impl<'de> ::serde::Deserialize<'de> for StorageConfigId {
    fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
    where
        D: ::serde::Deserializer<'de>,
    {
        ::std::string::String::deserialize(deserializer)?
            .parse()
            .map_err(|e: self::error::ConversionError| {
                <D::Error as ::serde::de::Error>::custom(e.to_string())
            })
    }
}
/// Types for composing complex structures.
pub mod builder {
    #[derive(Clone, Debug)]
    pub struct CredentialState {
        account: ::std::result::Result<
            ::std::option::Option<super::ExternalAccountId>,
            ::std::string::String,
        >,
        context: ::std::result::Result<
            ::std::option::Option<super::ExternalAccountContextId>,
            ::std::string::String,
        >,
        fingerprint: ::std::result::Result<
            ::std::option::Option<super::DigestMultibase>,
            ::std::string::String,
        >,
        rooms_holding_credentials:
            ::std::result::Result<::std::option::Option<u64>, ::std::string::String>,
        set_at: ::std::result::Result<
            ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
            ::std::string::String,
        >,
        status: ::std::result::Result<super::CredentialStateStatus, ::std::string::String>,
    }
    impl ::std::default::Default for CredentialState {
        fn default() -> Self {
            Self {
                account: Ok(Default::default()),
                context: Ok(Default::default()),
                fingerprint: Ok(Default::default()),
                rooms_holding_credentials: Ok(Default::default()),
                set_at: Ok(Default::default()),
                status: Err("no value supplied for status".to_string()),
            }
        }
    }
    impl CredentialState {
        pub fn account<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<super::ExternalAccountId>>,
            T::Error: ::std::fmt::Display,
        {
            self.account = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for account: {e}"));
            self
        }
        pub fn context<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<super::ExternalAccountContextId>>,
            T::Error: ::std::fmt::Display,
        {
            self.context = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for context: {e}"));
            self
        }
        pub fn fingerprint<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<super::DigestMultibase>>,
            T::Error: ::std::fmt::Display,
        {
            self.fingerprint = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for fingerprint: {e}"));
            self
        }
        pub fn rooms_holding_credentials<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<u64>>,
            T::Error: ::std::fmt::Display,
        {
            self.rooms_holding_credentials = value.try_into().map_err(|e| {
                format!("error converting supplied value for rooms_holding_credentials: {e}")
            });
            self
        }
        pub fn set_at<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<
                ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
            >,
            T::Error: ::std::fmt::Display,
        {
            self.set_at = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for set_at: {e}"));
            self
        }
        pub fn status<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::CredentialStateStatus>,
            T::Error: ::std::fmt::Display,
        {
            self.status = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for status: {e}"));
            self
        }
    }
    impl ::std::convert::TryFrom<CredentialState> for super::CredentialState {
        type Error = super::error::ConversionError;
        fn try_from(
            value: CredentialState,
        ) -> ::std::result::Result<Self, super::error::ConversionError> {
            Ok(Self {
                account: value.account?,
                context: value.context?,
                fingerprint: value.fingerprint?,
                rooms_holding_credentials: value.rooms_holding_credentials?,
                set_at: value.set_at?,
                status: value.status?,
            })
        }
    }
    impl ::std::convert::From<super::CredentialState> for CredentialState {
        fn from(value: super::CredentialState) -> Self {
            Self {
                account: Ok(value.account),
                context: Ok(value.context),
                fingerprint: Ok(value.fingerprint),
                rooms_holding_credentials: Ok(value.rooms_holding_credentials),
                set_at: Ok(value.set_at),
                status: Ok(value.status),
            }
        }
    }
    #[derive(Clone, Debug)]
    pub struct Payload {
        config_id: ::std::result::Result<super::StorageConfigId, ::std::string::String>,
        digest_multibase: ::std::result::Result<super::DigestMultibase, ::std::string::String>,
        ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
        reason: ::std::result::Result<super::PayloadReason, ::std::string::String>,
        sealed: ::std::result::Result<super::PayloadSealed, ::std::string::String>,
    }
    impl ::std::default::Default for Payload {
        fn default() -> Self {
            Self {
                config_id: Err("no value supplied for config_id".to_string()),
                digest_multibase: Err("no value supplied for digest_multibase".to_string()),
                ext: Ok(Default::default()),
                reason: Err("no value supplied for reason".to_string()),
                sealed: Err("no value supplied for sealed".to_string()),
            }
        }
    }
    impl Payload {
        pub fn config_id<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::StorageConfigId>,
            T::Error: ::std::fmt::Display,
        {
            self.config_id = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for config_id: {e}"));
            self
        }
        pub fn digest_multibase<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::DigestMultibase>,
            T::Error: ::std::fmt::Display,
        {
            self.digest_multibase = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for digest_multibase: {e}"));
            self
        }
        pub fn ext<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
            T::Error: ::std::fmt::Display,
        {
            self.ext = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for ext: {e}"));
            self
        }
        pub fn reason<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::PayloadReason>,
            T::Error: ::std::fmt::Display,
        {
            self.reason = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for reason: {e}"));
            self
        }
        pub fn sealed<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::PayloadSealed>,
            T::Error: ::std::fmt::Display,
        {
            self.sealed = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for sealed: {e}"));
            self
        }
    }
    impl ::std::convert::TryFrom<Payload> for super::Payload {
        type Error = super::error::ConversionError;
        fn try_from(value: Payload) -> ::std::result::Result<Self, super::error::ConversionError> {
            Ok(Self {
                config_id: value.config_id?,
                digest_multibase: value.digest_multibase?,
                ext: value.ext?,
                reason: value.reason?,
                sealed: value.sealed?,
            })
        }
    }
    impl ::std::convert::From<super::Payload> for Payload {
        fn from(value: super::Payload) -> Self {
            Self {
                config_id: Ok(value.config_id),
                digest_multibase: Ok(value.digest_multibase),
                ext: Ok(value.ext),
                reason: Ok(value.reason),
                sealed: Ok(value.sealed),
            }
        }
    }
    #[derive(Clone, Debug)]
    pub struct Response {
        config_id: ::std::result::Result<super::StorageConfigId, ::std::string::String>,
        credential_state: ::std::result::Result<super::CredentialState, ::std::string::String>,
        ext: ::std::result::Result<::std::option::Option<super::Ext>, ::std::string::String>,
        probe_ok: ::std::result::Result<::std::option::Option<bool>, ::std::string::String>,
    }
    impl ::std::default::Default for Response {
        fn default() -> Self {
            Self {
                config_id: Err("no value supplied for config_id".to_string()),
                credential_state: Err("no value supplied for credential_state".to_string()),
                ext: Ok(Default::default()),
                probe_ok: Ok(Default::default()),
            }
        }
    }
    impl Response {
        pub fn config_id<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::StorageConfigId>,
            T::Error: ::std::fmt::Display,
        {
            self.config_id = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for config_id: {e}"));
            self
        }
        pub fn credential_state<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::CredentialState>,
            T::Error: ::std::fmt::Display,
        {
            self.credential_state = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for credential_state: {e}"));
            self
        }
        pub fn ext<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<super::Ext>>,
            T::Error: ::std::fmt::Display,
        {
            self.ext = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for ext: {e}"));
            self
        }
        pub fn probe_ok<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::std::option::Option<bool>>,
            T::Error: ::std::fmt::Display,
        {
            self.probe_ok = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for probe_ok: {e}"));
            self
        }
    }
    impl ::std::convert::TryFrom<Response> for super::Response {
        type Error = super::error::ConversionError;
        fn try_from(value: Response) -> ::std::result::Result<Self, super::error::ConversionError> {
            Ok(Self {
                config_id: value.config_id?,
                credential_state: value.credential_state?,
                ext: value.ext?,
                probe_ok: value.probe_ok?,
            })
        }
    }
    impl ::std::convert::From<super::Response> for Response {
        fn from(value: super::Response) -> Self {
            Self {
                config_id: Ok(value.config_id),
                credential_state: Ok(value.credential_state),
                ext: Ok(value.ext),
                probe_ok: Ok(value.probe_ok),
            }
        }
    }
    #[derive(Clone, Debug)]
    pub struct SealedStorageCredentialServiceAccountKey {
        client_email: ::std::result::Result<
            super::SealedStorageCredentialServiceAccountKeyClientEmail,
            ::std::string::String,
        >,
        private_key: ::std::result::Result<
            super::SealedStorageCredentialServiceAccountKeyPrivateKey,
            ::std::string::String,
        >,
        private_key_id: ::std::result::Result<
            super::SealedStorageCredentialServiceAccountKeyPrivateKeyId,
            ::std::string::String,
        >,
        type_: ::std::result::Result<::serde_json::Value, ::std::string::String>,
    }
    impl ::std::default::Default for SealedStorageCredentialServiceAccountKey {
        fn default() -> Self {
            Self {
                client_email: Err("no value supplied for client_email".to_string()),
                private_key: Err("no value supplied for private_key".to_string()),
                private_key_id: Err("no value supplied for private_key_id".to_string()),
                type_: Err("no value supplied for type_".to_string()),
            }
        }
    }
    impl SealedStorageCredentialServiceAccountKey {
        pub fn client_email<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::SealedStorageCredentialServiceAccountKeyClientEmail>,
            T::Error: ::std::fmt::Display,
        {
            self.client_email = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for client_email: {e}"));
            self
        }
        pub fn private_key<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::SealedStorageCredentialServiceAccountKeyPrivateKey>,
            T::Error: ::std::fmt::Display,
        {
            self.private_key = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for private_key: {e}"));
            self
        }
        pub fn private_key_id<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<super::SealedStorageCredentialServiceAccountKeyPrivateKeyId>,
            T::Error: ::std::fmt::Display,
        {
            self.private_key_id = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for private_key_id: {e}"));
            self
        }
        pub fn type_<T>(mut self, value: T) -> Self
        where
            T: ::std::convert::TryInto<::serde_json::Value>,
            T::Error: ::std::fmt::Display,
        {
            self.type_ = value
                .try_into()
                .map_err(|e| format!("error converting supplied value for type_: {e}"));
            self
        }
    }
    impl ::std::convert::TryFrom<SealedStorageCredentialServiceAccountKey>
        for super::SealedStorageCredentialServiceAccountKey
    {
        type Error = super::error::ConversionError;
        fn try_from(
            value: SealedStorageCredentialServiceAccountKey,
        ) -> ::std::result::Result<Self, super::error::ConversionError> {
            Ok(Self {
                client_email: value.client_email?,
                private_key: value.private_key?,
                private_key_id: value.private_key_id?,
                type_: value.type_?,
            })
        }
    }
    impl ::std::convert::From<super::SealedStorageCredentialServiceAccountKey>
        for SealedStorageCredentialServiceAccountKey
    {
        fn from(value: super::SealedStorageCredentialServiceAccountKey) -> Self {
            Self {
                client_email: Ok(value.client_email),
                private_key: Ok(value.private_key),
                private_key_id: Ok(value.private_key_id),
                type_: Ok(value.type_),
            }
        }
    }
}
impl crate::Payload for Payload {
    const TYPE_URI: &'static str = "https://trusttasks.org/spec/vtc/storage/credentials/set/0.2";
    const IS_PROOF_REQUIRED: bool = true;
    const IS_ISSUED_AT_REQUIRED: bool = true;
    const IS_RECIPIENT_REQUIRED: bool = true;
    const PAYLOAD_SCHEMA: Option<&'static str> = Some(
        "{\n  \"$defs\": {\n    \"CredentialState\": {\n      \"additionalProperties\": false,\n      \"description\": \"Whether a config can authenticate now, and how — never the credential. `status`: `vta-account`, `ambient` and `sealed` are usable; `required` means the config cannot store until a credential is provided (a `sealed` config never set, or set before a restore, which carries no credential); `notAllowed` means the config's mode is one the community's host configuration no longer permits, so it cannot store until its `auth` is changed; `none` is a `local` config.\",\n      \"properties\": {\n        \"account\": {\n          \"$ref\": \"#/$defs/ExternalAccountId\",\n          \"description\": \"Present with `vta-account`.\"\n        },\n        \"context\": {\n          \"$ref\": \"#/$defs/ExternalAccountContextId\",\n          \"description\": \"Present with `vta-account`.\"\n        },\n        \"fingerprint\": {\n          \"$ref\": \"#/$defs/DigestMultibase\",\n          \"description\": \"Present with `sealed`: a digest identifying the stored credential, so an administrator can tell which one is set without anyone being able to read it. Computed over the credential with a community-held key, never a bare hash of a low-entropy secret.\"\n        },\n        \"roomsHoldingCredentials\": {\n          \"description\": \"Present with `vta-account`, `ambient` and `sealed`: how many rooms the community currently holds a live room-scoped credential for.\",\n          \"minimum\": 0,\n          \"type\": \"integer\"\n        },\n        \"setAt\": {\n          \"description\": \"Present with `sealed`: when the stored credential was last set.\",\n          \"format\": \"date-time\",\n          \"type\": \"string\"\n        },\n        \"status\": {\n          \"enum\": [\n            \"vta-account\",\n            \"ambient\",\n            \"sealed\",\n            \"required\",\n            \"notAllowed\",\n            \"none\"\n          ],\n          \"type\": \"string\"\n        }\n      },\n      \"required\": [\n        \"status\"\n      ],\n      \"title\": \"CredentialState\",\n      \"type\": \"object\"\n    },\n    \"DigestMultibase\": {\n      \"description\": \"A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\\n\\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\\n\\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\\n\\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \\\"interoperability is not guaranteed between implementations using such values\\\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.\",\n      \"examples\": [\n        \"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR\"\n      ],\n      \"minLength\": 16,\n      \"pattern\": \"^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$\",\n      \"title\": \"DigestMultibase\",\n      \"type\": \"string\"\n    },\n    \"Ext\": {\n      \"additionalProperties\": true,\n      \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n      \"minProperties\": 1,\n      \"propertyNames\": {\n        \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n      },\n      \"title\": \"Ext\",\n      \"type\": \"object\"\n    },\n    \"ExternalAccountContextId\": {\n      \"description\": \"The context at the community's VTA that owns an external account. The VTA names an account by its context and its identifier, and decides who may use it by act scope in that context: the community must hold `external-auth-use` there, and be bound to the account, for the account to issue it anything. Naming a context grants nothing; the VTA's binding is the gate.\",\n      \"maxLength\": 256,\n      \"minLength\": 1,\n      \"title\": \"ExternalAccountContextId\",\n      \"type\": \"string\"\n    },\n    \"ExternalAccountId\": {\n      \"description\": \"The identifier of an external account held by the community's VTA (the external/accounts/* family), which issues the community short-lived, room-scoped credentials and holds the long-lived authority itself.\",\n      \"maxLength\": 64,\n      \"minLength\": 1,\n      \"pattern\": \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\",\n      \"title\": \"ExternalAccountId\",\n      \"type\": \"string\"\n    },\n    \"Response\": {\n      \"$anchor\": \"response\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"configId\": {\n          \"$ref\": \"#/$defs/StorageConfigId\"\n        },\n        \"credentialState\": {\n          \"$ref\": \"#/$defs/CredentialState\"\n        },\n        \"ext\": {\n          \"$ref\": \"#/$defs/Ext\"\n        },\n        \"probeOk\": {\n          \"description\": \"Present when the community probed the config with the new credential.\",\n          \"type\": \"boolean\"\n        }\n      },\n      \"required\": [\n        \"configId\",\n        \"credentialState\"\n      ],\n      \"title\": \"VTC Storage — Credentials — Set — response payload\",\n      \"type\": \"object\"\n    },\n    \"SealedCredentialCleartext\": {\n      \"$ref\": \"#/$defs/SealedStorageCredential\",\n      \"description\": \"Not a member of the payload: the cleartext inside `sealed`, declared here so that every generated binding carries the type a producer seals and a community opens. Never appears on the wire outside a seal.\"\n    },\n    \"SealedStorageCredential\": {\n      \"description\": \"The cleartext inside the sealed block of vtc/storage/credentials/set/0.2, discriminated by `kind`, which must equal the config's kind. It names the config it is for inside the seal, so that a block captured on its way to one config cannot be replayed into another: a community MUST refuse a block whose `configId` differs from the request's. Never appears on the wire outside a seal, and is never returned. A `local` config has no credential.\",\n      \"oneOf\": [\n        {\n          \"additionalProperties\": false,\n          \"description\": \"An S3 access-key pair: an AWS IAM user's key, or an S3-compatible store's (R2, B2, MinIO).\",\n          \"properties\": {\n            \"accessKeyId\": {\n              \"description\": \"The access key's identifier.\",\n              \"maxLength\": 128,\n              \"minLength\": 1,\n              \"pattern\": \"^[A-Za-z0-9]+$\",\n              \"type\": \"string\"\n            },\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"s3\"\n            },\n            \"secretAccessKey\": {\n              \"description\": \"The secret half.\",\n              \"maxLength\": 256,\n              \"minLength\": 1,\n              \"pattern\": \"^[!-~]+$\",\n              \"type\": \"string\"\n            },\n            \"sessionToken\": {\n              \"description\": \"Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.\",\n              \"maxLength\": 8192,\n              \"minLength\": 1,\n              \"pattern\": \"^[!-~]+$\",\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"accessKeyId\",\n            \"secretAccessKey\"\n          ],\n          \"type\": \"object\"\n        },\n        {\n          \"additionalProperties\": false,\n          \"description\": \"A Google Cloud service-account key.\",\n          \"properties\": {\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"gcs\"\n            },\n            \"serviceAccountKey\": {\n              \"additionalProperties\": true,\n              \"description\": \"The service-account key exactly as Google issues it — the JSON key file, as an object, its member names carried verbatim in Google's own snake_case. Members beyond the four required (`project_id`, `client_id`, `token_uri`, `universe_domain` and the rest) are permitted, and a community MAY discard them: it authenticates with `client_email`, `private_key_id` and `private_key` alone, against Google's own token endpoint, and never against a `token_uri` the key file names.\",\n              \"properties\": {\n                \"client_email\": {\n                  \"maxLength\": 320,\n                  \"minLength\": 3,\n                  \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+$\",\n                  \"type\": \"string\"\n                },\n                \"private_key\": {\n                  \"description\": \"The PKCS #8 PEM private key.\",\n                  \"maxLength\": 8192,\n                  \"minLength\": 64,\n                  \"pattern\": \"^-----BEGIN PRIVATE KEY-----\",\n                  \"type\": \"string\"\n                },\n                \"private_key_id\": {\n                  \"maxLength\": 128,\n                  \"minLength\": 1,\n                  \"pattern\": \"^[A-Za-z0-9]+$\",\n                  \"type\": \"string\"\n                },\n                \"type\": {\n                  \"const\": \"service_account\"\n                }\n              },\n              \"required\": [\n                \"type\",\n                \"client_email\",\n                \"private_key_id\",\n                \"private_key\"\n              ],\n              \"type\": \"object\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"serviceAccountKey\"\n          ],\n          \"type\": \"object\"\n        },\n        {\n          \"additionalProperties\": false,\n          \"description\": \"The Sui key that pays for a `walrus` config's storage.\",\n          \"properties\": {\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"walrus\"\n            },\n            \"suiPrivateKey\": {\n              \"description\": \"The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.\",\n              \"maxLength\": 256,\n              \"minLength\": 20,\n              \"pattern\": \"^suiprivkey1[02-9ac-hj-np-z]+$\",\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"suiPrivateKey\"\n          ],\n          \"type\": \"object\"\n        }\n      ],\n      \"title\": \"SealedStorageCredential\"\n    },\n    \"StorageConfigId\": {\n      \"description\": \"A storage config's identifier, chosen by the administrator who creates it and immutable thereafter: lowercase letters, digits and inner hyphens, at most 64 characters (`eu-s3-primary`, `walrus-main`). Unique within the community. Never reused after a config is retired, because blobs name their config by this value.\",\n      \"maxLength\": 64,\n      \"minLength\": 1,\n      \"pattern\": \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\",\n      \"title\": \"StorageConfigId\",\n      \"type\": \"string\"\n    }\n  },\n  \"$id\": \"https://trusttasks.org/spec/vtc/storage/credentials/set/0.2\",\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"additionalProperties\": false,\n  \"description\": \"Store a `sealed` storage config's long-lived credential, sealed end to end to the community. Write-only: no task returns it. The outer document members are owned by the framework — SPEC §6.3.\",\n  \"properties\": {\n    \"configId\": {\n      \"$ref\": \"#/$defs/StorageConfigId\"\n    },\n    \"digestMultibase\": {\n      \"$ref\": \"#/$defs/DigestMultibase\",\n      \"description\": \"Digest over the armored bytes exactly as carried in `sealed`. Covered by the document's proof, and shown to approvers in place of the credential.\"\n    },\n    \"ext\": {\n      \"$ref\": \"#/$defs/Ext\"\n    },\n    \"reason\": {\n      \"description\": \"Why the administrator is making this change. Recorded with the change in the audit trail and shown to approvers. Attributed to its author on every surface and untrusted: it MUST NOT carry personal data or a credential, and a reader MUST NOT treat it as instructions.\",\n      \"maxLength\": 500,\n      \"minLength\": 1,\n      \"type\": \"string\"\n    },\n    \"sealed\": {\n      \"description\": \"OpenPGP-style ASCII-armored `sealed_transfer` ciphertext of the credential. HPKE base mode, X25519-HKDF-SHA256 KEM, ChaCha20-Poly1305 AEAD, info string `vta-sealed-transfer/v1`; recipient the X25519 derivation of the community DID's Ed25519 key.\",\n      \"maxLength\": 16384,\n      \"minLength\": 64,\n      \"pattern\": \"^-----BEGIN VTA SEALED BUNDLE-----\",\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"configId\",\n    \"sealed\",\n    \"digestMultibase\",\n    \"reason\"\n  ],\n  \"title\": \"VTC Storage — Credentials — Set — payload\",\n  \"type\": \"object\"\n}\n",
    );
}
impl crate::Payload for Response {
    const TYPE_URI: &'static str =
        "https://trusttasks.org/spec/vtc/storage/credentials/set/0.2#response";
    const IS_PROOF_REQUIRED: bool = true;
    const IS_ISSUED_AT_REQUIRED: bool = true;
    const IS_RECIPIENT_REQUIRED: bool = true;
    const PAYLOAD_SCHEMA: Option<&'static str> = Some(
        "{\n  \"$defs\": {\n    \"CredentialState\": {\n      \"additionalProperties\": false,\n      \"description\": \"Whether a config can authenticate now, and how — never the credential. `status`: `vta-account`, `ambient` and `sealed` are usable; `required` means the config cannot store until a credential is provided (a `sealed` config never set, or set before a restore, which carries no credential); `notAllowed` means the config's mode is one the community's host configuration no longer permits, so it cannot store until its `auth` is changed; `none` is a `local` config.\",\n      \"properties\": {\n        \"account\": {\n          \"$ref\": \"#/$defs/ExternalAccountId\",\n          \"description\": \"Present with `vta-account`.\"\n        },\n        \"context\": {\n          \"$ref\": \"#/$defs/ExternalAccountContextId\",\n          \"description\": \"Present with `vta-account`.\"\n        },\n        \"fingerprint\": {\n          \"$ref\": \"#/$defs/DigestMultibase\",\n          \"description\": \"Present with `sealed`: a digest identifying the stored credential, so an administrator can tell which one is set without anyone being able to read it. Computed over the credential with a community-held key, never a bare hash of a low-entropy secret.\"\n        },\n        \"roomsHoldingCredentials\": {\n          \"description\": \"Present with `vta-account`, `ambient` and `sealed`: how many rooms the community currently holds a live room-scoped credential for.\",\n          \"minimum\": 0,\n          \"type\": \"integer\"\n        },\n        \"setAt\": {\n          \"description\": \"Present with `sealed`: when the stored credential was last set.\",\n          \"format\": \"date-time\",\n          \"type\": \"string\"\n        },\n        \"status\": {\n          \"enum\": [\n            \"vta-account\",\n            \"ambient\",\n            \"sealed\",\n            \"required\",\n            \"notAllowed\",\n            \"none\"\n          ],\n          \"type\": \"string\"\n        }\n      },\n      \"required\": [\n        \"status\"\n      ],\n      \"title\": \"CredentialState\",\n      \"type\": \"object\"\n    },\n    \"DigestMultibase\": {\n      \"description\": \"A cryptographic digest as a multibase-encoded multihash — the encoding the W3C Verifiable Credentials Data Model 2.0 defines for `digestMultibase`, and the one `did:webvh` uses for its SCID and entry hashes.\\n\\nMultihash carries the hash algorithm in-band, so the value is self-describing and the wire format survives an algorithm change without a schema revision; multibase does the same for the base encoding, so a verifier never infers base58 from base64url by context. A bare hex string or a `sha-256:`-style prefix hard-codes one algorithm into the wire contract and is non-conforming here.\\n\\nThis definition constrains the *encoding only*. What the digest is computed over is stated by each referencing field, because it differs legitimately: a digest over a JSON document is taken over its RFC 8785 (JCS) canonicalization, while a digest over an opaque artifact is taken over its bytes. A field whose input is a JSON document and which does not name a canonicalization is not reproducible.\\n\\nRestricted to the two multibase headers W3C Controlled Identifiers 1.0 §2.4 normatively requires — `z` (base58btc) and `u` (base64url-no-pad). CID permits others but states that \\\"interoperability is not guaranteed between implementations using such values\\\", and a registry whose purpose is interoperability should not mint digests a conforming verifier may be unable to read. The alphabets are enforced rather than assumed: base58btc excludes 0, O, I and l, and an earlier permissive pattern let three published examples carry digests that were not valid base58 at all. base58btc is RECOMMENDED, for consistency with `did:key` and `did:webvh`.\",\n      \"examples\": [\n        \"zQmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR\"\n      ],\n      \"minLength\": 16,\n      \"pattern\": \"^(z[1-9A-HJ-NP-Za-km-z]+|u[A-Za-z0-9_-]+)$\",\n      \"title\": \"DigestMultibase\",\n      \"type\": \"string\"\n    },\n    \"Ext\": {\n      \"additionalProperties\": true,\n      \"description\": \"Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.\",\n      \"minProperties\": 1,\n      \"propertyNames\": {\n        \"pattern\": \"^[a-z][a-z0-9-]*(\\\\.[a-z0-9-]+)+$\"\n      },\n      \"title\": \"Ext\",\n      \"type\": \"object\"\n    },\n    \"ExternalAccountContextId\": {\n      \"description\": \"The context at the community's VTA that owns an external account. The VTA names an account by its context and its identifier, and decides who may use it by act scope in that context: the community must hold `external-auth-use` there, and be bound to the account, for the account to issue it anything. Naming a context grants nothing; the VTA's binding is the gate.\",\n      \"maxLength\": 256,\n      \"minLength\": 1,\n      \"title\": \"ExternalAccountContextId\",\n      \"type\": \"string\"\n    },\n    \"ExternalAccountId\": {\n      \"description\": \"The identifier of an external account held by the community's VTA (the external/accounts/* family), which issues the community short-lived, room-scoped credentials and holds the long-lived authority itself.\",\n      \"maxLength\": 64,\n      \"minLength\": 1,\n      \"pattern\": \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\",\n      \"title\": \"ExternalAccountId\",\n      \"type\": \"string\"\n    },\n    \"Response\": {\n      \"$anchor\": \"response\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"configId\": {\n          \"$ref\": \"#/$defs/StorageConfigId\"\n        },\n        \"credentialState\": {\n          \"$ref\": \"#/$defs/CredentialState\"\n        },\n        \"ext\": {\n          \"$ref\": \"#/$defs/Ext\"\n        },\n        \"probeOk\": {\n          \"description\": \"Present when the community probed the config with the new credential.\",\n          \"type\": \"boolean\"\n        }\n      },\n      \"required\": [\n        \"configId\",\n        \"credentialState\"\n      ],\n      \"title\": \"VTC Storage — Credentials — Set — response payload\",\n      \"type\": \"object\"\n    },\n    \"SealedCredentialCleartext\": {\n      \"$ref\": \"#/$defs/SealedStorageCredential\",\n      \"description\": \"Not a member of the payload: the cleartext inside `sealed`, declared here so that every generated binding carries the type a producer seals and a community opens. Never appears on the wire outside a seal.\"\n    },\n    \"SealedStorageCredential\": {\n      \"description\": \"The cleartext inside the sealed block of vtc/storage/credentials/set/0.2, discriminated by `kind`, which must equal the config's kind. It names the config it is for inside the seal, so that a block captured on its way to one config cannot be replayed into another: a community MUST refuse a block whose `configId` differs from the request's. Never appears on the wire outside a seal, and is never returned. A `local` config has no credential.\",\n      \"oneOf\": [\n        {\n          \"additionalProperties\": false,\n          \"description\": \"An S3 access-key pair: an AWS IAM user's key, or an S3-compatible store's (R2, B2, MinIO).\",\n          \"properties\": {\n            \"accessKeyId\": {\n              \"description\": \"The access key's identifier.\",\n              \"maxLength\": 128,\n              \"minLength\": 1,\n              \"pattern\": \"^[A-Za-z0-9]+$\",\n              \"type\": \"string\"\n            },\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"s3\"\n            },\n            \"secretAccessKey\": {\n              \"description\": \"The secret half.\",\n              \"maxLength\": 256,\n              \"minLength\": 1,\n              \"pattern\": \"^[!-~]+$\",\n              \"type\": \"string\"\n            },\n            \"sessionToken\": {\n              \"description\": \"Present when the pair is a temporary one that needs it. A temporary pair stops working at its own expiry, after which the config reports failures until another is set; it is accepted for evaluation, never recommended.\",\n              \"maxLength\": 8192,\n              \"minLength\": 1,\n              \"pattern\": \"^[!-~]+$\",\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"accessKeyId\",\n            \"secretAccessKey\"\n          ],\n          \"type\": \"object\"\n        },\n        {\n          \"additionalProperties\": false,\n          \"description\": \"A Google Cloud service-account key.\",\n          \"properties\": {\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"gcs\"\n            },\n            \"serviceAccountKey\": {\n              \"additionalProperties\": true,\n              \"description\": \"The service-account key exactly as Google issues it — the JSON key file, as an object, its member names carried verbatim in Google's own snake_case. Members beyond the four required (`project_id`, `client_id`, `token_uri`, `universe_domain` and the rest) are permitted, and a community MAY discard them: it authenticates with `client_email`, `private_key_id` and `private_key` alone, against Google's own token endpoint, and never against a `token_uri` the key file names.\",\n              \"properties\": {\n                \"client_email\": {\n                  \"maxLength\": 320,\n                  \"minLength\": 3,\n                  \"pattern\": \"^[^@\\\\s]+@[^@\\\\s]+$\",\n                  \"type\": \"string\"\n                },\n                \"private_key\": {\n                  \"description\": \"The PKCS #8 PEM private key.\",\n                  \"maxLength\": 8192,\n                  \"minLength\": 64,\n                  \"pattern\": \"^-----BEGIN PRIVATE KEY-----\",\n                  \"type\": \"string\"\n                },\n                \"private_key_id\": {\n                  \"maxLength\": 128,\n                  \"minLength\": 1,\n                  \"pattern\": \"^[A-Za-z0-9]+$\",\n                  \"type\": \"string\"\n                },\n                \"type\": {\n                  \"const\": \"service_account\"\n                }\n              },\n              \"required\": [\n                \"type\",\n                \"client_email\",\n                \"private_key_id\",\n                \"private_key\"\n              ],\n              \"type\": \"object\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"serviceAccountKey\"\n          ],\n          \"type\": \"object\"\n        },\n        {\n          \"additionalProperties\": false,\n          \"description\": \"The Sui key that pays for a `walrus` config's storage.\",\n          \"properties\": {\n            \"configId\": {\n              \"$ref\": \"#/$defs/StorageConfigId\"\n            },\n            \"kind\": {\n              \"const\": \"walrus\"\n            },\n            \"suiPrivateKey\": {\n              \"description\": \"The private key in Sui's Bech32 `suiprivkey` encoding (SIP-15), which carries its signature scheme.\",\n              \"maxLength\": 256,\n              \"minLength\": 20,\n              \"pattern\": \"^suiprivkey1[02-9ac-hj-np-z]+$\",\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"kind\",\n            \"configId\",\n            \"suiPrivateKey\"\n          ],\n          \"type\": \"object\"\n        }\n      ],\n      \"title\": \"SealedStorageCredential\"\n    },\n    \"StorageConfigId\": {\n      \"description\": \"A storage config's identifier, chosen by the administrator who creates it and immutable thereafter: lowercase letters, digits and inner hyphens, at most 64 characters (`eu-s3-primary`, `walrus-main`). Unique within the community. Never reused after a config is retired, because blobs name their config by this value.\",\n      \"maxLength\": 64,\n      \"minLength\": 1,\n      \"pattern\": \"^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$\",\n      \"title\": \"StorageConfigId\",\n      \"type\": \"string\"\n    }\n  },\n  \"$ref\": \"#/$defs/Response\",\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\"\n}\n",
    );
}
impl crate::RequestPayload for Payload {
    type Response = Response;
}
/// The extended error codes this specification declares (SPEC §7.3 item 9,
/// §8.5), in declaration order. Empty when it declares none.
pub const ERROR_CODES: &[crate::DeclaredErrorCode] = &[
    error_codes::NOT_FOUND,
    error_codes::NOT_SEALED_MODE,
    error_codes::CANNOT_OPEN,
    error_codes::INVALID_CREDENTIAL,
    error_codes::AUTH_NOT_ALLOWED,
];
/// One constant per extended error code this specification declares
/// (SPEC §7.3 item 9), named for its local part.
///
/// Emit these rather than a string literal: the code is read from the
/// specification, so it cannot name a code the specification never
/// declared.
pub mod error_codes {
    /// `vtc/storage/credentials/set:notFound`
    ///
    /// The community has no storage config with this identifier.
    ///
    /// Declared `retryable: false`.
    pub const NOT_FOUND: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
        code: "vtc/storage/credentials/set:notFound",
        retryable: false,
        details_schema: ::core::option::Option::None,
    };
    /// `vtc/storage/credentials/set:notSealedMode`
    ///
    /// The config's `auth.mode` is not `sealed`. Credentials for a `vta-account` config are the VTA's, set there; an `ambient` config has none.
    ///
    /// Declared `retryable: false`.
    pub const NOT_SEALED_MODE: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
        code: "vtc/storage/credentials/set:notSealedMode",
        retryable: false,
        details_schema: ::core::option::Option::None,
    };
    /// `vtc/storage/credentials/set:cannotOpen`
    ///
    /// The sealed block is not sealed to this community, is malformed, or its digest does not match `digestMultibase`. Nothing was stored.
    ///
    /// Declared `retryable: false`.
    pub const CANNOT_OPEN: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
        code: "vtc/storage/credentials/set:cannotOpen",
        retryable: false,
        details_schema: ::core::option::Option::None,
    };
    /// `vtc/storage/credentials/set:invalidCredential`
    ///
    /// The block opened, but its cleartext is not a `SealedStorageCredential` for this config — it does not validate, its `kind` is not the config's, or its `configId` is not the request's. Nothing was stored.
    ///
    /// Declared `retryable: false`.
    pub const INVALID_CREDENTIAL: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
        code: "vtc/storage/credentials/set:invalidCredential",
        retryable: false,
        details_schema: ::core::option::Option::None,
    };
    /// `vtc/storage/credentials/set:authNotAllowed`
    ///
    /// The community's host configuration does not permit `sealed` authentication. Nothing was stored; move the config to a permitted mode with vtc/storage/configs/update.
    ///
    /// Declared `retryable: false`.
    pub const AUTH_NOT_ALLOWED: crate::DeclaredErrorCode = crate::DeclaredErrorCode {
        code: "vtc/storage/credentials/set:authNotAllowed",
        retryable: false,
        details_schema: ::core::option::Option::None,
    };
}