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

/// WebhookDeploymentStatusCreatedDeploymentStatus : The [deployment status](https://docs.github.com/rest/deployments/statuses#list-deployment-statuses).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookDeploymentStatusCreatedDeploymentStatus {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
    pub creator: Option<Box<models::User>>,
    #[serde(rename = "deployment_url")]
    pub deployment_url: String,
    /// The optional human-readable description added to the status.
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "environment")]
    pub environment: String,
    #[serde(rename = "environment_url", skip_serializing_if = "Option::is_none")]
    pub environment_url: Option<String>,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "log_url", skip_serializing_if = "Option::is_none")]
    pub log_url: Option<String>,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "performed_via_github_app", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub performed_via_github_app: Option<Option<Box<models::App7>>>,
    #[serde(rename = "repository_url")]
    pub repository_url: String,
    /// The new state. Can be `pending`, `success`, `failure`, or `error`.
    #[serde(rename = "state")]
    pub state: String,
    /// The optional link added to the status.
    #[serde(rename = "target_url")]
    pub target_url: String,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "url")]
    pub url: String,
}

impl WebhookDeploymentStatusCreatedDeploymentStatus {
    /// The [deployment status](https://docs.github.com/rest/deployments/statuses#list-deployment-statuses).
    pub fn new(created_at: String, creator: Option<models::User>, deployment_url: String, description: String, environment: String, id: i32, node_id: String, repository_url: String, state: String, target_url: String, updated_at: String, url: String) -> WebhookDeploymentStatusCreatedDeploymentStatus {
        WebhookDeploymentStatusCreatedDeploymentStatus {
            created_at,
            creator: creator.map(Box::new),
            deployment_url,
            description,
            environment,
            environment_url: None,
            id,
            log_url: None,
            node_id,
            performed_via_github_app: None,
            repository_url,
            state,
            target_url,
            updated_at,
            url,
        }
    }
}