openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WebhookCheckSuiteRequestedCheckSuite : The [check_suite](https://docs.github.com/rest/checks/suites#get-a-check-suite).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookCheckSuiteRequestedCheckSuite {
    #[serde(rename = "after", deserialize_with = "Option::deserialize")]
    pub after: Option<String>,
    #[serde(rename = "app")]
    pub app: Box<models::App3>,
    #[serde(rename = "before", deserialize_with = "Option::deserialize")]
    pub before: Option<String>,
    #[serde(rename = "check_runs_url")]
    pub check_runs_url: String,
    /// The summary conclusion for all check runs that are part of the check suite. This value will be `null` until the check run has completed.
    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
    pub conclusion: Option<Conclusion>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The head branch name the changes are on.
    #[serde(rename = "head_branch", deserialize_with = "Option::deserialize")]
    pub head_branch: Option<String>,
    #[serde(rename = "head_commit")]
    pub head_commit: Box<models::SimpleCommit>,
    /// The SHA of the head commit that is being checked.
    #[serde(rename = "head_sha")]
    pub head_sha: String,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "latest_check_runs_count")]
    pub latest_check_runs_count: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// An array of pull requests that match this check suite. A pull request matches a check suite if they have the same `head_sha` and `head_branch`. When the check suite's `head_branch` is in a forked repository it will be `null` and the `pull_requests` array will be empty.
    #[serde(rename = "pull_requests")]
    pub pull_requests: Vec<models::CheckRunPullRequest>,
    #[serde(rename = "rerequestable", skip_serializing_if = "Option::is_none")]
    pub rerequestable: Option<bool>,
    #[serde(rename = "runs_rerequestable", skip_serializing_if = "Option::is_none")]
    pub runs_rerequestable: Option<bool>,
    /// The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`.
    #[serde(rename = "status", deserialize_with = "Option::deserialize")]
    pub status: Option<Status>,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// URL that points to the check suite API resource.
    #[serde(rename = "url")]
    pub url: String,
}

impl WebhookCheckSuiteRequestedCheckSuite {
    /// The [check_suite](https://docs.github.com/rest/checks/suites#get-a-check-suite).
    pub fn new(after: Option<String>, app: models::App3, before: Option<String>, check_runs_url: String, conclusion: Option<Conclusion>, created_at: String, head_branch: Option<String>, head_commit: models::SimpleCommit, head_sha: String, id: i32, latest_check_runs_count: i32, node_id: String, pull_requests: Vec<models::CheckRunPullRequest>, status: Option<Status>, updated_at: String, url: String) -> WebhookCheckSuiteRequestedCheckSuite {
        WebhookCheckSuiteRequestedCheckSuite {
            after,
            app: Box::new(app),
            before,
            check_runs_url,
            conclusion,
            created_at,
            head_branch,
            head_commit: Box::new(head_commit),
            head_sha,
            id,
            latest_check_runs_count,
            node_id,
            pull_requests,
            rerequestable: None,
            runs_rerequestable: None,
            status,
            updated_at,
            url,
        }
    }
}
/// The summary conclusion for all check runs that are part of the check suite. This value will be `null` until the check run has completed.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Conclusion {
    #[serde(rename = "success")]
    Success,
    #[serde(rename = "failure")]
    Failure,
    #[serde(rename = "neutral")]
    Neutral,
    #[serde(rename = "cancelled")]
    Cancelled,
    #[serde(rename = "timed_out")]
    TimedOut,
    #[serde(rename = "action_required")]
    ActionRequired,
    #[serde(rename = "stale")]
    Stale,
    #[serde(rename = "skipped")]
    Skipped,
}

impl Default for Conclusion {
    fn default() -> Conclusion {
        Self::Success
    }
}
/// The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "requested")]
    Requested,
    #[serde(rename = "in_progress")]
    InProgress,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "queued")]
    Queued,
}

impl Default for Status {
    fn default() -> Status {
        Self::Requested
    }
}