openapi_github/models/
repos_create_commit_status_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 ReposCreateCommitStatusRequest {
16    /// The state of the status.
17    #[serde(rename = "state")]
18    pub state: State,
19    /// The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status.   For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA:   `http://ci.example.com/user/repo/build/sha`
20    #[serde(rename = "target_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub target_url: Option<Option<String>>,
22    /// A short description of the status.
23    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub description: Option<Option<String>>,
25    /// A string label to differentiate this status from the status of other systems. This field is case-insensitive.
26    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
27    pub context: Option<String>,
28}
29
30impl ReposCreateCommitStatusRequest {
31    pub fn new(state: State) -> ReposCreateCommitStatusRequest {
32        ReposCreateCommitStatusRequest {
33            state,
34            target_url: None,
35            description: None,
36            context: None,
37        }
38    }
39}
40/// The state of the status.
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
42pub enum State {
43    #[serde(rename = "error")]
44    Error,
45    #[serde(rename = "failure")]
46    Failure,
47    #[serde(rename = "pending")]
48    Pending,
49    #[serde(rename = "success")]
50    Success,
51}
52
53impl Default for State {
54    fn default() -> State {
55        Self::Error
56    }
57}
58