openapi_github/models/
deployment_workflow_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 DeploymentWorkflowRun {
16    #[serde(rename = "actor", deserialize_with = "Option::deserialize")]
17    pub actor: Option<Box<models::User>>,
18    #[serde(rename = "artifacts_url", skip_serializing_if = "Option::is_none")]
19    pub artifacts_url: Option<String>,
20    #[serde(rename = "cancel_url", skip_serializing_if = "Option::is_none")]
21    pub cancel_url: Option<String>,
22    #[serde(rename = "check_suite_id")]
23    pub check_suite_id: i32,
24    #[serde(rename = "check_suite_node_id")]
25    pub check_suite_node_id: String,
26    #[serde(rename = "check_suite_url", skip_serializing_if = "Option::is_none")]
27    pub check_suite_url: Option<String>,
28    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
29    pub conclusion: Option<Conclusion>,
30    #[serde(rename = "created_at")]
31    pub created_at: String,
32    #[serde(rename = "display_title")]
33    pub display_title: String,
34    #[serde(rename = "event")]
35    pub event: String,
36    #[serde(rename = "head_branch")]
37    pub head_branch: String,
38    #[serde(rename = "head_commit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub head_commit: Option<Option<serde_json::Value>>,
40    #[serde(rename = "head_repository", skip_serializing_if = "Option::is_none")]
41    pub head_repository: Option<Box<models::DeploymentWorkflowRunHeadRepository>>,
42    #[serde(rename = "head_sha")]
43    pub head_sha: String,
44    #[serde(rename = "html_url")]
45    pub html_url: String,
46    #[serde(rename = "id")]
47    pub id: i32,
48    #[serde(rename = "jobs_url", skip_serializing_if = "Option::is_none")]
49    pub jobs_url: Option<String>,
50    #[serde(rename = "logs_url", skip_serializing_if = "Option::is_none")]
51    pub logs_url: Option<String>,
52    #[serde(rename = "name")]
53    pub name: String,
54    #[serde(rename = "node_id")]
55    pub node_id: String,
56    #[serde(rename = "path")]
57    pub path: String,
58    #[serde(rename = "previous_attempt_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
59    pub previous_attempt_url: Option<Option<serde_json::Value>>,
60    #[serde(rename = "pull_requests")]
61    pub pull_requests: Vec<models::CheckRunPullRequest>,
62    #[serde(rename = "referenced_workflows", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63    pub referenced_workflows: Option<Option<Vec<models::DeploymentWorkflowRunReferencedWorkflowsInner>>>,
64    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
65    pub repository: Option<Box<models::DeploymentWorkflowRunHeadRepository>>,
66    #[serde(rename = "rerun_url", skip_serializing_if = "Option::is_none")]
67    pub rerun_url: Option<String>,
68    #[serde(rename = "run_attempt")]
69    pub run_attempt: i32,
70    #[serde(rename = "run_number")]
71    pub run_number: i32,
72    #[serde(rename = "run_started_at")]
73    pub run_started_at: String,
74    #[serde(rename = "status")]
75    pub status: Status,
76    #[serde(rename = "triggering_actor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
77    pub triggering_actor: Option<Option<Box<models::User>>>,
78    #[serde(rename = "updated_at")]
79    pub updated_at: String,
80    #[serde(rename = "url")]
81    pub url: String,
82    #[serde(rename = "workflow_id")]
83    pub workflow_id: i32,
84    #[serde(rename = "workflow_url", skip_serializing_if = "Option::is_none")]
85    pub workflow_url: Option<String>,
86}
87
88impl DeploymentWorkflowRun {
89    pub fn new(actor: Option<models::User>, check_suite_id: i32, check_suite_node_id: String, conclusion: Option<Conclusion>, created_at: String, display_title: String, event: String, head_branch: String, head_sha: String, html_url: String, id: i32, name: String, node_id: String, path: String, pull_requests: Vec<models::CheckRunPullRequest>, run_attempt: i32, run_number: i32, run_started_at: String, status: Status, updated_at: String, url: String, workflow_id: i32) -> DeploymentWorkflowRun {
90        DeploymentWorkflowRun {
91            actor: actor.map(Box::new),
92            artifacts_url: None,
93            cancel_url: None,
94            check_suite_id,
95            check_suite_node_id,
96            check_suite_url: None,
97            conclusion,
98            created_at,
99            display_title,
100            event,
101            head_branch,
102            head_commit: None,
103            head_repository: None,
104            head_sha,
105            html_url,
106            id,
107            jobs_url: None,
108            logs_url: None,
109            name,
110            node_id,
111            path,
112            previous_attempt_url: None,
113            pull_requests,
114            referenced_workflows: None,
115            repository: None,
116            rerun_url: None,
117            run_attempt,
118            run_number,
119            run_started_at,
120            status,
121            triggering_actor: None,
122            updated_at,
123            url,
124            workflow_id,
125            workflow_url: None,
126        }
127    }
128}
129/// 
130#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
131pub enum Conclusion {
132    #[serde(rename = "success")]
133    Success,
134    #[serde(rename = "failure")]
135    Failure,
136    #[serde(rename = "neutral")]
137    Neutral,
138    #[serde(rename = "cancelled")]
139    Cancelled,
140    #[serde(rename = "timed_out")]
141    TimedOut,
142    #[serde(rename = "action_required")]
143    ActionRequired,
144    #[serde(rename = "stale")]
145    Stale,
146}
147
148impl Default for Conclusion {
149    fn default() -> Conclusion {
150        Self::Success
151    }
152}
153/// 
154#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
155pub enum Status {
156    #[serde(rename = "requested")]
157    Requested,
158    #[serde(rename = "in_progress")]
159    InProgress,
160    #[serde(rename = "completed")]
161    Completed,
162    #[serde(rename = "queued")]
163    Queued,
164    #[serde(rename = "waiting")]
165    Waiting,
166    #[serde(rename = "pending")]
167    Pending,
168}
169
170impl Default for Status {
171    fn default() -> Status {
172        Self::Requested
173    }
174}
175