pethost 0.2.4

Client for the API of Pethost, managed hosting for Docker Compose projects: deploy, logs, HTTP traffic, files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
// @generated by protoc-gen-panel-rust from v1/panel.proto. DO NOT EDIT.

//! The API's messages, enums and oneofs.
//!
//! A struct without `#[non_exhaustive]` is one a request holds: write it as a literal that ends in
//! `..Default::default()`.
//!
//! # JSON
//!
//! Every struct and enum here is `serde`'s `Serialize` and `Deserialize`, and its JSON is the
//! API's own, as the API answers and takes it over HTTP and as
//! [its reference](https://pethost.dev/docs/api/) shows it:
//!
//! - a field under its name in the proto, as the struct has it: `project_id`;
//! - a field that is absent, or an unmarked one at its zero, left out;
//! - an enum as its value's name, `"OPERATION_STATUS_RUNNING"`, and a value this version does
//!   not know, `Unrecognized(number)`, as the number;
//! - a 64-bit integer as a string, a time as RFC 3339, bytes as base64;
//! - a oneof as the field of the member that is set, beside its message's other fields. A
//!   oneof's enum has no JSON of its own, and its `Unrecognized` is written as no member.
//!
//! Reading takes the same form, and a 64-bit integer as a number too. It refuses a field this
//! version does not know, any other spelling of one (`projectId`) and an enum's name it does
//! not know, as the API refuses a field it does not have: a misspelled field cannot make a call
//! that does something else. The JSON of a later API, with a field added since, is refused so
//! too.
//!
//! ```
//! use pethost::types::{FileChange, FileChangeChange};
//!
//! fn main() -> Result<(), serde_json::Error> {
//!     let change = FileChange {
//!         path: "/hello.txt".into(),
//!         change: Some(FileChangeChange::Text("Hello".into())),
//!         ..Default::default()
//!     };
//!
//!     // The API's JSON, and the message back from it.
//!     let json = serde_json::to_string(&change)?;
//!     assert_eq!(json, r#"{"path":"/hello.txt","text":"Hello"}"#);
//!     assert_eq!(serde_json::from_str::<FileChange>(&json)?, change);
//!
//!     // A field the API does not have is refused: here, one misspelled.
//!     assert!(serde_json::from_str::<FileChange>(r#"{"pth": "/hello.txt"}"#).is_err());
//!     Ok(())
//! }
//! ```

/// What [`Client::get_machine`](crate::Client::get_machine) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetMachineRequest {}

/// What [`Client::get_machine`](crate::Client::get_machine) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetMachineResponse {
    pub machine: ::core::option::Option<Machine>,
    /// By `project_id`.
    pub projects: ::std::vec::Vec<ProjectSummary>,
    /// Projects no longer on the machine whose snapshots remain, the most recently backed up first; restore one with [`RunProjectActionRequestAction::RestoreSnapshot`](crate::types::RunProjectActionRequestAction::RestoreSnapshot) and its `project_id`. Current after the machine's own backups and deletes; changes made to the backup repository elsewhere show later. Not known while [`Machine::snapshot_list_time`](crate::types::Machine::snapshot_list_time) is absent.
    pub deleted_projects: ::std::vec::Vec<DeletedProject>,
    pub github: ::core::option::Option<GithubConnection>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Machine {
    /// Its plan's name, e.g. \"Starter\".
    pub name: ::std::string::String,
    /// Where it runs, e.g. \"Europe\". Empty = not known.
    pub location: ::std::string::String,
    /// When the figures below were read.
    pub sample_time: ::core::option::Option<crate::Timestamp>,
    /// By projects and builds.
    pub cpu_used_cores: f64,
    pub cpu_total_cores: f64,
    /// Without page cache, as `docker stats` counts.
    pub memory_used_bytes: u64,
    /// The machine's, less a reserve for the system.
    pub memory_total_bytes: u64,
    /// The projects\' disk. The operating system has its own partition outside it, and the machine's own files are left out: a new machine uses 0.
    pub disk_used_bytes: u64,
    pub disk_total_bytes: u64,
    pub disk_usage: ::core::option::Option<DiskUsage>,
    /// The machine's name: what the person's own domains point at (a CNAME), and where they log in to a service's container ([`Service::ssh_command`](crate::types::Service::ssh_command)). [`Client::create_transfer`](crate::Client::create_transfer)\'s URLs are on it as well, and no route can take it.
    pub hostname: ::std::string::String,
    /// \"SHA256:\.\.\.\", to check on the first connection.
    pub ssh_host_key_fingerprint: ::std::string::String,
    /// The person's public keys: each logs in to every container. Empty = none yet: nobody can log in until [`RunMachineActionRequestAction::AddSshKey`](crate::types::RunMachineActionRequestAction::AddSshKey) adds one.
    pub ssh_keys: ::std::vec::Vec<SshKey>,
    /// True = every project is backed up nightly, and on demand. False, always written = nothing is backed up: there are no snapshots, and a deleted project or volume is gone for good.
    pub backups_enabled: bool,
    /// When the machine last read the backup repository's list of snapshots whole. Absent = not yet (`snapshot_list_failure_message` says why, once a read failed), or backups are off: snapshot counts, [`Volume::last_backup_time`](crate::types::Volume::last_backup_time), [`Project::snapshots`](crate::types::Project::snapshots) and [`GetMachineResponse::deleted_projects`](crate::types::GetMachineResponse::deleted_projects) are then not known, rather than none.
    pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
    /// Why the machine could not read that list, while backups are on and `snapshot_list_time` is absent: the backup repository's error, e.g. a wrong password or a host that does not answer. The machine keeps trying. Empty = no read has failed, or the list is known, or backups are off.
    pub snapshot_list_failure_message: ::std::string::String,
    /// Snapshots are pruned once they are this many hours older than their project's newest. 0 = kept forever: nothing deletes them.
    pub backup_retention_hours: u32,
    /// True = a host that no certificate installed on the machine covers gets one from Let's Encrypt once it resolves to the machine. False, always written = such a host serves plain HTTP only.
    pub acme_enabled: bool,
    /// The person's domain on Pethost, e.g. \"sam.pethost.app\": theirs alone, so \"my domain\" or \"my Pethost domain\" means this one unless they name another. A route's host `<name>.<apps_domain>`, or `apps_domain` itself, works at once over HTTPS, with no DNS record to make, and a web port a project publishes gets such a host by itself ([`Client::create_project`](crate::Client::create_project)). Only the person changes it, in the panel's settings. Empty = there is none: every host is a domain the person owns, and published ports all open on the machine.
    pub apps_domain: ::std::string::String,
    pub daemon_version: ::std::string::String,
    pub docker_version: ::std::string::String,
    pub boot_time: ::core::option::Option<crate::Timestamp>,
    /// When an update started to need a machine restart. Absent = none is needed.
    pub restart_required_time: ::core::option::Option<crate::Timestamp>,
    /// When [`RunMachineActionRequestAction::RestartMachine`](crate::types::RunMachineActionRequestAction::RestartMachine) will restart it; later while what it waits for is still going on ([`RestartMachineAction::interrupt_operations`](crate::types::RestartMachineAction::interrupt_operations)). Absent = not scheduled.
    pub scheduled_restart_time: ::core::option::Option<crate::Timestamp>,
    /// What people have open in the containers now, oldest first: at most 100, the most the machine holds at once.
    pub sessions: ::std::vec::Vec<MachineSession>,
    /// Where Pethost tells the person of incidents: the account's channels that are on, email first, then the oldest. The person sets them in the panel's Settings → Alerts; no tool does. Empty = alerts reach nobody.
    pub alert_channels: ::std::vec::Vec<AlertDestination>,
}

/// A channel Pethost tells the person of incidents on ([`Machine::alert_channels`](crate::types::Machine::alert_channels)).
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct AlertDestination {
    pub kind: AlertChannelKind,
    /// The chat's title, or \"#ops · Acme\". Empty for email.
    pub label: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum AlertChannelKind {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// The account's email.
    Email,
    /// A Telegram chat or group.
    Telegram,
    /// A Slack channel.
    Slack,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// Something a person has open in a container: a web terminal (`OpenTerminal`), or, through SSH, a program, SFTP or one connection of a tunnel. It lasts until the program exits or the connection closes; [`RunMachineActionRequestAction::EndSessionId`](crate::types::RunMachineActionRequestAction::EndSessionId) ends it sooner.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineSession {
    /// For [`RunMachineActionRequestAction::EndSessionId`](crate::types::RunMachineActionRequestAction::EndSessionId).
    pub session_id: ::std::string::String,
    pub kind: MachineSessionKind,
    pub project_id: ::std::string::String,
    pub service: ::std::string::String,
    /// TUNNEL: the container's port.
    pub port: u32,
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// The person's IP address.
    pub client_address: ::std::string::String,
    /// Through SSH: the key they logged in with, as it was then. Empty for `WEB_TERMINAL`.
    pub ssh_key_label: ::std::string::String,
    pub ssh_key_fingerprint: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum MachineSessionKind {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// The web panel's terminal.
    WebTerminal,
    /// A program in a terminal, such as `ssh`\'s shell.
    SshTerminal,
    /// A program without a terminal, such as `ssh ... <command>` or rsync.
    SshCommand,
    /// scp, sftp or sshfs.
    Sftp,
    /// One connection of an `ssh -L` tunnel to `port`.
    Tunnel,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// Where the disk goes; the rest of `disk_used_bytes` is the filesystem's own metadata and the machine's small files. Measured every few minutes.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DiskUsage {
    pub images_bytes: u64,
    /// Absent = not known: Docker cannot size the build cache.
    pub build_cache_bytes: ::core::option::Option<u64>,
    pub volumes_bytes: u64,
    /// What containers wrote outside volumes.
    pub container_layers_bytes: u64,
    /// Project directories and operation logs.
    pub project_files_bytes: u64,
    /// Kept on the operating system's partition, outside `disk_used_bytes`; the machine bounds their age and size ([`QueryContainerLogsResponse::oldest_kept_time`](crate::types::QueryContainerLogsResponse::oldest_kept_time)).
    pub container_logs_bytes: u64,
    /// The HTTP request log.
    pub http_traffic_bytes: u64,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct SshKey {
    /// The public key, as in `authorized_keys`: \"ssh-ed25519 AAAA\.\.\.\"; never a private key.
    pub public_key: ::std::string::String,
    /// Shown in the panel and session logs, e.g. \"MacBook Pro\".
    pub label: ::std::string::String,
    /// \"SHA256:\.\.\.\". Ignored on input.
    pub fingerprint: ::std::string::String,
}

/// The panel's GitHub App, one for every account: projects are created from the repositories of the account's own installations of it. Absent = GitHub is not set up on this panel.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GithubConnection {
    /// As in https://github.com/apps/\<`app_name`\>.
    pub app_name: ::std::string::String,
    /// The panel's page that sends a signed-in person to GitHub to install the app on their repositories, or to change which.
    pub install_url: ::std::string::String,
    /// The repositories of the account's installations, most recently pushed first, at most 200.
    pub repositories: ::std::vec::Vec<GithubRepository>,
    /// In all.
    pub repository_count: u32,
    /// False = pushes reach the panel only by its check every 5 minutes, not at once.
    pub webhooks_enabled: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GithubRepository {
    /// \"owner/name\".
    pub repository: ::std::string::String,
    pub default_branch: ::std::string::String,
    pub private: bool,
    pub push_time: ::core::option::Option<crate::Timestamp>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DeletedProject {
    pub project_id: ::std::string::String,
    /// Restore it to bring the project back as it was last backed up; [`Client::get_project`](crate::Client::get_project) then pages the older ones (`snapshots_before`).
    pub newest_snapshot: ::core::option::Option<Snapshot>,
    /// In all.
    pub snapshot_count: u32,
}

/// What [`Client::run_machine_action`](crate::Client::run_machine_action) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunMachineActionRequest {
    pub action: ::core::option::Option<RunMachineActionRequestAction>,
}

/// The oneof [`RunMachineActionRequest::action`](crate::types::RunMachineActionRequest::action): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum RunMachineActionRequestAction {
    /// label: one line, ≤100 chars; empty = the key's comment. An existing key gets the new label.
    AddSshKey(SshKey),
    /// A [`Machine::ssh_keys`](crate::types::Machine::ssh_keys) fingerprint; its sessions end. [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = no such key.
    RemoveSshKeyFingerprint(::std::string::String),
    /// Containers come back per restart policy. A new call before the restart replaces it; after ([`Machine::boot_time`](crate::types::Machine::boot_time) changed), restarts again.
    RestartMachine(RestartMachineAction),
    /// True = cancels the scheduled restart.
    CancelRestart(bool),
    /// A [`Machine::sessions`](crate::types::Machine::sessions) id: ends it now (its key can open new ones until removed). [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = ended.
    EndSessionId(::std::string::String),
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct RestartMachineAction {
    /// Absent = now, or `at_maintenance_window`. [`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument) = in the past.
    pub restart_time: ::core::option::Option<crate::Timestamp>,
    /// True = the next nightly window ([`Machine::scheduled_restart_time`](crate::types::Machine::scheduled_restart_time)). Not with `restart_time`.
    pub at_maintenance_window: bool,
    /// False = wait for operations and nightly backups to end; true = cut them short.
    pub interrupt_operations: bool,
}

/// What [`Client::run_machine_action`](crate::Client::run_machine_action) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunMachineActionResponse {
    /// As changed.
    pub machine: ::core::option::Option<Machine>,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectMetadata {
    /// Empty = none: people see the id.
    pub name: ::core::option::Option<::std::string::String>,
    pub emoji: ::core::option::Option<::std::string::String>,
    /// One line.
    pub description: ::core::option::Option<::std::string::String>,
    /// Free text.
    pub notes: ::core::option::Option<::std::string::String>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectSummary {
    pub project_id: ::std::string::String,
    pub metadata: ::core::option::Option<ProjectMetadata>,
    /// Most urgent first. Empty = nothing wrong.
    pub problems: ::std::vec::Vec<ProjectProblem>,
    /// By name.
    pub services: ::std::vec::Vec<ServiceSummary>,
    /// The first route's host as a URL, e.g. \"https://recipes.example.com\". Empty = no route.
    pub url: ::std::string::String,
    /// Every host its routes use, in the routes\' order.
    pub hosts: ::std::vec::Vec<::std::string::String>,
    /// The last day's requests, 5xx responses and latency, as in Project: [`Client::query_http_traffic`](crate::Client::query_http_traffic) says which paths. Absent = no request.
    pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
    pub cpu_used_cores: f64,
    pub memory_used_bytes: u64,
    /// As in Project.
    pub deploy_time: ::core::option::Option<crate::Timestamp>,
    /// Operations in progress, newest first: a backup can run beside another one.
    pub running_operations: ::std::vec::Vec<Operation>,
    /// A github project stays on its commit: [`GithubSource::pinned`](crate::types::GithubSource::pinned).
    pub pinned: bool,
    /// Its volumes, files, what its containers wrote outside volumes, and its images: one it shares with another project counts in both. Measured every few minutes.
    pub disk_used_bytes: u64,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ServiceSummary {
    pub service: ::std::string::String,
    pub state: ServiceState,
}

/// Something that needs attention. A service has at most one, its cause first.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectProblem {
    pub kind: ProjectProblemKind,
    /// Empty = not about one service. `DEPLOY_FAILED`: the service that failed it, when one did.
    pub service: ::std::string::String,
    /// `DEPLOY_FAILED`, `DEPLOY_CANCELLED`, `BACKUP_FAILED`, `RESTORE_FAILED`: the operation; [`Client::get_operation`](crate::Client::get_operation) gives its log.
    pub operation_id: ::std::string::String,
    /// `DEPLOY_FAILED`, `DEPLOY_CANCELLED`, `BACKUP_FAILED`, `RESTORE_FAILED`: the operation's end. `SERVICE_EXITED`, RESTARTING and `OUT_OF_MEMORY`: when its last run ended, once it did; else its last start. `AUTO_DEPLOY_REFUSED`: when auto-deploy tried the commit. Absent = not known, as for UNHEALTHY.
    pub since_time: ::core::option::Option<crate::Timestamp>,
    /// One sentence for people, without a time of day (`since_time` has it), e.g. \"bot fails its healthcheck: 11 failures in a row\". A failed or cancelled deploy's also says whether it changed the project.
    pub problem_message: ::std::string::String,
    /// The open incident that records it ([`Project::incidents`](crate::types::Project::incidents)). Empty = none yet.
    pub incident_id: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ProjectProblemKind {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// The latest deploy failed. Its operation says why, and with `made_current` whether its files were applied (then some containers may run the old configuration).
    DeployFailed,
    /// Running; its healthcheck fails.
    ServiceUnhealthy,
    /// Docker is restarting it, or it runs and Docker restarted it recently: likely a crash loop.
    ServiceRestarting,
    /// Its last run was killed for exceeding its memory, or a process of it was since it started. A loop whose runs last 10 s or more shows as RESTARTING: Docker forgets the kill when it starts it again.
    ServiceOutOfMemory,
    /// The latest backup failed; its operation says why.
    BackupFailed,
    /// The latest deploy was cancelled; its operation says, with `made_current`, whether its files were applied.
    DeployCancelled,
    /// It exited on its own with a non-zero code ([`Service::exit_code`](crate::types::Service::exit_code)) and stays down: its restart policy does not restart it. A service a person stopped is no problem.
    ServiceExited,
    /// A restore failed or was cancelled, or a machine restart cut it short, and its harm remains: services it stopped are still stopped (starting them ends it); unless a restore that succeeded since replaced them, its volumes may be partly restored, and its operation's `undo_snapshot_id` holds them as they were. Or it brought a deleted project back, and no deploy has replaced it. The newest such restore counts; one that changed nothing does not.
    RestoreFailed,
    /// Auto-deploy is on, and the machine refused the commit it last tried, the branch's newest then, which the files are not; the message says why. Each commit is tried once: fix it and push, or [`Client::deploy_project`](crate::Client::deploy_project) with `newest_commit`, whose refusal gives the violations.
    AutoDeployRefused,
    /// It runs and does not listen on the port a route sends to (or only at 127.0.0.1, which the proxy cannot reach): the route answers 502. The message names the ports it does listen on ([`Service::listening_ports`](crate::types::Service::listening_ports)): change the route's port with [`DeployProjectRequest::x_pethost`](crate::types::DeployProjectRequest::x_pethost), or the app.
    ServicePortClosed,
    /// A site check ([`Project::alerts`](crate::types::Project::alerts)) failed 3 times in a row; service: the one its route sends to.
    SiteDown,
    /// A traffic rule on 5xx holds.
    HttpErrors,
    /// A traffic rule on p95 holds.
    HttpSlow,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What [`Client::get_project`](crate::Client::get_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetProjectRequest {
    pub project_id: ::std::string::String,
    /// True = include env-file values ([`EnvironmentVariable::secret`](crate::types::EnvironmentVariable::secret)). To edit .env: [`Client::read_path`](crate::Client::read_path) /.env.
    pub include_secret_values: bool,
    /// Only older snapshots: the oldest `create_time` seen, to page back. Absent = the newest.
    pub snapshots_before: ::core::option::Option<crate::Timestamp>,
    /// Only snapshots holding this volume ([`Volume::snapshot_count`](crate::types::Volume::snapshot_count)). Empty = all.
    pub snapshots_volume: ::std::string::String,
    /// Only incidents that opened before it: the oldest `open_time` seen, to page back. Absent = the newest.
    pub incidents_before: ::core::option::Option<crate::Timestamp>,
    /// ≤90: [`Project::uptime_days`](crate::types::Project::uptime_days). 0 = none.
    pub uptime_day_count: u32,
    /// With `incidents_before`: the `incident_id` of the oldest seen, so that those that opened at the same time are not skipped.
    pub incidents_before_id: ::std::string::String,
}

/// What [`Client::get_project`](crate::Client::get_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetProjectResponse {
    pub project: ::core::option::Option<Project>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Project {
    pub project_id: ::std::string::String,
    pub metadata: ::core::option::Option<ProjectMetadata>,
    pub problems: ::std::vec::Vec<ProjectProblem>,
    /// As in [`ProjectSummary`](crate::types::ProjectSummary).
    pub url: ::std::string::String,
    pub cpu_used_cores: f64,
    pub memory_used_bytes: u64,
    /// The `operation_id` of the deploy whose files the project has. For a deleted project brought back, the RESTORE that did it. Empty = no deploy yet.
    pub deploy_id: ::std::string::String,
    /// How that operation went, or is going. Unspecified = no deploy yet.
    pub deploy_status: OperationStatus,
    /// When the current deploy made its files the project's. Absent = no deploy yet, or one that failed or was cancelled leaving no service with a container: nothing runs.
    pub deploy_time: ::core::option::Option<crate::Timestamp>,
    /// True = the current deploy succeeded and every service has a container, so a deploy whose files differ only inside `x-pethost` (or not at all) applies at once, with no build or pull, and no restart but the one [`Client::deploy_project`](crate::Client::deploy_project) names. False = the next deploy runs in full.
    pub x_pethost_applies_at_once: bool,
    /// By name.
    pub services: ::std::vec::Vec<Service>,
    /// Every one the machine holds for the project, by name.
    pub volumes: ::std::vec::Vec<Volume>,
    /// x-pethost.routes as the machine holds them, in order: the list `x_pethost.routes` replaces, so send these back with your change to add, change or remove one.
    pub routes: ::std::vec::Vec<Route>,
    /// Every host of the routes, in the order of its first route.
    pub hosts: ::std::vec::Vec<Host>,
    /// True = every route asks visitors for the project's password (`x_pethost.password`). The password itself is never returned.
    pub password_protected: bool,
    /// Newest first, every one the machine keeps: the newest 20, any still in progress, and however old, the current deploy's (`deploy_id`) and those whose files it keeps for a rollback ([`Operation::files_kept`](crate::types::Operation::files_kept)). Older ones are gone.
    pub operations: ::std::vec::Vec<Operation>,
    /// The newest 10, newest first, of those [`GetProjectRequest`](crate::types::GetProjectRequest)\'s `snapshots_before` and `snapshots_volume` select. Empty while backups are off or the list is not read yet (`snapshot_list_time`).
    pub snapshots: ::std::vec::Vec<Snapshot>,
    /// The project's, in all; see `snapshot_list_time`.
    pub snapshot_count: u32,
    /// When the machine read the list of snapshots that `snapshot_count`, [`Volume::snapshot_count`](crate::types::Volume::snapshot_count) and [`Volume::last_backup_time`](crate::types::Volume::last_backup_time) come from ([`Machine::snapshot_list_time`](crate::types::Machine::snapshot_list_time), as sampled with them). Absent = the list is not known: backups are off, or it is not read yet ([`Machine::snapshot_list_failure_message`](crate::types::Machine::snapshot_list_failure_message) says why); a count of 0 then does not mean none.
    pub snapshot_list_time: ::core::option::Option<crate::Timestamp>,
    /// Measured every few minutes.
    pub http_traffic_last_day: ::core::option::Option<HttpTrafficSummary>,
    pub source: ::core::option::Option<ProjectSource>,
    /// The `start_services`, `stop_services` or `restart_services` that runs now, whoever called it ([`Client::run_project_action`](crate::Client::run_project_action) waits for its end). Until then the project takes no other action or deploy, and [`Service::state`](crate::types::Service::state) is still what it was before. Absent = none.
    pub running_services_action: ::core::option::Option<RunningServicesAction>,
    /// What Pethost watches and how each part stands. Absent = the machine's software predates alerts: they come with its next update.
    pub alerts: ::core::option::Option<ProjectAlerts>,
    /// The newest 5 that [`GetProjectRequest::incidents_before`](crate::types::GetProjectRequest::incidents_before) selects, newest first: an open one in full but its evidence (`GetIncident`), a resolved one as its id, kind, times, message, `after_operation_id`, `quiet_reason` and flapping.
    pub incidents: ::std::vec::Vec<Incident>,
    /// True = older ones remain: page with `incidents_before` and `incidents_before_id`.
    pub more_incidents: bool,
    /// Oldest first, [`GetProjectRequest::uptime_day_count`](crate::types::GetProjectRequest::uptime_day_count) of them, today's last.
    pub uptime_days: ::std::vec::Vec<UptimeDay>,
}

/// A start, stop or restart of services that has not ended yet.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunningServicesAction {
    pub kind: ServicesActionKind,
    /// Those it acts on.
    pub services: ::std::vec::Vec<::std::string::String>,
    pub start_time: ::core::option::Option<crate::Timestamp>,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ServicesActionKind {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    Start,
    Stop,
    Restart,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// Where the files come from (THE PROJECT IS ITS DIRECTORY).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectSource {
    pub kind: ::core::option::Option<ProjectSourceKind>,
}

/// The oneof [`ProjectSource::kind`](crate::types::ProjectSource::kind): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum ProjectSourceKind {
    /// True = the files live on the machine.
    Files(bool),
    Github(GithubSource),
    /// A member this version of the crate does not know: the API set none it knows, and sent
    /// fields it does not know. Sent, it counts as no member.
    Unrecognized,
}

/// Input: an absent field keeps its value (`set_source`) or takes its default (new source).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GithubSource {
    /// \"owner/name\", one of [`GetMachineResponse::github`](crate::types::GetMachineResponse::github)`.repositories`.
    pub repository: ::core::option::Option<::std::string::String>,
    /// Empty = the default branch, also when absent on a new source.
    pub branch: ::core::option::Option<::std::string::String>,
    /// The project's directory in it, e.g. \"apps/web\"; empty = the root.
    pub directory: ::core::option::Option<::std::string::String>,
    /// True = deploy each new `newest_commit`, each tried once. Deploying another commit turns it off; only `set_source` turns it on. Default true; always written on output.
    pub auto_deploy: ::core::option::Option<bool>,
    /// Output: the branch's newest commit touching the directory, as of the last push or 5-minute check.
    pub newest_commit: ::core::option::Option<GithubCommit>,
    /// Output: the commit the files are at. Absent = no deploy, or the files came from another source.
    pub deployed_commit: ::core::option::Option<GithubCommit>,
    /// Output: `deployed_commit` set and `auto_deploy` off, e.g. after a rollback.
    pub pinned: bool,
    /// Output: true = auto-deploy will deploy `newest_commit` (not yet tried) once the project is free. A tried commit that failed or was refused waits for a person: [`Client::deploy_project`](crate::Client::deploy_project) or a new push.
    pub auto_deploy_pending: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct GithubCommit {
    /// Full.
    pub sha: ::std::string::String,
    /// First line of its message. Untrusted.
    pub title: ::std::string::String,
    /// On github.com.
    pub url: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Service {
    pub service: ::std::string::String,
    pub state: ServiceState,
    /// True = its container runs, as [`Client::run_service_command`](crate::Client::run_service_command), `OpenTerminal` and [`Client::read_path`](crate::Client::read_path) of its own files (outside volumes) need: in RUNNING, HEALTHY and UNHEALTHY, and in STARTING once its process started.
    pub container_running: bool,
    /// The image as compose.yaml names it; for `build:` without `image:`, the name Compose gives.
    pub image: ::std::string::String,
    /// Built on the machine from a `build:` section.
    pub builds_image: bool,
    /// The registry digest it was pulled as, \"sha256:\.\.\.\". Empty for a built image.
    pub image_digest: ::std::string::String,
    /// Absent until the machine next measures sizes, every few minutes, as after a build or pull.
    pub image_size_bytes: u64,
    /// What the main process runs, as compose.yaml writes it (entrypoint, then command), `${...}` not interpolated, so that no value of an env file shows; the image's own argv when compose.yaml writes neither. Empty = not known without those values: compose.yaml loads only interpolated, e.g. with an `include` path from .env.
    pub command: ::std::vec::Vec<::std::string::String>,
    pub run_as_user: ::std::string::String,
    /// Of the current or last run.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// Set once it exited, and while Docker waits to restart it: when, with what code (0 = a clean exit: a job that finished, or a server stopped; 137 = killed), and whether a process of it was killed for exceeding its memory.
    pub finish_time: ::core::option::Option<crate::Timestamp>,
    pub exit_code: ::core::option::Option<i32>,
    pub out_of_memory: bool,
    /// Restarts by Docker since the container was created.
    pub restart_count: u32,
    pub cpu_used_cores: f64,
    pub memory_used_bytes: u64,
    /// 0 = no limit: it shares the machine.
    pub memory_limit_bytes: u64,
    /// 0 = no limit.
    pub cpu_limit_cores: f64,
    /// Written outside volumes: lost on a recreate.
    pub writable_layer_bytes: u64,
    /// The ports it is reached at, as far as the machine knows: those compose.yaml or its image declares and those its routes send to. The project's other services reach it at `<service>:<port>`.
    pub ports: ::std::vec::Vec<u32>,
    /// The TCP ports its processes listen on now, at an address the proxy and the other services reach: a route's port must be one of them. Empty = it does not run, or listens on none.
    pub listening_ports: ::std::vec::Vec<u32>,
    /// The ports `ports:` opens on the machine now: not one a route serves, nor one bound to 127.0.0.1.
    pub published_ports: ::std::vec::Vec<PublishedPort>,
    pub volume_mounts: ::std::vec::Vec<VolumeMount>,
    pub restart_policy: RestartPolicy,
    /// Absent = no healthcheck.
    pub health_check: ::core::option::Option<HealthCheck>,
    /// What the container is configured with, not what its image sets.
    pub environment: ::std::vec::Vec<EnvironmentVariable>,
    /// The files its `env_file:` names, as compose.yaml writes them, e.g. \"./.env\": relative to the project directory. Change them with [`DeployProjectRequest::files`](crate::types::DeployProjectRequest::files).
    pub env_files: ::std::vec::Vec<::std::string::String>,
    /// What the person runs in their own terminal for a shell in its container, e.g. \"ssh web.notes@m1.pethost.dev\"; scp, sftp, rsync and `ssh -L` tunnels take the same address. It works once one of their public keys is among [`Machine::ssh_keys`](crate::types::Machine::ssh_keys).
    pub ssh_command: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum ServiceState {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// Declared; no container yet.
    NotCreated,
    /// Starting, or created while an operation that starts containers runs (deploy, `recreate_service`, restore); its healthcheck has not passed yet.
    Starting,
    /// Running, without a healthcheck.
    Running,
    /// Running; its healthcheck passes.
    Healthy,
    /// Running; its healthcheck fails.
    Unhealthy,
    /// Exited and Docker is restarting it.
    Restarting,
    /// Not running: stopped by `stop_services` or a restore, never started, paused or dead.
    Stopped,
    /// Not running: it exited on its own (see `exit_code`; 0 = a job that finished).
    Exited,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// A port that `ports:` opens on the machine directly, to anyone, bypassing the proxy.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct PublishedPort {
    /// 0 = Docker picks one when the container starts.
    pub machine_port: u32,
    pub container_port: u32,
    /// \"tcp\", \"udp\" or \"sctp\".
    pub protocol: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct VolumeMount {
    pub volume: ::std::string::String,
    /// E.g. \"/var/lib/postgresql/data\".
    pub container_path: ::std::string::String,
}

/// Docker's restart policies: what happens when the process exits, and when the machine starts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum RestartPolicy {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// Never restarted.
    No,
    /// Restarted when it exits non-zero. When the machine or Docker restarts it comes back unless it exited 0 (a finished job), so one stopped with `stop_services` comes back too. The default when compose.yaml sets none.
    OnFailure,
    /// Always restarted, unless stopped with [`RunProjectActionRequestAction::StopServices`](crate::types::RunProjectActionRequestAction::StopServices).
    UnlessStopped,
    Always,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// The healthcheck Docker runs: compose.yaml's, else the image's HEALTHCHECK.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HealthCheck {
    /// The program and its arguments, e.g. \[\"curl\", \"-f\", \"http://localhost:8000/health\"\]; a test written as a shell line is \[\"/bin/sh\", \"-c\", \<line\>\]. Written and known as [`Service::command`](crate::types::Service::command) is: compose.yaml's `healthcheck.test`, else the image's.
    pub command: ::std::vec::Vec<::std::string::String>,
    /// How often Docker runs it.
    pub interval_seconds: u32,
    /// Absent while the service is not running.
    pub status: HealthStatus,
    pub consecutive_failure_count: u32,
    /// Up to the last 5 checks, oldest first.
    pub recent_results_passed: ::std::vec::Vec<bool>,
    /// Of the latest failed check, at most 4 KiB. Untrusted.
    pub last_failure_output: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum HealthStatus {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    Starting,
    Healthy,
    Unhealthy,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct EnvironmentVariable {
    pub name: ::std::string::String,
    /// Absent when empty, when `secret` and [`Client::get_project`](crate::Client::get_project) had no `include_secret_values`, or when `value_left_out`.
    pub value: ::std::string::String,
    /// True = its value is not empty and comes from an env file, directly or through `${...}` in compose.yaml: env files hold the secrets. Empty values, and values written in compose.yaml itself, are not secret. The machine hides these values in operation logs too.
    pub secret: bool,
    /// The file to edit to change it, absolute in the project's directory: \"/compose.yaml\" (the service's `environment:`, which wins) or the env file it comes from, e.g. \"/.env\", \"/web.env\". Empty = the machine cannot tell, as when compose.yaml takes that file's path from .env.
    pub source_file: ::std::string::String,
    /// When compose.yaml builds it from `${...}`: the .env variables to edit to change it.
    pub from_env_file_variables: ::std::vec::Vec<::std::string::String>,
    /// True = the value is left out: the project's values together hold more than about 64 KiB. Read `source_file` with [`Client::read_path`](crate::Client::read_path).
    pub value_left_out: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Volume {
    pub volume: ::std::string::String,
    /// Measured every few minutes.
    pub size_bytes: u64,
    pub mounted_by: ::std::vec::Vec<VolumeMountedBy>,
    /// Of the newest snapshot that holds this volume. Absent = no snapshot holds it, or the list is not known ([`Project::snapshot_list_time`](crate::types::Project::snapshot_list_time)).
    pub last_backup_time: ::core::option::Option<crate::Timestamp>,
    /// The snapshots that hold it, in all; [`GetProjectRequest::snapshots_volume`](crate::types::GetProjectRequest::snapshots_volume) lists them. See [`Project::snapshot_list_time`](crate::types::Project::snapshot_list_time).
    pub snapshot_count: u32,
    /// False, always written = compose.yaml no longer declares it, so no service mounts it: it keeps its data and is in every backup until [`RunProjectActionRequestAction::DeleteVolume`](crate::types::RunProjectActionRequestAction::DeleteVolume) or the project is deleted. [`Client::read_path`](crate::Client::read_path) reads it with the volume root, `restore_snapshot` restores it, and declaring it again mounts it as it is.
    pub declared: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct VolumeMountedBy {
    pub service: ::std::string::String,
    pub container_path: ::std::string::String,
}

/// A host of [`Project::routes`](crate::types::Project::routes), with its certificate.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Host {
    /// As x-pethost.routes\[\].host.
    pub host: ::std::string::String,
    /// \"https://\<host\>\" once its certificate is served, and plain HTTP is redirected there; until then \"http://\<host\>\", which reaches the services. For AUTOMATIC, the host must resolve to the machine first. A protected project ([`Project::password_protected`](crate::types::Project::password_protected)) is never served over plain HTTP: it is always redirected, so the host answers only once its certificate is served.
    pub url: ::std::string::String,
    pub certificate_source: CertificateSource,
    /// When the certificate served expires. Absent = none is served yet.
    pub certificate_expire_time: ::core::option::Option<crate::Timestamp>,
    /// Why the host answers nobody: a name under the panel's domain that is not one label under [`Machine::apps_domain`](crate::types::Machine::apps_domain) (another account's, a former `apps_domain` of this one, or two labels deep). Change its host. Empty = it answers, or it is the person's own domain.
    pub unavailable_message: ::std::string::String,
}

/// An x-pethost route: requests for `host` under `path` go to `port` of `service`. The field names are the YAML keys.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct Route {
    /// `<name>.<Machine.apps_domain>`, the person's domain on Pethost: HTTPS at once, nothing to set up. Or a domain they own: a CNAME to [`Machine::hostname`](crate::types::Machine::hostname) (an ALIAS at the apex, never an IP address), certified once it resolves.
    pub host: ::std::string::String,
    /// Whole segments, the longest wins. Empty = \"/\": every path.
    pub path: ::std::string::String,
    pub service: ::std::string::String,
    /// The port the service listens on in its container, at 0.0.0.0.
    pub port: u32,
    /// True = the path's prefix is removed from the request.
    pub strip_path: bool,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum CertificateSource {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// No certificate will come: plain HTTP only. As when [`Machine::acme_enabled`](crate::types::Machine::acme_enabled) is off, or for an IP address or another name Let's Encrypt does not issue for.
    None,
    /// A certificate installed on the machine covers it.
    Installed,
    /// From Let's Encrypt, renewed automatically.
    Automatic,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Operation {
    pub operation_id: ::std::string::String,
    pub kind: OperationKind,
    pub status: OperationStatus,
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// Absent while in progress.
    pub finish_time: ::core::option::Option<crate::Timestamp>,
    /// When FAILED: why, for people. The log says more.
    pub failure_message: ::std::string::String,
    /// DEPLOY or `RECREATE_SERVICE` that FAILED: why, to branch on.
    pub deploy_failure_reason: DeployFailureReason,
    /// DEPLOY, or a RESTORE that brought a deleted project back: true = it made its files the project's. It stays true once a later deploy replaces them: [`Project::deploy_id`](crate::types::Project::deploy_id) names the one whose files the project has now. A deploy switches the files partway, when it starts the containers, so one that FAILED or was CANCELLED without it left the files as they were: to retry, send all its changes again. A project's first deploy has it from its start: its files stay however it ends, to fix and deploy again.
    pub made_current: bool,
    /// `RECREATE_SERVICE`: the service. A failed DEPLOY or `RECREATE_SERVICE`: the service that failed.
    pub service: ::std::string::String,
    /// DEPLOY or `RECREATE_SERVICE` that failed `CONTAINER_EXITED`.
    pub failed_exit_code: i32,
    /// BACKUP, or DELETE's final backup, that succeeded: the snapshot taken. RESTORE: the snapshot restored.
    pub snapshot_id: ::std::string::String,
    /// RESTORE: the volumes it replaced.
    pub restored_volumes: ::std::vec::Vec<::std::string::String>,
    /// RESTORE: the backup taken first; restore it to undo. Empty = none was taken.
    pub undo_snapshot_id: ::std::string::String,
    /// DEPLOY of a github project: the commit its files are, also when it changed only /.env or x-pethost.
    pub github_commit: ::core::option::Option<GithubCommit>,
    /// DEPLOY of an uploaded archive: its file name.
    pub archive_name: ::std::string::String,
    /// DEPLOY: what making that version changed that its request did not write, for people: the earlier deploy whose files it took, the compose file it took or wrote for a Dockerfile, the compose files it left out, the project's /.env and x-pethost kept in place of the version's own. Nothing else in the compose file is changed: it runs as written.
    pub adjustments: ::std::vec::Vec<::std::string::String>,
    /// DEPLOY: the paths its request changed, for people, the first 10: [`DeployProjectRequest::files`](crate::types::DeployProjectRequest::files), or [`Client::create_project`](crate::Client::create_project)\'s files; a move lists both paths. A commit's or an archive's own files are not listed: `github_commit` or `archive_name` says what they brought.
    pub changed_paths: ::std::vec::Vec<::std::string::String>,
    /// DEPLOY: the paths its request changed, in all.
    pub changed_path_count: u32,
    /// DEPLOY: true = the machine keeps the files it deployed, which are no longer the project's: [`DeployProjectRequestVersion::RollbackDeployId`](crate::types::DeployProjectRequestVersion::RollbackDeployId) puts them back. It keeps the 3 newest versions of the files before the current one; of deploys that changed only /.env or x-pethost, whose files are the same, the newest has it.
    pub files_kept: bool,
    /// DEPLOY: the deploy that first deployed its files: itself when its request brought or changed files (a commit, an archive, a file other than /.env); else an earlier one, as after a deploy that changed only /.env or x-pethost.
    pub files_operation_id: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OperationKind {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    Deploy,
    RecreateService,
    Backup,
    Restore,
    Delete,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OperationStatus {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    InProgress,
    Succeeded,
    Failed,
    Cancelled,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum DeployFailureReason {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// A wrong name or tag, or a private image.
    ImagePullFailed,
    ImageBuildFailed,
    /// E.g. the command does not exist.
    ContainerStartFailed,
    DiskFull,
    /// Includes a machine restart during the operation.
    Internal,
    /// A `ports:` machine port is taken.
    PortUnavailable,
    /// Exited, or kept restarting, after starting.
    ContainerExited,
    ContainerUnhealthy,
    TimedOut,
    /// The image declares a VOLUME no mount covers: it would never be backed up. Mount a named volume there.
    UncoveredImageVolume,
    /// The running projects leave too little memory for a build; the message says how much.
    BuildMemoryUnavailable,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Snapshot {
    pub snapshot_id: ::std::string::String,
    pub create_time: ::core::option::Option<crate::Timestamp>,
    /// Of its files, the directory and every volume. 0 = not known.
    pub size_bytes: u64,
    /// The volumes it holds, besides the project's directory.
    pub volumes: ::std::vec::Vec<::std::string::String>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpTrafficSummary {
    pub request_count: u64,
    /// 5xx responses.
    pub server_error_count: u64,
    /// Of responses: WebSockets, logged when they close, count as requests but not here.
    pub latency_p50_ms: u32,
    pub latency_p95_ms: u32,
}

/// What [`Client::create_project`](crate::Client::create_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CreateProjectRequest {
    /// New, \[a-z0-9\]\[a-z0-9\_-\]\*, ≤63 chars; immutable.
    pub project_id: ::std::string::String,
    /// Set = a GitHub project: {github: {repository}}. Absent = the files of this request.
    pub source: ::core::option::Option<ProjectSource>,
    /// An archive of the project's directory, from [`CreateTransferRequestTransfer::UploadArchive`](crate::types::CreateTransferRequestTransfer::UploadArchive), unpacked first. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = not arrived; [`ErrorCode::NotFound`](crate::ErrorCode::NotFound) = expired or used. One the machine refused (its PUT said why) answers with its `violations`.
    pub upload_id: ::std::string::String,
    /// The project's files, e.g. \[{path: \"/compose.yaml\", text: \"…\"}, {path: \"/.env\", text: \"…\"}\], or those to write over the archive's or the commit's. A github source takes only /.env.
    pub files: ::std::vec::Vec<FileChange>,
    /// Changes to the files\' x-pethost: the name people see, the routes, a password.
    pub x_pethost: ::core::option::Option<ProjectExtension>,
    /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `timeout_seconds`.
    pub timeout_seconds: u32,
    /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `operation_id`.
    pub operation_id: ::std::string::String,
    /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s `wait_seconds`.
    pub wait_seconds: ::core::option::Option<u32>,
}

/// What [`Client::create_project`](crate::Client::create_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct CreateProjectResponse {
    /// The first deploy: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)). Absent when violations stopped it: nothing was created.
    pub operation: ::core::option::Option<Operation>,
    pub violations: ::std::vec::Vec<SpecViolation>,
    /// With violations: what the machine had changed, as in [`Operation::adjustments`](crate::types::Operation::adjustments). A deploy that started lists them in operation.adjustments only.
    pub adjustments: ::std::vec::Vec<::std::string::String>,
    /// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
    pub project: ::core::option::Option<Project>,
    /// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
    pub log: ::std::vec::Vec<OperationLogLine>,
}

/// What [`Client::deploy_project`](crate::Client::deploy_project) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct DeployProjectRequest {
    pub project_id: ::std::string::String,
    /// [`Project::deploy_id`](crate::types::Project::deploy_id) as you read it: [`ErrorCode::Aborted`](crate::ErrorCode::Aborted) if the project was deployed since. Empty = no check.
    pub base_deploy_id: ::std::string::String,
    /// Written in order over the current files, or over the new version's: e.g. \[{path: \"/.env\", text: \"…\"}\] writes that file whole, and the files not named stay. With no new version pethost.compose.yaml is refused: write /compose.yaml. github: only /.env. None = redeploy.
    pub files: ::std::vec::Vec<FileChange>,
    /// Edits x-pethost by part, after `files`: metadata by key; routes all at once.
    pub x_pethost: ::core::option::Option<ProjectExtension>,
    /// Not with `upload_id`, or github.
    pub mount_volume: ::core::option::Option<MountVolume>,
    /// For the whole deploy, builds included; 0 = default.
    pub timeout_seconds: u32,
    /// For a safe retry: the same id returns the first call's operation and starts nothing. \[A-Za-z0-9\]\[A-Za-z0-9.\_-\]\*, ≤128 chars; empty = generated.
    pub operation_id: ::std::string::String,
    /// A new version of the files; none = the current one.
    pub version: ::core::option::Option<DeployProjectRequestVersion>,
    /// Seconds to wait for the deploy's end, ≤45. Absent = 45; 0 = answer once it started. Still `IN_PROGRESS` then: [`Client::get_operation`](crate::Client::get_operation) waits on.
    pub wait_seconds: ::core::option::Option<u32>,
}

/// The oneof [`DeployProjectRequest::version`](crate::types::DeployProjectRequest::version): one of its members.
///
/// A new version of the files; none = the current one.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum DeployProjectRequestVersion {
    /// files project: an archive from [`Client::create_transfer`](crate::Client::create_transfer); replaces all files but /.env and x-pethost.
    UploadId(::std::string::String),
    /// github project: a commit of its branch (SHA, ≥7 chars), from [`Client::list_commits`](crate::Client::list_commits).
    Commit(::std::string::String),
    /// github project: true = [`GithubSource::newest_commit`](crate::types::GithubSource::newest_commit), read now.
    NewestCommit(bool),
    /// files project, a rollback: the `operation_id` of an earlier deploy with `files_kept` ([`Project::operations`](crate::types::Project::operations)). Its files return as a new version; /.env, x-pethost and volumes stay.
    RollbackDeployId(::std::string::String),
}

/// Adds `<volume>:<container_path>` to the service, declaring the volume if needed.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct MountVolume {
    /// A service of compose.yaml.
    pub service: ::std::string::String,
    /// New, or one of [`Project::volumes`](crate::types::Project::volumes).
    pub volume: ::std::string::String,
    /// Absolute, e.g. \"/data\".
    pub container_path: ::std::string::String,
}

/// x-pethost as data. Absent parts stay.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ProjectExtension {
    /// Sets the fields given; an empty one is removed.
    pub metadata: ::core::option::Option<ProjectMetadata>,
    /// The project's routes from now on: these replace all it has, so send [`Project::routes`](crate::types::Project::routes) with your change to add, change or remove one. Empty = they stay.
    pub routes: ::std::vec::Vec<Route>,
    /// True = the project has no route from now on. Not with routes.
    pub remove_routes: bool,
    /// Visitors of every route must enter it. Empty = it stays.
    pub password: ::std::string::String,
    /// True = no password. Not with password.
    pub remove_password: bool,
}

/// `path` and exactly one change.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct FileChange {
    /// Absolute in the project's directory.
    pub path: ::std::string::String,
    pub change: ::core::option::Option<FileChangeChange>,
    /// With text or data: mode 0755, not 0644.
    pub executable: bool,
}

/// The oneof [`FileChange::change`](crate::types::FileChange::change): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum FileChangeChange {
    /// Writes the file as UTF-8 text, creating parents.
    Text(::std::string::String),
    /// Writes the file as bytes, likewise.
    Data(::std::vec::Vec<u8>),
    /// True = creates it and its parents.
    MakeDirectory(bool),
    /// True = deletes the file, symlink or empty directory.
    Delete(bool),
    /// True = deletes a directory recursively, if present.
    DeleteTree(bool),
    /// Moves it to this path.
    RenameTo(::std::string::String),
}

/// What [`Client::deploy_project`](crate::Client::deploy_project) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct DeployProjectResponse {
    /// The deploy: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)). Absent when violations stopped it.
    pub operation: ::core::option::Option<Operation>,
    /// Why the files cannot be deployed: nothing changed and no operation started.
    pub violations: ::std::vec::Vec<SpecViolation>,
    /// As in [`CreateProjectResponse`](crate::types::CreateProjectResponse): with violations only.
    pub adjustments: ::std::vec::Vec<::std::string::String>,
    /// Once the operation ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it.
    pub project: ::core::option::Option<Project>,
    /// The log's last lines, unless it SUCCEEDED: why it FAILED, or what it is doing.
    pub log: ::std::vec::Vec<OperationLogLine>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SpecViolation {
    /// Empty = not about one service.
    pub service: ::std::string::String,
    /// In compose.yaml, down to the key it is about, e.g. \"services.db.volumes\[0\]\", \"x-pethost.routes\[2\].host\"; or a file's absolute path, e.g. \"/.env\".
    pub location: ::std::string::String,
    /// What is wrong and what to write instead.
    pub violation_message: ::std::string::String,
}

/// What [`Client::list_commits`](crate::Client::list_commits) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ListCommitsRequest {
    pub project_id: ::std::string::String,
    /// The previous page's last sha. Empty = from the newest.
    pub before_commit: ::std::string::String,
}

/// What [`Client::list_commits`](crate::Client::list_commits) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ListCommitsResponse {
    /// Newest first, at most 30.
    pub commits: ::std::vec::Vec<BranchCommit>,
    /// Older ones exist: pass the last one's sha as `before_commit`.
    pub more: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct BranchCommit {
    pub commit: ::core::option::Option<GithubCommit>,
    /// The author's GitHub login, else their name. Untrusted.
    pub author: ::std::string::String,
    /// When it was committed.
    pub commit_time: ::core::option::Option<crate::Timestamp>,
    /// The project's files are this commit ([`GithubSource::deployed_commit`](crate::types::GithubSource::deployed_commit)).
    pub deployed: bool,
    /// The newest deploy of it among the operations the machine keeps; its status says how it went. Absent = none.
    pub last_deploy: ::core::option::Option<Operation>,
    /// True = the branch's newest commit that changes the directory, as GitHub answered this call: deploying any other turns `auto_deploy` off (see [`Client::deploy_project`](crate::Client::deploy_project)).
    pub newest: bool,
}

/// What [`Client::run_project_action`](crate::Client::run_project_action) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunProjectActionRequest {
    pub project_id: ::std::string::String,
    pub action: ::core::option::Option<RunProjectActionRequestAction>,
    /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
    pub operation_id: ::std::string::String,
    /// As [`Client::deploy_project`](crate::Client::deploy_project)\'s, for the actions that run as operations.
    pub wait_seconds: ::core::option::Option<u32>,
}

/// The oneof [`RunProjectActionRequest::action`](crate::types::RunProjectActionRequest::action): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum RunProjectActionRequestAction {
    /// Starts stopped services and reruns jobs, not their dependencies. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = no container yet (deploy or `recreate_service`), or a published machine port is taken.
    StartServices(ServicesAction),
    /// Stops services, each with its grace period. A machine restart may start them, per restart policy.
    StopServices(ServicesAction),
    /// Restarts processes in the same containers. Codes as `start_services`.
    RestartServices(ServicesAction),
    /// A new container: a fresh filesystem outside volumes. An operation.
    RecreateService(RecreateServiceAction),
    /// Backs up the directory and volumes now, live. An operation. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = backups off ([`Machine::backups_enabled`](crate::types::Machine::backups_enabled)).
    BackUp(BackUpAction),
    /// From a snapshot of this project. An operation.
    RestoreSnapshot(RestoreSnapshotAction),
    /// Stops a running or starting operation: it ends CANCELLED, leaving what a failure would; one only starting answers CANCELLED from its own call. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = a delete past its final backup.
    CancelOperation(CancelOperationAction),
    /// An operation: a final backup while backups are on, then containers, volumes, files, hosts, logs. Snapshots stay ([`GetMachineResponse::deleted_projects`](crate::types::GetMachineResponse::deleted_projects)), and restoring one brings the project back, source included; with backups off there is none, and it is gone for good.
    DeleteProject(DeleteProjectAction),
    /// Changes the source. To files: keeps the current files. To github: only the fields set change, e.g. {github: {`auto_deploy`: true}} follows pushes again; from files, repository is required. Deploys the newest commit if `auto_deploy` is on and the files are not at it. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = as [`Client::create_project`](crate::Client::create_project).
    SetSource(ProjectSource),
    /// A volume compose.yaml no longer declares ([`Volume::declared`](crate::types::Volume::declared) false). Its data then lives only in snapshots. [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) = declared or in use.
    DeleteVolume(::std::string::String),
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct ServicesAction {
    /// Empty = all (start: those with a container; restart: running ones).
    pub services: ::std::vec::Vec<::std::string::String>,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct RecreateServiceAction {
    pub service: ::std::string::String,
    /// True = pull the tag's newest image, or rebuild on the newest base images.
    pub pull_latest_image: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct BackUpAction {}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct RestoreSnapshotAction {
    pub snapshot_id: ::std::string::String,
    /// Existing project: the volumes to replace (≥1); it is backed up first ([`Operation::undo_snapshot_id`](crate::types::Operation::undo_snapshot_id)), stopped and restarted; files stay. Deleted project: files, source and volumes return, then it deploys.
    pub volumes: ::std::vec::Vec<::std::string::String>,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct CancelOperationAction {
    /// Required.
    pub operation_id: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct DeleteProjectAction {
    /// True = no final backup, while backups are on: changes since the newest snapshot are lost.
    pub skip_final_backup: bool,
}

/// What [`Client::run_project_action`](crate::Client::run_project_action) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunProjectActionResponse {
    /// Set when the action runs as an operation: finished, or `IN_PROGRESS` when `wait_seconds` ran out (then [`Client::get_operation`](crate::Client::get_operation)); for `set_source`, the deploy it started, if any; for `cancel_operation`, the operation it stopped, if the machine had recorded it (see `cancel_operation`).
    pub operation: ::core::option::Option<Operation>,
    /// The project as [`Client::get_project`](crate::Client::get_project) returns it, after the action, or once its operation ended: after `set_source`, its source says what it now is. Absent while the operation runs, and once `delete_project` has deleted it.
    pub project: ::core::option::Option<Project>,
    /// The operation's last log lines, unless it SUCCEEDED.
    pub log: ::std::vec::Vec<OperationLogLine>,
}

/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct SetProjectAlertsRequest {
    pub project_id: ::std::string::String,
    /// ≤10. Given = the whole list.
    pub checks: ::std::vec::Vec<SiteCheck>,
    /// True = none, not even the default check.
    pub remove_checks: bool,
    /// ≤10. Given = the whole list.
    pub traffic_rules: ::std::vec::Vec<TrafficRule>,
    /// True = none.
    pub remove_traffic_rules: bool,
    /// True = incidents are recorded, nothing is sent. Absent = stays.
    pub off: ::core::option::Option<bool>,
    /// ≤10080; 0 = unmute. Incidents opened meanwhile are not sent. Absent = stays.
    pub mute_minutes: ::core::option::Option<u32>,
}

/// What [`Client::set_project_alerts`](crate::Client::set_project_alerts) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SetProjectAlertsResponse {
    /// As changed.
    pub alerts: ::core::option::Option<ProjectAlerts>,
}

/// An address of the project the machine opens every minute through its proxy, from inside the machine. Down = no connection, a bad certificate, no answer in 10 s, the wrong status, or `must_contain` missing; 3 failures in a row open `SITE_DOWN`. A password page is passed.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct SiteCheck {
    /// A [`Host::host`](crate::types::Host::host) of the project.
    pub host: ::std::string::String,
    /// \"/…\", ≤200 chars, a query allowed. Empty = \"/\".
    pub path: ::std::string::String,
    /// 100-599. 0 = any status below 500 is up: 401, 404 and redirects too.
    pub expect_status: u32,
    /// ≤100 chars, in the body's first 64 KiB. Empty = not looked for.
    pub must_contain: ::std::string::String,
}

/// Fires when `metric`, over the last `window_minutes` of the requests `filter` selects, reaches `threshold` 2 minutes in a row; clears after 3 below.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TrafficRule {
    pub metric: TrafficMetric,
    /// `status_class` not taken.
    pub filter: ::core::option::Option<HttpTrafficFilter>,
    /// A count, a percent (0-100) or ms.
    pub threshold: f64,
    /// 1-60. 0 = 5.
    pub window_minutes: u32,
    /// Percent and p95: fewer requests in the window leave the rule as it was. ≤10000. 0 = 20.
    pub min_requests: u32,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum TrafficMetric {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// 5xx responses in the window.
    ServerErrors,
    /// 5xx, of the window's requests (WebSockets too).
    ServerErrorPercent,
    LatencyP95Ms,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What Pethost watches on a project ([`Client::set_project_alerts`](crate::Client::set_project_alerts)), and how each part stands now. Service crashes, running out of memory, failed healthchecks, and failed backups, restores and auto-deploys are always watched.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectAlerts {
    /// Until set: the project's URL at \"/\" (`machine_default`); none without a route.
    pub checks: ::std::vec::Vec<SiteCheckState>,
    /// Until set: 10 or more 5xx in 5 minutes, of every request (`machine_default`).
    pub traffic_rules: ::std::vec::Vec<TrafficRuleState>,
    /// True = incidents are recorded, nothing is sent.
    pub off: bool,
    /// Absent = not muted.
    pub mute_end_time: ::core::option::Option<crate::Timestamp>,
    /// Of the time the checks ran in the last 30 days, the share they were up, e.g. 99.97. Absent = no check ran.
    pub uptime_percent: ::core::option::Option<f64>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SiteCheckState {
    pub check: ::core::option::Option<SiteCheck>,
    /// The default check, as no list was set.
    pub machine_default: bool,
    pub status: AlertStatus,
    /// Absent = not run yet.
    pub last_result: ::core::option::Option<SiteCheckResult>,
    /// The open incident. Empty = none.
    pub incident_id: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct SiteCheckResult {
    pub check_time: ::core::option::Option<crate::Timestamp>,
    /// 0 = no HTTP answer: `failure_message` says why.
    pub status: u32,
    pub duration_ms: u32,
    /// E.g. \"connection refused\", \"status 502\", \"the text is missing\". Empty = up.
    pub failure_message: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TrafficRuleState {
    pub rule: ::core::option::Option<TrafficRule>,
    /// The default rule, as no list was set.
    pub machine_default: bool,
    pub status: AlertStatus,
    /// The metric at the last evaluation.
    pub value: f64,
    /// In the window then.
    pub request_count: u64,
    /// The open incident. Empty = none.
    pub incident_id: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum AlertStatus {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    Ok,
    /// It holds or cleared, not confirmed yet.
    Pending,
    /// An incident is open.
    Firing,
    /// Not checked now: a deploy or restore runs or just ended, the project is stopped, or no route has the check's host.
    Paused,
    /// Not evaluated yet, or too few requests.
    NoData,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// A period during which something of a project needed attention, from its confirmation to its end.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct Incident {
    pub incident_id: ::std::string::String,
    /// `DEPLOY_CANCELLED` opens none.
    pub kind: ProjectProblemKind,
    /// As in its [`ProjectProblem`](crate::types::ProjectProblem).
    pub service: ::std::string::String,
    /// `SITE_DOWN`.
    pub check: ::core::option::Option<SiteCheck>,
    /// `HTTP_ERRORS`, `HTTP_SLOW`.
    pub traffic_rule: ::core::option::Option<TrafficRule>,
    /// `DEPLOY_FAILED`, `BACKUP_FAILED`, `RESTORE_FAILED`.
    pub operation_id: ::std::string::String,
    pub open_time: ::core::option::Option<crate::Timestamp>,
    /// When it and every incident joined to it cleared. Absent = open.
    pub resolve_time: ::core::option::Option<crate::Timestamp>,
    /// `HTTP_ERRORS`, `HTTP_SLOW`: the metric at open.
    pub value: f64,
    /// `HTTP_ERRORS`, `HTTP_SLOW`: the window's requests at open.
    pub request_count: u64,
    /// A deploy, recreate or restore that ran when it opened, or ended ≤30 minutes before: a likely cause, undone with [`DeployProjectRequestVersion::RollbackDeployId`](crate::types::DeployProjectRequestVersion::RollbackDeployId) or an older commit. Empty = none.
    pub after_operation_id: ::std::string::String,
    /// Absent = it was running.
    pub after_operation_end_time: ::core::option::Option<crate::Timestamp>,
    /// The incident this one is part of: it is told with that one, not on its own. Empty = none.
    pub joined_incident_id: ::std::string::String,
    /// Set = nobody is told of it.
    pub quiet_reason: IncidentQuietReason,
    /// True = it went down and up 3 times within an hour; it stands for them all and clears after 15 clean minutes.
    pub flapping: bool,
    /// One sentence for people, without a time of day.
    pub incident_message: ::std::string::String,
    /// `GetIncident` only.
    pub evidence: ::core::option::Option<IncidentEvidence>,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum IncidentQuietReason {
    /// Told.
    #[default]
    Unspecified,
    Muted,
    Off,
    /// Already so when the machine first watched it, as after the update that brought alerts.
    FirstEvaluation,
    /// A deploy someone ran failed: they watch it.
    ManualDeploy,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What the machine saw when an incident opened, kept with it. Untrusted.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct IncidentEvidence {
    /// `SITE_DOWN`: the third failure.
    pub check_result: ::core::option::Option<SiteCheckResult>,
    /// The service's container: `SERVICE_`\* kinds, and `SITE_DOWN`\'s service.
    pub exit_code: i32,
    pub oom_killed: bool,
    /// In the 10 minutes before.
    pub restart_count: u32,
    /// The last healthcheck's, ≤1 KiB.
    pub health_output: ::std::string::String,
    /// The service's last ≤20 before it opened, oldest first.
    pub log_lines: ::std::vec::Vec<LogLine>,
    /// `HTTP_ERRORS`: the path with the most 5xx in the window; `HTTP_SLOW`: the slowest.
    pub top_path: ::core::option::Option<HttpPathTraffic>,
}

/// One UTC day of a project's site checks.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct UptimeDay {
    /// Midnight UTC.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// Absent = no check ran.
    pub uptime_percent: ::core::option::Option<f64>,
    pub down_seconds: u32,
}

/// What [`Client::get_operation`](crate::Client::get_operation) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetOperationRequest {
    pub project_id: ::std::string::String,
    /// Empty = the latest.
    pub operation_id: ::std::string::String,
    /// How long to wait for it to end, ≤45. Absent = 45; 0 = answer at once.
    pub wait_seconds: ::core::option::Option<u32>,
    /// The previous `next_after_log_line`; 0 = from the start. Absent = the last lines.
    pub after_log_line: ::core::option::Option<u32>,
    /// ≤500; 0 = 50, when asked for lines. Also ends at \~64 KiB.
    pub log_line_limit: ::core::option::Option<u32>,
}

/// What [`Client::get_operation`](crate::Client::get_operation) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct GetOperationResponse {
    pub operation: ::core::option::Option<Operation>,
    /// Once it ended, however it did: the project as [`Client::get_project`](crate::Client::get_project) returns it. Absent once a delete has deleted it.
    pub project: ::core::option::Option<Project>,
    /// Oldest first. Unless `after_log_line` or `log_line_limit` asks for lines: the last 50 of one that FAILED, the last 5 of one `IN_PROGRESS` (what it is doing), none of one that SUCCEEDED.
    pub log: ::std::vec::Vec<OperationLogLine>,
    /// Lines in the whole log so far.
    pub log_line_count: u32,
    /// Pass it as `after_log_line` to get the lines after these; absent = 0. The machine keeps every line of the log.
    pub next_after_log_line: u32,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct OperationLogLine {
    pub time: ::core::option::Option<crate::Timestamp>,
    /// From Compose, BuildKit, restic or the daemon, as [`LogLine::text`](crate::types::LogLine::text) is kept; at most 2 KiB, a longer line is cut.
    pub text: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct HttpTrafficFilter {
    /// As [`Host::host`](crate::types::Host::host); a removed host still matches.
    pub host: ::std::string::String,
    /// E.g. \"GET\".
    pub method: ::std::string::String,
    /// Without the query; any case.
    pub path_contains: ::std::string::String,
    /// As [`HttpPathTraffic::path_pattern`](crate::types::HttpPathTraffic::path_pattern), e.g. \"/recipes/\*\".
    pub path_pattern: ::std::string::String,
    /// 1-5: 5 = 5xx.
    pub status_class: u32,
}

/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct QueryHttpTrafficRequest {
    pub project_id: ::std::string::String,
    pub filter: ::core::option::Option<HttpTrafficFilter>,
    /// Absent = a day before `end_time`.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// Absent = now.
    pub end_time: ::core::option::Option<crate::Timestamp>,
    /// The range ending at `end_time`, e.g. 3600 = the last hour. Not with `start_time`.
    pub last_seconds: u32,
    /// Time series bucket width; ≤500 buckets. 0 = no series.
    pub bucket_width_seconds: u32,
    /// Requests to return, newest first; ≤200. 0 = aggregates only.
    pub request_limit: u32,
    /// The previous `next_page_token`, other fields unchanged: older requests only.
    pub page_token: ::std::string::String,
}

/// What [`Client::query_http_traffic`](crate::Client::query_http_traffic) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct QueryHttpTrafficResponse {
    /// The range queried, as the machine resolved it: defaults applied, on its clock.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    pub end_time: ::core::option::Option<crate::Timestamp>,
    /// Of the oldest request the machine keeps for the project. Absent = none is kept.
    pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
    pub summary: ::core::option::Option<HttpTrafficSummary>,
    /// Oldest first, each `bucket_width_seconds` wide; one with no request is left out.
    pub buckets: ::std::vec::Vec<HttpTrafficBucket>,
    /// The 10 busiest, busiest first.
    pub top_paths: ::std::vec::Vec<HttpPathTraffic>,
    /// The sequence of the newest request the machine had logged: summary, buckets and `top_paths` count every one up to it, and [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) streams the later ones. 0 = none was logged.
    pub newest_sequence: u64,
    pub requests: ::std::vec::Vec<HttpRequest>,
    /// Empty = no more requests.
    pub next_page_token: ::std::string::String,
    /// Where [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) goes on from (`after_sequence`), so it misses no request newer than these: set on a first page with `request_limit`, empty or not. 0 = the machine had logged none.
    pub tail_sequence: u64,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpTrafficBucket {
    pub start_time: ::core::option::Option<crate::Timestamp>,
    pub summary: ::core::option::Option<HttpTrafficSummary>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpPathTraffic {
    pub method: ::std::string::String,
    /// The path with id-like segments as `*`, e.g. \"/recipes/\*\": requests to one endpoint.
    pub path_pattern: ::std::string::String,
    pub summary: ::core::option::Option<HttpTrafficSummary>,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct HttpRequest {
    /// Unique and increasing on the machine: [`Client::tail_http_traffic`](crate::Client::tail_http_traffic)\'s cursor.
    pub sequence: u64,
    /// When the response finished. A WebSocket is logged when it closes, with status 0.
    pub finish_time: ::core::option::Option<crate::Timestamp>,
    pub host: ::std::string::String,
    pub method: ::std::string::String,
    /// With the query. Untrusted.
    pub path: ::std::string::String,
    pub path_pattern: ::std::string::String,
    /// The route that matched.
    pub route_path: ::std::string::String,
    /// That answered. Empty = of a route the project no longer has.
    pub service: ::std::string::String,
    pub port: u32,
    /// 0 = a WebSocket; 499 = the client left before the response. A 401, 303 or 429 of a protected project ([`Project::password_protected`](crate::types::Project::password_protected)) may be its password page's, not the service's.
    pub status_code: u32,
    pub response_size_bytes: u64,
    /// In total.
    pub duration_ms: u32,
    /// Of which inside the service.
    pub service_duration_ms: u32,
    pub client_ip_address: ::std::string::String,
    /// Untrusted.
    pub user_agent: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct ContainerLogFilter {
    /// Empty = all, removed services too.
    pub service: ::std::string::String,
    /// Absent = both.
    pub stream: OutputStream,
    /// Literal, any ASCII case, ignoring escape sequences. Length limited ([`ErrorCode::InvalidArgument`](crate::ErrorCode::InvalidArgument)).
    pub text_contains: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum OutputStream {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    Stdout,
    Stderr,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What [`Client::query_container_logs`](crate::Client::query_container_logs) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct QueryContainerLogsRequest {
    pub project_id: ::std::string::String,
    pub filter: ::core::option::Option<ContainerLogFilter>,
    /// Absent = the oldest kept.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    /// Absent = now.
    pub end_time: ::core::option::Option<crate::Timestamp>,
    /// As in [`Client::query_http_traffic`](crate::Client::query_http_traffic).
    pub last_seconds: u32,
    /// ≤500; 0 = 100. Also ends at \~64 KiB.
    pub limit: u32,
    /// False = the newest before `end_time`; true = the oldest after `start_time`.
    pub from_start: bool,
    /// The previous `next_page_token`, other fields unchanged.
    pub page_token: ::std::string::String,
}

/// What [`Client::query_container_logs`](crate::Client::query_container_logs) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct QueryContainerLogsResponse {
    /// The range queried, as the machine resolved it: defaults applied, on its clock.
    pub start_time: ::core::option::Option<crate::Timestamp>,
    pub end_time: ::core::option::Option<crate::Timestamp>,
    /// Of the oldest line of container output the machine keeps: nothing older can be queried. Absent = none is kept.
    pub oldest_kept_time: ::core::option::Option<crate::Timestamp>,
    pub lines: ::std::vec::Vec<LogLine>,
    /// Empty = no more.
    pub next_page_token: ::std::string::String,
    /// Where [`Client::tail_container_logs`](crate::Client::tail_container_logs) goes on from (`after_cursor`), so it misses no line newer than these: set on every page, an empty one too. Empty = the machine had logged no line.
    pub tail_cursor: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct LogLine {
    pub time: ::core::option::Option<crate::Timestamp>,
    pub service: ::std::string::String,
    pub stream: OutputStream,
    /// A line as written, with its colour codes (SGR escape sequences); other escape sequences, and control characters but tab, are removed. A line over 4 KiB is cut (over 16 KiB in streams). Untrusted.
    pub text: ::std::string::String,
}

/// What [`Client::run_service_command`](crate::Client::run_service_command) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RunServiceCommandRequest {
    pub project_id: ::std::string::String,
    pub service: ::std::string::String,
    /// E.g. \[\"psql\", \"-c\", \"select 1\"\]; a shell line: \[\"sh\", \"-c\", \"ls | head\"\].
    pub command: ::std::vec::Vec<::std::string::String>,
    /// Written to stdin, then closed.
    pub stdin: ::std::string::String,
    /// Empty = the container's. \"root\" can install packages.
    pub run_as_user: ::std::string::String,
    /// Empty = the container's.
    pub working_directory: ::std::string::String,
    /// 0 = default. Kills the main process only. Over \~50 may outlast your client: background long jobs.
    pub timeout_seconds: u32,
}

/// What [`Client::run_service_command`](crate::Client::run_service_command) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct RunServiceCommandResponse {
    pub exit_code: i32,
    /// True = the machine killed it at the timeout; `exit_code` is then -1.
    pub timed_out: bool,
    /// The last 32 KiB of each, as the machine kept them. Invalid UTF-8, and control characters other than tab, newline and carriage return (colour codes included), become U+FFFD. Untrusted.
    pub stdout: ::std::string::String,
    pub stderr: ::std::string::String,
    /// True = the start of stdout or stderr was cut.
    pub output_truncated: bool,
}

#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct FileEntry {
    /// Without its directory.
    pub name: ::std::string::String,
    pub r#type: FileType,
    /// Of a regular file; 0 otherwise.
    pub size_bytes: u64,
    pub modify_time: ::core::option::Option<crate::Timestamp>,
    /// Permission bits in octal, e.g. \"0644\".
    pub mode: ::std::string::String,
    /// As inside the container.
    pub owner_uid: u32,
    pub owner_gid: u32,
    /// When SYMLINK.
    pub symlink_target: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum FileType {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    File,
    Directory,
    Symlink,
    /// A device, socket or FIFO.
    Other,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// Where a path of a service's container lies, which says whether it lasts.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum FileLocation {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// The container's own files, its image and what it wrote outside volumes, and its scratch space (an anonymous volume, a tmpfs): lost when it is recreated.
    Container,
    /// A named volume ([`ReadPathResponse::volume`](crate::types::ReadPathResponse::volume)): kept across deploys and backed up.
    Volume,
    /// The project's files, mounted read-only from its source as deployed: change them with [`Client::deploy_project`](crate::Client::deploy_project).
    ProjectFiles,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What [`Client::read_path`](crate::Client::read_path) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ReadPathRequest {
    pub project_id: ::std::string::String,
    /// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
    pub root: ::core::option::Option<ReadPathRequestRoot>,
    /// From the root, e.g. \"/compose.yaml\", \"/data/uploads\". Empty = \"/\": the root's entries.
    pub path: ::std::string::String,
    /// 0 = 200. Also ends at \~64 KiB.
    pub entry_limit: u32,
    /// File offset.
    pub offset_bytes: u64,
    /// ≤1 MiB; 0 = 64 KiB.
    pub length_bytes: u32,
    /// The previous `next_entry_page_token`, other fields unchanged.
    pub entry_page_token: ::std::string::String,
}

/// The oneof [`ReadPathRequest::root`](crate::types::ReadPathRequest::root): one of its members.
///
/// Where the path is. Neither = the project's deployed files, read-only: \"/compose.yaml\", \"/.env\", its sources.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum ReadPathRequestRoot {
    /// In its container.
    Service(::std::string::String),
    /// In the volume, from its root.
    Volume(::std::string::String),
}

/// What [`Client::read_path`](crate::Client::read_path) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ReadPathResponse {
    /// The path itself, symlinks followed; a symlink whose target does not exist is its own entry.
    pub entry: ::core::option::Option<FileEntry>,
    /// With `service`: where the path lies. Unspecified otherwise: the request says it.
    pub location: FileLocation,
    /// With `service`: the volume the path lies on, when location is VOLUME. Else empty.
    pub volume: ::std::string::String,
    /// A directory's: directories first, then by name (bytewise).
    pub entries: ::std::vec::Vec<FileEntry>,
    /// A directory's in all.
    pub entry_count: u32,
    /// Set = more entries follow these: pass it as `entry_page_token`.
    pub next_entry_page_token: ::std::string::String,
    /// A text file's contents from `offset_bytes`, ending on a whole character. Untrusted.
    pub text: ::std::string::String,
    /// True = the file is binary (a NUL byte in its first 8 KiB): no text. Download it with [`Client::create_transfer`](crate::Client::create_transfer).
    pub binary: bool,
    /// Where the next read of the file starts. 0 = the read reached its end.
    pub next_offset_bytes: u64,
    /// The project's files: the deploy whose files these are. Pass it as [`Client::deploy_project`](crate::Client::deploy_project)\'s `base_deploy_id` to be refused if they changed since you read them.
    pub deploy_id: ::std::string::String,
}

/// What [`Client::create_transfer`](crate::Client::create_transfer) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct CreateTransferRequest {
    pub transfer: ::core::option::Option<CreateTransferRequestTransfer>,
}

/// The oneof [`CreateTransferRequest::transfer`](crate::types::CreateTransferRequest::transfer): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum CreateTransferRequestTransfer {
    UploadArchive(ArchiveUpload),
    UploadFile(FileUpload),
    Download(PathDownload),
}

/// The project's directory as a zip, tar or tar.gz (told by content), for [`Client::create_project`](crate::Client::create_project)\'s or [`Client::deploy_project`](crate::Client::deploy_project)\'s `upload_id`: {} is enough. A single top folder is unwrapped; .git, \_\_MACOSX, .`DS_Store`, .\_\* are dropped. Leave out what the build makes again (`node_modules`, .venv, target).
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ArchiveUpload {
    /// The archive's name for people, e.g. \"recipes.zip\". Empty = \"archive.tgz\".
    pub file_name: ::std::string::String,
}

#[derive(Debug, Clone, PartialEq, Default)]
pub struct FileUpload {
    pub project_id: ::std::string::String,
    pub root: ::core::option::Option<FileUploadRoot>,
    /// From the root, e.g. \"/data/uploads/a.jpg\".
    pub path: ::std::string::String,
}

/// The oneof [`FileUpload::root`](crate::types::FileUpload::root): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum FileUploadRoot {
    /// In its container.
    Service(::std::string::String),
    /// In the volume, from its root.
    Volume(::std::string::String),
}

/// A directory comes as a .tar of what [`Client::read_path`](crate::Client::read_path) shows; symlinks kept.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct PathDownload {
    pub project_id: ::std::string::String,
    /// Where the path is. Neither = the project's deployed files.
    pub root: ::core::option::Option<PathDownloadRoot>,
    /// From the root. Empty = \"/\": the whole root.
    pub path: ::std::string::String,
}

/// The oneof [`PathDownload::root`](crate::types::PathDownload::root): one of its members.
///
/// Where the path is. Neither = the project's deployed files.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum PathDownloadRoot {
    /// In its container.
    Service(::std::string::String),
    /// In the volume, from its root.
    Volume(::std::string::String),
}

/// What [`Client::create_transfer`](crate::Client::create_transfer) returns.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct CreateTransferResponse {
    /// On the machine's hostname ([`Machine::hostname`](crate::types::Machine::hostname)); it works once.
    pub url: ::std::string::String,
    /// \"PUT\" or \"GET\".
    pub http_method: ::std::string::String,
    /// Start the request before this.
    pub expire_time: ::core::option::Option<crate::Timestamp>,
    /// Does it in a shell. `upload_archive`: packs the current directory and sends it, e.g. \"tar czf - \-\-exclude=.git \-\-exclude=`node_modules` . | curl -sS \-\-fail-with-body -T - \'\<url\>\'\": run it in the project's directory (a ready archive: curl \-\-fail-with-body -T \<file\> \'\<url\>\'). `upload_file`: \"curl -sS \-\-fail-with-body -T \'\<file\>\' \'\<url\>\'\", with your file's path in place of its name. download: \"curl -sS \-\-fail-with-body -o \'photo.jpg\' \'\<url\>\'\".
    pub command: ::std::string::String,
    /// `upload_archive`: for [`CreateProjectRequest::upload_id`](crate::types::CreateProjectRequest::upload_id) or [`DeployProjectRequestVersion::UploadId`](crate::types::DeployProjectRequestVersion::UploadId) once the machine answered the PUT with 200.
    pub upload_id: ::std::string::String,
    /// `upload_file`: a file is at path now; the upload replaces it.
    pub replaces: bool,
    /// download: the name it saves as: a file's own; a directory's ends in \".tar\", and \"/\" is named after the project and its service or volume. Empty for an upload.
    pub file_name: ::std::string::String,
    /// `upload_archive`: the names `command` leaves out of the archive, wherever they lie in the directory. A program that packs the directory itself leaves out the same.
    pub exclude_names: ::std::vec::Vec<::std::string::String>,
}

/// Detail of an [`ErrorCode::Unavailable`](crate::ErrorCode::Unavailable) error: an operation, or a short action, holds the project. The message says the same in words.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectBusy {
    /// Empty = a short action, done while its caller waits: call again in a few seconds. Else wait for it with [`Client::get_operation`](crate::Client::get_operation), even while it is still starting; when it is your own `operation_id`, the first call with it is still starting it: call again.
    pub operation_id: ::std::string::String,
    /// Unspecified when `operation_id` is empty.
    pub kind: OperationKind,
    /// Since when it holds the project.
    pub start_time: ::core::option::Option<crate::Timestamp>,
}

/// Detail of an [`ErrorCode::Aborted`](crate::ErrorCode::Aborted) error: `base_deploy_id` is not the current deploy: the project was deployed since you read it. Read it again ([`Project::deploy_id`](crate::types::Project::deploy_id)) and redo your change on its files.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct ProjectChanged {}

/// Detail of an [`ErrorCode::Unavailable`](crate::ErrorCode::Unavailable) error: the machine does not answer now, as while it restarts. Call again later.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineUnreachable {
    /// Since when Pethost has not reached it, once that is over 3 minutes: then the person was told ([`Machine::alert_channels`](crate::types::Machine::alert_channels)). Absent = not known yet.
    pub since_time: ::core::option::Option<crate::Timestamp>,
}

/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error: the machine's software predates what was asked. It comes with the machine's next update, which Pethost runs; nothing for the caller to do.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct MachineUpdatePending {}

/// Detail of a [`ErrorCode::FailedPrecondition`](crate::ErrorCode::FailedPrecondition) error: the account has no machine to run projects on yet.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct NoMachine {
    pub reason: NoMachineReason,
    /// Where the person goes on in the browser.
    pub url: ::std::string::String,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
#[non_exhaustive]
pub enum NoMachineReason {
    /// The zero value: absent, and not sent.
    #[default]
    Unspecified,
    /// The person has not chosen and paid for a plan: they do it at url.
    NoPlan,
    /// The plan is paid and a machine is being prepared for the account: Pethost emails the person when it is ready. Call again later.
    BeingPrepared,
    /// A value this version of the crate does not know, as the number the API sent.
    Unrecognized(i32),
}

/// What [`Client::watch_operation`](crate::Client::watch_operation) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct WatchOperationRequest {
    pub project_id: ::std::string::String,
    /// Empty = the latest.
    pub operation_id: ::std::string::String,
}

/// What [`Client::watch_operation`](crate::Client::watch_operation) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct WatchOperationResponse {
    pub message: ::core::option::Option<WatchOperationResponseMessage>,
}

/// The oneof [`WatchOperationResponse::message`](crate::types::WatchOperationResponse::message): one of its members.
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
#[allow(clippy::large_enum_variant)]
pub enum WatchOperationResponseMessage {
    Log(OperationLogLine),
    /// Always the last message.
    FinishedOperation(Operation),
    /// A member this version of the crate does not know: the API set none it knows, and sent
    /// fields it does not know. Sent, it counts as no member.
    Unrecognized,
}

/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TailContainerLogsRequest {
    pub project_id: ::std::string::String,
    pub filter: ::core::option::Option<ContainerLogFilter>,
    /// Empty = only lines written from now on.
    pub after_cursor: ::std::string::String,
}

/// What [`Client::tail_container_logs`](crate::Client::tail_container_logs) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TailContainerLogsResponse {
    pub line: ::core::option::Option<LogLine>,
    /// To reconnect after this line.
    pub cursor: ::std::string::String,
}

/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) takes.
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TailHttpTrafficRequest {
    pub project_id: ::std::string::String,
    pub filter: ::core::option::Option<HttpTrafficFilter>,
    /// 0 = only requests from now on.
    pub after_sequence: u64,
}

/// What [`Client::tail_http_traffic`](crate::Client::tail_http_traffic) yields.
#[derive(Debug, Clone, PartialEq, Default)]
#[non_exhaustive]
pub struct TailHttpTrafficResponse {
    pub request: ::core::option::Option<HttpRequest>,
}