/*
 * codex-backend
 *
 * codex-backend
 *
 * The version of the OpenAPI document: 0.0.1
 *
 * Generated by: https://openapi-generator.tech
 */

use serde::Deserialize;
use serde::Serialize;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GitPullRequest {
    #[serde(rename = "number")]
    pub number: i32,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "state")]
    pub state: String,
    #[serde(rename = "merged")]
    pub merged: bool,
    #[serde(rename = "mergeable")]
    pub mergeable: bool,
    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
    pub draft: Option<bool>,
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    #[serde(rename = "body", skip_serializing_if = "Option::is_none")]
    pub body: Option<String>,
    #[serde(rename = "base", skip_serializing_if = "Option::is_none")]
    pub base: Option<String>,
    #[serde(rename = "head", skip_serializing_if = "Option::is_none")]
    pub head: Option<String>,
    #[serde(rename = "base_sha", skip_serializing_if = "Option::is_none")]
    pub base_sha: Option<String>,
    #[serde(rename = "head_sha", skip_serializing_if = "Option::is_none")]
    pub head_sha: Option<String>,
    #[serde(rename = "merge_commit_sha", skip_serializing_if = "Option::is_none")]
    pub merge_commit_sha: Option<String>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<serde_json::Value>,
    #[serde(rename = "diff", skip_serializing_if = "Option::is_none")]
    pub diff: Option<serde_json::Value>,
    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
    pub user: Option<serde_json::Value>,
}

impl GitPullRequest {
    pub fn new(
        number: i32,
        url: String,
        state: String,
        merged: bool,
        mergeable: bool,
    ) -> GitPullRequest {
        GitPullRequest {
            number,
            url,
            state,
            merged,
            mergeable,
            draft: None,
            title: None,
            body: None,
            base: None,
            head: None,
            base_sha: None,
            head_sha: None,
            merge_commit_sha: None,
            comments: None,
            diff: None,
            user: None,
        }
    }
}
