openapi_github/models/
job_steps_inner.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 JobStepsInner {
16    /// The phase of the lifecycle that the job is currently in.
17    #[serde(rename = "status")]
18    pub status: Status,
19    /// The outcome of the job.
20    #[serde(rename = "conclusion", deserialize_with = "Option::deserialize")]
21    pub conclusion: Option<String>,
22    /// The name of the job.
23    #[serde(rename = "name")]
24    pub name: String,
25    #[serde(rename = "number")]
26    pub number: i32,
27    /// The time that the step started, in ISO 8601 format.
28    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub started_at: Option<Option<String>>,
30    /// The time that the job finished, in ISO 8601 format.
31    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub completed_at: Option<Option<String>>,
33}
34
35impl JobStepsInner {
36    pub fn new(status: Status, conclusion: Option<String>, name: String, number: i32) -> JobStepsInner {
37        JobStepsInner {
38            status,
39            conclusion,
40            name,
41            number,
42            started_at: None,
43            completed_at: None,
44        }
45    }
46}
47/// The phase of the lifecycle that the job is currently in.
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Status {
50    #[serde(rename = "queued")]
51    Queued,
52    #[serde(rename = "in_progress")]
53    InProgress,
54    #[serde(rename = "completed")]
55    Completed,
56}
57
58impl Default for Status {
59    fn default() -> Status {
60        Self::Queued
61    }
62}
63