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