Commit 92bb1e21 authored by Brad King's avatar Brad King
Browse files

Merge topic '8.16'

363083c3 types: update for 8.16
d41cb19e types: update for 8.15
64459cbc types: update for UserFull's rename upstream
f5fd77d5 types: remove ProjectNamespace
6d4484ef

 data: add missing newlines
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !66
parents 3c136d03 363083c3
......@@ -3,7 +3,7 @@
This library implements an interface to communicate with a Gitlab instance. Not
all API endpoints are implemented, but patches are welcome.
The API is based off of the 8.14.0 API and will likely aggressively track new
The API is based off of the 8.16.0 API and will likely aggressively track new
API additions, so the newest release may not support talking to older releases
where fields have been added..
......
{"awardable_type": "Note", "awardable_id": 177359, "name": "8ball", "created_at": "2016-12-07T11:23:46.742-05:00", "updated_at": "2016-12-07T11:23:46.742-05:00", "user": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "id": 335}
\ No newline at end of file
{"awardable_type": "Note", "awardable_id": 177359, "name": "8ball", "created_at": "2016-12-07T11:23:46.742-05:00", "updated_at": "2016-12-07T11:23:46.742-05:00", "user": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "id": 335}
{"author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "created_at": "2016-12-07T11:28:33.966-05:00", "note": "Example commit note for data fetching.", "line_type": null, "path": null, "line": null}
\ No newline at end of file
{"author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "created_at": "2016-12-07T11:28:33.966-05:00", "note": "Example commit note for data fetching.", "line_type": null, "path": null, "line": null}
{"status": "success", "target_url": "https://buildbot.kitware.com/builders/rust-gitlab-megas-linux-debug/builds/41", "name": "rust-gitlab-megas-linux-debug", "author": {"username": "buildbot", "web_url": "https://gitlab.kitware.com/buildbot", "name": "buildbot", "state": "active", "avatar_url": "https://gitlab.kitware.com/uploads/user/avatar/35/buildbot-logo.png", "id": 35}, "finished_at": "2016-11-08T09:35:32.629-05:00", "created_at": "2016-11-08T09:35:32.627-05:00", "allow_failure": false, "sha": "de4ac3cf96cb8a0893be22b03f5171d934f9d392", "started_at": null, "ref": "master", "id": 931434, "description": "expected"}
\ No newline at end of file
{"status": "success", "target_url": "https://buildbot.kitware.com/builders/rust-gitlab-megas-linux-debug/builds/41", "name": "rust-gitlab-megas-linux-debug", "author": {"username": "buildbot", "web_url": "https://gitlab.kitware.com/buildbot", "name": "buildbot", "state": "active", "avatar_url": "https://gitlab.kitware.com/uploads/user/avatar/35/buildbot-logo.png", "id": 35}, "finished_at": "2016-11-08T09:35:32.629-05:00", "created_at": "2016-11-08T09:35:32.627-05:00", "allow_failure": false, "sha": "de4ac3cf96cb8a0893be22b03f5171d934f9d392", "started_at": null, "ref": "master", "id": 931434, "description": "expected"}
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "description": "", "subscribed": true, "title": "fix documentation warnings", "created_at": "2016-10-30T14:54:28.954-04:00", "labels": [], "updated_at": "2016-10-30T14:54:29.242-04:00", "iid": 6, "state": "opened", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69328}
\ No newline at end of file
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "description": "", "subscribed": true, "title": "fix documentation warnings", "created_at": "2016-10-30T14:54:28.954-04:00", "labels": [], "updated_at": "2016-10-30T14:54:29.242-04:00", "iid": 6, "state": "opened", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69328}
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "subscribed": true, "title": "Add project hook APIs", "created_at": "2016-10-04T14:59:37.178-04:00", "labels": [], "updated_at": "2016-10-04T16:18:57.519-04:00", "iid": 5, "state": "closed", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69075}
\ No newline at end of file
{"due_date": null, "downvotes": 0, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "subscribed": true, "title": "Add project hook APIs", "created_at": "2016-10-04T14:59:37.178-04:00", "labels": [], "updated_at": "2016-10-04T16:18:57.519-04:00", "iid": 5, "state": "closed", "user_notes_count": 0, "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "milestone": null, "upvotes": 0, "project_id": 855, "confidential": false, "id": 69075}
{"username": "kwrobot", "web_url": "https://gitlab.kitware.com/kwrobot", "name": "Kitware Robot", "expires_at": null, "access_level": 50, "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "id": 11}
\ No newline at end of file
{"username": "kwrobot", "web_url": "https://gitlab.kitware.com/kwrobot", "name": "Kitware Robot", "expires_at": null, "access_level": 50, "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "id": 11}
{"target_project_id": 855, "source_branch": "migrate-to-reqwest", "downvotes": 0, "labels": [], "updated_at": "2016-12-07T10:45:22.184-05:00", "work_in_progress": false, "assignee": null, "user_notes_count": 7, "id": 21211, "force_remove_source_branch": true, "target_branch": "master", "subscribed": true, "title": "Migrate to reqwest", "merge_commit_sha": null, "state": "opened", "upvotes": 0, "project_id": 855, "description": "Currently, we cannot use both `rust-gitlab` (depending on `hyper`'s SSL support) and `libgit2` in the same application, because they require different versions of `rust-openssl` (hyper: 0.7.x, libgit2: 0.9.x).\r\n(I want to use the both libraries in my GitLab helper application.)\r\n\r\nseanmonstar (hyper's author) recommends using reqwest for HTTP clients.\r\n\r\nhttps://github.com/hyperium/hyper/issues/907#issuecomment-255509020\r\n\r\n> reqwest: Be the convenient, higher level Client crate. This will release very soon, and depend on rust-native-tls. Everyone using hyper for a client should be able to easily switch the reqwest, getting better TLS support immediately, and a (as much as possible) not-breaking API, even as hyper v0.10 comes out with its async Client.\r\n\r\nthoughts?\r\n\r\n(This MR is based on !51 changes)", "iid": 52, "milestone": null, "source_project_id": 1154, "merge_when_build_succeeds": false, "merge_status": "can_be_merged", "should_remove_source_branch": null, "created_at": "2016-12-07T09:43:31.653-05:00", "author": {"username": "gifnksm", "web_url": "https://gitlab.kitware.com/gifnksm", "name": "NAKASHIMA, Makoto", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/4f544d7f9fc4ae2b04512317f1a06b6e?s=80&d=identicon", "id": 1489}, "sha": "f2784e0607d08e79b361ccf58a8379b04de2df35", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/52"}
\ No newline at end of file
{"target_project_id": 855, "source_branch": "migrate-to-reqwest", "downvotes": 0, "labels": [], "updated_at": "2016-12-07T10:45:22.184-05:00", "work_in_progress": false, "assignee": null, "user_notes_count": 7, "id": 21211, "force_remove_source_branch": true, "target_branch": "master", "subscribed": true, "title": "Migrate to reqwest", "merge_commit_sha": null, "state": "opened", "upvotes": 0, "project_id": 855, "description": "Currently, we cannot use both `rust-gitlab` (depending on `hyper`'s SSL support) and `libgit2` in the same application, because they require different versions of `rust-openssl` (hyper: 0.7.x, libgit2: 0.9.x).\r\n(I want to use the both libraries in my GitLab helper application.)\r\n\r\nseanmonstar (hyper's author) recommends using reqwest for HTTP clients.\r\n\r\nhttps://github.com/hyperium/hyper/issues/907#issuecomment-255509020\r\n\r\n> reqwest: Be the convenient, higher level Client crate. This will release very soon, and depend on rust-native-tls. Everyone using hyper for a client should be able to easily switch the reqwest, getting better TLS support immediately, and a (as much as possible) not-breaking API, even as hyper v0.10 comes out with its async Client.\r\n\r\nthoughts?\r\n\r\n(This MR is based on !51 changes)", "iid": 52, "milestone": null, "source_project_id": 1154, "merge_when_build_succeeds": false, "merge_status": "can_be_merged", "should_remove_source_branch": null, "created_at": "2016-12-07T09:43:31.653-05:00", "author": {"username": "gifnksm", "web_url": "https://gitlab.kitware.com/gifnksm", "name": "NAKASHIMA, Makoto", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/4f544d7f9fc4ae2b04512317f1a06b6e?s=80&d=identicon", "id": 1489}, "sha": "f2784e0607d08e79b361ccf58a8379b04de2df35", "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/52"}
{"body": "Mentioned in commit 47d475d8625424bd37efd27f7097354306842b93", "downvote?": false, "author": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "created_at": "2016-10-04T16:18:57.786-04:00", "updated_at": "2016-10-04T16:18:57.786-04:00", "noteable_type": "MergeRequest", "system": true, "attachment": null, "noteable_id": 20215, "id": 177371, "upvote?": false}
\ No newline at end of file
{"body": "Mentioned in commit 47d475d8625424bd37efd27f7097354306842b93", "downvote?": false, "author": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "created_at": "2016-10-04T16:18:57.786-04:00", "updated_at": "2016-10-04T16:18:57.786-04:00", "noteable_type": "MergeRequest", "system": true, "attachment": null, "noteable_id": 20215, "id": 177371, "upvote?": false}
{"lfs_enabled": true, "request_access_enabled": true, "forks_count": 2, "only_allow_merge_if_all_discussions_are_resolved": null, "container_registry_enabled": true, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab", "wiki_enabled": true, "public_builds": true, "id": 855, "merge_requests_enabled": true, "archived": false, "snippets_enabled": false, "http_url_to_repo": "https://gitlab.kitware.com/utils/rust-gitlab.git", "namespace": {"request_access_enabled": true, "lfs_enabled": null, "share_with_group_lock": false, "deleted_at": null, "name": "Utils", "created_at": "2016-02-03T16:26:13.133-05:00", "description": "", "updated_at": "2016-02-03T16:27:05.284-05:00", "avatar": {"url": null}, "path": "utils", "visibility_level": 20, "id": 498, "owner_id": null}, "star_count": 0, "avatar_url": null, "issues_enabled": true, "path_with_namespace": "utils/rust-gitlab", "public": true, "shared_with_groups": [], "description": "Rust library for communicating with a Gitlab instance.", "default_branch": "master", "only_allow_merge_if_build_succeeds": false, "runners_token": "M3yGSHxyULoxbXoSbG1o", "ssh_url_to_repo": "git@gitlab.kitware.com:utils/rust-gitlab.git", "path": "rust-gitlab", "visibility_level": 20, "permissions": {"group_access": {"notification_level": 3, "access_level": 50}, "project_access": null}, "open_issues_count": 3, "last_activity_at": "2016-12-07T10:45:22.450-05:00", "name": "rust-gitlab", "name_with_namespace": "Utils / rust-gitlab", "created_at": "2016-06-29T13:35:12.495-04:00", "builds_enabled": false, "creator_id": 13, "shared_runners_enabled": true, "tag_list": []}
\ No newline at end of file
{"id":855,"description":"Rust library for communicating with a Gitlab instance.","default_branch":"master","tag_list":[],"public":true,"archived":false,"visibility_level":20,"ssh_url_to_repo":"git@gitlab.kitware.com:utils/rust-gitlab.git","http_url_to_repo":"https://gitlab.kitware.com/utils/rust-gitlab.git","web_url":"https://gitlab.kitware.com/utils/rust-gitlab","name":"rust-gitlab","name_with_namespace":"Utils / rust-gitlab","path":"rust-gitlab","path_with_namespace":"utils/rust-gitlab","container_registry_enabled":true,"issues_enabled":true,"merge_requests_enabled":true,"wiki_enabled":true,"builds_enabled":false,"snippets_enabled":false,"created_at":"2016-06-29T13:35:12.495-04:00","last_activity_at":"2017-01-18T12:27:17.734-05:00","shared_runners_enabled":true,"lfs_enabled":true,"creator_id":13,"namespace":{"id":498,"name":"Utils","path":"utils","kind":"group"},"avatar_url":null,"star_count":0,"forks_count":3,"open_issues_count":1,"runners_token":"M3yGSHxyULoxbXoSbG1o","public_builds":true,"shared_with_groups":[],"only_allow_merge_if_build_succeeds":false,"request_access_enabled":true,"only_allow_merge_if_all_discussions_are_resolved":null,"permissions":{"project_access":null,"group_access":{"access_level":50,"notification_level":3}}}
{"note_events": true, "tag_push_events": true, "url": "http://kwrobot02:8080/event", "created_at": "2016-06-29T13:35:15.771-04:00", "enable_ssl_verification": false, "pipeline_events": false, "issues_events": true, "push_events": true, "merge_requests_events": true, "build_events": false, "project_id": 855, "id": 887, "wiki_page_events": false}
\ No newline at end of file
{"note_events": true, "tag_push_events": true, "url": "http://kwrobot02:8080/event", "created_at": "2016-06-29T13:35:15.771-04:00", "enable_ssl_verification": false, "pipeline_events": false, "issues_events": true, "push_events": true, "merge_requests_events": true, "build_events": false, "project_id": 855, "id": 887, "wiki_page_events": false}
{"commit": {"committer_email": "kwrobot@kitware.com", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "author_name": "Brad King", "parent_ids": ["de4ac3cf96cb8a0893be22b03f5171d934f9d392", "370267d429821e0f4354cb43c52ee2053c2cb744"], "committed_date": "2016-11-11T09:59:37.000-05:00", "message": "Merge topic 'nullable-fields'\n\n370267d4 types: more nullable fields\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !47\n", "authored_date": "2016-11-11T09:59:37.000-05:00", "id": "a418466df1c8b4e676e97d7d8d0d3cdfb1336558"}, "protected": true, "name": "master", "developers_can_push": false, "developers_can_merge": false}
\ No newline at end of file
{"commit": {"committer_email": "kwrobot@kitware.com", "author_email": "brad.king@kitware.com", "committer_name": "Kitware Robot", "author_name": "Brad King", "parent_ids": ["de4ac3cf96cb8a0893be22b03f5171d934f9d392", "370267d429821e0f4354cb43c52ee2053c2cb744"], "committed_date": "2016-11-11T09:59:37.000-05:00", "message": "Merge topic 'nullable-fields'\n\n370267d4 types: more nullable fields\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !47\n", "authored_date": "2016-11-11T09:59:37.000-05:00", "id": "a418466df1c8b4e676e97d7d8d0d3cdfb1336558"}, "protected": true, "name": "master", "developers_can_push": false, "developers_can_merge": false}
{"status": "success", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
\ No newline at end of file
{"status": "success", "stats": {"deletions": 0, "additions": 8, "total": 8}, "short_id": "de4ac3cf", "title": "Merge topic 'mr-awards'", "author_email": "brad.king@kitware.com", "created_at": "2016-11-08T09:30:13.000-05:00", "author_name": "Brad King", "parent_ids": ["559f5f4a2bfe1f48e9e95afa09c029deb655cf7d", "a222c5539569cda6999b8069f1e51a5202c30711"], "committed_date": "2016-11-08T09:30:13.000-05:00", "message": "Merge topic 'mr-awards'\n\na222c553 gitlab: add a method for MR award queries\n\nAcked-by: Kitware Robot <kwrobot@kitware.com>\nReviewed-by: Brad King <brad.king@kitware.com>\nMerge-request: !46\n", "authored_date": "2016-11-08T09:30:13.000-05:00", "id": "de4ac3cf96cb8a0893be22b03f5171d934f9d392"}
{"username": "kwrobot", "bio": "", "web_url": "https://gitlab.kitware.com/kwrobot", "name": "Kitware Robot", "twitter": "", "created_at": "2015-02-26T10:58:34.670-05:00", "linkedin": "", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "is_admin": true, "location": null, "skype": "", "organization": null, "id": 11, "website_url": ""}
\ No newline at end of file
{"username": "kwrobot", "bio": "", "web_url": "https://gitlab.kitware.com/kwrobot", "name": "Kitware Robot", "twitter": "", "created_at": "2015-02-26T10:58:34.670-05:00", "linkedin": "", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "is_admin": true, "location": null, "skype": "", "organization": null, "id": 11, "website_url": ""}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T12:23:28.693-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 2, "web_url": "https://gitlab.kitware.com/ben.boeckel", "skype": "", "identities": [], "id": 13, "projects_limit": 50, "current_sign_in_at": "2016-12-07T11:15:50.720-05:00", "state": "active", "location": null, "email": "ben.boeckel@kitware.com", "website_url": "", "username": "ben.boeckel", "bio": null, "last_sign_in_at": "2016-12-07T10:05:56.167-05:00", "is_admin": false, "external": false, "organization": null, "name": "Ben Boeckel", "can_create_group": true, "created_at": "2015-02-26T12:23:28.730-05:00", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "theme_id": 2}
\ No newline at end of file
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T12:23:28.693-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 2, "web_url": "https://gitlab.kitware.com/ben.boeckel", "skype": "", "identities": [], "id": 13, "projects_limit": 50, "current_sign_in_at": "2016-12-07T11:15:50.720-05:00", "state": "active", "location": null, "email": "ben.boeckel@kitware.com", "website_url": "", "username": "ben.boeckel", "bio": null, "last_sign_in_at": "2016-12-07T10:05:56.167-05:00", "is_admin": false, "external": false, "organization": null, "name": "Ben Boeckel", "can_create_group": true, "created_at": "2015-02-26T12:23:28.730-05:00", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "theme_id": 2}
......@@ -96,13 +96,13 @@ impl Gitlab {
};
// Ensure the API is working.
let _: UserFull = try!(api._get("user"));
let _: UserPublic = try!(api._get("user"));
Ok(api)
}
/// The user the API is acting as.
pub fn current_user(&self) -> Result<UserFull> {
pub fn current_user(&self) -> Result<UserPublic> {
self._get("user")
}
......
......@@ -335,38 +335,21 @@ fn test_read_project() {
UTC.ymd(2016, 6, 29)
.and_hms_milli(17, 35, 12, 495));
assert_eq!(project.last_activity_at,
UTC.ymd(2016, 12, 7)
.and_hms_milli(15, 45, 22, 450));
UTC.ymd(2017, 1, 18)
.and_hms_milli(17, 27, 17, 734));
assert_eq!(project.shared_runners_enabled, true);
assert_eq!(project.lfs_enabled, true);
assert_eq!(project.creator_id, UserId::new(13));
assert_eq!(project.namespace.name, "Utils");
assert_eq!(project.namespace.path, "utils");
assert_eq!(project.namespace.description, "");
assert_eq!(project.namespace.id, 498);
assert_eq!(project.namespace.owner_id(),
assert_eq!(project.namespace.id(),
NamespaceId::Group(GroupId::new(498)));
assert_eq!(project.namespace.created_at,
UTC.ymd(2016, 2, 3)
.and_hms_milli(21, 26, 13, 133));
assert_eq!(project.namespace.updated_at,
UTC.ymd(2016, 2, 3)
.and_hms_milli(21, 27, 5, 284));
assert_eq!(project.namespace.deleted_at, None);
assert_eq!(project.namespace.visibility_level, 20);
if let Some(ref avatar) = project.namespace.avatar {
assert_eq!(avatar.url, None);
} else {
panic!("expected to have an avatar for the namespace");
}
assert_eq!(project.namespace.lfs_enabled, None);
assert_eq!(project.namespace.request_access_enabled, true);
assert_eq!(project.namespace.share_with_group_lock, false);
assert_eq!(project.namespace.kind, NamespaceKind::Group);
assert!(project.forked_from_project.is_none());
assert_eq!(project.avatar_url, None);
assert_eq!(project.star_count, 0);
assert_eq!(project.forks_count, 2);
assert_eq!(project.open_issues_count, Some(3));
assert_eq!(project.forks_count, 3);
assert_eq!(project.open_issues_count, Some(1));
assert_eq!(project.public_builds, true);
assert!(project.shared_with_groups.is_empty());
assert_eq!(project.only_allow_merge_if_build_succeeds, Some(false));
......@@ -505,43 +488,43 @@ fn test_read_user() {
}
#[test]
fn test_read_user_full() {
let user_full: UserFull = read_test_file("user_full");
assert_eq!(user_full.username, "ben.boeckel");
assert_eq!(user_full.name, "Ben Boeckel");
assert_eq!(user_full.id, UserId::new(13));
assert_eq!(user_full.state, UserState::Active);
assert_eq!(user_full.avatar_url,
fn test_read_user_public() {
let user_public: UserPublic = read_test_file("user_public");
assert_eq!(user_public.username, "ben.boeckel");
assert_eq!(user_public.name, "Ben Boeckel");
assert_eq!(user_public.id, UserId::new(13));
assert_eq!(user_public.state, UserState::Active);
assert_eq!(user_public.avatar_url,
"https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon");
assert_eq!(user_full.web_url, "https://gitlab.kitware.com/ben.boeckel");
assert_eq!(user_full.created_at,
assert_eq!(user_public.web_url, "https://gitlab.kitware.com/ben.boeckel");
assert_eq!(user_public.created_at,
UTC.ymd(2015, 2, 26)
.and_hms_milli(17, 23, 28, 730));
assert_eq!(user_full.is_admin, false);
assert_eq!(user_full.bio, None);
assert_eq!(user_full.location, None);
assert_eq!(user_full.skype, "");
assert_eq!(user_full.linkedin, "");
assert_eq!(user_full.twitter, "");
assert_eq!(user_full.website_url, "");
assert_eq!(user_full.organization, None);
assert_eq!(user_full.last_sign_in_at,
assert_eq!(user_public.is_admin, false);
assert_eq!(user_public.bio, None);
assert_eq!(user_public.location, None);
assert_eq!(user_public.skype, "");
assert_eq!(user_public.linkedin, "");
assert_eq!(user_public.twitter, "");
assert_eq!(user_public.website_url, "");
assert_eq!(user_public.organization, None);
assert_eq!(user_public.last_sign_in_at,
Some(UTC.ymd(2016, 12, 7)
.and_hms_milli(15, 5, 56, 167)));
assert_eq!(user_full.confirmed_at,
assert_eq!(user_public.confirmed_at,
UTC.ymd(2015, 2, 26)
.and_hms_milli(17, 23, 28, 693));
assert_eq!(user_full.email, "ben.boeckel@kitware.com");
assert_eq!(user_full.theme_id, ThemeId::new(2));
assert_eq!(user_full.color_scheme_id, ColorSchemeId::new(2));
assert_eq!(user_full.projects_limit, 50);
assert_eq!(user_full.current_sign_in_at,
assert_eq!(user_public.email, "ben.boeckel@kitware.com");
assert_eq!(user_public.theme_id, ThemeId::new(2));
assert_eq!(user_public.color_scheme_id, ColorSchemeId::new(2));
assert_eq!(user_public.projects_limit, 50);
assert_eq!(user_public.current_sign_in_at,
Some(UTC.ymd(2016, 12, 7)
.and_hms_milli(16, 15, 50, 720)));
assert!(user_full.identities.is_empty());
assert_eq!(user_full.can_create_group, true);
assert_eq!(user_full.can_create_project, true);
assert_eq!(user_full.two_factor_enabled, true);
assert_eq!(user_full.external, false);
assert!(user_public.identities.is_empty());
assert_eq!(user_public.can_create_group, true);
assert_eq!(user_public.can_create_project, true);
assert_eq!(user_public.two_factor_enabled, true);
assert_eq!(user_public.external, false);
}
......@@ -141,7 +141,7 @@ impl_id!(ColorSchemeId);
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Full user structure information.
pub struct UserFull {
pub struct UserPublic {
/// The username.
pub username: String,
/// The display name.
......@@ -201,14 +201,10 @@ pub struct UserFull {
pub two_factor_enabled: bool,
/// Whether the account is externally controlled.
pub external: bool,
// There's a `UserLogin` structure as well which contains this key too, but the API already has
// this token, so this is being skipped.
//pub private_token: String,
}
impl From<UserFull> for UserBasic {
fn from(user: UserFull) -> Self {
impl From<UserPublic> for UserBasic {
fn from(user: UserPublic) -> Self {
UserBasic {
username: user.username,
name: user.name,
......@@ -220,8 +216,8 @@ impl From<UserFull> for UserBasic {
}
}
impl From<UserFull> for User {
fn from(user: UserFull) -> Self {
impl From<UserPublic> for User {
fn from(user: UserPublic) -> Self {
User {
username: user.username,
name: user.name,
......@@ -463,48 +459,6 @@ pub struct ProjectNamespaceAvatar {
pub url: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Data about a project's namespace (group or user).
///
/// NOTE: This is an ad-hoc entity in Gitlab.
pub struct ProjectNamespace {
/// The name of the namespace.
pub name: String,
/// The URL path of the namespace.
pub path: String,
/// The description of the namespace.
pub description: String,
/// The ID of the namespace.
pub id: u64,
owner_id: Option<u64>,
/// When the namespace was created.
pub created_at: DateTime<UTC>,
/// When the namespace was last updated.
pub updated_at: DateTime<UTC>,
/// When the namespace was deleted.
pub deleted_at: Option<DateTime<UTC>>,
/// The visibility of the namespace.
pub visibility_level: u64,
/// The avatar of the namespace.
pub avatar: Option<ProjectNamespaceAvatar>,
/// Whether LFS is enabled for the namespace or not.
pub lfs_enabled: Option<bool>,
/// Whether access to the namespace may be requested.
pub request_access_enabled: bool,
/// FIXME: Probably internal.
pub share_with_group_lock: bool,
}
impl ProjectNamespace {
/// The owner of the namespace.
pub fn owner_id(&self) -> NamespaceId {
match self.owner_id {
Some(_) => NamespaceId::User(UserId(self.id)),
None => NamespaceId::Group(GroupId(self.id)),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Project information.
pub struct Project {
......@@ -554,7 +508,7 @@ pub struct Project {
/// The user who created the repository.
pub creator_id: UserId,
/// The namespace the project lives in.
pub namespace: ProjectNamespace,
pub namespace: Namespace,
/// If the project is a fork, details about it.
pub forked_from_project: Option<BasicProjectDetails>,
/// The URL to the project avatar.
......@@ -587,12 +541,29 @@ pub struct Project {
pub snippets_enabled: bool,
/// Whether the project wiki is enabled or not.
pub wiki_enabled: bool,
/// Statistics about the project.
pub statistics: Option<ProjectStatistics>,
/// If this is present, it is `ProjectWithAccess`, but since it is so similar, just have it be
/// optional here.
pub permissions: Option<Permissions>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Statistics about a project.
pub struct ProjectStatistics {
/// The number of commits in the repository.
pub commit_count: u64,
/// The size, in bytes, of the total storage required for the project.
pub storage_size: u64,
/// The size, in bytes, of the repository.
pub repository_size: u64,
/// The size, in bytes, of uploaded LFS files.
pub lfs_objects_size: u64,
/// The size, in bytes, of uploaded build artifacts.
pub build_artifacts_size: u64,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
/// Access levels for groups and projects.
pub enum AccessLevel {
......@@ -739,6 +710,21 @@ pub struct Group {
pub web_url: String,
/// Whether membership requests are allowed for the group.
pub request_access_enabled: bool,
/// Statistics about the group.
pub statistics: Option<ProjectStatistics>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Statistics about a group.
pub struct GroupStatistics {
/// The size, in bytes, of the total storage required for the group.
pub storage_size: u64,
/// The size, in bytes, of all repositories in the group.
pub repository_size: u64,
/// The size, in bytes, of uploaded LFS files in the group.
pub lfs_objects_size: u64,
/// The size, in bytes, of uploaded build artifacts in the group.
pub build_artifacts_size: u64,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
......@@ -766,6 +752,8 @@ pub struct GroupDetail {
pub shared_projects: Vec<Project>,
/// Whether membership requests are allowed for the group.
pub request_access_enabled: bool,
/// Statistics about the group.
pub statistics: Option<ProjectStatistics>,
}
impl From<GroupDetail> for Group {
......@@ -780,6 +768,7 @@ impl From<GroupDetail> for Group {
avatar_url: detail.avatar_url,
web_url: detail.web_url,
request_access_enabled: detail.request_access_enabled,
statistics: detail.statistics,
}
}
}
......@@ -884,6 +873,10 @@ pub struct RepoCommit {
pub author_name: String,
/// The commit author's email address.
pub author_email: String,
/// The committer's name.
pub committer_name: String,
/// The committer's email address.
pub committer_email: String,
pub created_at: DateTime<UTC>,
/// The full commit message.
pub message: String,
......@@ -952,6 +945,19 @@ pub struct ProjectSnippet {
pub web_url: String,
}
//class PersonalSnippet < Grape::Entity
// expose :id, :title, :file_name
// expose :author, using: Entities::UserBasic
// expose :updated_at, :created_at
//
// expose :web_url do |snippet|
// Gitlab::UrlBuilder.build(snippet)
// end
// expose :raw_url do |snippet|
// Gitlab::UrlBuilder.build(snippet) + "/raw"
// end
//end
// This is just used as a common "base class" in Ruby.
//#[derive(Serialize, Deserialize, Debug, Clone)]
//pub struct ProjectEntity {
......@@ -1092,6 +1098,19 @@ pub struct Issue {
pub web_url: String,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
/// A time estimate on an issue or merge request.
pub struct IssuableTimeEstimate {
/// The time estimate, in seconds.
pub time_estimate: u64,
/// The total time spent, in seconds.
pub total_time_spent: u64,
/// The time estimate, as a human-readable string.
pub human_time_estimate: Option<String>,
/// The total time spent, as a human-readable string.
pub human_total_time_spent: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq)]
/// Type-safe external issue ID.
pub struct ExternalIssueId(u64);
......@@ -1351,6 +1370,8 @@ pub struct SshKey {
pub key: String,
/// When the key was created.
pub created_at: DateTime<UTC>,
/// Whether the key may push to repositories or not.
pub can_push: bool,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
......@@ -1365,7 +1386,7 @@ pub struct SshKeyWithUser {
/// When the key was created.
pub created_at: DateTime<UTC>,
/// The user associated with the SSH key.
pub user: UserFull,
pub user: UserPublic,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
......@@ -1742,6 +1763,8 @@ pub struct Namespace {
id: u64,
/// The URL of the namespace.
pub path: String,
/// The name of the namespace.
pub name: String,
/// The kind of the namespace.
pub kind: NamespaceKind,
}
......@@ -1868,6 +1891,8 @@ impl Namespace {
// expose :repository_storages
// expose :koding_enabled
// expose :koding_url
// expose :plantuml_enabled
// expose :plantuml_url
//end
//class Release < Grape::Entity
......@@ -1983,7 +2008,7 @@ pub struct Build {
//end
//class EnvironmentBasic < Grape::Entity
// expose :id, :name, :external_url
// expose :id, :name, :slug, :external_url
//end
//class Environment < EnvironmentBasic
......
Supports Markdown
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