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 CodeScanningAlertItems {
    /// The security alert number.
    #[serde(rename = "number")]
    pub number: i32,
    /// The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
    #[serde(rename = "created_at")]
    pub created_at: String,
    /// The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
    #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// The REST API URL of the alert resource.
    #[serde(rename = "url")]
    pub url: String,
    /// The GitHub URL of the alert resource.
    #[serde(rename = "html_url")]
    pub html_url: String,
    /// The REST API URL for fetching the list of instances for an alert.
    #[serde(rename = "instances_url")]
    pub instances_url: String,
    #[serde(rename = "state")]
    pub state: models::CodeScanningAlertState,
    /// The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
    #[serde(rename = "fixed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub fixed_at: Option<Option<String>>,
    #[serde(rename = "dismissed_by", deserialize_with = "Option::deserialize")]
    pub dismissed_by: Option<Box<models::NullableSimpleUser>>,
    /// The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
    #[serde(rename = "dismissed_at", deserialize_with = "Option::deserialize")]
    pub dismissed_at: Option<String>,
    #[serde(rename = "dismissed_reason", deserialize_with = "Option::deserialize")]
    pub dismissed_reason: Option<models::CodeScanningAlertDismissedReason>,
    /// The dismissal comment associated with the dismissal of the alert.
    #[serde(rename = "dismissed_comment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub dismissed_comment: Option<Option<String>>,
    #[serde(rename = "rule")]
    pub rule: Box<models::CodeScanningAlertRuleSummary>,
    #[serde(rename = "tool")]
    pub tool: Box<models::CodeScanningAnalysisTool>,
    #[serde(rename = "most_recent_instance")]
    pub most_recent_instance: Box<models::CodeScanningAlertInstance>,
}

impl CodeScanningAlertItems {
    pub fn new(number: i32, created_at: String, url: String, html_url: String, instances_url: String, state: models::CodeScanningAlertState, dismissed_by: Option<models::NullableSimpleUser>, dismissed_at: Option<String>, dismissed_reason: Option<models::CodeScanningAlertDismissedReason>, rule: models::CodeScanningAlertRuleSummary, tool: models::CodeScanningAnalysisTool, most_recent_instance: models::CodeScanningAlertInstance) -> CodeScanningAlertItems {
        CodeScanningAlertItems {
            number,
            created_at,
            updated_at: None,
            url,
            html_url,
            instances_url,
            state,
            fixed_at: None,
            dismissed_by: dismissed_by.map(Box::new),
            dismissed_at,
            dismissed_reason,
            dismissed_comment: None,
            rule: Box::new(rule),
            tool: Box::new(tool),
            most_recent_instance: Box::new(most_recent_instance),
        }
    }
}