openapi_github/models/
webhook_workflow_job_completed_workflow_job.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 WebhookWorkflowJobCompletedWorkflowJob {
16    #[serde(rename = "check_run_url")]
17    pub check_run_url: String,
18    #[serde(rename = "completed_at")]
19    pub completed_at: String,
20    #[serde(rename = "conclusion")]
21    pub conclusion: Conclusion,
22    /// The time that the job created.
23    #[serde(rename = "created_at")]
24    pub created_at: String,
25    #[serde(rename = "head_sha")]
26    pub head_sha: String,
27    #[serde(rename = "html_url")]
28    pub html_url: String,
29    #[serde(rename = "id")]
30    pub id: i32,
31    #[serde(rename = "labels")]
32    pub labels: Vec<String>,
33    #[serde(rename = "name")]
34    pub name: String,
35    #[serde(rename = "node_id")]
36    pub node_id: String,
37    #[serde(rename = "run_attempt")]
38    pub run_attempt: i32,
39    #[serde(rename = "run_id")]
40    pub run_id: i32,
41    #[serde(rename = "run_url")]
42    pub run_url: String,
43    #[serde(rename = "runner_group_id", deserialize_with = "Option::deserialize")]
44    pub runner_group_id: Option<f64>,
45    #[serde(rename = "runner_group_name", deserialize_with = "Option::deserialize")]
46    pub runner_group_name: Option<String>,
47    #[serde(rename = "runner_id", deserialize_with = "Option::deserialize")]
48    pub runner_id: Option<f64>,
49    #[serde(rename = "runner_name", deserialize_with = "Option::deserialize")]
50    pub runner_name: Option<String>,
51    #[serde(rename = "started_at")]
52    pub started_at: String,
53    #[serde(rename = "status")]
54    pub status: String,
55    /// The name of the current branch.
56    #[serde(rename = "head_branch", deserialize_with = "Option::deserialize")]
57    pub head_branch: Option<String>,
58    /// The name of the workflow.
59    #[serde(rename = "workflow_name", deserialize_with = "Option::deserialize")]
60    pub workflow_name: Option<String>,
61    #[serde(rename = "steps")]
62    pub steps: Vec<serde_json::Value>,
63    #[serde(rename = "url")]
64    pub url: String,
65}
66
67impl WebhookWorkflowJobCompletedWorkflowJob {
68    pub fn new(check_run_url: String, completed_at: String, conclusion: Conclusion, created_at: String, head_sha: String, html_url: String, id: i32, labels: Vec<String>, name: String, node_id: String, run_attempt: i32, run_id: i32, run_url: String, runner_group_id: Option<f64>, runner_group_name: Option<String>, runner_id: Option<f64>, runner_name: Option<String>, started_at: String, status: String, head_branch: Option<String>, workflow_name: Option<String>, steps: Vec<serde_json::Value>, url: String) -> WebhookWorkflowJobCompletedWorkflowJob {
69        WebhookWorkflowJobCompletedWorkflowJob {
70            check_run_url,
71            completed_at,
72            conclusion,
73            created_at,
74            head_sha,
75            html_url,
76            id,
77            labels,
78            name,
79            node_id,
80            run_attempt,
81            run_id,
82            run_url,
83            runner_group_id,
84            runner_group_name,
85            runner_id,
86            runner_name,
87            started_at,
88            status,
89            head_branch,
90            workflow_name,
91            steps,
92            url,
93        }
94    }
95}
96/// 
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum Conclusion {
99    #[serde(rename = "success")]
100    Success,
101    #[serde(rename = "failure")]
102    Failure,
103    #[serde(rename = "skipped")]
104    Skipped,
105    #[serde(rename = "cancelled")]
106    Cancelled,
107    #[serde(rename = "action_required")]
108    ActionRequired,
109    #[serde(rename = "neutral")]
110    Neutral,
111    #[serde(rename = "timed_out")]
112    TimedOut,
113}
114
115impl Default for Conclusion {
116    fn default() -> Conclusion {
117        Self::Success
118    }
119}
120