openapi_github/models/
content_directory_inner.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 ContentDirectoryInner {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    #[serde(rename = "size")]
19    pub size: i32,
20    #[serde(rename = "name")]
21    pub name: String,
22    #[serde(rename = "path")]
23    pub path: String,
24    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
25    pub content: Option<String>,
26    #[serde(rename = "sha")]
27    pub sha: String,
28    #[serde(rename = "url")]
29    pub url: String,
30    #[serde(rename = "git_url", deserialize_with = "Option::deserialize")]
31    pub git_url: Option<String>,
32    #[serde(rename = "html_url", deserialize_with = "Option::deserialize")]
33    pub html_url: Option<String>,
34    #[serde(rename = "download_url", deserialize_with = "Option::deserialize")]
35    pub download_url: Option<String>,
36    #[serde(rename = "_links")]
37    pub _links: Box<models::ContentTreeEntriesInnerLinks>,
38}
39
40impl ContentDirectoryInner {
41    pub fn new(r#type: Type, 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) -> ContentDirectoryInner {
42        ContentDirectoryInner {
43            r#type,
44            size,
45            name,
46            path,
47            content: None,
48            sha,
49            url,
50            git_url,
51            html_url,
52            download_url,
53            _links: Box::new(_links),
54        }
55    }
56}
57/// 
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Type {
60    #[serde(rename = "dir")]
61    Dir,
62    #[serde(rename = "file")]
63    File,
64    #[serde(rename = "submodule")]
65    Submodule,
66    #[serde(rename = "symlink")]
67    Symlink,
68}
69
70impl Default for Type {
71    fn default() -> Type {
72        Self::Dir
73    }
74}
75