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

types: update for 11.4

Users gained a field for their public email address, if any.
parent 57ebae39
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2018-08-24T10:10:45.623-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "private_profile": null, "last_sign_in_at": "2018-07-18T07:33:59.612-04:00", "last_activity_on": "2018-08-28", "external": false, "organization": null, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2018-10-11T08:36:09.687-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "private_profile": null, "last_sign_in_at": "2018-10-08T13:25:29.086-04:00", "last_activity_on": "2018-10-25", "external": false, "organization": null, "public_email": "", "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "is_admin": true, "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2018-08-24T10:10:45.623-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "private_profile": null, "last_sign_in_at": "2018-07-18T07:33:59.612-04:00", "last_activity_on": "2018-08-28", "external": false, "organization": null, "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
{"two_factor_enabled": true, "can_create_project": true, "confirmed_at": "2015-02-26T10:58:34.660-05:00", "twitter": "", "linkedin": "", "color_scheme_id": 4, "web_url": "https://gitlab.kitware.com/kwrobot", "skype": "", "is_admin": true, "identities": [], "id": 11, "projects_limit": 50, "current_sign_in_at": "2018-10-11T08:36:09.687-04:00", "state": "active", "location": null, "email": "kwrobot@kitware.com", "website_url": "", "username": "kwrobot", "bio": "", "private_profile": null, "last_sign_in_at": "2018-10-08T13:25:29.086-04:00", "last_activity_on": "2018-10-25", "external": false, "organization": null, "public_email": "", "name": "Kitware Robot", "can_create_group": true, "created_at": "2015-02-26T10:58:34.670-05:00", "avatar_url": "https://secure.gravatar.com/avatar/9ddcd45fcb89d966aab95b1f1002f84c?s=80&d=identicon", "theme_id": null}
......@@ -550,6 +550,7 @@ fn test_read_user() {
assert_eq!(user.bio, Some("".to_string()));
assert_eq!(user.private_profile, None);
assert_eq!(user.location, None);
assert_eq!(user.public_email, Some("".to_string()));
assert_eq!(user.skype, "");
assert_eq!(user.linkedin, "");
assert_eq!(user.twitter, "");
......@@ -576,16 +577,17 @@ fn test_read_user_public() {
assert_eq!(user_public.bio, Some("".to_string()));
assert_eq!(user_public.private_profile, None);
assert_eq!(user_public.location, None);
assert_eq!(user_public.public_email, Some("".to_string()));
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(2018, 7, 18)
.and_hms_milli(11, 33, 59, 612)));
Some(Utc.ymd(2018, 10, 8)
.and_hms_milli(17, 25, 29, 86)));
assert_eq!(user_public.last_activity_on,
Some(NaiveDate::from_ymd(2018, 8, 28)));
Some(NaiveDate::from_ymd(2018, 10, 25)));
assert_eq!(user_public.confirmed_at,
Some(Utc.ymd(2015, 2, 26)
.and_hms_milli(15, 58, 34, 660)));
......@@ -594,8 +596,8 @@ fn test_read_user_public() {
assert_eq!(user_public.color_scheme_id, ColorSchemeId::new(4));
assert_eq!(user_public.projects_limit, 50);
assert_eq!(user_public.current_sign_in_at,
Some(Utc.ymd(2018, 8, 24)
.and_hms_milli(14, 10, 45, 623)));
Some(Utc.ymd(2018, 10, 11)
.and_hms_milli(12, 36, 9, 687)));
assert!(user_public.identities.is_empty());
assert_eq!(user_public.can_create_group, true);
assert_eq!(user_public.can_create_project, true);
......
......@@ -105,6 +105,8 @@ pub struct User {
pub private_profile: Option<bool>,
/// Geographic location of the user.
pub location: Option<String>,
/// User public email address, if any.
pub public_email: Option<String>,
/// Skype contact information.
pub skype: String,
......@@ -181,6 +183,8 @@ pub struct UserPublic {
pub private_profile: Option<bool>,
/// Geographic location of the user.
pub location: Option<String>,
/// User public email address, if any.
pub public_email: Option<String>,
/// Skype contact information.
pub skype: String,
......@@ -251,6 +255,7 @@ impl From<UserPublic> for User {
bio: user.bio,
private_profile: user.private_profile,
location: user.location,
public_email: user.public_email,
skype: user.skype,
linkedin: user.linkedin,
twitter: user.twitter,
......
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