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