openapi_github/models/
content_tree.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/// ContentTree : Content Tree
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContentTree {
17    #[serde(rename = "type")]
18    pub r#type: String,
19    #[serde(rename = "size")]
20    pub size: i32,
21    #[serde(rename = "name")]
22    pub name: String,
23    #[serde(rename = "path")]
24    pub path: String,
25    #[serde(rename = "sha")]
26    pub sha: String,
27    #[serde(rename = "url")]
28    pub url: String,
29    #[serde(rename = "git_url", deserialize_with = "Option::deserialize")]
30    pub git_url: Option<String>,
31    #[serde(rename = "html_url", deserialize_with = "Option::deserialize")]
32    pub html_url: Option<String>,
33    #[serde(rename = "download_url", deserialize_with = "Option::deserialize")]
34    pub download_url: Option<String>,
35    #[serde(rename = "entries", skip_serializing_if = "Option::is_none")]
36    pub entries: Option<Vec<models::ContentTreeEntriesInner>>,
37    #[serde(rename = "_links")]
38    pub _links: Box<models::ContentTreeEntriesInnerLinks>,
39}
40
41impl ContentTree {
42    /// Content Tree
43    pub fn new(r#type: String, size: i32, name: String, path: String, sha: String, url: String, git_url: Option<String>, html_url: Option<String>, download_url: Option<String>, _links: models::ContentTreeEntriesInnerLinks) -> ContentTree {
44        ContentTree {
45            r#type,
46            size,
47            name,
48            path,
49            sha,
50            url,
51            git_url,
52            html_url,
53            download_url,
54            entries: None,
55            _links: Box::new(_links),
56        }
57    }
58}
59