Adrià Vilanova MartÃnez | f19ea43 | 2024-01-23 20:20:52 +0100 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | /* eslint-disable no-unused-vars */ |
| 6 | |
| 7 | /** |
| 8 | * Fetches the user from Monorai. |
| 9 | * @param {string} userName The resource name of the user. |
| 10 | * @return {User} |
| 11 | */ |
| 12 | function getUser(userName) { |
| 13 | const message = {'name': userName}; |
| 14 | const url = URL + 'monorail.v3.Users/GetUser'; |
| 15 | return run_(url, message); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Fetches the users from Monorail. |
| 20 | * @param {Array<string>} userNames The resource names of the users. |
| 21 | * @return {Array<User>} |
| 22 | */ |
| 23 | function batchGetUsers(userNames) { |
| 24 | const message = {'names': userNames}; |
| 25 | const url = URL + 'monorail.v3.Users/BatchGetUsers'; |
| 26 | return run_(url, message); |
| 27 | } |