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