openapi_github/models/
webhook_installation_repositories_added.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 WebhookInstallationRepositoriesAdded {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
19    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
20    #[serde(rename = "installation")]
21    pub installation: Box<models::Installation>,
22    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
23    pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
24    /// An array of repository objects, which were added to the installation.
25    #[serde(rename = "repositories_added")]
26    pub repositories_added: Vec<models::WebhooksRepositoriesInner>,
27    /// An array of repository objects, which were removed from the installation.
28    #[serde(rename = "repositories_removed")]
29    pub repositories_removed: Vec<models::WebhookInstallationRepositoriesAddedRepositoriesRemovedInner>,
30    #[serde(rename = "repository", skip_serializing_if = "Option::is_none")]
31    pub repository: Option<Box<models::RepositoryWebhooks>>,
32    #[serde(rename = "repository_selection")]
33    pub repository_selection: models::WebhooksRepositorySelection,
34    #[serde(rename = "requester", deserialize_with = "Option::deserialize")]
35    pub requester: Option<Box<models::WebhooksUser>>,
36    #[serde(rename = "sender")]
37    pub sender: Box<models::SimpleUserWebhooks>,
38}
39
40impl WebhookInstallationRepositoriesAdded {
41    pub fn new(action: Action, installation: models::Installation, repositories_added: Vec<models::WebhooksRepositoriesInner>, repositories_removed: Vec<models::WebhookInstallationRepositoriesAddedRepositoriesRemovedInner>, repository_selection: models::WebhooksRepositorySelection, requester: Option<models::WebhooksUser>, sender: models::SimpleUserWebhooks) -> WebhookInstallationRepositoriesAdded {
42        WebhookInstallationRepositoriesAdded {
43            action,
44            enterprise: None,
45            installation: Box::new(installation),
46            organization: None,
47            repositories_added,
48            repositories_removed,
49            repository: None,
50            repository_selection,
51            requester: requester.map(Box::new),
52            sender: Box::new(sender),
53        }
54    }
55}
56/// 
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum Action {
59    #[serde(rename = "added")]
60    Added,
61}
62
63impl Default for Action {
64    fn default() -> Action {
65        Self::Added
66    }
67}
68