codealong_github/
pull_request.rs

1use chrono::prelude::*;
2use chrono::DateTime;
3
4use crate::repo::Repo;
5use crate::user::User;
6
7#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
8pub struct PullRequest {
9    pub id: u64,
10    pub url: Option<String>,
11    pub number: u64,
12    pub base: Ref,
13    pub head: Ref,
14    pub html_url: Option<String>,
15    pub state: Option<String>,
16    pub title: Option<String>,
17    pub body: Option<String>,
18    pub user: User,
19    pub created_at: DateTime<Utc>,
20    pub updated_at: DateTime<Utc>,
21    pub closed_at: Option<DateTime<Utc>>,
22    pub merged_at: Option<DateTime<Utc>>,
23}
24
25#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
26pub struct Ref {
27    pub sha: String,
28    #[serde(rename = "ref")]
29    pub reference: String,
30    pub repo: Option<Repo>,
31}