openapi_github/models/
apps_create_from_manifest_201_response.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 AppsCreateFromManifest201Response {
16    /// Unique identifier of the GitHub app
17    #[serde(rename = "id")]
18    pub id: i32,
19    /// The slug name of the GitHub app
20    #[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
21    pub slug: Option<String>,
22    #[serde(rename = "node_id")]
23    pub node_id: String,
24    #[serde(rename = "owner", deserialize_with = "Option::deserialize")]
25    pub owner: Option<Box<models::NullableSimpleUser>>,
26    /// The name of the GitHub app
27    #[serde(rename = "name")]
28    pub name: String,
29    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
30    pub description: Option<String>,
31    #[serde(rename = "external_url")]
32    pub external_url: String,
33    #[serde(rename = "html_url")]
34    pub html_url: String,
35    #[serde(rename = "created_at")]
36    pub created_at: String,
37    #[serde(rename = "updated_at")]
38    pub updated_at: String,
39    #[serde(rename = "permissions")]
40    pub permissions: models::IntegrationPermissions,
41    /// The list of events for the GitHub app
42    #[serde(rename = "events")]
43    pub events: Vec<String>,
44    /// The number of installations associated with the GitHub app
45    #[serde(rename = "installations_count", skip_serializing_if = "Option::is_none")]
46    pub installations_count: Option<i32>,
47    #[serde(rename = "client_id")]
48    pub client_id: String,
49    #[serde(rename = "client_secret")]
50    pub client_secret: String,
51    #[serde(rename = "webhook_secret", deserialize_with = "Option::deserialize")]
52    pub webhook_secret: Option<String>,
53    #[serde(rename = "pem")]
54    pub pem: String,
55}
56
57impl AppsCreateFromManifest201Response {
58    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>, client_id: String, client_secret: String, webhook_secret: Option<String>, pem: String) -> AppsCreateFromManifest201Response {
59        AppsCreateFromManifest201Response {
60            id,
61            slug: None,
62            node_id,
63            owner: owner.map(Box::new),
64            name,
65            description,
66            external_url,
67            html_url,
68            created_at,
69            updated_at,
70            permissions,
71            events,
72            installations_count: None,
73            client_id,
74            client_secret,
75            webhook_secret,
76            pem,
77        }
78    }
79}
80