openapi_github/models/
webhooks_comment.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhooksComment {
16    /// How the author is associated with the repository.
17    #[serde(rename = "author_association")]
18    pub author_association: AuthorAssociation,
19    #[serde(rename = "body")]
20    pub body: String,
21    #[serde(rename = "child_comment_count")]
22    pub child_comment_count: i32,
23    #[serde(rename = "created_at")]
24    pub created_at: String,
25    #[serde(rename = "discussion_id")]
26    pub discussion_id: i32,
27    #[serde(rename = "html_url")]
28    pub html_url: String,
29    #[serde(rename = "id")]
30    pub id: i32,
31    #[serde(rename = "node_id")]
32    pub node_id: String,
33    #[serde(rename = "parent_id", deserialize_with = "Option::deserialize")]
34    pub parent_id: Option<i32>,
35    #[serde(rename = "reactions")]
36    pub reactions: Box<models::Reactions>,
37    #[serde(rename = "repository_url")]
38    pub repository_url: String,
39    #[serde(rename = "updated_at")]
40    pub updated_at: String,
41    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
42    pub user: Option<Box<models::User>>,
43}
44
45impl WebhooksComment {
46    pub fn new(author_association: AuthorAssociation, body: String, child_comment_count: i32, created_at: String, discussion_id: i32, html_url: String, id: i32, node_id: String, parent_id: Option<i32>, reactions: models::Reactions, repository_url: String, updated_at: String, user: Option<models::User>) -> WebhooksComment {
47        WebhooksComment {
48            author_association,
49            body,
50            child_comment_count,
51            created_at,
52            discussion_id,
53            html_url,
54            id,
55            node_id,
56            parent_id,
57            reactions: Box::new(reactions),
58            repository_url,
59            updated_at,
60            user: user.map(Box::new),
61        }
62    }
63}
64/// How the author is associated with the repository.
65#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum AuthorAssociation {
67    #[serde(rename = "COLLABORATOR")]
68    Collaborator,
69    #[serde(rename = "CONTRIBUTOR")]
70    Contributor,
71    #[serde(rename = "FIRST_TIMER")]
72    FirstTimer,
73    #[serde(rename = "FIRST_TIME_CONTRIBUTOR")]
74    FirstTimeContributor,
75    #[serde(rename = "MANNEQUIN")]
76    Mannequin,
77    #[serde(rename = "MEMBER")]
78    Member,
79    #[serde(rename = "NONE")]
80    None,
81    #[serde(rename = "OWNER")]
82    Owner,
83}
84
85impl Default for AuthorAssociation {
86    fn default() -> AuthorAssociation {
87        Self::Collaborator
88    }
89}
90