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

/// WebhookOrganizationMemberInvitedInvitation : The invitation for the user or email if the action is `member_invited`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookOrganizationMemberInvitedInvitation {
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "email", deserialize_with = "Option::deserialize")]
    pub email: Option<String>,
    #[serde(rename = "failed_at", deserialize_with = "Option::deserialize")]
    pub failed_at: Option<String>,
    #[serde(rename = "failed_reason", deserialize_with = "Option::deserialize")]
    pub failed_reason: Option<String>,
    #[serde(rename = "id")]
    pub id: f64,
    #[serde(rename = "invitation_teams_url")]
    pub invitation_teams_url: String,
    #[serde(rename = "inviter", deserialize_with = "Option::deserialize")]
    pub inviter: Option<Box<models::User>>,
    #[serde(rename = "login", deserialize_with = "Option::deserialize")]
    pub login: Option<String>,
    #[serde(rename = "node_id")]
    pub node_id: String,
    #[serde(rename = "role")]
    pub role: String,
    #[serde(rename = "team_count")]
    pub team_count: f64,
    #[serde(rename = "invitation_source", skip_serializing_if = "Option::is_none")]
    pub invitation_source: Option<String>,
}

impl WebhookOrganizationMemberInvitedInvitation {
    /// The invitation for the user or email if the action is `member_invited`.
    pub fn new(created_at: String, email: Option<String>, failed_at: Option<String>, failed_reason: Option<String>, id: f64, invitation_teams_url: String, inviter: Option<models::User>, login: Option<String>, node_id: String, role: String, team_count: f64) -> WebhookOrganizationMemberInvitedInvitation {
        WebhookOrganizationMemberInvitedInvitation {
            created_at,
            email,
            failed_at,
            failed_reason,
            id,
            invitation_teams_url,
            inviter: inviter.map(Box::new),
            login,
            node_id,
            role,
            team_count,
            invitation_source: None,
        }
    }
}