openapi_github/models/
webhook_deployment_status_created_check_run.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookDeploymentStatusCreatedCheckRun {
16    #[serde(rename = "completed_at", deserialize_with = "Option::deserialize")]
17    pub completed_at: Option<String>,
18    /// The result of the completed check run. This value will be `null` until the check run has completed.
19    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
20    pub conclusion: Option<Conclusion>,
21    #[serde(rename = "details_url")]
22    pub details_url: String,
23    #[serde(rename = "external_id")]
24    pub external_id: String,
25    /// The SHA of the commit that is being checked.
26    #[serde(rename = "head_sha")]
27    pub head_sha: String,
28    #[serde(rename = "html_url")]
29    pub html_url: String,
30    /// The id of the check.
31    #[serde(rename = "id")]
32    pub id: i32,
33    /// The name of the check run.
34    #[serde(rename = "name")]
35    pub name: String,
36    #[serde(rename = "node_id")]
37    pub node_id: String,
38    #[serde(rename = "started_at")]
39    pub started_at: String,
40    /// The current status of the check run. Can be `queued`, `in_progress`, or `completed`.
41    #[serde(rename = "status")]
42    pub status: Status,
43    #[serde(rename = "url")]
44    pub url: String,
45}
46
47impl WebhookDeploymentStatusCreatedCheckRun {
48    pub fn new(completed_at: Option<String>, conclusion: Option<Conclusion>, details_url: String, external_id: String, head_sha: String, html_url: String, id: i32, name: String, node_id: String, started_at: String, status: Status, url: String) -> WebhookDeploymentStatusCreatedCheckRun {
49        WebhookDeploymentStatusCreatedCheckRun {
50            completed_at,
51            conclusion,
52            details_url,
53            external_id,
54            head_sha,
55            html_url,
56            id,
57            name,
58            node_id,
59            started_at,
60            status,
61            url,
62        }
63    }
64}
65/// The result of the completed check run. This value will be `null` until the check run has completed.
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum Conclusion {
68    #[serde(rename = "success")]
69    Success,
70    #[serde(rename = "failure")]
71    Failure,
72    #[serde(rename = "neutral")]
73    Neutral,
74    #[serde(rename = "cancelled")]
75    Cancelled,
76    #[serde(rename = "timed_out")]
77    TimedOut,
78    #[serde(rename = "action_required")]
79    ActionRequired,
80    #[serde(rename = "stale")]
81    Stale,
82    #[serde(rename = "skipped")]
83    Skipped,
84}
85
86impl Default for Conclusion {
87    fn default() -> Conclusion {
88        Self::Success
89    }
90}
91/// The current status of the check run. Can be `queued`, `in_progress`, or `completed`.
92#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
93pub enum Status {
94    #[serde(rename = "queued")]
95    Queued,
96    #[serde(rename = "in_progress")]
97    InProgress,
98    #[serde(rename = "completed")]
99    Completed,
100    #[serde(rename = "waiting")]
101    Waiting,
102    #[serde(rename = "pending")]
103    Pending,
104}
105
106impl Default for Status {
107    fn default() -> Status {
108        Self::Queued
109    }
110}
111