use serde::{Deserialize, Serialize};
use crate::{OpenCloseState, Reaction};
#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)]
pub struct PullRequest {
pub index: usize,
pub poster_id: usize,
pub title: String,
pub content: String,
pub milestone: Option<String>,
pub state: OpenCloseState,
pub is_locked: bool,
pub created: String,
pub updated: String,
pub closed: Option<String>,
pub labels: Option<Vec<String>>,
pub reactions: Option<Vec<Reaction>>,
pub assignees: Option<Vec<String>>,
pub patch_url: String,
pub merged: bool,
pub merged_time: Option<String>,
pub merged_commit_sha: Option<String>,
pub head: Option<PullRequestRef>,
pub base: Option<PullRequestRef>,
}
#[derive(Clone, Debug, Serialize, Deserialize, Default, Eq, PartialEq)]
pub struct PullRequestRef {
pub clone_url: String,
#[serde(rename(serialize = "ref", deserialize = "ref"))]
pub reference: Option<String>,
pub sha: String,
pub repo_name: String,
pub owner_name: String,
}