openapi_github/models/
enterprise_webhooks.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/// EnterpriseWebhooks : An enterprise on GitHub. Webhook payloads contain the `enterprise` property when the webhook is configured on an enterprise account or an organization that's part of an enterprise account. For more information, see \"[About enterprise accounts](https://docs.github.com/admin/overview/about-enterprise-accounts).\" 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EnterpriseWebhooks {
17    /// A short description of the enterprise.
18    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub description: Option<Option<String>>,
20    #[serde(rename = "html_url")]
21    pub html_url: String,
22    /// The enterprise's website URL.
23    #[serde(rename = "website_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub website_url: Option<Option<String>>,
25    /// Unique identifier of the enterprise
26    #[serde(rename = "id")]
27    pub id: i32,
28    #[serde(rename = "node_id")]
29    pub node_id: String,
30    /// The name of the enterprise.
31    #[serde(rename = "name")]
32    pub name: String,
33    /// The slug url identifier for the enterprise.
34    #[serde(rename = "slug")]
35    pub slug: String,
36    #[serde(rename = "created_at", deserialize_with = "Option::deserialize")]
37    pub created_at: Option<String>,
38    #[serde(rename = "updated_at", deserialize_with = "Option::deserialize")]
39    pub updated_at: Option<String>,
40    #[serde(rename = "avatar_url")]
41    pub avatar_url: String,
42}
43
44impl EnterpriseWebhooks {
45    /// An enterprise on GitHub. Webhook payloads contain the `enterprise` property when the webhook is configured on an enterprise account or an organization that's part of an enterprise account. For more information, see \"[About enterprise accounts](https://docs.github.com/admin/overview/about-enterprise-accounts).\" 
46    pub fn new(html_url: String, id: i32, node_id: String, name: String, slug: String, created_at: Option<String>, updated_at: Option<String>, avatar_url: String) -> EnterpriseWebhooks {
47        EnterpriseWebhooks {
48            description: None,
49            html_url,
50            website_url: None,
51            id,
52            node_id,
53            name,
54            slug,
55            created_at,
56            updated_at,
57            avatar_url,
58        }
59    }
60}
61