1 |
use serde::{Deserialize, Serialize};
|
2 |
|
3 |
use crate::model::repository::RepositoryVisibility;
|
4 |
use crate::model::{
|
5 |
repository::{Commit, Repository, RepositoryTreeEntry},
|
6 |
user::User,
|
7 |
};
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
23 |
pub struct RepositoryCreateRequest {
|
24 |
pub name: String,
|
25 |
pub description: Option<String>,
|
26 |
pub visibility: RepositoryVisibility,
|
27 |
pub default_branch: String,
|
28 |
pub owner: User,
|
29 |
}
|
30 |
|
31 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
32 |
pub struct RepositoryCreateResponse;
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
44 |
pub struct RepositoryFileInspectRequest {
|
45 |
pub path: RepositoryTreeEntry,
|
46 |
}
|
47 |
|
48 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
49 |
pub enum RepositoryFileInspectionResponse {
|
50 |
File {
|
51 |
commit_metadata: Commit,
|
52 |
},
|
53 |
Folder {
|
54 |
commit_metadata: Commit,
|
55 |
members: Vec<RepositoryTreeEntry>,
|
56 |
},
|
57 |
Invalid {
|
58 |
path: RepositoryTreeEntry,
|
59 |
},
|
60 |
}
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
72 |
pub struct RepositoryIssuesCountRequest;
|
73 |
|
74 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
75 |
pub struct RepositoryIssuesCountResponse {
|
76 |
pub count: u64,
|
77 |
}
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
89 |
pub struct RepositoryIssueLabelsRequest;
|
90 |
|
91 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
92 |
pub struct RepositoryIssueLabelsResponse {
|
93 |
pub labels: Vec<IssueLabel>,
|
94 |
}
|
95 |
|
96 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
97 |
pub struct IssueLabel {
|
98 |
pub name: String,
|
99 |
pub color: String,
|
100 |
}
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
112 |
pub struct RepositoryIssuesRequest;
|
113 |
|
114 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
115 |
pub struct RepositoryIssuesResponse {
|
116 |
pub issues: Vec<RepositoryIssue>,
|
117 |
}
|
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
|
127 |
|
128 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
129 |
pub struct RepositoryIssue {
|
130 |
pub author: User,
|
131 |
pub id: u64,
|
132 |
pub title: String,
|
133 |
pub contents: String,
|
134 |
pub labels: Vec<IssueLabel>,
|
135 |
}
|
136 |
|
137 |
#[derive(Clone, Debug, Serialize, Deserialize)]
|
138 |
pub struct RepositoryInfoRequest {
|
139 |
pub repository: Repository,
|
140 |
|
141 |
pub extra_metadata: bool,
|
142 |
|
143 |
pub rev: Option<String>,
|
144 |
|
145 |
pub path: Option<String>,
|
146 |
}
|
147 |
|