openapi_github/models/
orgs_create_webhook_request.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 OrgsCreateWebhookRequest {
16    /// Must be passed as \"web\".
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "config")]
20    pub config: Box<models::OrgsCreateWebhookRequestConfig>,
21    /// Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. Set to `[\"*\"]` to receive all possible events.
22    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
23    pub events: Option<Vec<String>>,
24    /// Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.
25    #[serde(rename = "active", skip_serializing_if = "Option::is_none")]
26    pub active: Option<bool>,
27}
28
29impl OrgsCreateWebhookRequest {
30    pub fn new(name: String, config: models::OrgsCreateWebhookRequestConfig) -> OrgsCreateWebhookRequest {
31        OrgsCreateWebhookRequest {
32            name,
33            config: Box::new(config),
34            events: None,
35            active: None,
36        }
37    }
38}
39