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

/// Event : Event
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Event {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "type", deserialize_with = "Option::deserialize")]
    pub r#type: Option<String>,
    #[serde(rename = "actor")]
    pub actor: Box<models::Actor>,
    #[serde(rename = "repo")]
    pub repo: Box<models::EventRepo>,
    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
    pub org: Option<Box<models::Actor>>,
    #[serde(rename = "payload")]
    pub payload: Box<models::EventPayload>,
    #[serde(rename = "public")]
    pub public: bool,
    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
    pub created_at: Option<String>,
}

impl Event {
    /// Event
    pub fn new(id: String, r#type: Option<String>, actor: models::Actor, repo: models::EventRepo, payload: models::EventPayload, public: bool, created_at: Option<String>) -> Event {
        Event {
            id,
            r#type,
            actor: Box::new(actor),
            repo: Box::new(repo),
            org: None,
            payload: Box::new(payload),
            public,
            created_at,
        }
    }
}