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