openapi_github/models/
webhook_status_commit.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 WebhookStatusCommit {
16    #[serde(rename = "author", deserialize_with = "Option::deserialize")]
17    pub author: Option<Box<models::User3>>,
18    #[serde(rename = "comments_url")]
19    pub comments_url: String,
20    #[serde(rename = "commit")]
21    pub commit: Box<models::WebhookStatusCommitCommit>,
22    #[serde(rename = "committer", deserialize_with = "Option::deserialize")]
23    pub committer: Option<Box<models::User3>>,
24    #[serde(rename = "html_url")]
25    pub html_url: String,
26    #[serde(rename = "node_id")]
27    pub node_id: String,
28    #[serde(rename = "parents")]
29    pub parents: Vec<models::WebhookStatusCommitParentsInner>,
30    #[serde(rename = "sha")]
31    pub sha: String,
32    #[serde(rename = "url")]
33    pub url: String,
34}
35
36impl WebhookStatusCommit {
37    pub fn new(author: Option<models::User3>, comments_url: String, commit: models::WebhookStatusCommitCommit, committer: Option<models::User3>, html_url: String, node_id: String, parents: Vec<models::WebhookStatusCommitParentsInner>, sha: String, url: String) -> WebhookStatusCommit {
38        WebhookStatusCommit {
39            author: author.map(Box::new),
40            comments_url,
41            commit: Box::new(commit),
42            committer: committer.map(Box::new),
43            html_url,
44            node_id,
45            parents,
46            sha,
47            url,
48        }
49    }
50}
51