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};

/// Status : The status of a commit.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Status {
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "avatar_url", deserialize_with = "Option::deserialize")]
    pub avatar_url: Option<String>,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "state")]
    pub state: String,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "target_url", deserialize_with = "Option::deserialize")]
    pub target_url: Option<String>,
    #[serde(rename = "context")]
    pub context: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
    pub creator: Option<Box<models::NullableSimpleUser>>,
}

impl Status {
    /// The status of a commit.
    pub fn new(url: String, avatar_url: Option<String>, id: i32, node_id: String, state: String, description: Option<String>, target_url: Option<String>, context: String, created_at: String, updated_at: String, creator: Option<models::NullableSimpleUser>) -> Status {
        Status {
            url,
            avatar_url,
            id,
            node_id,
            state,
            description,
            target_url,
            context,
            created_at,
            updated_at,
            creator: creator.map(Box::new),
        }
    }
}