use serde::Deserialize;
#[derive(Debug, Clone, Deserialize)]
pub struct PrFile {
pub filename: String,
pub patch: Option<String>,
#[serde(default)]
pub additions: u32,
#[serde(default)]
pub deletions: u32,
#[serde(default)]
pub status: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrMetadata {
pub number: u32,
pub title: String,
pub body: Option<String>,
pub user: Option<PrUser>,
pub head: PrHead,
pub base: PrBase,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrHead {
pub sha: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrBase {
#[serde(rename = "ref")]
pub ref_name: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Tag {
pub name: String,
pub commit: TagCommit,
}
#[derive(Debug, Clone, Deserialize)]
pub struct TagCommit {
pub sha: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CommitVerification {
pub verified: bool,
pub reason: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CommitAuthor {
pub login: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CompareCommitInner {
pub message: String,
pub verification: CommitVerification,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CommitParent {
pub sha: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CompareCommit {
pub sha: String,
pub commit: CompareCommitInner,
pub author: Option<CommitAuthor>,
#[serde(default)]
pub parents: Vec<CommitParent>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CompareResponse {
pub commits: Vec<CompareCommit>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PullRequestSummary {
pub number: u32,
pub merged_at: Option<String>,
pub user: PrUser,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrUser {
pub login: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Release {
pub tag_name: String,
pub assets: Vec<ReleaseAsset>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct ReleaseAsset {
pub name: String,
pub browser_download_url: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Review {
pub user: PrUser,
pub state: String,
pub submitted_at: Option<String>,
#[serde(default)]
pub body: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrCommit {
pub sha: String,
pub commit: PrCommitInner,
pub author: Option<PrUser>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrCommitInner {
pub committer: Option<PrCommitAuthor>,
pub verification: Option<CommitVerification>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct PrCommitAuthor {
pub date: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CheckRunApp {
pub slug: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CheckRunItem {
pub name: String,
pub status: String,
pub conclusion: Option<String>,
pub app: Option<CheckRunApp>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CombinedStatusResponse {
pub state: String,
pub statuses: Vec<CommitStatusItem>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct CommitStatusItem {
pub context: String,
pub state: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct SearchResponse<T> {
pub total_count: u32,
pub items: Vec<T>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct SearchPrItem {
pub number: u32,
pub pull_request: Option<SearchPrMeta>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct SearchPrMeta {
pub merged_at: Option<String>,
}