openapi_github/models/
nullable_integration.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/// NullableIntegration : GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct NullableIntegration {
17    /// Unique identifier of the GitHub app
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// The slug name of the GitHub app
21    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
22    pub slug: Option<String>,
23    #[serde(rename = "node_id")]
24    pub node_id: String,
25    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
26    pub owner: Option<Box<models::NullableSimpleUser>>,
27    /// The name of the GitHub app
28    #[serde(rename = "name")]
29    pub name: String,
30    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
31    pub description: Option<String>,
32    #[serde(rename = "external_url")]
33    pub external_url: String,
34    #[serde(rename = "html_url")]
35    pub html_url: String,
36    #[serde(rename = "created_at")]
37    pub created_at: String,
38    #[serde(rename = "updated_at")]
39    pub updated_at: String,
40    #[serde(rename = "permissions")]
41    pub permissions: models::IntegrationPermissions,
42    /// The list of events for the GitHub app
43    #[serde(rename = "events")]
44    pub events: Vec<String>,
45    /// The number of installations associated with the GitHub app
46    #[serde(rename = "installations_count", skip_serializing_if = "Option::is_none")]
47    pub installations_count: Option<i32>,
48    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
49    pub client_id: Option<String>,
50    #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
51    pub client_secret: Option<String>,
52    #[serde(rename = "webhook_secret", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub webhook_secret: Option<Option<String>>,
54    #[serde(rename = "pem", skip_serializing_if = "Option::is_none")]
55    pub pem: Option<String>,
56}
57
58impl NullableIntegration {
59    /// GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
60    pub fn new(id: i32, node_id: String, owner: Option<models::NullableSimpleUser>, name: String, description: Option<String>, external_url: String, html_url: String, created_at: String, updated_at: String, permissions: models::IntegrationPermissions, events: Vec<String>) -> NullableIntegration {
61        NullableIntegration {
62            id,
63            slug: None,
64            node_id,
65            owner: owner.map(Box::new),
66            name,
67            description,
68            external_url,
69            html_url,
70            created_at,
71            updated_at,
72            permissions,
73            events,
74            installations_count: None,
75            client_id: None,
76            client_secret: None,
77            webhook_secret: None,
78            pem: None,
79        }
80    }
81}
82