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

/// Environment : Details of a deployment environment
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Environment {
    /// The id of the environment.
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// The name of the environment.
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// The time that the environment was created, in ISO 8601 format.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The time that the environment was last updated, in ISO 8601 format.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// Built-in deployment protection rules for the environment.
    #[serde(rename = "protection_rules", skip_serializing_if = "Option::is_none")]
    pub protection_rules: Option<Vec<models::EnvironmentProtectionRulesInner>>,
    #[serde(rename = "deployment_branch_policy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub deployment_branch_policy: Option<Option<Box<models::DeploymentBranchPolicySettings>>>,
}

impl Environment {
    /// Details of a deployment environment
    pub fn new(id: i32, node_id: String, name: String, url: String, html_url: String, created_at: String, updated_at: String) -> Environment {
        Environment {
            id,
            node_id,
            name,
            url,
            html_url,
            created_at,
            updated_at,
            protection_rules: None,
            deployment_branch_policy: None,
        }
    }
}