use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct GhPullRequest {
pub number: u64,
pub title: String,
pub body: Option<String>,
pub state: String,
pub draft: Option<bool>,
pub merged_at: Option<String>,
pub user: GhUser,
pub base: GhRef,
pub head: GhRef,
pub created_at: String,
pub mergeable_state: Option<String>,
pub mergeable: Option<bool>,
}
#[derive(Debug, Deserialize)]
pub struct GhUser {
pub login: String,
pub id: u64,
}
#[derive(Debug, Deserialize)]
pub struct GhRef {
#[serde(rename = "ref")]
pub ref_name: String,
pub sha: String,
}
#[derive(Debug, Deserialize)]
pub struct GhCommit {
pub sha: String,
pub commit: GhCommitDetail,
pub author: Option<GhUser>,
}
#[derive(Debug, Deserialize)]
pub struct GhCommitDetail {
pub message: String,
pub author: GhGitActor,
}
#[derive(Debug, Deserialize)]
pub struct GhGitActor {
pub name: String,
pub date: Option<String>,
}
#[derive(Debug, Deserialize)]
pub struct GhFile {
pub filename: String,
pub status: String,
pub additions: u64,
pub deletions: u64,
pub patch: Option<String>,
pub previous_filename: Option<String>,
}
#[derive(Debug, Deserialize)]
pub struct GhReviewComment {
pub id: u64,
pub body: String,
pub path: String,
pub line: Option<u32>,
pub start_line: Option<u32>,
pub side: Option<String>,
pub start_side: Option<String>,
pub commit_id: String,
pub user: GhUser,
pub created_at: String,
pub in_reply_to_id: Option<u64>,
}
#[derive(Debug, Deserialize)]
pub struct GhIssueComment {
pub id: u64,
pub body: Option<String>,
pub user: GhUser,
pub created_at: String,
}
#[derive(Debug, Deserialize)]
pub struct GhReview {
pub id: u64,
pub state: String,
pub body: Option<String>,
pub user: GhUser,
pub submitted_at: Option<String>,
}
#[derive(Debug, Deserialize)]
pub struct GhRepoPermissions {
pub push: Option<bool>,
pub maintain: Option<bool>,
pub admin: Option<bool>,
}
#[derive(Debug, Deserialize)]
pub struct GhRepo {
pub permissions: Option<GhRepoPermissions>,
pub allow_merge_commit: Option<bool>,
pub allow_squash_merge: Option<bool>,
pub allow_rebase_merge: Option<bool>,
}
#[derive(Debug, Deserialize)]
pub struct GhCommitDetail2 {
pub sha: String,
pub files: Option<Vec<GhFile>>,
}
#[derive(Debug, Deserialize)]
pub struct GhPullRequestListItem {
pub number: u64,
pub title: String,
pub state: String,
pub draft: Option<bool>,
pub merged_at: Option<String>,
pub user: GhUser,
pub base: GhRef,
pub head: GhRef,
pub updated_at: String,
#[serde(default)]
pub requested_reviewers: Vec<GhUser>,
#[serde(default)]
pub assignees: Vec<GhUser>,
pub comments: Option<u64>,
pub review_comments: Option<u64>,
}