-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_user.proto
executable file
·125 lines (110 loc) · 3.52 KB
/
admin_user.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
syntax = "proto3";
import "admin_security.proto";
import "status.proto";
option go_package = "vectara.com/public/proto/admin";
option java_package = "com.vectara.admin";
option java_outer_classname = "AdminUserProtos";
package com.vectara.admin;
// Represents a user in an account.
// A user is a person or an application that has access to the system.
message User {
// Unique ID for the user. This is required for deleting, enabling, disabling a user
// or to reset their password. This can be retrieved via ListUsers API or it is also
// returned as part of ManageUser API when a new user is created.
uint32 id = 1;
// Name of the user. This is required for creating a new user.
string handle = 3;
// Type of user
UserType type = 4;
// Comment about the user
string comment = 5;
// Seconds since epoch when the user was created.
int64 ts_create = 6;
// ID of the user who created this user.
uint32 id_create = 7;
// Email address associated with the user. This is required for creating a new user.
string email = 10;
// Status of the user such as ACTIVE, DISABLED etc.
UserStatus user_status = 11;
// List of customer level roles
repeated CustomerRole role = 12;
}
enum UserType {
USER_TYPE__NONE = 0;
// A normal user
USER_TYPE__USER = 1;
// A user that is authenticated by an external identity provider such as Google etc.
USER_TYPE__FEDERATED_USER = 2;
// An application client. Please note that this doesn't work with ManageUser API.
// To create an App Client, use the ManageAppClient API.
USER_TYPE__APP_CLIENT = 3;
}
enum UserStatus {
USER_STATUS__NONE = 0;
// User is active
USER_STATUS__ACTIVE = 1;
// User is disabled
USER_STATUS__DISABLED = 2;
}
enum ListUsersType {
LIST_USERS_TYPE__NONE = 0;
// Only List users with customer account-level authorizations.
LIST_USERS_TYPE__CUSTOMER = 2;
// List All the users
LIST_USERS_TYPE__ALL = 3;
}
message ListUsersRequest {
// Type of users that we want to retrieve
ListUsersType list_users_type = 3;
// A key that is passed to retrieve a specific page of results.
// Leave empty to retrieve first page. Subsequent page requests should
// use the page key returned in previous response, and all other
// fields are ignored.
bytes page_key = 4;
// Number of results to return.
uint32 num_results = 5;
}
message ListUsersResponse {
// List of users
repeated User user = 1;
// A key that is passed into a subsequent result in order to
// retrieve the next page of results.
bytes page_key = 2;
// Status response of the request such as OK, FAILED etc.
Status status = 1000;
}
enum UserActionType {
USER_ACTION_TYPE__NONE = 0;
// Add User
USER_ACTION_TYPE__ADD = 1;
// Delete User
USER_ACTION_TYPE__DELETE = 2;
// Disable User
USER_ACTION_TYPE__DISABLE = 3;
// Enable User
USER_ACTION_TYPE__ENABLE = 4;
// Reset User Password
USER_ACTION_TYPE__RESET_PASSWORD = 5;
}
message ManageUserRequest {
// User and action to be performed on user
message UserAction {
// User object
User user = 1;
// Action to be performed on user
UserActionType user_action_type = 2;
}
// List of users and actions to be performed on them
repeated UserAction user_action = 1;
}
message ManageUserResponse {
// List of users and their status
message UserResponse {
// User object
User user = 1;
// Status response of the request such as OK, FAILED etc.
Status status = 1000;
}
// List of users alongwith relative status such as OK, FAILED etc.
repeated UserResponse response = 1;
}