Commit f8c93940 authored by Brad King's avatar Brad King
Browse files

types: update for 12.1

Projects gained fields for visibility of individual features.

They also gained fields for devops and build configuration.
Leave out bindings for these for now.
parent b8d338af
......@@ -9,7 +9,14 @@
"self": "https://gitlab.kitware.com/api/v4/projects/855"
},
"archived": false,
"auto_cancel_pending_pipelines": "enabled",
"auto_devops_deploy_strategy": "continuous",
"auto_devops_enabled": false,
"avatar_url": null,
"build_coverage_regex": "",
"build_git_strategy": "fetch",
"build_timeout": 3600,
"builds_access_level": "disabled",
"ci_config_path": null,
"ci_default_git_depth": null,
"container_registry_enabled": true,
......@@ -18,17 +25,18 @@
"default_branch": "master",
"description": "Rust library for communicating with a Gitlab instance.",
"empty_repo": false,
"external_authorization_classification_label": null,
"forks_count": 17,
"http_url_to_repo": "https://gitlab.kitware.com/utils/rust-gitlab.git",
"id": 855,
"import_error": null,
"import_status": "none",
"issues_access_level": "enabled",
"issues_enabled": true,
"jobs_enabled": false,
"last_activity_at": "2019-07-30T12:42:57.649-04:00",
"lfs_enabled": true,
"merge_method": "merge",
"merge_requests_access_level": "enabled",
"merge_requests_enabled": true,
"name": "rust-gitlab",
"name_with_namespace": "Utils / rust-gitlab",
......@@ -57,15 +65,18 @@
"printing_merge_request_link_enabled": true,
"public_jobs": true,
"readme_url": "https://gitlab.kitware.com/utils/rust-gitlab/blob/master/README.md",
"repository_access_level": "enabled",
"request_access_enabled": true,
"resolve_outdated_diff_discussions": null,
"shared_runners_enabled": true,
"shared_with_groups": [],
"snippets_access_level": "disabled",
"snippets_enabled": false,
"ssh_url_to_repo": "git@gitlab.kitware.com:utils/rust-gitlab.git",
"star_count": 6,
"tag_list": [],
"visibility": "public",
"web_url": "https://gitlab.kitware.com/utils/rust-gitlab",
"wiki_access_level": "enabled",
"wiki_enabled": true
}
......@@ -544,6 +544,13 @@ fn test_read_project() {
assert_eq!(project.snippets_enabled, false);
assert_eq!(project.wiki_enabled, true);
assert_eq!(project.builds_access_level, FeatureVisibilityLevel::Disabled);
assert_eq!(project.issues_access_level, FeatureVisibilityLevel::Enabled);
assert_eq!(project.merge_requests_access_level, FeatureVisibilityLevel::Enabled);
assert_eq!(project.repository_access_level, FeatureVisibilityLevel::Enabled);
assert_eq!(project.snippets_access_level, FeatureVisibilityLevel::Disabled);
assert_eq!(project.wiki_access_level, FeatureVisibilityLevel::Enabled);
assert_eq!(project.merge_method, Some("merge".to_string()));
if let Some(ref permissions) = project.permissions {
if let Some(ref group_access) = permissions.group_access {
......
......@@ -468,6 +468,25 @@ enum_serialize!(VisibilityLevel -> "visibility level",
Private => "private",
);
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
/// Visibility levels for project features.
pub enum FeatureVisibilityLevel {
/// Feature is disabled.
Disabled,
/// Feature is enabled and accessible privately.
Private,
/// Feature is enabled and accessible with project-wide visibility level.
Enabled,
/// Feature is enabled and accessible publicly.
Public,
}
enum_serialize!(FeatureVisibilityLevel -> "feature visibility level",
Disabled => "disabled",
Private => "private",
Enabled => "enabled",
Public => "public",
);
// TODO: enum for NotificationLevel
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
......@@ -628,6 +647,19 @@ pub struct Project {
/// Whether the project wiki is enabled or not.
pub wiki_enabled: bool,
/// Visibility of builds.
pub builds_access_level: FeatureVisibilityLevel,
/// Visibility of issues.
pub issues_access_level: FeatureVisibilityLevel,
/// Visibility of merge requests.
pub merge_requests_access_level: FeatureVisibilityLevel,
/// Visibility of repository.
pub repository_access_level: FeatureVisibilityLevel,
/// Visibility of snippets.
pub snippets_access_level: FeatureVisibilityLevel,
/// Visibility of wiki.
pub wiki_access_level: FeatureVisibilityLevel,
/// The merge method used when merging merge request.
pub merge_method: Option<String>,
/// Statistics about the project.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment