#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum ListingSort {
#[serde(rename = "asc")]
Asc,
#[serde(rename = "desc")]
Desc,
}
#[derive(Debug, Clone, Copy, Serialize, Deserialize)]
pub enum ListingVisibility {
#[serde(rename = "public")]
Public,
#[serde(rename = "internal")]
Internal,
#[serde(rename = "private")]
Private,
}
#[derive(Debug, Serialize, Deserialize)]
enum IssueState {
#[serde(rename = "opened")]
Opened,
#[serde(rename = "closed")]
Closed,
}
#[derive(Debug, Serialize, Deserialize)]
enum UserState {
#[serde(rename = "active")]
Active,
#[serde(rename = "blocked")]
Blocked,
}
#[derive(Debug, Serialize, Deserialize)]
enum MilestoneState {
#[serde(rename = "active")]
Active,
#[serde(rename = "closed")]
Closed,
}
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
pub enum MergeRequestState {
#[serde(rename = "merged")]
Merged,
#[serde(rename = "opened")]
Opened,
#[serde(rename = "closed")]
Closed,
#[serde(rename = "all")]
All,
}
#[derive(Debug, Serialize, Deserialize)]
enum MergeRequestStatus {
#[serde(rename = "can_be_merged")]
CanBeMerged,
#[serde(rename = "cannot_be_merged")]
CannotBeMerged,
#[serde(rename = "unchecked")]
Unchecked,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Version {
pub version: String,
pub revision: String,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Group {
pub id: i64,
pub name: String,
pub path: String,
pub description: String,
pub visibility_level: i64,
pub lfs_enabled: bool,
pub avatar_url: Option<String>,
pub web_url: String,
pub request_access_enabled: bool,
}
pub type Groups = Vec<Group>;
#[derive(Debug, Serialize, Deserialize)]
pub struct ProjectOwner {
pub name: String,
pub username: String,
pub id: i64,
pub state: String,
pub avatar_url: String,
pub web_url: String,
}
#[derive(Debug, Serialize, Deserialize)]
struct ProjectNamespaceAvatar {
url: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
struct ProjectNamespace {
id: i64,
name: String,
path: String,
owner_id: Option<i64>, created_at: String, updated_at: String, description: String,
avatar: Option<ProjectNamespaceAvatar>,
membership_lock: Option<bool>,
share_with_group_lock: bool,
visibility_level: i64,
request_access_enabled: bool,
ldap_sync_status: Option<String>,
ldap_sync_error: Option<String>, ldap_sync_last_update_at: Option<String>, ldap_sync_last_successful_update_at: Option<String>, ldap_sync_last_sync_at: Option<String>, deleted_at: Option<String>, lfs_enabled: Option<String>, repository_size_limit: Option<String> }
#[derive(Debug, Serialize, Deserialize)]
struct ProjectForkedFrom {
id: i64,
http_url_to_repo: String,
web_url: String,
name: String,
name_with_namespace: String,
path: String,
path_with_namespace: String,
}
#[derive(Debug, Serialize, Deserialize)]
struct ProjectAccess {
access_level: i64,
notification_level: i64,
}
#[derive(Debug, Serialize, Deserialize)]
struct ProjectPermissions {
project_access: Option<ProjectAccess>,
group_access: Option<ProjectAccess>,
}
#[derive(Debug, Serialize, Deserialize)]
struct ProjectSharedWithGroup {
group_id: i64,
group_name: String,
group_access_level: i64,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Project {
id: i64,
description: String,
default_branch: Option<String>,
tag_list: Vec<String>,
public: bool,
archived: bool,
visibility_level: i64,
ssh_url_to_repo: String,
http_url_to_repo: String,
web_url: String,
name: String,
name_with_namespace: String,
path: String,
path_with_namespace: String,
container_registry_enabled: Option<bool>,
issues_enabled: bool,
merge_requests_enabled: bool,
wiki_enabled: bool,
builds_enabled: bool,
snippets_enabled: bool,
created_at: String, last_activity_at: String, shared_runners_enabled: bool,
lfs_enabled: bool,
creator_id: i64,
namespace: ProjectNamespace,
forked_from_project: Option<ProjectForkedFrom>,
avatar_url: Option<String>,
star_count: i64,
forks_count: i64,
open_issues_count: i64,
runners_token: Option<String>,
public_builds: bool,
shared_with_groups: Vec<ProjectSharedWithGroup>,
only_allow_merge_if_build_succeeds: bool,
request_access_enabled: bool,
only_allow_merge_if_all_discussions_are_resolved: Option<bool>, approvals_before_merge: Option<i64>,
permissions: ProjectPermissions,
}
pub type Projects = Vec<Project>;
#[derive(Debug, Serialize, Deserialize)]
struct Milestone {
id: i64,
iid: i64,
project_id: i64,
title: String,
description: String,
state: MilestoneState,
created_at: String, updated_at: String, due_date: Option<String> }
#[derive(Debug, Serialize, Deserialize)]
struct User {
name: String,
username: String,
id: i64,
state: UserState,
avatar_url: Option<String>,
web_url: Option<String>
}
#[derive(Debug, Serialize, Deserialize)]
pub struct Issue {
id: i64,
iid: i64,
project_id: i64,
title: String,
description: String,
state: IssueState,
created_at: String, updated_at: String, labels: Vec<String>,
milestone: Option<Milestone>,
assignee: Option<User>,
author: User,
subscribed: bool,
user_notes_count: i64,
upvotes: i64,
downvotes: i64,
due_date: Option<String>, confidential: bool,
web_url: Option<String>
}
pub type Issues = Vec<Issue>;
#[derive(Debug, Serialize, Deserialize)]
pub struct MergeRequest {
id: i64,
iid: i64,
project_id: i64,
title: String,
description: String,
state: MergeRequestState,
created_at: String, updated_at: String, target_branch: String,
source_branch: String,
upvotes: i64,
downvotes: i64,
author: User,
assignee: Option<User>,
source_project_id: i64,
target_project_id: i64,
labels: Vec<String>,
work_in_progress: bool,
milestone: Option<Milestone>,
merge_when_build_succeeds: bool,
merge_status: MergeRequestStatus,
sha: String,
merge_commit_sha: Option<String>,
subscribed: bool,
user_notes_count: i64,
should_remove_source_branch: Option<bool>,
force_remove_source_branch: Option<bool>,
web_url: String
}
pub type MergeRequests = Vec<MergeRequest>;