1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GitCreateTreeRequestTreeInner {
/// The file referenced in the tree.
#[serde(rename = "path", skip_serializing_if = "Option::is_none")]
pub path: Option<String>,
/// The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink.
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<Mode>,
/// Either `blob`, `tree`, or `commit`.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.
#[serde(rename = "sha", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub sha: Option<Option<String>>,
/// The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error.
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
}
impl GitCreateTreeRequestTreeInner {
pub fn new() -> GitCreateTreeRequestTreeInner {
GitCreateTreeRequestTreeInner {
path: None,
mode: None,
r#type: None,
sha: None,
content: None,
}
}
}
/// The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Mode {
#[serde(rename = "100644")]
Variant100644,
#[serde(rename = "100755")]
Variant100755,
#[serde(rename = "040000")]
Variant040000,
#[serde(rename = "160000")]
Variant160000,
#[serde(rename = "120000")]
Variant120000,
}
impl Default for Mode {
fn default() -> Mode {
Self::Variant100644
}
}
/// Either `blob`, `tree`, or `commit`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "blob")]
Blob,
#[serde(rename = "tree")]
Tree,
#[serde(rename = "commit")]
Commit,
}
impl Default for Type {
fn default() -> Type {
Self::Blob
}
}