| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
use schemars::JsonSchema; |
| 10 |
use serde::{Deserialize, Serialize}; |
| 11 |
|
| 12 |
|
| 13 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 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 |
|
| 21 |
pub created_ms: i64, |
| 22 |
pub updated_ms: i64, |
| 23 |
|
| 24 |
pub clone_url: String, |
| 25 |
} |
| 26 |
|
| 27 |
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 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 |
|
| 55 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 56 |
pub struct Bookmark { |
| 57 |
pub name: String, |
| 58 |
pub heads: Vec<String>, |
| 59 |
|
| 60 |
pub changes: usize, |
| 61 |
pub default: bool, |
| 62 |
} |
| 63 |
|
| 64 |
|
| 65 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 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 |
|
| 74 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 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 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 85 |
pub via: Option<Via>, |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 90 |
pub struct Via { |
| 91 |
pub name: String, |
| 92 |
pub key: String, |
| 93 |
|
| 94 |
pub scope: String, |
| 95 |
pub expires_ms: Option<u64>, |
| 96 |
|
| 97 |
pub revoked: bool, |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 103 |
pub struct Author { |
| 104 |
pub name: String, |
| 105 |
pub email: String, |
| 106 |
pub key: String, |
| 107 |
|
| 108 |
pub account: Option<String>, |
| 109 |
|
| 110 |
|
| 111 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 112 |
pub note: Option<String>, |
| 113 |
} |
| 114 |
|
| 115 |
impl Author { |
| 116 |
|
| 117 |
pub const UNLINKED: &'static str = |
| 118 |
"signed by a key not linked to any account; its owner links it under Settings → Keys (/settings/keys)"; |
| 119 |
|
| 120 |
|
| 121 |
pub fn note_for(key: &str, account: &Option<String>) -> Option<String> { |
| 122 |
(!key.is_empty() && account.is_none()).then(|| Self::UNLINKED.to_string()) |
| 123 |
} |
| 124 |
} |
| 125 |
|
| 126 |
|
| 127 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 128 |
#[serde(tag = "status", rename_all = "lowercase")] |
| 129 |
pub enum Signature { |
| 130 |
Unsigned, |
| 131 |
Valid { key: String, sealed: bool, revoked: bool }, |
| 132 |
Invalid { reason: String }, |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 137 |
pub struct Problem { |
| 138 |
pub status: u16, |
| 139 |
pub title: String, |
| 140 |
pub detail: String, |
| 141 |
} |
| 142 |
|
| 143 |
#[cfg(test)] |
| 144 |
mod tests { |
| 145 |
use super::*; |
| 146 |
|
| 147 |
#[test] |
| 148 |
fn visibility_round_trips() { |
| 149 |
for v in [Visibility::Public, Visibility::Internal, Visibility::Private] { |
| 150 |
assert_eq!(Visibility::parse(v.as_str()), Some(v)); |
| 151 |
} |
| 152 |
assert_eq!(Visibility::parse("secret"), None); |
| 153 |
} |
| 154 |
} |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 160 |
pub struct Proposal { |
| 161 |
pub number: i64, |
| 162 |
pub title: String, |
| 163 |
pub body: String, |
| 164 |
pub author: String, |
| 165 |
pub state: ProposalState, |
| 166 |
pub target: String, |
| 167 |
pub source: ProposalSource, |
| 168 |
|
| 169 |
pub changes: Vec<ChangeSummary>, |
| 170 |
|
| 171 |
pub projected_heads: Vec<String>, |
| 172 |
pub projected_state: Option<String>, |
| 173 |
pub conflicted: bool, |
| 174 |
pub approvals: Vec<Approval>, |
| 175 |
pub landable: bool, |
| 176 |
pub blockers: Vec<String>, |
| 177 |
pub created_ms: i64, |
| 178 |
pub updated_ms: i64, |
| 179 |
|
| 180 |
pub url: String, |
| 181 |
|
| 182 |
pub repository_url: String, |
| 183 |
|
| 184 |
pub source_url: Option<String>, |
| 185 |
|
| 186 |
#[serde(default)] |
| 187 |
pub landed: Option<Landed>, |
| 188 |
|
| 189 |
#[serde(default)] |
| 190 |
pub auto_land: Option<String>, |
| 191 |
|
| 192 |
#[serde(default)] |
| 193 |
pub requested_reviewers: Vec<String>, |
| 194 |
#[serde(default)] |
| 195 |
pub labels: Vec<Label>, |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 200 |
pub struct Landed { |
| 201 |
pub by: String, |
| 202 |
|
| 203 |
pub via: String, |
| 204 |
pub when_ms: i64, |
| 205 |
} |
| 206 |
|
| 207 |
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 208 |
#[serde(rename_all = "lowercase")] |
| 209 |
pub enum ProposalState { |
| 210 |
Draft, |
| 211 |
Open, |
| 212 |
Landed, |
| 213 |
Closed, |
| 214 |
} |
| 215 |
|
| 216 |
impl ProposalState { |
| 217 |
pub fn as_str(self) -> &'static str { |
| 218 |
match self { |
| 219 |
ProposalState::Draft => "draft", |
| 220 |
ProposalState::Open => "open", |
| 221 |
ProposalState::Landed => "landed", |
| 222 |
ProposalState::Closed => "closed", |
| 223 |
} |
| 224 |
} |
| 225 |
|
| 226 |
pub fn parse(s: &str) -> Option<ProposalState> { |
| 227 |
Some(match s { |
| 228 |
"draft" => ProposalState::Draft, |
| 229 |
"open" => ProposalState::Open, |
| 230 |
"landed" => ProposalState::Landed, |
| 231 |
"closed" => ProposalState::Closed, |
| 232 |
_ => return None, |
| 233 |
}) |
| 234 |
} |
| 235 |
} |
| 236 |
|
| 237 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 238 |
#[serde(tag = "kind", rename_all = "lowercase")] |
| 239 |
pub enum ProposalSource { |
| 240 |
|
| 241 |
Bookmark { bookmark: String }, |
| 242 |
|
| 243 |
Fork { owner: String, name: String, bookmark: String }, |
| 244 |
|
| 245 |
Changes { hashes: Vec<String> }, |
| 246 |
} |
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 251 |
pub struct Approval { |
| 252 |
pub account: String, |
| 253 |
pub sealed: bool, |
| 254 |
pub key: Option<String>, |
| 255 |
} |
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 260 |
pub struct Issue { |
| 261 |
pub number: i64, |
| 262 |
pub title: String, |
| 263 |
pub body: String, |
| 264 |
pub author: String, |
| 265 |
pub state: String, |
| 266 |
pub reason: String, |
| 267 |
pub labels: Vec<Label>, |
| 268 |
pub assignees: Vec<String>, |
| 269 |
pub milestone: Option<String>, |
| 270 |
pub comments: i64, |
| 271 |
pub locked: bool, |
| 272 |
pub pinned: bool, |
| 273 |
pub created_ms: i64, |
| 274 |
pub updated_ms: i64, |
| 275 |
pub closed_ms: Option<i64>, |
| 276 |
pub url: String, |
| 277 |
} |
| 278 |
|
| 279 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 280 |
pub struct Label { |
| 281 |
pub name: String, |
| 282 |
pub colour: String, |
| 283 |
pub description: String, |
| 284 |
} |
| 285 |
|
| 286 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 287 |
pub struct Milestone { |
| 288 |
pub title: String, |
| 289 |
pub description: String, |
| 290 |
pub due_ms: Option<i64>, |
| 291 |
pub state: String, |
| 292 |
pub open: i64, |
| 293 |
pub closed: i64, |
| 294 |
} |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 299 |
pub struct NewMilestone { |
| 300 |
pub title: String, |
| 301 |
#[serde(default)] |
| 302 |
pub description: String, |
| 303 |
|
| 304 |
#[serde(default)] |
| 305 |
pub due: Option<String>, |
| 306 |
} |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 311 |
#[serde(deny_unknown_fields)] |
| 312 |
pub struct MilestoneEdit { |
| 313 |
#[serde(default)] |
| 314 |
pub title: Option<String>, |
| 315 |
#[serde(default)] |
| 316 |
pub description: Option<String>, |
| 317 |
|
| 318 |
#[serde(default)] |
| 319 |
pub due: Option<String>, |
| 320 |
|
| 321 |
#[serde(default)] |
| 322 |
pub state: Option<String>, |
| 323 |
} |
| 324 |
|
| 325 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 326 |
pub struct Comment { |
| 327 |
pub id: i64, |
| 328 |
pub author: String, |
| 329 |
pub body: String, |
| 330 |
pub created_ms: i64, |
| 331 |
|
| 332 |
pub path: Option<String>, |
| 333 |
pub anchor: Option<Atom>, |
| 334 |
|
| 335 |
|
| 336 |
#[serde(default)] |
| 337 |
pub line: Option<usize>, |
| 338 |
pub resolved: bool, |
| 339 |
} |
| 340 |
|
| 341 |
|
| 342 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 343 |
pub struct Notification { |
| 344 |
pub id: i64, |
| 345 |
pub at_ms: i64, |
| 346 |
|
| 347 |
pub kind: String, |
| 348 |
pub title: String, |
| 349 |
|
| 350 |
pub url: String, |
| 351 |
pub actor: String, |
| 352 |
pub read: bool, |
| 353 |
|
| 354 |
#[serde(default)] |
| 355 |
pub repository: Option<String>, |
| 356 |
|
| 357 |
#[serde(default)] |
| 358 |
pub reason: String, |
| 359 |
|
| 360 |
|
| 361 |
#[serde(default)] |
| 362 |
pub thread: String, |
| 363 |
|
| 364 |
#[serde(default)] |
| 365 |
pub label: Option<String>, |
| 366 |
} |
| 367 |
|
| 368 |
|
| 369 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 370 |
pub struct Inbox { |
| 371 |
pub unread: i64, |
| 372 |
pub items: Vec<Notification>, |
| 373 |
} |
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
|
| 378 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 379 |
pub struct ProposalFile { |
| 380 |
pub path: String, |
| 381 |
|
| 382 |
pub from: Option<String>, |
| 383 |
|
| 384 |
pub kind: String, |
| 385 |
pub added: usize, |
| 386 |
pub removed: usize, |
| 387 |
} |
| 388 |
|
| 389 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 390 |
pub struct Atom { |
| 391 |
pub change: String, |
| 392 |
pub index: u32, |
| 393 |
} |
| 394 |
|
| 395 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 396 |
pub struct Review { |
| 397 |
pub id: i64, |
| 398 |
pub author: String, |
| 399 |
pub verdict: String, |
| 400 |
pub body: String, |
| 401 |
pub sealed: bool, |
| 402 |
pub created_ms: i64, |
| 403 |
|
| 404 |
|
| 405 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 406 |
pub via: String, |
| 407 |
} |
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 412 |
pub struct TreeEntry { |
| 413 |
pub name: String, |
| 414 |
pub path: String, |
| 415 |
pub kind: String, |
| 416 |
pub exec: bool, |
| 417 |
pub size: Option<u64>, |
| 418 |
pub conflicted: bool, |
| 419 |
} |
| 420 |
|
| 421 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 422 |
pub struct BlameLine { |
| 423 |
pub line: usize, |
| 424 |
pub change: String, |
| 425 |
pub index: u32, |
| 426 |
pub author: String, |
| 427 |
pub when_ms: u64, |
| 428 |
pub text: String, |
| 429 |
} |
| 430 |
|
| 431 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 432 |
pub struct FileChange { |
| 433 |
pub path: String, |
| 434 |
pub kind: String, |
| 435 |
pub from: Option<String>, |
| 436 |
pub added: usize, |
| 437 |
pub removed: usize, |
| 438 |
|
| 439 |
#[serde(default)] |
| 440 |
pub lines: Vec<DiffLine>, |
| 441 |
|
| 442 |
#[serde(default)] |
| 443 |
pub truncated: bool, |
| 444 |
} |
| 445 |
|
| 446 |
|
| 447 |
pub const DIFF_LINES: usize = 2000; |
| 448 |
|
| 449 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 450 |
pub struct DiffLine { |
| 451 |
|
| 452 |
pub kind: String, |
| 453 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 454 |
pub old: Option<u32>, |
| 455 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 456 |
pub new: Option<u32>, |
| 457 |
#[serde(default)] |
| 458 |
pub text: String, |
| 459 |
} |
| 460 |
|
| 461 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 462 |
pub struct ChangeDetail { |
| 463 |
pub change: ChangeSummary, |
| 464 |
pub body: String, |
| 465 |
pub dependents: Vec<String>, |
| 466 |
pub in_bookmarks: Vec<String>, |
| 467 |
pub in_tags: Vec<String>, |
| 468 |
pub files: Vec<FileChange>, |
| 469 |
} |
| 470 |
|
| 471 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 472 |
pub struct History { |
| 473 |
pub reference: String, |
| 474 |
pub heads: Vec<String>, |
| 475 |
pub total: usize, |
| 476 |
pub offset: usize, |
| 477 |
pub changes: Vec<ChangeSummary>, |
| 478 |
} |
| 479 |
|
| 480 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 481 |
pub struct Conflict { |
| 482 |
pub bookmark: String, |
| 483 |
pub path: String, |
| 484 |
pub kind: String, |
| 485 |
pub contributors: Vec<String>, |
| 486 |
} |
| 487 |
|
| 488 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 489 |
pub struct Push { |
| 490 |
pub at_ms: i64, |
| 491 |
pub pusher: String, |
| 492 |
pub reference: String, |
| 493 |
pub ok: bool, |
| 494 |
pub reason: String, |
| 495 |
pub old_state: String, |
| 496 |
pub new_state: String, |
| 497 |
pub heads: i64, |
| 498 |
pub changes: i64, |
| 499 |
} |
| 500 |
|
| 501 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 502 |
pub struct Trust { |
| 503 |
pub policy: Option<Policy>, |
| 504 |
pub signed: usize, |
| 505 |
pub sealed: usize, |
| 506 |
pub unsigned: usize, |
| 507 |
pub invalid: Vec<String>, |
| 508 |
pub hub_key: String, |
| 509 |
} |
| 510 |
|
| 511 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 512 |
pub struct Policy { |
| 513 |
pub serial: u64, |
| 514 |
pub expires_ms: u64, |
| 515 |
pub roots: Vec<String>, |
| 516 |
pub root_threshold: u32, |
| 517 |
pub rules: Vec<Rule>, |
| 518 |
} |
| 519 |
|
| 520 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 521 |
pub struct Rule { |
| 522 |
pub pattern: String, |
| 523 |
pub keys: Vec<String>, |
| 524 |
pub threshold: u32, |
| 525 |
pub require: String, |
| 526 |
pub allow_conflicts: bool, |
| 527 |
} |
| 528 |
|
| 529 |
|
| 530 |
|
| 531 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 532 |
pub struct Hook { |
| 533 |
pub id: i64, |
| 534 |
pub url: String, |
| 535 |
pub events: String, |
| 536 |
pub active: bool, |
| 537 |
pub created_ms: i64, |
| 538 |
} |
| 539 |
|
| 540 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 541 |
pub struct NewHook { |
| 542 |
pub url: String, |
| 543 |
pub secret: String, |
| 544 |
#[serde(default = "star")] |
| 545 |
pub events: String, |
| 546 |
} |
| 547 |
|
| 548 |
fn star() -> String { |
| 549 |
"*".into() |
| 550 |
} |
| 551 |
|
| 552 |
|
| 553 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 554 |
pub struct FlowRun { |
| 555 |
|
| 556 |
pub number: i64, |
| 557 |
pub bookmark: String, |
| 558 |
|
| 559 |
pub state: String, |
| 560 |
|
| 561 |
pub heads: Vec<String>, |
| 562 |
|
| 563 |
pub status: String, |
| 564 |
|
| 565 |
pub trigger: String, |
| 566 |
pub actor: String, |
| 567 |
pub pipeline_hash: String, |
| 568 |
|
| 569 |
pub error: String, |
| 570 |
pub created_ms: i64, |
| 571 |
pub finished_ms: Option<i64>, |
| 572 |
pub url: String, |
| 573 |
|
| 574 |
|
| 575 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 576 |
pub queue_position: Option<i64>, |
| 577 |
|
| 578 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 579 |
pub jobs: Vec<FlowJob>, |
| 580 |
} |
| 581 |
|
| 582 |
|
| 583 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 584 |
pub struct FlowJob { |
| 585 |
pub name: String, |
| 586 |
|
| 587 |
pub status: String, |
| 588 |
pub depends_on: Vec<String>, |
| 589 |
pub runner: String, |
| 590 |
pub exit_code: Option<i64>, |
| 591 |
pub error: String, |
| 592 |
pub started_ms: Option<i64>, |
| 593 |
pub finished_ms: Option<i64>, |
| 594 |
|
| 595 |
pub log_lines: i64, |
| 596 |
|
| 597 |
|
| 598 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 599 |
pub waiting: String, |
| 600 |
|
| 601 |
|
| 602 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 603 |
pub placed: String, |
| 604 |
|
| 605 |
|
| 606 |
|
| 607 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 608 |
pub approval: String, |
| 609 |
|
| 610 |
|
| 611 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 612 |
pub queued_ms: Option<i64>, |
| 613 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 614 |
pub ready_ms: Option<i64>, |
| 615 |
|
| 616 |
|
| 617 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 618 |
pub phases: Vec<FlowPhase>, |
| 619 |
|
| 620 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 621 |
pub peak_disk_mib: Option<i64>, |
| 622 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 623 |
pub peak_memory_mib: Option<i64>, |
| 624 |
} |
| 625 |
|
| 626 |
|
| 627 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 628 |
pub struct FlowPhase { |
| 629 |
pub name: String, |
| 630 |
pub ms: u64, |
| 631 |
} |
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] |
| 636 |
pub struct Report { |
| 637 |
|
| 638 |
pub id: i64, |
| 639 |
|
| 640 |
pub name: String, |
| 641 |
|
| 642 |
pub kind: String, |
| 643 |
pub title: String, |
| 644 |
pub summary: String, |
| 645 |
pub metrics: Vec<ReportMetric>, |
| 646 |
|
| 647 |
pub context: serde_json::Value, |
| 648 |
|
| 649 |
pub run: Option<i64>, |
| 650 |
pub job: String, |
| 651 |
pub bookmark: String, |
| 652 |
|
| 653 |
pub state: String, |
| 654 |
|
| 655 |
pub files: i64, |
| 656 |
pub bytes: i64, |
| 657 |
pub created_ms: i64, |
| 658 |
|
| 659 |
|
| 660 |
pub files_expired_ms: Option<i64>, |
| 661 |
|
| 662 |
pub url: String, |
| 663 |
|
| 664 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 665 |
pub manifest: Vec<ReportFile>, |
| 666 |
} |
| 667 |
|
| 668 |
|
| 669 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] |
| 670 |
pub struct ReportMetric { |
| 671 |
pub key: String, |
| 672 |
pub value: f64, |
| 673 |
pub unit: String, |
| 674 |
|
| 675 |
pub better: String, |
| 676 |
pub fail_above: Option<f64>, |
| 677 |
pub fail_below: Option<f64>, |
| 678 |
} |
| 679 |
|
| 680 |
|
| 681 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 682 |
pub struct ReportFile { |
| 683 |
pub path: String, |
| 684 |
pub size: i64, |
| 685 |
} |
| 686 |
|
| 687 |
|
| 688 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 689 |
pub struct FlowLogLine { |
| 690 |
|
| 691 |
pub seq: i64, |
| 692 |
|
| 693 |
pub t: i64, |
| 694 |
|
| 695 |
pub stream: String, |
| 696 |
pub text: String, |
| 697 |
} |
| 698 |
|
| 699 |
|
| 700 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 701 |
pub struct Check { |
| 702 |
pub state: String, |
| 703 |
pub name: String, |
| 704 |
pub status: CheckStatus, |
| 705 |
pub summary: String, |
| 706 |
pub url: String, |
| 707 |
pub reporter: String, |
| 708 |
|
| 709 |
pub seal: Option<String>, |
| 710 |
pub started_ms: i64, |
| 711 |
pub finished_ms: Option<i64>, |
| 712 |
} |
| 713 |
|
| 714 |
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 715 |
#[serde(rename_all = "lowercase")] |
| 716 |
pub enum CheckStatus { |
| 717 |
Queued, |
| 718 |
Running, |
| 719 |
Passed, |
| 720 |
Failed, |
| 721 |
Cancelled, |
| 722 |
Skipped, |
| 723 |
} |
| 724 |
|
| 725 |
impl CheckStatus { |
| 726 |
pub fn as_str(self) -> &'static str { |
| 727 |
match self { |
| 728 |
CheckStatus::Queued => "queued", |
| 729 |
CheckStatus::Running => "running", |
| 730 |
CheckStatus::Passed => "passed", |
| 731 |
CheckStatus::Failed => "failed", |
| 732 |
CheckStatus::Cancelled => "cancelled", |
| 733 |
CheckStatus::Skipped => "skipped", |
| 734 |
} |
| 735 |
} |
| 736 |
|
| 737 |
pub fn parse(s: &str) -> Option<CheckStatus> { |
| 738 |
Some(match s { |
| 739 |
"queued" => CheckStatus::Queued, |
| 740 |
"running" => CheckStatus::Running, |
| 741 |
"passed" => CheckStatus::Passed, |
| 742 |
"failed" => CheckStatus::Failed, |
| 743 |
"cancelled" => CheckStatus::Cancelled, |
| 744 |
"skipped" => CheckStatus::Skipped, |
| 745 |
_ => return None, |
| 746 |
}) |
| 747 |
} |
| 748 |
} |
| 749 |
|
| 750 |
|
| 751 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 752 |
pub struct NewCheck { |
| 753 |
pub state: String, |
| 754 |
pub name: String, |
| 755 |
pub status: CheckStatus, |
| 756 |
#[serde(default)] |
| 757 |
pub summary: String, |
| 758 |
#[serde(default)] |
| 759 |
pub url: String, |
| 760 |
|
| 761 |
#[serde(default)] |
| 762 |
pub seal: Option<String>, |
| 763 |
} |
| 764 |
|
| 765 |
|
| 766 |
|
| 767 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 768 |
pub struct User { |
| 769 |
pub username: String, |
| 770 |
pub display_name: String, |
| 771 |
pub is_admin: bool, |
| 772 |
pub keys: Vec<String>, |
| 773 |
pub created_ms: i64, |
| 774 |
} |
| 775 |
|
| 776 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 777 |
pub struct Organisation { |
| 778 |
pub name: String, |
| 779 |
pub display_name: String, |
| 780 |
pub description: String, |
| 781 |
pub members: Vec<String>, |
| 782 |
} |
| 783 |
|
| 784 |
|
| 785 |
|
| 786 |
|
| 787 |
|
| 788 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 789 |
pub struct RunnerToken { |
| 790 |
pub token: String, |
| 791 |
|
| 792 |
pub owner: String, |
| 793 |
} |
| 794 |
|
| 795 |
|
| 796 |
|
| 797 |
|
| 798 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 799 |
pub struct UserProposals { |
| 800 |
pub review: Vec<ProposalBrief>, |
| 801 |
pub authored: Vec<ProposalBrief>, |
| 802 |
|
| 803 |
|
| 804 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 805 |
pub landable: Vec<ProposalBrief>, |
| 806 |
} |
| 807 |
|
| 808 |
|
| 809 |
|
| 810 |
|
| 811 |
|
| 812 |
|
| 813 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 814 |
pub struct UserSky { |
| 815 |
|
| 816 |
pub now: i64, |
| 817 |
|
| 818 |
pub repos: Vec<String>, |
| 819 |
|
| 820 |
|
| 821 |
|
| 822 |
pub events: Vec<[i64; 4]>, |
| 823 |
} |
| 824 |
|
| 825 |
|
| 826 |
|
| 827 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 828 |
pub struct UserFlowRun { |
| 829 |
|
| 830 |
pub repository: String, |
| 831 |
#[serde(flatten)] |
| 832 |
pub run: FlowRun, |
| 833 |
} |
| 834 |
|
| 835 |
|
| 836 |
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] |
| 837 |
pub struct UserFlowRunsQuery { |
| 838 |
#[serde(default)] |
| 839 |
pub limit: Option<i64>, |
| 840 |
#[serde(default)] |
| 841 |
pub before: Option<i64>, |
| 842 |
} |
| 843 |
|
| 844 |
|
| 845 |
|
| 846 |
|
| 847 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 848 |
pub struct StarterAssistants { |
| 849 |
pub assistants: Vec<StarterAssistant>, |
| 850 |
} |
| 851 |
|
| 852 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 853 |
pub struct StarterAssistant { |
| 854 |
pub name: String, |
| 855 |
pub model: String, |
| 856 |
|
| 857 |
pub from: String, |
| 858 |
} |
| 859 |
|
| 860 |
|
| 861 |
|
| 862 |
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] |
| 863 |
pub struct StarterRequest { |
| 864 |
pub description: String, |
| 865 |
#[serde(default)] |
| 866 |
pub assistant: Option<String>, |
| 867 |
} |
| 868 |
|
| 869 |
|
| 870 |
|
| 871 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 872 |
pub struct StarterStatus { |
| 873 |
pub status: String, |
| 874 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 875 |
pub assistant: String, |
| 876 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 877 |
pub change: String, |
| 878 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 879 |
pub files: Vec<String>, |
| 880 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 881 |
pub error: String, |
| 882 |
} |
| 883 |
|
| 884 |
|
| 885 |
|
| 886 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 887 |
pub struct IssueBrief { |
| 888 |
|
| 889 |
pub repository: String, |
| 890 |
pub number: i64, |
| 891 |
pub title: String, |
| 892 |
pub updated_ms: i64, |
| 893 |
|
| 894 |
pub url: String, |
| 895 |
} |
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 902 |
pub struct NewAuthenticator { |
| 903 |
pub public_key: String, |
| 904 |
pub code: String, |
| 905 |
} |
| 906 |
|
| 907 |
|
| 908 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 909 |
pub struct Authenticator { |
| 910 |
|
| 911 |
pub id: i64, |
| 912 |
pub name: String, |
| 913 |
pub created_ms: i64, |
| 914 |
|
| 915 |
pub last_used_ms: i64, |
| 916 |
|
| 917 |
#[serde(default)] |
| 918 |
pub this: bool, |
| 919 |
} |
| 920 |
|
| 921 |
|
| 922 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 923 |
pub struct PendingApproval { |
| 924 |
pub id: String, |
| 925 |
|
| 926 |
pub kind: String, |
| 927 |
|
| 928 |
pub what: String, |
| 929 |
|
| 930 |
pub choices: Vec<i64>, |
| 931 |
pub created_ms: i64, |
| 932 |
pub expires_ms: i64, |
| 933 |
} |
| 934 |
|
| 935 |
|
| 936 |
|
| 937 |
|
| 938 |
|
| 939 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 940 |
pub struct ApprovalAnswer { |
| 941 |
pub approve: bool, |
| 942 |
#[serde(default)] |
| 943 |
pub number: i64, |
| 944 |
#[serde(default)] |
| 945 |
pub signature: String, |
| 946 |
} |
| 947 |
|
| 948 |
|
| 949 |
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] |
| 950 |
pub struct UserProposalsQuery { |
| 951 |
|
| 952 |
|
| 953 |
#[serde(default)] |
| 954 |
pub landable: bool, |
| 955 |
} |
| 956 |
|
| 957 |
|
| 958 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 959 |
pub struct ProposalBrief { |
| 960 |
|
| 961 |
pub repository: String, |
| 962 |
pub number: i64, |
| 963 |
pub title: String, |
| 964 |
pub author: String, |
| 965 |
pub state: ProposalState, |
| 966 |
pub conflicted: bool, |
| 967 |
pub updated_ms: i64, |
| 968 |
|
| 969 |
pub url: String, |
| 970 |
} |
| 971 |
|
| 972 |
|
| 973 |
|
| 974 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 975 |
pub struct UserOrg { |
| 976 |
pub name: String, |
| 977 |
pub display_name: String, |
| 978 |
pub role: String, |
| 979 |
} |
| 980 |
|
| 981 |
|
| 982 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 983 |
pub struct NewRepository { |
| 984 |
pub owner: String, |
| 985 |
pub name: String, |
| 986 |
#[serde(default)] |
| 987 |
pub description: String, |
| 988 |
#[serde(default = "public")] |
| 989 |
pub visibility: Visibility, |
| 990 |
} |
| 991 |
|
| 992 |
fn public() -> Visibility { |
| 993 |
Visibility::Public |
| 994 |
} |
| 995 |
|
| 996 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 997 |
pub struct NewIssue { |
| 998 |
pub title: String, |
| 999 |
#[serde(default)] |
| 1000 |
pub body: String, |
| 1001 |
|
| 1002 |
#[serde(default)] |
| 1003 |
pub labels: Vec<String>, |
| 1004 |
|
| 1005 |
#[serde(default)] |
| 1006 |
pub assignees: Vec<String>, |
| 1007 |
|
| 1008 |
#[serde(default)] |
| 1009 |
pub milestone: Option<String>, |
| 1010 |
} |
| 1011 |
|
| 1012 |
|
| 1013 |
|
| 1014 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1015 |
#[serde(deny_unknown_fields)] |
| 1016 |
pub struct IssueEdit { |
| 1017 |
#[serde(default)] |
| 1018 |
pub title: Option<String>, |
| 1019 |
#[serde(default)] |
| 1020 |
pub body: Option<String>, |
| 1021 |
|
| 1022 |
#[serde(default)] |
| 1023 |
pub labels: Option<Vec<String>>, |
| 1024 |
|
| 1025 |
#[serde(default)] |
| 1026 |
pub assignees: Option<Vec<String>>, |
| 1027 |
|
| 1028 |
#[serde(default)] |
| 1029 |
pub milestone: Option<String>, |
| 1030 |
} |
| 1031 |
|
| 1032 |
|
| 1033 |
|
| 1034 |
|
| 1035 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1036 |
pub struct RequiredChecks { |
| 1037 |
pub names: Vec<String>, |
| 1038 |
} |
| 1039 |
|
| 1040 |
|
| 1041 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1042 |
pub struct Project { |
| 1043 |
pub owner: String, |
| 1044 |
pub number: i64, |
| 1045 |
pub title: String, |
| 1046 |
pub description: String, |
| 1047 |
pub public: bool, |
| 1048 |
pub closed: bool, |
| 1049 |
pub updated_ms: i64, |
| 1050 |
|
| 1051 |
pub url: String, |
| 1052 |
} |
| 1053 |
|
| 1054 |
|
| 1055 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1056 |
pub struct ProjectCard { |
| 1057 |
pub id: i64, |
| 1058 |
|
| 1059 |
pub kind: String, |
| 1060 |
|
| 1061 |
pub reference: String, |
| 1062 |
|
| 1063 |
pub title: String, |
| 1064 |
|
| 1065 |
pub state: String, |
| 1066 |
|
| 1067 |
#[serde(default)] |
| 1068 |
pub labels: Vec<String>, |
| 1069 |
|
| 1070 |
#[serde(default)] |
| 1071 |
pub assignees: Vec<String>, |
| 1072 |
|
| 1073 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1074 |
pub archived_ms: Option<i64>, |
| 1075 |
} |
| 1076 |
|
| 1077 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1078 |
pub struct ProjectColumn { |
| 1079 |
pub id: i64, |
| 1080 |
pub name: String, |
| 1081 |
pub cards: Vec<ProjectCard>, |
| 1082 |
} |
| 1083 |
|
| 1084 |
|
| 1085 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1086 |
pub struct Board { |
| 1087 |
pub project: Project, |
| 1088 |
pub columns: Vec<ProjectColumn>, |
| 1089 |
} |
| 1090 |
|
| 1091 |
|
| 1092 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1093 |
pub struct NewProject { |
| 1094 |
pub title: String, |
| 1095 |
#[serde(default)] |
| 1096 |
pub description: String, |
| 1097 |
#[serde(default)] |
| 1098 |
pub private: bool, |
| 1099 |
} |
| 1100 |
|
| 1101 |
|
| 1102 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1103 |
#[serde(deny_unknown_fields)] |
| 1104 |
pub struct ProjectEdit { |
| 1105 |
|
| 1106 |
|
| 1107 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1108 |
pub owner: Option<String>, |
| 1109 |
#[serde(default)] |
| 1110 |
pub title: Option<String>, |
| 1111 |
#[serde(default)] |
| 1112 |
pub description: Option<String>, |
| 1113 |
#[serde(default)] |
| 1114 |
pub private: Option<bool>, |
| 1115 |
#[serde(default)] |
| 1116 |
pub closed: Option<bool>, |
| 1117 |
} |
| 1118 |
|
| 1119 |
|
| 1120 |
|
| 1121 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1122 |
pub struct NewCard { |
| 1123 |
#[serde(default)] |
| 1124 |
pub column: Option<String>, |
| 1125 |
#[serde(default)] |
| 1126 |
pub reference: String, |
| 1127 |
#[serde(default)] |
| 1128 |
pub note: String, |
| 1129 |
} |
| 1130 |
|
| 1131 |
|
| 1132 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1133 |
pub struct CardMove { |
| 1134 |
pub column: String, |
| 1135 |
} |
| 1136 |
|
| 1137 |
|
| 1138 |
|
| 1139 |
|
| 1140 |
|
| 1141 |
|
| 1142 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1143 |
pub struct CardsMove { |
| 1144 |
pub from: String, |
| 1145 |
pub column: String, |
| 1146 |
#[serde(default)] |
| 1147 |
pub except: Vec<String>, |
| 1148 |
#[serde(default)] |
| 1149 |
pub state: Vec<String>, |
| 1150 |
#[serde(default)] |
| 1151 |
pub dry_run: bool, |
| 1152 |
} |
| 1153 |
|
| 1154 |
|
| 1155 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1156 |
pub struct CardsMoved { |
| 1157 |
pub moved: Vec<ProjectCard>, |
| 1158 |
pub kept: Vec<ProjectCard>, |
| 1159 |
pub dry_run: bool, |
| 1160 |
} |
| 1161 |
|
| 1162 |
|
| 1163 |
|
| 1164 |
|
| 1165 |
|
| 1166 |
|
| 1167 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1168 |
pub struct CardsArchive { |
| 1169 |
pub from: String, |
| 1170 |
#[serde(default)] |
| 1171 |
pub older_days: Option<i64>, |
| 1172 |
#[serde(default)] |
| 1173 |
pub except: Vec<String>, |
| 1174 |
#[serde(default)] |
| 1175 |
pub state: Vec<String>, |
| 1176 |
#[serde(default)] |
| 1177 |
pub dry_run: bool, |
| 1178 |
} |
| 1179 |
|
| 1180 |
|
| 1181 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1182 |
pub struct CardsArchived { |
| 1183 |
pub archived: Vec<ProjectCard>, |
| 1184 |
pub kept: Vec<ProjectCard>, |
| 1185 |
pub dry_run: bool, |
| 1186 |
} |
| 1187 |
|
| 1188 |
|
| 1189 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1190 |
pub struct NewLabel { |
| 1191 |
pub name: String, |
| 1192 |
|
| 1193 |
#[serde(default)] |
| 1194 |
pub colour: Option<String>, |
| 1195 |
#[serde(default)] |
| 1196 |
pub description: String, |
| 1197 |
} |
| 1198 |
|
| 1199 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1200 |
pub struct NewComment { |
| 1201 |
pub body: String, |
| 1202 |
|
| 1203 |
|
| 1204 |
#[serde(default)] |
| 1205 |
pub path: Option<String>, |
| 1206 |
#[serde(default)] |
| 1207 |
pub line: Option<usize>, |
| 1208 |
} |
| 1209 |
|
| 1210 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1211 |
pub struct NewProposal { |
| 1212 |
pub title: String, |
| 1213 |
#[serde(default)] |
| 1214 |
pub body: String, |
| 1215 |
pub target: String, |
| 1216 |
|
| 1217 |
pub source: String, |
| 1218 |
#[serde(default)] |
| 1219 |
pub draft: bool, |
| 1220 |
} |
| 1221 |
|
| 1222 |
|
| 1223 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1224 |
pub struct ReviewRequest { |
| 1225 |
pub reviewers: Vec<String>, |
| 1226 |
} |
| 1227 |
|
| 1228 |
|
| 1229 |
|
| 1230 |
|
| 1231 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1232 |
pub struct AssistantRequest { |
| 1233 |
pub assistant: String, |
| 1234 |
} |
| 1235 |
|
| 1236 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1237 |
pub struct NewReview { |
| 1238 |
pub verdict: String, |
| 1239 |
#[serde(default)] |
| 1240 |
pub body: String, |
| 1241 |
} |
| 1242 |
|
| 1243 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1244 |
pub struct IssueStateChange { |
| 1245 |
|
| 1246 |
pub state: String, |
| 1247 |
#[serde(default)] |
| 1248 |
pub reason: String, |
| 1249 |
} |
| 1250 |
|
| 1251 |
|
| 1252 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1253 |
pub struct WebhookEnvelope { |
| 1254 |
pub event: String, |
| 1255 |
pub delivery: String, |
| 1256 |
pub repository: Option<Repository>, |
| 1257 |
pub actor: String, |
| 1258 |
pub at_ms: i64, |
| 1259 |
pub data: serde_json::Value, |
| 1260 |
} |
| 1261 |
|
| 1262 |
|
| 1263 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1264 |
pub struct ProposalEvent { |
| 1265 |
pub number: i64, |
| 1266 |
pub kind: String, |
| 1267 |
pub check: Option<Check>, |
| 1268 |
} |
| 1269 |
|
| 1270 |
|
| 1271 |
|
| 1272 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1273 |
pub struct Release { |
| 1274 |
pub tag: String, |
| 1275 |
pub title: String, |
| 1276 |
pub notes: String, |
| 1277 |
pub prerelease: bool, |
| 1278 |
pub latest: bool, |
| 1279 |
pub author: String, |
| 1280 |
pub heads: Vec<String>, |
| 1281 |
pub signer: Option<String>, |
| 1282 |
pub assets: Vec<ReleaseAsset>, |
| 1283 |
pub archives: Vec<String>, |
| 1284 |
pub created_ms: i64, |
| 1285 |
pub url: String, |
| 1286 |
} |
| 1287 |
|
| 1288 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1289 |
pub struct ReleaseAsset { |
| 1290 |
pub name: String, |
| 1291 |
pub size: i64, |
| 1292 |
|
| 1293 |
pub hash: String, |
| 1294 |
pub content_type: String, |
| 1295 |
pub downloads: i64, |
| 1296 |
pub url: String, |
| 1297 |
|
| 1298 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1299 |
pub built_by: Option<AssetBuild>, |
| 1300 |
} |
| 1301 |
|
| 1302 |
|
| 1303 |
|
| 1304 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1305 |
pub struct AssetBuild { |
| 1306 |
pub run: i64, |
| 1307 |
pub job: String, |
| 1308 |
pub artifact: String, |
| 1309 |
pub run_url: String, |
| 1310 |
|
| 1311 |
pub receipt: Option<String>, |
| 1312 |
pub receipt_url: Option<String>, |
| 1313 |
pub signer: Option<String>, |
| 1314 |
} |
| 1315 |
|
| 1316 |
|
| 1317 |
|
| 1318 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1319 |
#[serde(deny_unknown_fields)] |
| 1320 |
pub struct ProposalEdit { |
| 1321 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1322 |
pub title: Option<String>, |
| 1323 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1324 |
pub body: Option<String>, |
| 1325 |
|
| 1326 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1327 |
pub labels: Option<Vec<String>>, |
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
|
| 1332 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1333 |
pub state: Option<String>, |
| 1334 |
|
| 1335 |
|
| 1336 |
|
| 1337 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1338 |
pub draft: Option<bool>, |
| 1339 |
} |
| 1340 |
|
| 1341 |
|
| 1342 |
|
| 1343 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1344 |
#[serde(deny_unknown_fields)] |
| 1345 |
pub struct ReleaseEdit { |
| 1346 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1347 |
pub title: Option<String>, |
| 1348 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1349 |
pub notes: Option<String>, |
| 1350 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1351 |
pub prerelease: Option<bool>, |
| 1352 |
} |
| 1353 |
|
| 1354 |
|
| 1355 |
|
| 1356 |
|
| 1357 |
|
| 1358 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1359 |
pub struct Drop { |
| 1360 |
|
| 1361 |
pub id: String, |
| 1362 |
pub owner: String, |
| 1363 |
pub title: String, |
| 1364 |
pub description: String, |
| 1365 |
|
| 1366 |
|
| 1367 |
pub visibility: String, |
| 1368 |
|
| 1369 |
pub url: String, |
| 1370 |
|
| 1371 |
pub clone_url: String, |
| 1372 |
pub created_ms: i64, |
| 1373 |
pub updated_ms: i64, |
| 1374 |
pub files: Vec<DropFile>, |
| 1375 |
|
| 1376 |
#[serde(default)] |
| 1377 |
pub stars: i64, |
| 1378 |
#[serde(default)] |
| 1379 |
pub starred: bool, |
| 1380 |
|
| 1381 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1382 |
pub forked_from: Option<String>, |
| 1383 |
|
| 1384 |
#[serde(default)] |
| 1385 |
pub embed_url: String, |
| 1386 |
} |
| 1387 |
|
| 1388 |
|
| 1389 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1390 |
pub struct DropComment { |
| 1391 |
|
| 1392 |
pub id: i64, |
| 1393 |
pub author: String, |
| 1394 |
|
| 1395 |
pub body: String, |
| 1396 |
pub created_ms: i64, |
| 1397 |
} |
| 1398 |
|
| 1399 |
|
| 1400 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1401 |
pub struct NewDropComment { |
| 1402 |
pub body: String, |
| 1403 |
} |
| 1404 |
|
| 1405 |
|
| 1406 |
|
| 1407 |
|
| 1408 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1409 |
pub struct Attachment { |
| 1410 |
pub id: i64, |
| 1411 |
pub name: String, |
| 1412 |
pub size: i64, |
| 1413 |
|
| 1414 |
|
| 1415 |
pub content_type: String, |
| 1416 |
|
| 1417 |
pub inline: bool, |
| 1418 |
pub url: String, |
| 1419 |
|
| 1420 |
|
| 1421 |
pub markdown: String, |
| 1422 |
} |
| 1423 |
|
| 1424 |
|
| 1425 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1426 |
pub struct DropStars { |
| 1427 |
pub stars: i64, |
| 1428 |
pub starred: bool, |
| 1429 |
} |
| 1430 |
|
| 1431 |
|
| 1432 |
|
| 1433 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1434 |
pub struct DropFile { |
| 1435 |
pub name: String, |
| 1436 |
pub size: u64, |
| 1437 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1438 |
pub content: Option<String>, |
| 1439 |
|
| 1440 |
pub raw_url: String, |
| 1441 |
} |
| 1442 |
|
| 1443 |
|
| 1444 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1445 |
pub struct NewDrop { |
| 1446 |
#[serde(default)] |
| 1447 |
pub title: String, |
| 1448 |
#[serde(default)] |
| 1449 |
pub description: String, |
| 1450 |
|
| 1451 |
#[serde(default)] |
| 1452 |
pub secret: bool, |
| 1453 |
pub files: Vec<NewDropFile>, |
| 1454 |
} |
| 1455 |
|
| 1456 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1457 |
pub struct NewDropFile { |
| 1458 |
pub name: String, |
| 1459 |
pub content: String, |
| 1460 |
} |
| 1461 |
|
| 1462 |
|
| 1463 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1464 |
#[serde(deny_unknown_fields)] |
| 1465 |
pub struct DropEdit { |
| 1466 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1467 |
pub title: Option<String>, |
| 1468 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1469 |
pub description: Option<String>, |
| 1470 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1471 |
pub secret: Option<bool>, |
| 1472 |
|
| 1473 |
#[serde(default)] |
| 1474 |
pub files: Vec<DropFileEdit>, |
| 1475 |
|
| 1476 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1477 |
pub message: Option<String>, |
| 1478 |
} |
| 1479 |
|
| 1480 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1481 |
#[serde(deny_unknown_fields)] |
| 1482 |
pub struct DropFileEdit { |
| 1483 |
pub name: String, |
| 1484 |
#[serde(default)] |
| 1485 |
pub content: Option<String>, |
| 1486 |
} |
| 1487 |
|
| 1488 |
|
| 1489 |
|
| 1490 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1491 |
pub struct NewTag { |
| 1492 |
pub name: String, |
| 1493 |
#[serde(default)] |
| 1494 |
pub target: Option<String>, |
| 1495 |
#[serde(default)] |
| 1496 |
pub message: Option<String>, |
| 1497 |
} |
| 1498 |
|
| 1499 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1500 |
pub struct NewRelease { |
| 1501 |
pub tag: String, |
| 1502 |
pub title: String, |
| 1503 |
#[serde(default)] |
| 1504 |
pub notes: Option<String>, |
| 1505 |
#[serde(default)] |
| 1506 |
pub prerelease: bool, |
| 1507 |
} |
| 1508 |
|
| 1509 |
|
| 1510 |
|
| 1511 |
|
| 1512 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1513 |
pub struct Diffusion { |
| 1514 |
pub takes_from: Vec<DiffusionPin>, |
| 1515 |
pub diffuses_to: Vec<DiffusionPin>, |
| 1516 |
} |
| 1517 |
|
| 1518 |
|
| 1519 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1520 |
pub struct DiffusionPin { |
| 1521 |
pub upstream: String, |
| 1522 |
pub consumer: String, |
| 1523 |
|
| 1524 |
pub path: String, |
| 1525 |
|
| 1526 |
pub bookmark: String, |
| 1527 |
|
| 1528 |
#[serde(default)] |
| 1529 |
pub behind: Option<u64>, |
| 1530 |
|
| 1531 |
pub follow: String, |
| 1532 |
|
| 1533 |
#[serde(default)] |
| 1534 |
pub bump: Option<i64>, |
| 1535 |
|
| 1536 |
#[serde(default)] |
| 1537 |
pub run: Option<i64>, |
| 1538 |
#[serde(default)] |
| 1539 |
pub run_status: Option<String>, |
| 1540 |
|
| 1541 |
pub upstream_state: DiffusionHalf, |
| 1542 |
pub consumer_state: DiffusionHalf, |
| 1543 |
} |
| 1544 |
|
| 1545 |
|
| 1546 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1547 |
pub struct DiffusionHalf { |
| 1548 |
|
| 1549 |
pub tone: String, |
| 1550 |
|
| 1551 |
pub word: String, |
| 1552 |
|
| 1553 |
pub title: String, |
| 1554 |
} |
| 1555 |
|
| 1556 |
|
| 1557 |
pub fn schemas() -> Vec<(&'static str, schemars::Schema)> { |
| 1558 |
vec![ |
| 1559 |
("Repository", schemars::schema_for!(Repository)), |
| 1560 |
("Diffusion", schemars::schema_for!(Diffusion)), |
| 1561 |
("DiffusionPin", schemars::schema_for!(DiffusionPin)), |
| 1562 |
("DiffusionHalf", schemars::schema_for!(DiffusionHalf)), |
| 1563 |
("Visibility", schemars::schema_for!(Visibility)), |
| 1564 |
("Bookmark", schemars::schema_for!(Bookmark)), |
| 1565 |
("Tag", schemars::schema_for!(Tag)), |
| 1566 |
("ChangeSummary", schemars::schema_for!(ChangeSummary)), |
| 1567 |
("Author", schemars::schema_for!(Author)), |
| 1568 |
("Signature", schemars::schema_for!(Signature)), |
| 1569 |
("Problem", schemars::schema_for!(Problem)), |
| 1570 |
("Proposal", schemars::schema_for!(Proposal)), |
| 1571 |
("ProposalState", schemars::schema_for!(ProposalState)), |
| 1572 |
("ProposalSource", schemars::schema_for!(ProposalSource)), |
| 1573 |
("Approval", schemars::schema_for!(Approval)), |
| 1574 |
("Issue", schemars::schema_for!(Issue)), |
| 1575 |
("Label", schemars::schema_for!(Label)), |
| 1576 |
("Milestone", schemars::schema_for!(Milestone)), |
| 1577 |
("NewMilestone", schemars::schema_for!(NewMilestone)), |
| 1578 |
("MilestoneEdit", schemars::schema_for!(MilestoneEdit)), |
| 1579 |
("Comment", schemars::schema_for!(Comment)), |
| 1580 |
("ProposalFile", schemars::schema_for!(ProposalFile)), |
| 1581 |
("Notification", schemars::schema_for!(Notification)), |
| 1582 |
("Inbox", schemars::schema_for!(Inbox)), |
| 1583 |
("Atom", schemars::schema_for!(Atom)), |
| 1584 |
("Review", schemars::schema_for!(Review)), |
| 1585 |
("TreeEntry", schemars::schema_for!(TreeEntry)), |
| 1586 |
("BlameLine", schemars::schema_for!(BlameLine)), |
| 1587 |
("FileChange", schemars::schema_for!(FileChange)), |
| 1588 |
("ChangeDetail", schemars::schema_for!(ChangeDetail)), |
| 1589 |
("History", schemars::schema_for!(History)), |
| 1590 |
("Conflict", schemars::schema_for!(Conflict)), |
| 1591 |
("Push", schemars::schema_for!(Push)), |
| 1592 |
("Trust", schemars::schema_for!(Trust)), |
| 1593 |
("Policy", schemars::schema_for!(Policy)), |
| 1594 |
("Rule", schemars::schema_for!(Rule)), |
| 1595 |
("Hook", schemars::schema_for!(Hook)), |
| 1596 |
("NewHook", schemars::schema_for!(NewHook)), |
| 1597 |
("Check", schemars::schema_for!(Check)), |
| 1598 |
("CheckStatus", schemars::schema_for!(CheckStatus)), |
| 1599 |
("NewCheck", schemars::schema_for!(NewCheck)), |
| 1600 |
("User", schemars::schema_for!(User)), |
| 1601 |
("Organisation", schemars::schema_for!(Organisation)), |
| 1602 |
("NewRepository", schemars::schema_for!(NewRepository)), |
| 1603 |
("NewIssue", schemars::schema_for!(NewIssue)), |
| 1604 |
("IssueEdit", schemars::schema_for!(IssueEdit)), |
| 1605 |
("ReleaseEdit", schemars::schema_for!(ReleaseEdit)), |
| 1606 |
("ProposalEdit", schemars::schema_for!(ProposalEdit)), |
| 1607 |
("NewLabel", schemars::schema_for!(NewLabel)), |
| 1608 |
("RequiredChecks", schemars::schema_for!(RequiredChecks)), |
| 1609 |
("Project", schemars::schema_for!(Project)), |
| 1610 |
("ProjectCard", schemars::schema_for!(ProjectCard)), |
| 1611 |
("ProjectColumn", schemars::schema_for!(ProjectColumn)), |
| 1612 |
("Board", schemars::schema_for!(Board)), |
| 1613 |
("NewProject", schemars::schema_for!(NewProject)), |
| 1614 |
("ProjectEdit", schemars::schema_for!(ProjectEdit)), |
| 1615 |
("NewCard", schemars::schema_for!(NewCard)), |
| 1616 |
("CardMove", schemars::schema_for!(CardMove)), |
| 1617 |
("NewComment", schemars::schema_for!(NewComment)), |
| 1618 |
("NewProposal", schemars::schema_for!(NewProposal)), |
| 1619 |
("NewReview", schemars::schema_for!(NewReview)), |
| 1620 |
("IssueStateChange", schemars::schema_for!(IssueStateChange)), |
| 1621 |
("WebhookEnvelope", schemars::schema_for!(WebhookEnvelope)), |
| 1622 |
("ProposalEvent", schemars::schema_for!(ProposalEvent)), |
| 1623 |
("Release", schemars::schema_for!(Release)), |
| 1624 |
("FlowRun", schemars::schema_for!(FlowRun)), |
| 1625 |
("FlowJob", schemars::schema_for!(FlowJob)), |
| 1626 |
("FlowLogLine", schemars::schema_for!(FlowLogLine)), |
| 1627 |
("FlowPhase", schemars::schema_for!(FlowPhase)), |
| 1628 |
("Report", schemars::schema_for!(Report)), |
| 1629 |
("ReportMetric", schemars::schema_for!(ReportMetric)), |
| 1630 |
("ReportFile", schemars::schema_for!(ReportFile)), |
| 1631 |
("AssetBuild", schemars::schema_for!(AssetBuild)), |
| 1632 |
("ReleaseAsset", schemars::schema_for!(ReleaseAsset)), |
| 1633 |
("NewRelease", schemars::schema_for!(NewRelease)), |
| 1634 |
("Drop", schemars::schema_for!(Drop)), |
| 1635 |
("DropComment", schemars::schema_for!(DropComment)), |
| 1636 |
("NewDropComment", schemars::schema_for!(NewDropComment)), |
| 1637 |
("DropStars", schemars::schema_for!(DropStars)), |
| 1638 |
("Attachment", schemars::schema_for!(Attachment)), |
| 1639 |
("NewDrop", schemars::schema_for!(NewDrop)), |
| 1640 |
("DropEdit", schemars::schema_for!(DropEdit)), |
| 1641 |
("UserProposals", schemars::schema_for!(UserProposals)), |
| 1642 |
("ProposalBrief", schemars::schema_for!(ProposalBrief)), |
| 1643 |
("IssueBrief", schemars::schema_for!(IssueBrief)), |
| 1644 |
("NewAuthenticator", schemars::schema_for!(NewAuthenticator)), |
| 1645 |
("Authenticator", schemars::schema_for!(Authenticator)), |
| 1646 |
("PendingApproval", schemars::schema_for!(PendingApproval)), |
| 1647 |
("ApprovalAnswer", schemars::schema_for!(ApprovalAnswer)), |
| 1648 |
("StarterAssistants", schemars::schema_for!(StarterAssistants)), |
| 1649 |
("StarterStatus", schemars::schema_for!(StarterStatus)), |
| 1650 |
("StarterRequest", schemars::schema_for!(StarterRequest)), |
| 1651 |
("TestReport", schemars::schema_for!(TestReport)), |
| 1652 |
("TestReportDetail", schemars::schema_for!(TestReportDetail)), |
| 1653 |
] |
| 1654 |
} |
| 1655 |
|
| 1656 |
|
| 1657 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1658 |
pub struct Runner { |
| 1659 |
pub id: i64, |
| 1660 |
pub name: String, |
| 1661 |
|
| 1662 |
pub status: String, |
| 1663 |
|
| 1664 |
pub serves: String, |
| 1665 |
pub arch: String, |
| 1666 |
pub os: String, |
| 1667 |
pub version: String, |
| 1668 |
pub labels: Vec<String>, |
| 1669 |
pub max_jobs: i64, |
| 1670 |
pub memory_mib: Option<i64>, |
| 1671 |
pub cpus: Option<i64>, |
| 1672 |
|
| 1673 |
pub key: String, |
| 1674 |
|
| 1675 |
pub source: String, |
| 1676 |
pub last_seen_ms: Option<i64>, |
| 1677 |
|
| 1678 |
pub running: i64, |
| 1679 |
|
| 1680 |
|
| 1681 |
|
| 1682 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1683 |
pub free_disk_mib: Option<i64>, |
| 1684 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1685 |
pub load_x100: Option<i64>, |
| 1686 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1687 |
pub speed: Option<i64>, |
| 1688 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1689 |
pub speed_class: Option<i64>, |
| 1690 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 1691 |
pub kernel: String, |
| 1692 |
} |
| 1693 |
|
| 1694 |
|
| 1695 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1696 |
pub struct RunnerJob { |
| 1697 |
pub repo: String, |
| 1698 |
pub run: i64, |
| 1699 |
pub job: String, |
| 1700 |
pub status: String, |
| 1701 |
pub started_ms: Option<i64>, |
| 1702 |
pub finished_ms: Option<i64>, |
| 1703 |
} |
| 1704 |
|
| 1705 |
|
| 1706 |
|
| 1707 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1708 |
pub struct QueueItem { |
| 1709 |
pub repo: String, |
| 1710 |
pub run: i64, |
| 1711 |
pub job: String, |
| 1712 |
|
| 1713 |
pub status: String, |
| 1714 |
|
| 1715 |
pub runner: String, |
| 1716 |
} |
| 1717 |
|
| 1718 |
|
| 1719 |
|
| 1720 |
|
| 1721 |
|
| 1722 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1723 |
pub struct Assistant { |
| 1724 |
pub name: String, |
| 1725 |
pub endpoint: String, |
| 1726 |
pub api: String, |
| 1727 |
pub model: String, |
| 1728 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 1729 |
pub headers: String, |
| 1730 |
pub enabled: bool, |
| 1731 |
pub budget: i64, |
| 1732 |
pub has_token: bool, |
| 1733 |
|
| 1734 |
|
| 1735 |
#[serde(default, skip_serializing_if = "String::is_empty")] |
| 1736 |
pub from: String, |
| 1737 |
|
| 1738 |
#[serde(default)] |
| 1739 |
pub off_above: bool, |
| 1740 |
} |
| 1741 |
|
| 1742 |
|
| 1743 |
|
| 1744 |
|
| 1745 |
|
| 1746 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1747 |
pub struct NewAssistant { |
| 1748 |
#[serde(default)] |
| 1749 |
pub name: String, |
| 1750 |
#[serde(default)] |
| 1751 |
pub preset: String, |
| 1752 |
#[serde(default)] |
| 1753 |
pub endpoint: String, |
| 1754 |
#[serde(default)] |
| 1755 |
pub api: String, |
| 1756 |
pub model: String, |
| 1757 |
#[serde(default)] |
| 1758 |
pub token: String, |
| 1759 |
#[serde(default)] |
| 1760 |
pub headers: String, |
| 1761 |
#[serde(default = "yes")] |
| 1762 |
pub enabled: bool, |
| 1763 |
#[serde(default)] |
| 1764 |
pub budget: Option<i64>, |
| 1765 |
} |
| 1766 |
|
| 1767 |
fn yes() -> bool { |
| 1768 |
true |
| 1769 |
} |
| 1770 |
|
| 1771 |
|
| 1772 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1773 |
pub struct AssistantPrompt { |
| 1774 |
pub prompt: String, |
| 1775 |
#[serde(default, skip_serializing_if = "Vec::is_empty")] |
| 1776 |
pub inherited: Vec<(String, String)>, |
| 1777 |
} |
| 1778 |
|
| 1779 |
|
| 1780 |
|
| 1781 |
|
| 1782 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] |
| 1783 |
pub struct CoverageReport { |
| 1784 |
pub id: i64, |
| 1785 |
pub run: i64, |
| 1786 |
pub job: String, |
| 1787 |
pub bookmark: String, |
| 1788 |
|
| 1789 |
pub state: String, |
| 1790 |
|
| 1791 |
pub format: String, |
| 1792 |
pub lines_found: i64, |
| 1793 |
pub lines_hit: i64, |
| 1794 |
pub percent: Option<f64>, |
| 1795 |
pub functions_found: i64, |
| 1796 |
pub functions_hit: i64, |
| 1797 |
pub branches_found: i64, |
| 1798 |
pub branches_hit: i64, |
| 1799 |
pub files: i64, |
| 1800 |
|
| 1801 |
pub dropped: i64, |
| 1802 |
pub created_ms: i64, |
| 1803 |
|
| 1804 |
pub url: String, |
| 1805 |
|
| 1806 |
|
| 1807 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1808 |
pub uploaded_by: Option<String>, |
| 1809 |
} |
| 1810 |
|
| 1811 |
|
| 1812 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] |
| 1813 |
pub struct CoverageFile { |
| 1814 |
pub path: String, |
| 1815 |
pub lines_found: i64, |
| 1816 |
pub lines_hit: i64, |
| 1817 |
pub percent: Option<f64>, |
| 1818 |
pub functions_found: i64, |
| 1819 |
pub functions_hit: i64, |
| 1820 |
pub branches_found: i64, |
| 1821 |
pub branches_hit: i64, |
| 1822 |
} |
| 1823 |
|
| 1824 |
|
| 1825 |
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] |
| 1826 |
pub struct CoverageDetail { |
| 1827 |
pub report: CoverageReport, |
| 1828 |
pub files: Vec<CoverageFile>, |
| 1829 |
} |
| 1830 |
|
| 1831 |
|
| 1832 |
|
| 1833 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1834 |
pub struct TestReport { |
| 1835 |
pub id: i64, |
| 1836 |
pub run: i64, |
| 1837 |
pub job: String, |
| 1838 |
pub bookmark: String, |
| 1839 |
pub state: String, |
| 1840 |
pub tests: i64, |
| 1841 |
pub passed: i64, |
| 1842 |
pub failed: i64, |
| 1843 |
pub errors: i64, |
| 1844 |
pub skipped: i64, |
| 1845 |
|
| 1846 |
pub time_ms: i64, |
| 1847 |
pub created_ms: i64, |
| 1848 |
pub url: String, |
| 1849 |
} |
| 1850 |
|
| 1851 |
|
| 1852 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1853 |
pub struct TestCase { |
| 1854 |
pub suite: String, |
| 1855 |
pub classname: String, |
| 1856 |
pub name: String, |
| 1857 |
|
| 1858 |
pub status: String, |
| 1859 |
pub time_ms: i64, |
| 1860 |
pub message: String, |
| 1861 |
|
| 1862 |
pub output: String, |
| 1863 |
} |
| 1864 |
|
| 1865 |
|
| 1866 |
|
| 1867 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1868 |
pub struct TestReportDetail { |
| 1869 |
pub report: TestReport, |
| 1870 |
pub cases: Vec<TestCase>, |
| 1871 |
} |
| 1872 |
|
| 1873 |
|
| 1874 |
|
| 1875 |
|
| 1876 |
|
| 1877 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1878 |
pub struct RunnerUpdates { |
| 1879 |
|
| 1880 |
pub repo: String, |
| 1881 |
pub settings: Vec<UpdateSetting>, |
| 1882 |
pub groups: Vec<RunnerGroup>, |
| 1883 |
pub runners: Vec<RunnerUpdate>, |
| 1884 |
pub holds: Vec<HeldBuild>, |
| 1885 |
} |
| 1886 |
|
| 1887 |
|
| 1888 |
|
| 1889 |
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1890 |
pub struct UpdateSetting { |
| 1891 |
|
| 1892 |
pub scope: String, |
| 1893 |
|
| 1894 |
#[serde(default)] |
| 1895 |
pub key: String, |
| 1896 |
#[serde(default)] |
| 1897 |
pub updates: Option<bool>, |
| 1898 |
|
| 1899 |
#[serde(default)] |
| 1900 |
pub channel: Option<String>, |
| 1901 |
|
| 1902 |
#[serde(default)] |
| 1903 |
pub window: Option<String>, |
| 1904 |
#[serde(default)] |
| 1905 |
pub dry_run: Option<bool>, |
| 1906 |
} |
| 1907 |
|
| 1908 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1909 |
pub struct RunnerGroup { |
| 1910 |
pub id: i64, |
| 1911 |
|
| 1912 |
pub owner: String, |
| 1913 |
pub name: String, |
| 1914 |
|
| 1915 |
pub percent: Option<i64>, |
| 1916 |
|
| 1917 |
pub members: Vec<String>, |
| 1918 |
|
| 1919 |
#[serde(default, skip_serializing_if = "Option::is_none")] |
| 1920 |
pub wave: Option<i64>, |
| 1921 |
} |
| 1922 |
|
| 1923 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1924 |
pub struct RunnerUpdate { |
| 1925 |
pub id: i64, |
| 1926 |
pub name: String, |
| 1927 |
|
| 1928 |
pub owner: String, |
| 1929 |
pub version: String, |
| 1930 |
pub groups: Vec<String>, |
| 1931 |
pub updates: bool, |
| 1932 |
pub channel: String, |
| 1933 |
#[serde(default)] |
| 1934 |
pub window: Option<String>, |
| 1935 |
pub dry_run: bool, |
| 1936 |
|
| 1937 |
pub from: Vec<String>, |
| 1938 |
|
| 1939 |
pub now: String, |
| 1940 |
|
| 1941 |
pub said: String, |
| 1942 |
} |
| 1943 |
|
| 1944 |
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, JsonSchema)] |
| 1945 |
pub struct HeldBuild { |
| 1946 |
pub version: String, |
| 1947 |
pub runner: String, |
| 1948 |
pub why: String, |
| 1949 |
pub at_ms: i64, |
| 1950 |
} |