openapi_github/models/
gist.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/// Gist : Gist
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Gist {
17    #[serde(rename = "url")]
18    pub url: String,
19    #[serde(rename = "forks_url")]
20    pub forks_url: String,
21    #[serde(rename = "commits_url")]
22    pub commits_url: String,
23    #[serde(rename = "id")]
24    pub id: String,
25    #[serde(rename = "node_id")]
26    pub node_id: String,
27    #[serde(rename = "git_pull_url")]
28    pub git_pull_url: String,
29    #[serde(rename = "git_push_url")]
30    pub git_push_url: String,
31    #[serde(rename = "html_url")]
32    pub html_url: String,
33    #[serde(rename = "files")]
34    pub files: std::collections::HashMap<String, models::BaseGistFilesValue>,
35    #[serde(rename = "public")]
36    pub public: bool,
37    #[serde(rename = "created_at")]
38    pub created_at: String,
39    #[serde(rename = "updated_at")]
40    pub updated_at: String,
41    #[serde(rename = "description", deserialize_with = "Option::deserialize")]
42    pub description: Option<String>,
43    #[serde(rename = "comments")]
44    pub comments: i32,
45    #[serde(rename = "user", deserialize_with = "Option::deserialize")]
46    pub user: Option<Box<models::NullableSimpleUser>>,
47    #[serde(rename = "comments_url")]
48    pub comments_url: String,
49    #[serde(rename = "owner", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub owner: Option<Option<Box<models::NullableSimpleUser>>>,
51    #[serde(rename = "truncated", skip_serializing_if = "Option::is_none")]
52    pub truncated: Option<bool>,
53    #[serde(rename = "forks", skip_serializing_if = "Option::is_none")]
54    pub forks: Option<Vec<serde_json::Value>>,
55    #[serde(rename = "history", skip_serializing_if = "Option::is_none")]
56    pub history: Option<Vec<serde_json::Value>>,
57}
58
59impl Gist {
60    /// Gist
61    pub fn new(url: String, forks_url: String, commits_url: String, id: String, node_id: String, git_pull_url: String, git_push_url: String, html_url: String, files: std::collections::HashMap<String, models::BaseGistFilesValue>, public: bool, created_at: String, updated_at: String, description: Option<String>, comments: i32, user: Option<models::NullableSimpleUser>, comments_url: String) -> Gist {
62        Gist {
63            url,
64            forks_url,
65            commits_url,
66            id,
67            node_id,
68            git_pull_url,
69            git_push_url,
70            html_url,
71            files,
72            public,
73            created_at,
74            updated_at,
75            description,
76            comments,
77            user: user.map(Box::new),
78            comments_url,
79            owner: None,
80            truncated: None,
81            forks: None,
82            history: None,
83        }
84    }
85}
86