openapi_github/models/
webhook_repository_dispatch_sample.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct WebhookRepositoryDispatchSample {
16 #[serde(rename = "action")]
18 pub action: String,
19 #[serde(rename = "branch")]
20 pub branch: String,
21 #[serde(rename = "client_payload", deserialize_with = "Option::deserialize")]
23 pub client_payload: Option<std::collections::HashMap<String, serde_json::Value>>,
24 #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
25 pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
26 #[serde(rename = "installation")]
27 pub installation: Box<models::SimpleInstallation>,
28 #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
29 pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
30 #[serde(rename = "repository")]
31 pub repository: Box<models::RepositoryWebhooks>,
32 #[serde(rename = "sender")]
33 pub sender: Box<models::SimpleUserWebhooks>,
34}
35
36impl WebhookRepositoryDispatchSample {
37 pub fn new(action: String, branch: String, client_payload: Option<std::collections::HashMap<String, serde_json::Value>>, installation: models::SimpleInstallation, repository: models::RepositoryWebhooks, sender: models::SimpleUserWebhooks) -> WebhookRepositoryDispatchSample {
38 WebhookRepositoryDispatchSample {
39 action,
40 branch,
41 client_payload,
42 enterprise: None,
43 installation: Box::new(installation),
44 organization: None,
45 repository: Box::new(repository),
46 sender: Box::new(sender),
47 }
48 }
49}
50