openapi_github/models/
webhook_pull_request_synchronize.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 WebhookPullRequestSynchronize {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "after")]
19    pub after: String,
20    #[serde(rename = "before")]
21    pub before: String,
22    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
23    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
24    #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
25    pub installation: Option<Box<models::SimpleInstallation>>,
26    /// The pull request number.
27    #[serde(rename = "number")]
28    pub number: i32,
29    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
30    pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
31    #[serde(rename = "pull_request")]
32    pub pull_request: Box<models::PullRequest10>,
33    #[serde(rename = "repository")]
34    pub repository: Box<models::RepositoryWebhooks>,
35    #[serde(rename = "sender")]
36    pub sender: Box<models::SimpleUserWebhooks>,
37}
38
39impl WebhookPullRequestSynchronize {
40    pub fn new(action: Action, after: String, before: String, number: i32, pull_request: models::PullRequest10, repository: models::RepositoryWebhooks, sender: models::SimpleUserWebhooks) -> WebhookPullRequestSynchronize {
41        WebhookPullRequestSynchronize {
42            action,
43            after,
44            before,
45            enterprise: None,
46            installation: None,
47            number,
48            organization: None,
49            pull_request: Box::new(pull_request),
50            repository: Box::new(repository),
51            sender: Box::new(sender),
52        }
53    }
54}
55/// 
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Action {
58    #[serde(rename = "synchronize")]
59    Synchronize,
60}
61
62impl Default for Action {
63    fn default() -> Action {
64        Self::Synchronize
65    }
66}
67