openapi_github/models/
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/// CheckSuite : A suite of checks performed on the code of a given code change
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CheckSuite {
17    #[serde(rename = "id")]
18    pub id: i32,
19    #[serde(rename = "node_id")]
20    pub node_id: String,
21    #[serde(rename = "head_branch", deserialize_with = "Option::deserialize")]
22    pub head_branch: Option<String>,
23    /// The SHA of the head commit that is being checked.
24    #[serde(rename = "head_sha")]
25    pub head_sha: String,
26    /// The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites.
27    #[serde(rename = "status", deserialize_with = "Option::deserialize")]
28    pub status: Option<Status>,
29    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
30    pub conclusion: Option<Conclusion>,
31    #[serde(rename = "url", deserialize_with = "Option::deserialize")]
32    pub url: Option<String>,
33    #[serde(rename = "before", deserialize_with = "Option::deserialize")]
34    pub before: Option<String>,
35    #[serde(rename = "after", deserialize_with = "Option::deserialize")]
36    pub after: Option<String>,
37    #[serde(rename = "pull_requests", deserialize_with = "Option::deserialize")]
38    pub pull_requests: Option<Vec<models::PullRequestMinimal>>,
39    #[serde(rename = "app", deserialize_with = "Option::deserialize")]
40    pub app: Option<Box<models::NullableIntegration>>,
41    #[serde(rename = "repository")]
42    pub repository: Box<models::MinimalRepository>,
43    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
44    pub created_at: Option<String>,
45    #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
46    pub updated_at: Option<String>,
47    #[serde(rename = "head_commit")]
48    pub head_commit: Box<models::SimpleCommit>,
49    #[serde(rename = "latest_check_runs_count")]
50    pub latest_check_runs_count: i32,
51    #[serde(rename = "check_runs_url")]
52    pub check_runs_url: String,
53    #[serde(rename = "rerequestable", skip_serializing_if = "Option::is_none")]
54    pub rerequestable: Option<bool>,
55    #[serde(rename = "runs_rerequestable", skip_serializing_if = "Option::is_none")]
56    pub runs_rerequestable: Option<bool>,
57}
58
59impl CheckSuite {
60    /// A suite of checks performed on the code of a given code change
61    pub fn new(id: i32, node_id: String, head_branch: Option<String>, head_sha: String, status: Option<Status>, conclusion: Option<Conclusion>, url: Option<String>, before: Option<String>, after: Option<String>, pull_requests: Option<Vec<models::PullRequestMinimal>>, app: Option<models::NullableIntegration>, repository: models::MinimalRepository, created_at: Option<String>, updated_at: Option<String>, head_commit: models::SimpleCommit, latest_check_runs_count: i32, check_runs_url: String) -> CheckSuite {
62        CheckSuite {
63            id,
64            node_id,
65            head_branch,
66            head_sha,
67            status,
68            conclusion,
69            url,
70            before,
71            after,
72            pull_requests,
73            app: app.map(Box::new),
74            repository: Box::new(repository),
75            created_at,
76            updated_at,
77            head_commit: Box::new(head_commit),
78            latest_check_runs_count,
79            check_runs_url,
80            rerequestable: None,
81            runs_rerequestable: None,
82        }
83    }
84}
85/// The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites.
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum Status {
88    #[serde(rename = "queued")]
89    Queued,
90    #[serde(rename = "in_progress")]
91    InProgress,
92    #[serde(rename = "completed")]
93    Completed,
94    #[serde(rename = "waiting")]
95    Waiting,
96    #[serde(rename = "requested")]
97    Requested,
98    #[serde(rename = "pending")]
99    Pending,
100}
101
102impl Default for Status {
103    fn default() -> Status {
104        Self::Queued
105    }
106}
107/// 
108#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
109pub enum Conclusion {
110    #[serde(rename = "success")]
111    Success,
112    #[serde(rename = "failure")]
113    Failure,
114    #[serde(rename = "neutral")]
115    Neutral,
116    #[serde(rename = "cancelled")]
117    Cancelled,
118    #[serde(rename = "skipped")]
119    Skipped,
120    #[serde(rename = "timed_out")]
121    TimedOut,
122    #[serde(rename = "action_required")]
123    ActionRequired,
124    #[serde(rename = "startup_failure")]
125    StartupFailure,
126    #[serde(rename = "stale")]
127    Stale,
128}
129
130impl Default for Conclusion {
131    fn default() -> Conclusion {
132        Self::Success
133    }
134}
135