openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReposCreateCommitStatusRequest {
    /// The state of the status.
    #[serde(rename = "state")]
    pub state: State,
    /// 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`
    #[serde(rename = "target_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub target_url: Option<Option<String>>,
    /// A short description of the status.
    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub description: Option<Option<String>>,
    /// A string label to differentiate this status from the status of other systems. This field is case-insensitive.
    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
    pub context: Option<String>,
}

impl ReposCreateCommitStatusRequest {
    pub fn new(state: State) -> ReposCreateCommitStatusRequest {
        ReposCreateCommitStatusRequest {
            state,
            target_url: None,
            description: None,
            context: None,
        }
    }
}
/// The state of the status.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "failure")]
    Failure,
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "success")]
    Success,
}

impl Default for State {
    fn default() -> State {
        Self::Error
    }
}