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

/// Deployment : The [deployment](https://docs.github.com/rest/deployments/deployments#list-deployments).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Deployment {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "creator", deserialize_with = "Option::deserialize")]
    pub creator: Option<Box<models::User>>,
    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
    pub description: Option<String>,
    #[serde(rename = "environment")]
    pub environment: String,
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "original_environment")]
    pub original_environment: String,
    #[serde(rename = "payload")]
    pub payload: Box<models::DeploymentPayload>,
    #[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::App5>>>,
    #[serde(rename = "production_environment", skip_serializing_if = "Option::is_none")]
    pub production_environment: Option<bool>,
    #[serde(rename = "ref")]
    pub r#ref: String,
    #[serde(rename = "repository_url")]
    pub repository_url: String,
    #[serde(rename = "sha")]
    pub sha: String,
    #[serde(rename = "statuses_url")]
    pub statuses_url: String,
    #[serde(rename = "task")]
    pub task: String,
    #[serde(rename = "transient_environment", skip_serializing_if = "Option::is_none")]
    pub transient_environment: Option<bool>,
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    #[serde(rename = "url")]
    pub url: String,
}

impl Deployment {
    /// The [deployment](https://docs.github.com/rest/deployments/deployments#list-deployments).
    pub fn new(created_at: String, creator: Option<models::User>, description: Option<String>, environment: String, id: i32, node_id: String, original_environment: String, payload: models::DeploymentPayload, r#ref: String, repository_url: String, sha: String, statuses_url: String, task: String, updated_at: String, url: String) -> Deployment {
        Deployment {
            created_at,
            creator: creator.map(Box::new),
            description,
            environment,
            id,
            node_id,
            original_environment,
            payload: Box::new(payload),
            performed_via_github_app: None,
            production_environment: None,
            r#ref,
            repository_url,
            sha,
            statuses_url,
            task,
            transient_environment: None,
            updated_at,
            url,
        }
    }
}