openapi_github/models/
checks_update_request.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 ChecksUpdateRequest {
16    /// The name of the check. For example, \"code-coverage\".
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// The URL of the integrator's site that has the full details of the check.
20    #[serde(rename = "details_url", skip_serializing_if = "Option::is_none")]
21    pub details_url: Option<String>,
22    /// A reference for the run on the integrator's system.
23    #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")]
24    pub external_id: Option<String>,
25    /// This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
26    #[serde(rename = "started_at", skip_serializing_if = "Option::is_none")]
27    pub started_at: Option<String>,
28    /// The current status of the check run. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`.
29    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
30    pub status: Option<Status>,
31    /// **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check.  **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.
32    #[serde(rename = "conclusion", skip_serializing_if = "Option::is_none")]
33    pub conclusion: Option<Conclusion>,
34    /// The time the check completed. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`.
35    #[serde(rename = "completed_at", skip_serializing_if = "Option::is_none")]
36    pub completed_at: Option<String>,
37    #[serde(rename = "output", skip_serializing_if = "Option::is_none")]
38    pub output: Option<Box<models::ChecksUpdateRequestOutput>>,
39    /// Possible further actions the integrator can perform, which a user may trigger. Each action includes a `label`, `identifier` and `description`. A maximum of three actions are accepted. To learn more about check runs and requested actions, see \"[Check runs and requested actions](https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-checks#check-runs-and-requested-actions).\"
40    #[serde(rename = "actions", skip_serializing_if = "Option::is_none")]
41    pub actions: Option<Vec<models::ChecksCreateRequestActionsInner>>,
42}
43
44impl ChecksUpdateRequest {
45    pub fn new() -> ChecksUpdateRequest {
46        ChecksUpdateRequest {
47            name: None,
48            details_url: None,
49            external_id: None,
50            started_at: None,
51            status: None,
52            conclusion: None,
53            completed_at: None,
54            output: None,
55            actions: None,
56        }
57    }
58}
59/// The current status of the check run. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`.
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum Status {
62    #[serde(rename = "queued")]
63    Queued,
64    #[serde(rename = "in_progress")]
65    InProgress,
66    #[serde(rename = "completed")]
67    Completed,
68    #[serde(rename = "waiting")]
69    Waiting,
70    #[serde(rename = "requested")]
71    Requested,
72    #[serde(rename = "pending")]
73    Pending,
74}
75
76impl Default for Status {
77    fn default() -> Status {
78        Self::Queued
79    }
80}
81/// **Required if you provide `completed_at` or a `status` of `completed`**. The final conclusion of the check.  **Note:** Providing `conclusion` will automatically set the `status` parameter to `completed`. You cannot change a check run conclusion to `stale`, only GitHub can set this.
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum Conclusion {
84    #[serde(rename = "action_required")]
85    ActionRequired,
86    #[serde(rename = "cancelled")]
87    Cancelled,
88    #[serde(rename = "failure")]
89    Failure,
90    #[serde(rename = "neutral")]
91    Neutral,
92    #[serde(rename = "success")]
93    Success,
94    #[serde(rename = "skipped")]
95    Skipped,
96    #[serde(rename = "stale")]
97    Stale,
98    #[serde(rename = "timed_out")]
99    TimedOut,
100}
101
102impl Default for Conclusion {
103    fn default() -> Conclusion {
104        Self::ActionRequired
105    }
106}
107