Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file or at |
| 4 | // https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | syntax = "proto3"; |
| 7 | |
| 8 | package monorail; |
| 9 | |
| 10 | import "api/api_proto/user_objects.proto"; |
| 11 | import "api/api_proto/common.proto"; |
| 12 | |
| 13 | service Users { |
| 14 | rpc GetUser (GetUserRequest) returns (User) {} |
| 15 | rpc ListReferencedUsers (ListReferencedUsersRequest) returns (ListReferencedUsersResponse) {} |
| 16 | rpc GetMemberships (GetMembershipsRequest) returns (GetMembershipsResponse) {} |
| 17 | rpc GetSavedQueries (GetSavedQueriesRequest) returns (GetSavedQueriesResponse) {} |
| 18 | rpc GetUserStarCount (GetUserStarCountRequest) returns (GetUserStarCountResponse) {} |
| 19 | rpc StarUser (StarUserRequest) returns (StarUserResponse) {} |
| 20 | rpc GetUserPrefs (GetUserPrefsRequest) returns (GetUserPrefsResponse) {} |
| 21 | rpc SetUserPrefs (SetUserPrefsRequest) returns (SetUserPrefsResponse) {} |
| 22 | // TODO(jrobbins): Merge this into SetUserPrefs. |
| 23 | rpc SetExpandPermsPreference (SetExpandPermsPreferenceRequest) returns (SetExpandPermsPreferenceResponse) {} |
| 24 | rpc InviteLinkedParent (InviteLinkedParentRequest) returns (InviteLinkedParentResponse) {} |
| 25 | rpc AcceptLinkedChild (AcceptLinkedChildRequest) returns (AcceptLinkedChildResponse) {} |
| 26 | rpc UnlinkAccounts (UnlinkAccountsRequest) returns (UnlinkAccountsResponse) {} |
| 27 | rpc GetUsersProjects (GetUsersProjectsRequest) returns (GetUsersProjectsResponse) {} |
| 28 | rpc ExpungeUser (ExpungeUserRequest) returns (ExpungeUserResponse) {} |
| 29 | } |
| 30 | |
| 31 | |
| 32 | // Next available tag: 4 |
| 33 | message ListReferencedUsersRequest { |
| 34 | // emails is deprecated. Use user_refs instead. |
| 35 | repeated string emails = 2; |
| 36 | repeated UserRef user_refs = 3; |
| 37 | } |
| 38 | |
| 39 | |
| 40 | message ListReferencedUsersResponse { |
| 41 | repeated User users = 1; |
| 42 | } |
| 43 | |
| 44 | |
| 45 | // Next available tag: 3 |
| 46 | message GetUserRequest { |
| 47 | UserRef user_ref = 2; |
| 48 | } |
| 49 | |
| 50 | |
| 51 | // Next available tag: 3 |
| 52 | message GetMembershipsRequest { |
| 53 | UserRef user_ref = 2; |
| 54 | } |
| 55 | |
| 56 | |
| 57 | // Next available tag: 2 |
| 58 | message GetMembershipsResponse { |
| 59 | repeated UserRef group_refs = 1; |
| 60 | } |
| 61 | |
| 62 | |
| 63 | // Next available tag: 3 |
| 64 | message GetSavedQueriesRequest { |
| 65 | UserRef user_ref = 2; |
| 66 | } |
| 67 | |
| 68 | |
| 69 | // Next available tag: 2 |
| 70 | message GetSavedQueriesResponse { |
| 71 | repeated SavedQuery saved_queries = 1; |
| 72 | } |
| 73 | |
| 74 | // Next available tag: 3 |
| 75 | message GetUserStarCountRequest { |
| 76 | UserRef user_ref = 2; |
| 77 | } |
| 78 | |
| 79 | |
| 80 | // Next available tag: 2 |
| 81 | message GetUserStarCountResponse { |
| 82 | uint32 star_count = 1; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | // Next available tag: 4 |
| 87 | message StarUserRequest { |
| 88 | UserRef user_ref = 2; |
| 89 | bool starred = 3; |
| 90 | } |
| 91 | |
| 92 | |
| 93 | // Next available tag: 2 |
| 94 | message StarUserResponse { |
| 95 | uint32 star_count = 1; |
| 96 | } |
| 97 | |
| 98 | |
| 99 | // Next available tag: 3 |
| 100 | message SetExpandPermsPreferenceRequest { |
| 101 | bool expand_perms = 2; |
| 102 | } |
| 103 | |
| 104 | |
| 105 | // Next available tag: 1 |
| 106 | message SetExpandPermsPreferenceResponse { |
| 107 | } |
| 108 | |
| 109 | |
| 110 | // Next available tag: 3 |
| 111 | message GetUserPrefsRequest { |
| 112 | // Site admins may get prefs for specific users. Otherwise, it gets |
| 113 | // prefs for the signed-in user. |
| 114 | UserRef user_ref = 2; |
| 115 | } |
| 116 | |
| 117 | |
| 118 | // Next available tag: 2 |
| 119 | message GetUserPrefsResponse { |
| 120 | repeated UserPrefValue prefs = 1; |
| 121 | } |
| 122 | |
| 123 | |
| 124 | // Next available tag: 5 |
| 125 | message SetUserPrefsRequest { |
| 126 | // Site admins may set prefs for specific users. Otherwise, it sets |
| 127 | // prefs for the signed-in user. |
| 128 | UserRef user_ref = 2; |
| 129 | // The given prefs add to or overwrite current user prefs. |
| 130 | repeated UserPrefValue prefs = 3; |
| 131 | } |
| 132 | |
| 133 | |
| 134 | // Next available tag: 1 |
| 135 | message SetUserPrefsResponse { |
| 136 | } |
| 137 | |
| 138 | |
| 139 | // Next available tag: 3 |
| 140 | message InviteLinkedParentRequest { |
| 141 | string email = 2; |
| 142 | } |
| 143 | |
| 144 | |
| 145 | // Next available tag: 1 |
| 146 | message InviteLinkedParentResponse { |
| 147 | } |
| 148 | |
| 149 | |
| 150 | // Next available tag: 3 |
| 151 | message AcceptLinkedChildRequest { |
| 152 | string email = 2; |
| 153 | } |
| 154 | |
| 155 | |
| 156 | // Next available tag: 1 |
| 157 | message AcceptLinkedChildResponse { |
| 158 | } |
| 159 | |
| 160 | |
| 161 | // Next available tag: 4 |
| 162 | message UnlinkAccountsRequest { |
| 163 | UserRef parent = 2; |
| 164 | UserRef child = 3; |
| 165 | } |
| 166 | |
| 167 | |
| 168 | // Next available tag: 1 |
| 169 | message UnlinkAccountsResponse { |
| 170 | } |
| 171 | |
| 172 | |
| 173 | // Next available tag: 2 |
| 174 | message GetUsersProjectsRequest { |
| 175 | repeated UserRef user_refs = 1; |
| 176 | } |
| 177 | |
| 178 | |
| 179 | // Next available tag: 5 |
| 180 | message GetUsersProjectsResponse { |
| 181 | repeated UserProjects users_projects = 1; |
| 182 | } |
| 183 | |
| 184 | |
| 185 | // Next available tag: 2 |
| 186 | message ExpungeUserRequest { |
| 187 | string email = 1; |
| 188 | } |
| 189 | |
| 190 | |
| 191 | // Next available tag: 1 |
| 192 | message ExpungeUserResponse { |
| 193 | } |