OXYGENHUB
# ff6569530173 oxygenhub / crates / hub-api / src / lib.rs
20.2 KiB · Rust · last changed API: the notifications inbox 1 month ago source blame history raw
d23464c0 Andy McCall ↶ 1
//! Types of the Oxygenhub JSON API (hub spec §12.1). Everything here is
2
//! `serde` data with no behaviour, so clients in other languages can be
3
//! generated from it and the server can never drift from them.
4
//!
5
//! Shapes reuse `oxy --json`'s where one exists (hashes as lowercase hex,
6
//! times as milliseconds since the epoch), so tools written against the
7
//! command line work against the hub.
8
b64e2537 Andy McCall ↶ 9
use schemars::JsonSchema;
d23464c0 Andy McCall ↶ 10
use serde::{Deserialize, Serialize};
11
12
/// A repository as the API lists it.
b64e2537 Andy McCall ↶ 13
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 14
pub struct Repository {
15
    pub owner: String,
16
    pub name: String,
17
    pub description: String,
18
    pub default_bookmark: String,
19
    pub visibility: Visibility,
20
    /// Milliseconds since the epoch.
21
    pub created_ms: i64,
22
    pub updated_ms: i64,
23
    /// `https://…/{owner}/{name}`, what `oxy clone` takes.
24
    pub clone_url: String,
25
}
26
b64e2537 Andy McCall ↶ 27
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 28
#[serde(rename_all = "lowercase")]
29
pub enum Visibility {
30
    Public,
31
    Internal,
32
    Private,
33
}
34
35
impl Visibility {
36
    pub fn as_str(self) -> &'static str {
37
        match self {
38
            Visibility::Public => "public",
39
            Visibility::Internal => "internal",
40
            Visibility::Private => "private",
41
        }
42
    }
43
44
    pub fn parse(s: &str) -> Option<Visibility> {
45
        Some(match s {
46
            "public" => Visibility::Public,
47
            "internal" => Visibility::Internal,
48
            "private" => Visibility::Private,
49
            _ => return None,
50
        })
51
    }
52
}
53
54
/// A bookmark: a name for a set of heads (spec §10.1).
b64e2537 Andy McCall ↶ 55
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 56
pub struct Bookmark {
57
    pub name: String,
58
    pub heads: Vec<String>,
59
    /// Number of changes in the bookmark's state.
60
    pub changes: usize,
61
    pub default: bool,
62
}
63
64
/// A tag: a name for one state, with its attestation when signed.
b64e2537 Andy McCall ↶ 65
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 66
pub struct Tag {
67
    pub name: String,
68
    pub heads: Vec<String>,
69
    pub message: String,
70
    pub signer: Option<String>,
71
}
72
73
/// One change in a history listing.
b64e2537 Andy McCall ↶ 74
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 75
pub struct ChangeSummary {
76
    pub hash: String,
77
    pub message: String,
78
    pub author: Author,
79
    pub when_ms: u64,
80
    pub deps: Vec<String>,
81
    pub head: bool,
82
    pub signature: Signature,
83
}
84
85
/// Who wrote a change: the linked account when the signing key is linked,
86
/// else the key alone.
b64e2537 Andy McCall ↶ 87
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 88
pub struct Author {
89
    pub name: String,
90
    pub email: String,
91
    pub key: String,
92
    /// The hub account this key is linked to, when any.
93
    pub account: Option<String>,
94
}
95
96
/// Signature status of a change as `oxy verify` reports it.
b64e2537 Andy McCall ↶ 97
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 98
#[serde(tag = "status", rename_all = "lowercase")]
99
pub enum Signature {
100
    Unsigned,
101
    Valid { key: String, sealed: bool, revoked: bool },
102
    Invalid { reason: String },
103
}
104
105
/// An RFC 7807 problem response.
b64e2537 Andy McCall ↶ 106
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
d23464c0 Andy McCall ↶ 107
pub struct Problem {
108
    pub status: u16,
109
    pub title: String,
110
    pub detail: String,
111
}
112
113
#[cfg(test)]
114
mod tests {
115
    use super::*;
116
117
    #[test]
118
    fn visibility_round_trips() {
119
        for v in [Visibility::Public, Visibility::Internal, Visibility::Private] {
120
            assert_eq!(Visibility::parse(v.as_str()), Some(v));
121
        }
122
        assert_eq!(Visibility::parse("secret"), None);
123
    }
124
}
de505df5 Andy McCall ↶ 125
126
// ---------------------------------------------------------------- proposals
127
128
/// A proposal: a request to add changes to a target bookmark (hub spec §7).
b64e2537 Andy McCall ↶ 129
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
de505df5 Andy McCall ↶ 130
pub struct Proposal {
131
    pub number: i64,
132
    pub title: String,
133
    pub body: String,
134
    pub author: String,
135
    pub state: ProposalState,
136
    pub target: String,
137
    pub source: ProposalSource,
138
    /// The changes the proposal adds, dependency order, newest last.
139
    pub changes: Vec<ChangeSummary>,
140
    /// Heads of the projected state (target plus the changes), when computed.
141
    pub projected_heads: Vec<String>,
142
    pub projected_state: Option<String>,
143
    pub conflicted: bool,
144
    pub approvals: Vec<Approval>,
145
    pub landable: bool,
146
    pub blockers: Vec<String>,
147
    pub created_ms: i64,
148
    pub updated_ms: i64,
149
    /// `https://hub/{owner}/{name}/proposal/{number}`.
150
    pub url: String,
151
    /// Where `oxy` fetches the changes from.
152
    pub repository_url: String,
153
    /// The fork's clone URL when the source is a fork.
154
    pub source_url: Option<String>,
155
}
156
b64e2537 Andy McCall ↶ 157
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
de505df5 Andy McCall ↶ 158
#[serde(rename_all = "lowercase")]
159
pub enum ProposalState {
160
    Draft,
161
    Open,
162
    Landed,
163
    Closed,
164
}
165
166
impl ProposalState {
167
    pub fn as_str(self) -> &'static str {
168
        match self {
169
            ProposalState::Draft => "draft",
170
            ProposalState::Open => "open",
171
            ProposalState::Landed => "landed",
172
            ProposalState::Closed => "closed",
173
        }
174
    }
175
176
    pub fn parse(s: &str) -> Option<ProposalState> {
177
        Some(match s {
178
            "draft" => ProposalState::Draft,
179
            "open" => ProposalState::Open,
180
            "landed" => ProposalState::Landed,
181
            "closed" => ProposalState::Closed,
182
            _ => return None,
183
        })
184
    }
185
}
186
b64e2537 Andy McCall ↶ 187
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
de505df5 Andy McCall ↶ 188
#[serde(tag = "kind", rename_all = "lowercase")]
189
pub enum ProposalSource {
190
    /// A bookmark of the same repository.
191
    Bookmark { bookmark: String },
192
    /// A bookmark of a fork.
193
    Fork { owner: String, name: String, bookmark: String },
194
    /// An explicit list of change hashes.
195
    Changes { hashes: Vec<String> },
196
}
197
198
/// A reviewer's approval, counted only when backed by a seal over every
199
/// change of the proposal signed with a key linked to the reviewer.
b64e2537 Andy McCall ↶ 200
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
de505df5 Andy McCall ↶ 201
pub struct Approval {
202
    pub account: String,
203
    pub sealed: bool,
204
    pub key: Option<String>,
205
}
b64e2537 Andy McCall ↶ 206
207
// ------------------------------------------------------------------ issues
208
209
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
210
pub struct Issue {
211
    pub number: i64,
212
    pub title: String,
213
    pub body: String,
214
    pub author: String,
215
    pub state: String,
216
    pub reason: String,
217
    pub labels: Vec<Label>,
218
    pub assignees: Vec<String>,
219
    pub milestone: Option<String>,
220
    pub comments: i64,
221
    pub locked: bool,
222
    pub pinned: bool,
223
    pub created_ms: i64,
224
    pub updated_ms: i64,
225
    pub closed_ms: Option<i64>,
226
    pub url: String,
227
}
228
229
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
230
pub struct Label {
231
    pub name: String,
232
    pub colour: String,
233
    pub description: String,
234
}
235
236
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
237
pub struct Milestone {
238
    pub title: String,
239
    pub description: String,
240
    pub due_ms: Option<i64>,
241
    pub state: String,
242
    pub open: i64,
243
    pub closed: i64,
244
}
245
246
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
247
pub struct Comment {
248
    pub id: i64,
249
    pub author: String,
250
    pub body: String,
251
    pub created_ms: i64,
252
    /// For proposal comments: the file and the atom the comment anchors to.
253
    pub path: Option<String>,
254
    pub anchor: Option<Atom>,
255
    pub resolved: bool,
256
}
257
42a0ba4b Andy McCall ↶ 258
/// One entry in the caller's inbox (hub spec §10).
259
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
260
pub struct Notification {
261
    pub id: i64,
262
    pub at_ms: i64,
263
    /// `issue.opened`, `proposal.comment`, `mention`, `review`, …
264
    pub kind: String,
265
    pub title: String,
266
    /// The page on the hub, absolute.
267
    pub url: String,
268
    pub actor: String,
269
    pub read: bool,
270
}
271
272
/// `GET /notifications`: the unread count and the newest entries, unread first.
273
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
274
pub struct Inbox {
275
    pub unread: i64,
276
    pub items: Vec<Notification>,
277
}
278
3f02e5ea Andy McCall ↶ 279
/// A file a proposal changes, between the target's state and the
280
/// projected state (hub spec §7.2). Fetch either side's bytes from
281
/// `/proposals/{number}/content/{base|head}/{path}`.
b64e2537 Andy McCall ↶ 282
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
3f02e5ea Andy McCall ↶ 283
pub struct ProposalFile {
284
    pub path: String,
285
    /// For a rename, the path in the target's state.
286
    pub from: Option<String>,
287
    /// `added`, `removed`, `modified`, `renamed`, `mode` or `replaced`.
288
    pub kind: String,
289
    pub added: usize,
290
    pub removed: usize,
291
}
292
293
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
b64e2537 Andy McCall ↶ 294
pub struct Atom {
295
    pub change: String,
296
    pub index: u32,
297
}
298
299
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
300
pub struct Review {
301
    pub id: i64,
302
    pub author: String,
303
    pub verdict: String,
304
    pub body: String,
305
    pub sealed: bool,
306
    pub created_ms: i64,
307
}
308
309
// ------------------------------------------------------------- repository
310
311
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
312
pub struct TreeEntry {
313
    pub name: String,
314
    pub path: String,
315
    pub kind: String,
316
    pub exec: bool,
317
    pub size: Option<u64>,
318
    pub conflicted: bool,
319
}
320
321
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
322
pub struct BlameLine {
323
    pub line: usize,
324
    pub change: String,
325
    pub index: u32,
326
    pub author: String,
327
    pub when_ms: u64,
328
    pub text: String,
329
}
330
331
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
332
pub struct FileChange {
333
    pub path: String,
334
    pub kind: String,
335
    pub from: Option<String>,
336
    pub added: usize,
337
    pub removed: usize,
338
}
339
340
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
341
pub struct ChangeDetail {
342
    pub change: ChangeSummary,
343
    pub body: String,
344
    pub dependents: Vec<String>,
345
    pub in_bookmarks: Vec<String>,
346
    pub in_tags: Vec<String>,
347
    pub files: Vec<FileChange>,
348
}
349
350
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
351
pub struct History {
352
    pub reference: String,
353
    pub heads: Vec<String>,
354
    pub total: usize,
355
    pub offset: usize,
356
    pub changes: Vec<ChangeSummary>,
357
}
358
359
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
360
pub struct Conflict {
361
    pub bookmark: String,
362
    pub path: String,
363
    pub kind: String,
364
    pub contributors: Vec<String>,
365
}
366
367
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
368
pub struct Push {
369
    pub at_ms: i64,
370
    pub pusher: String,
371
    pub reference: String,
372
    pub ok: bool,
373
    pub reason: String,
374
    pub old_state: String,
375
    pub new_state: String,
376
    pub heads: i64,
377
    pub changes: i64,
378
}
379
380
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
381
pub struct Trust {
382
    pub policy: Option<Policy>,
383
    pub signed: usize,
384
    pub sealed: usize,
385
    pub unsigned: usize,
386
    pub invalid: Vec<String>,
387
    pub hub_key: String,
388
}
389
390
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
391
pub struct Policy {
392
    pub serial: u64,
393
    pub expires_ms: u64,
394
    pub roots: Vec<String>,
395
    pub root_threshold: u32,
396
    pub rules: Vec<Rule>,
397
}
398
399
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
400
pub struct Rule {
401
    pub pattern: String,
402
    pub keys: Vec<String>,
403
    pub threshold: u32,
404
    pub require: String,
405
    pub allow_conflicts: bool,
406
}
407
408
// ---------------------------------------------------------- hooks, checks
409
410
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
411
pub struct Hook {
412
    pub id: i64,
413
    pub url: String,
414
    pub events: String,
415
    pub active: bool,
416
    pub created_ms: i64,
417
}
418
419
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
420
pub struct NewHook {
421
    pub url: String,
422
    pub secret: String,
423
    #[serde(default = "star")]
424
    pub events: String,
425
}
426
427
fn star() -> String {
428
    "*".into()
429
}
430
431
/// A check on a state hash (hub spec §13.1).
432
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
433
pub struct Check {
434
    pub state: String,
435
    pub name: String,
436
    pub status: CheckStatus,
437
    pub summary: String,
438
    pub url: String,
439
    pub reporter: String,
440
    /// The seal attestation's reference when the checker sealed the changes.
441
    pub seal: Option<String>,
442
    pub started_ms: i64,
443
    pub finished_ms: Option<i64>,
444
}
445
446
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
447
#[serde(rename_all = "lowercase")]
448
pub enum CheckStatus {
449
    Queued,
450
    Running,
451
    Passed,
452
    Failed,
453
    Cancelled,
454
    Skipped,
455
}
456
457
impl CheckStatus {
458
    pub fn as_str(self) -> &'static str {
459
        match self {
460
            CheckStatus::Queued => "queued",
461
            CheckStatus::Running => "running",
462
            CheckStatus::Passed => "passed",
463
            CheckStatus::Failed => "failed",
464
            CheckStatus::Cancelled => "cancelled",
465
            CheckStatus::Skipped => "skipped",
466
        }
467
    }
468
469
    pub fn parse(s: &str) -> Option<CheckStatus> {
470
        Some(match s {
471
            "queued" => CheckStatus::Queued,
472
            "running" => CheckStatus::Running,
473
            "passed" => CheckStatus::Passed,
474
            "failed" => CheckStatus::Failed,
475
            "cancelled" => CheckStatus::Cancelled,
476
            "skipped" => CheckStatus::Skipped,
477
            _ => return None,
478
        })
479
    }
480
}
481
482
/// What a checker posts.
483
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
484
pub struct NewCheck {
485
    pub state: String,
486
    pub name: String,
487
    pub status: CheckStatus,
488
    #[serde(default)]
489
    pub summary: String,
490
    #[serde(default)]
491
    pub url: String,
492
    /// Hex of a seal attestation reference the checker pushed, if any.
493
    #[serde(default)]
494
    pub seal: Option<String>,
495
}
496
497
// ------------------------------------------------------------- accounts
498
499
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
500
pub struct User {
501
    pub username: String,
502
    pub display_name: String,
503
    pub is_admin: bool,
504
    pub keys: Vec<String>,
505
    pub created_ms: i64,
506
}
507
508
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
509
pub struct Organisation {
510
    pub name: String,
511
    pub display_name: String,
512
    pub description: String,
513
    pub members: Vec<String>,
514
}
515
516
/// Forms accepted by the write endpoints.
517
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
518
pub struct NewRepository {
519
    pub owner: String,
520
    pub name: String,
521
    #[serde(default)]
522
    pub description: String,
523
    #[serde(default = "public")]
524
    pub visibility: Visibility,
525
}
526
527
fn public() -> Visibility {
528
    Visibility::Public
529
}
530
531
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
532
pub struct NewIssue {
533
    pub title: String,
534
    #[serde(default)]
535
    pub body: String,
536
}
537
538
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
539
pub struct NewComment {
540
    pub body: String,
3f4b0ea6 Andy McCall ↶ 541
    /// For a proposal: anchor the comment to this file's line (1-based) of
542
    /// the projected state; the hub records the line's atom.
543
    #[serde(default)]
544
    pub path: Option<String>,
545
    #[serde(default)]
546
    pub line: Option<usize>,
b64e2537 Andy McCall ↶ 547
}
548
549
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
550
pub struct NewProposal {
551
    pub title: String,
552
    #[serde(default)]
553
    pub body: String,
554
    pub target: String,
555
    /// A bookmark here, or `owner/name:bookmark` of a fork.
556
    pub source: String,
557
    #[serde(default)]
558
    pub draft: bool,
559
}
560
561
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
562
pub struct NewReview {
563
    pub verdict: String,
564
    #[serde(default)]
565
    pub body: String,
566
}
567
568
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
569
pub struct IssueStateChange {
570
    /// `open` or `closed`.
571
    pub state: String,
572
    #[serde(default)]
573
    pub reason: String,
574
}
575
576
/// A webhook payload's envelope (hub spec §12.2).
577
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
578
pub struct WebhookEnvelope {
579
    pub event: String,
580
    pub delivery: String,
581
    pub repository: Option<Repository>,
582
    pub actor: String,
583
    pub at_ms: i64,
584
    pub data: serde_json::Value,
585
}
586
587
/// A server-sent event on a proposal's stream.
588
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
589
pub struct ProposalEvent {
590
    pub number: i64,
591
    pub kind: String,
592
    pub check: Option<Check>,
593
}
594
3f4b0ea6 Andy McCall ↶ 595
// --------------------------------------------------------------- releases
596
597
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
598
pub struct Release {
599
    pub tag: String,
600
    pub title: String,
601
    pub notes: String,
602
    pub prerelease: bool,
603
    pub latest: bool,
604
    pub author: String,
605
    pub heads: Vec<String>,
606
    pub signer: Option<String>,
607
    pub assets: Vec<ReleaseAsset>,
608
    pub archives: Vec<String>,
609
    pub created_ms: i64,
610
    pub url: String,
611
}
612
613
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
614
pub struct ReleaseAsset {
615
    pub name: String,
616
    pub size: i64,
617
    /// BLAKE3 of the content, hex.
618
    pub hash: String,
619
    pub content_type: String,
620
    pub downloads: i64,
621
    pub url: String,
622
}
623
624
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
625
pub struct NewRelease {
626
    pub tag: String,
627
    pub title: String,
628
    #[serde(default)]
629
    pub notes: Option<String>,
630
    #[serde(default)]
631
    pub prerelease: bool,
632
}
633
b64e2537 Andy McCall ↶ 634
/// Every type of the API, for schema generation.
635
pub fn schemas() -> Vec<(&'static str, schemars::Schema)> {
636
    vec![
637
        ("Repository", schemars::schema_for!(Repository)),
638
        ("Visibility", schemars::schema_for!(Visibility)),
639
        ("Bookmark", schemars::schema_for!(Bookmark)),
640
        ("Tag", schemars::schema_for!(Tag)),
641
        ("ChangeSummary", schemars::schema_for!(ChangeSummary)),
642
        ("Author", schemars::schema_for!(Author)),
643
        ("Signature", schemars::schema_for!(Signature)),
644
        ("Problem", schemars::schema_for!(Problem)),
645
        ("Proposal", schemars::schema_for!(Proposal)),
646
        ("ProposalState", schemars::schema_for!(ProposalState)),
647
        ("ProposalSource", schemars::schema_for!(ProposalSource)),
648
        ("Approval", schemars::schema_for!(Approval)),
649
        ("Issue", schemars::schema_for!(Issue)),
650
        ("Label", schemars::schema_for!(Label)),
651
        ("Milestone", schemars::schema_for!(Milestone)),
652
        ("Comment", schemars::schema_for!(Comment)),
3f02e5ea Andy McCall ↶ 653
        ("ProposalFile", schemars::schema_for!(ProposalFile)),
42a0ba4b Andy McCall ↶ 654
        ("Notification", schemars::schema_for!(Notification)),
655
        ("Inbox", schemars::schema_for!(Inbox)),
b64e2537 Andy McCall ↶ 656
        ("Atom", schemars::schema_for!(Atom)),
657
        ("Review", schemars::schema_for!(Review)),
658
        ("TreeEntry", schemars::schema_for!(TreeEntry)),
659
        ("BlameLine", schemars::schema_for!(BlameLine)),
660
        ("FileChange", schemars::schema_for!(FileChange)),
661
        ("ChangeDetail", schemars::schema_for!(ChangeDetail)),
662
        ("History", schemars::schema_for!(History)),
663
        ("Conflict", schemars::schema_for!(Conflict)),
664
        ("Push", schemars::schema_for!(Push)),
665
        ("Trust", schemars::schema_for!(Trust)),
666
        ("Policy", schemars::schema_for!(Policy)),
667
        ("Rule", schemars::schema_for!(Rule)),
668
        ("Hook", schemars::schema_for!(Hook)),
669
        ("NewHook", schemars::schema_for!(NewHook)),
670
        ("Check", schemars::schema_for!(Check)),
671
        ("CheckStatus", schemars::schema_for!(CheckStatus)),
672
        ("NewCheck", schemars::schema_for!(NewCheck)),
673
        ("User", schemars::schema_for!(User)),
674
        ("Organisation", schemars::schema_for!(Organisation)),
675
        ("NewRepository", schemars::schema_for!(NewRepository)),
676
        ("NewIssue", schemars::schema_for!(NewIssue)),
677
        ("NewComment", schemars::schema_for!(NewComment)),
678
        ("NewProposal", schemars::schema_for!(NewProposal)),
679
        ("NewReview", schemars::schema_for!(NewReview)),
680
        ("IssueStateChange", schemars::schema_for!(IssueStateChange)),
681
        ("WebhookEnvelope", schemars::schema_for!(WebhookEnvelope)),
682
        ("ProposalEvent", schemars::schema_for!(ProposalEvent)),
3f4b0ea6 Andy McCall ↶ 683
        ("Release", schemars::schema_for!(Release)),
684
        ("ReleaseAsset", schemars::schema_for!(ReleaseAsset)),
685
        ("NewRelease", schemars::schema_for!(NewRelease)),
b64e2537 Andy McCall ↶ 686
    ]
687
}