openapi_github/models/
webhook_deployment_created.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 WebhookDeploymentCreated {
16    #[serde(rename = "action")]
17    pub action: Action,
18    #[serde(rename = "deployment")]
19    pub deployment: Box<models::Deployment>,
20    #[serde(rename = "enterprise", skip_serializing_if = "Option::is_none")]
21    pub enterprise: Option<Box<models::EnterpriseWebhooks>>,
22    #[serde(rename = "installation", skip_serializing_if = "Option::is_none")]
23    pub installation: Option<Box<models::SimpleInstallation>>,
24    #[serde(rename = "organization", skip_serializing_if = "Option::is_none")]
25    pub organization: Option<Box<models::OrganizationSimpleWebhooks>>,
26    #[serde(rename = "repository")]
27    pub repository: Box<models::RepositoryWebhooks>,
28    #[serde(rename = "sender")]
29    pub sender: Box<models::SimpleUserWebhooks>,
30    #[serde(rename = "workflow", deserialize_with = "Option::deserialize")]
31    pub workflow: Option<Box<models::WebhooksWorkflow>>,
32    #[serde(rename = "workflow_run", deserialize_with = "Option::deserialize")]
33    pub workflow_run: Option<Box<models::DeploymentWorkflowRun>>,
34}
35
36impl WebhookDeploymentCreated {
37    pub fn new(action: Action, deployment: models::Deployment, repository: models::RepositoryWebhooks, sender: models::SimpleUserWebhooks, workflow: Option<models::WebhooksWorkflow>, workflow_run: Option<models::DeploymentWorkflowRun>) -> WebhookDeploymentCreated {
38        WebhookDeploymentCreated {
39            action,
40            deployment: Box::new(deployment),
41            enterprise: None,
42            installation: None,
43            organization: None,
44            repository: Box::new(repository),
45            sender: Box::new(sender),
46            workflow: workflow.map(Box::new),
47            workflow_run: workflow_run.map(Box::new),
48        }
49    }
50}
51/// 
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum Action {
54    #[serde(rename = "created")]
55    Created,
56}
57
58impl Default for Action {
59    fn default() -> Action {
60        Self::Created
61    }
62}
63