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