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