Skip to main content

tatuin_providers/gitlab/
structs.rs

1// SPDX-License-Identifier: MIT
2
3use serde::Deserialize;
4use serde::Serialize;
5
6#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct Todo {
8    pub id: i64,
9    pub project: Option<Project>,
10    pub author: Option<Author>,
11    pub action_name: Option<String>,
12    pub target_type: String,
13    pub target: Option<Target>,
14    pub target_url: String,
15    pub body: String,
16    pub state: String,
17    pub created_at: String,
18    pub updated_at: Option<String>,
19}
20
21#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
22pub struct Project {
23    pub id: i64,
24    pub name: String,
25    pub name_with_namespace: Option<String>,
26    pub path: String,
27    pub path_with_namespace: Option<String>,
28}
29
30#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
31pub struct Author {
32    pub name: Option<String>,
33    pub username: Option<String>,
34    pub id: Option<i64>,
35    pub state: Option<String>,
36    pub avatar_url: Option<String>,
37    pub web_url: Option<String>,
38}
39
40#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
41pub struct Target {
42    pub id: i64,
43    pub iid: i64,
44    pub project_id: i64,
45    pub title: String,
46    pub description: Option<String>,
47    pub state: Option<String>,
48    pub created_at: Option<String>,
49    pub updated_at: Option<String>,
50    pub target_branch: Option<String>,
51    pub source_branch: Option<String>,
52    pub upvotes: Option<i64>,
53    pub downvotes: Option<i64>,
54    pub author: Option<Author>,
55    pub assignee: Option<Assignee>,
56    pub source_project_id: Option<i64>,
57    pub target_project_id: Option<i64>,
58    pub labels: Option<Vec<String>>,
59    pub draft: Option<bool>,
60    pub work_in_progress: Option<bool>,
61    pub milestone: Option<Milestone>,
62    pub merge_when_pipeline_succeeds: Option<bool>,
63    pub merge_status: Option<String>,
64    pub user_notes_count: Option<i64>,
65}
66
67#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
68pub struct Assignee {
69    pub name: Option<String>,
70    pub username: Option<String>,
71    pub id: Option<i64>,
72    pub state: Option<String>,
73    pub avatar_url: Option<String>,
74    pub web_url: Option<String>,
75}
76
77#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
78pub struct Milestone {
79    pub id: Option<i64>,
80    pub iid: Option<i64>,
81    pub project_id: Option<i64>,
82    pub title: Option<String>,
83    pub description: Option<String>,
84    pub state: Option<String>,
85    pub created_at: Option<String>,
86    pub updated_at: Option<String>,
87    pub due_date: Option<String>,
88}
89
90#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
91pub struct Issue {
92    pub state: Option<String>,
93    pub description: Option<String>,
94    pub id: i64,
95    pub project_id: i64,
96    pub title: Option<String>,
97    pub created_at: String,
98    pub iid: i64,
99    pub due_date: Option<String>,
100    pub issue_type: String,
101}