openapi_github/models/
event.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Event : Event
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Event {
17    #[serde(rename = "id")]
18    pub id: String,
19    #[serde(rename = "type", deserialize_with = "Option::deserialize")]
20    pub r#type: Option<String>,
21    #[serde(rename = "actor")]
22    pub actor: Box<models::Actor>,
23    #[serde(rename = "repo")]
24    pub repo: Box<models::EventRepo>,
25    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
26    pub org: Option<Box<models::Actor>>,
27    #[serde(rename = "payload")]
28    pub payload: Box<models::EventPayload>,
29    #[serde(rename = "public")]
30    pub public: bool,
31    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
32    pub created_at: Option<String>,
33}
34
35impl Event {
36    /// Event
37    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 {
38        Event {
39            id,
40            r#type,
41            actor: Box::new(actor),
42            repo: Box::new(repo),
43            org: None,
44            payload: Box::new(payload),
45            public,
46            created_at,
47        }
48    }
49}
50