openapi_github/models/
webhook_check_suite_completed_check_suite.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// WebhookCheckSuiteCompletedCheckSuite : The [check_suite](https://docs.github.com/rest/checks/suites#get-a-check-suite).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookCheckSuiteCompletedCheckSuite {
17    #[serde(rename = "after", deserialize_with = "Option::deserialize")]
18    pub after: Option<String>,
19    #[serde(rename = "app")]
20    pub app: Box<models::App2>,
21    #[serde(rename = "before", deserialize_with = "Option::deserialize")]
22    pub before: Option<String>,
23    #[serde(rename = "check_runs_url")]
24    pub check_runs_url: String,
25    /// 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`.
26    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
27    pub conclusion: Option<Conclusion>,
28    #[serde(rename = "created_at")]
29    pub created_at: String,
30    /// The head branch name the changes are on.
31    #[serde(rename = "head_branch", deserialize_with = "Option::deserialize")]
32    pub head_branch: Option<String>,
33    #[serde(rename = "head_commit")]
34    pub head_commit: Box<models::SimpleCommit>,
35    /// The SHA of the head commit that is being checked.
36    #[serde(rename = "head_sha")]
37    pub head_sha: String,
38    #[serde(rename = "id")]
39    pub id: i32,
40    #[serde(rename = "latest_check_runs_count")]
41    pub latest_check_runs_count: i32,
42    #[serde(rename = "node_id")]
43    pub node_id: String,
44    /// 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.
45    #[serde(rename = "pull_requests")]
46    pub pull_requests: Vec<models::CheckRunPullRequest>,
47    #[serde(rename = "rerequestable", skip_serializing_if = "Option::is_none")]
48    pub rerequestable: Option<bool>,
49    #[serde(rename = "runs_rerequestable", skip_serializing_if = "Option::is_none")]
50    pub runs_rerequestable: Option<bool>,
51    /// The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`.
52    #[serde(rename = "status", deserialize_with = "Option::deserialize")]
53    pub status: Option<Status>,
54    #[serde(rename = "updated_at")]
55    pub updated_at: String,
56    /// URL that points to the check suite API resource.
57    #[serde(rename = "url")]
58    pub url: String,
59}
60
61impl WebhookCheckSuiteCompletedCheckSuite {
62    /// The [check_suite](https://docs.github.com/rest/checks/suites#get-a-check-suite).
63    pub fn new(after: Option<String>, app: models::App2, 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) -> WebhookCheckSuiteCompletedCheckSuite {
64        WebhookCheckSuiteCompletedCheckSuite {
65            after,
66            app: Box::new(app),
67            before,
68            check_runs_url,
69            conclusion,
70            created_at,
71            head_branch,
72            head_commit: Box::new(head_commit),
73            head_sha,
74            id,
75            latest_check_runs_count,
76            node_id,
77            pull_requests,
78            rerequestable: None,
79            runs_rerequestable: None,
80            status,
81            updated_at,
82            url,
83        }
84    }
85}
86/// 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`.
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum Conclusion {
89    #[serde(rename = "success")]
90    Success,
91    #[serde(rename = "failure")]
92    Failure,
93    #[serde(rename = "neutral")]
94    Neutral,
95    #[serde(rename = "cancelled")]
96    Cancelled,
97    #[serde(rename = "timed_out")]
98    TimedOut,
99    #[serde(rename = "action_required")]
100    ActionRequired,
101    #[serde(rename = "stale")]
102    Stale,
103    #[serde(rename = "skipped")]
104    Skipped,
105    #[serde(rename = "startup_failure")]
106    StartupFailure,
107}
108
109impl Default for Conclusion {
110    fn default() -> Conclusion {
111        Self::Success
112    }
113}
114/// The summary status for all check runs that are part of the check suite. Can be `requested`, `in_progress`, or `completed`.
115#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
116pub enum Status {
117    #[serde(rename = "requested")]
118    Requested,
119    #[serde(rename = "in_progress")]
120    InProgress,
121    #[serde(rename = "completed")]
122    Completed,
123    #[serde(rename = "queued")]
124    Queued,
125    #[serde(rename = "pending")]
126    Pending,
127}
128
129impl Default for Status {
130    fn default() -> Status {
131        Self::Requested
132    }
133}
134