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