github.com/litesolutions/justifay-api@v1.0.0-2.0.20220707114139-46f28a909481/proto/user/user.proto (about) 1 syntax="proto3"; 2 3 //package example; 4 //package resonate.api.user; 5 package user; 6 7 //option go_package = "user"; 8 9 import "google/api/annotations.proto"; 10 import "protoc-gen-openapiv2/options/annotations.proto"; 11 import "user/common.proto"; 12 import "user/user_messages.proto"; 13 import "user/usergroup_messages.proto"; 14 15 // Defines the import path that should be used to import the generated package, 16 // and the package name. 17 option go_package = "github.com/resonatecoop/user-api/proto/user"; 18 19 // These annotations are used when generating the OpenAPI file. 20 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { 21 info: { 22 version: "2.0.2"; 23 title: "Resonate Service Documentation: User"; 24 }; 25 external_docs: { 26 url: "https://github.com/resonatecoop/user-api"; 27 description: "gRPC-gateway resonate-user-api repository"; 28 } 29 security_definitions: { 30 security: { 31 key: "bearer" 32 value: { 33 type: TYPE_API_KEY 34 in: IN_HEADER 35 name: "Authorization" 36 description: "Authentication token, prefixed by Bearer: Bearer <token>" 37 } 38 } 39 } 40 security: { 41 security_requirement: { 42 key: "bearer" 43 } 44 } 45 schemes: HTTPS; 46 }; 47 48 service ResonateUser { 49 50 // Users 51 52 //GetUser provides a public level of information about a user 53 rpc GetUser(UserRequest) returns (UserPublicResponse) { 54 option (google.api.http) = { 55 // Route to this method from GET requests to /api/v1/user/{id} 56 get: "/api/v1/user/{id}" 57 }; 58 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 59 summary: "Get a user" 60 description: "Get a user's public information from the server." 61 tags: "Users" 62 }; 63 } 64 65 //rpc AddUser(UserAddRequest) returns (User) { 66 rpc AddUser(UserAddRequest) returns (UserRequest) { 67 option (google.api.http) = { 68 // Route to this method from POST requests to /api/v1/users 69 post: "/api/v1/users" 70 body: "*" 71 }; 72 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 73 summary: "Add a user" 74 description: "Add a user to the server." 75 tags: "Users" 76 }; 77 } 78 79 //rpc UpdateUser(UserUpdateRequest) returns (Empty) { 80 rpc UpdateUser(UserUpdateRequest) returns (Empty) { 81 option (google.api.http) = { 82 // Route to this method from PUT requests to /api/v1/user 83 patch: "/api/v1/user/{id}" 84 body: "*" 85 }; 86 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 87 summary: "Update a user" 88 description: "Update an existing user record on the server." 89 tags: "Users" 90 }; 91 } 92 93 //rpc UpdateUserRestricted(UserUpdateRestrictedRequest) returns (Empty) { 94 rpc UpdateUserRestricted(UserUpdateRestrictedRequest) returns (Empty) { 95 option (google.api.http) = { 96 // Route to this method from PUT requests to /api/v1/user 97 patch: "/api/v1/restricted/user/{id}" 98 body: "*" 99 }; 100 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 101 summary: "Update a user record for admins" 102 description: "Update an existing user record on the server including restricted information." 103 tags: "Users" 104 }; 105 } 106 107 // //rpc ResetUserPassword(AddUserRequest) returns (Empty) { 108 // rpc ResetUserPassword(ResetUserPasswordRequest) returns (Empty) { 109 // option (google.api.http) = { 110 // // Route to this method from PUT requests to /api/v1/account 111 // put: "/api/v1/account/password" 112 // body: "*" 113 // }; 114 // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 115 // summary: "Update a user's password" 116 // description: "Update an existing user's password on the server." 117 // tags: "Users Password" 118 // }; 119 // } 120 121 //GetUserRestricted provides private level of information about a user 122 rpc GetUserRestricted(UserRequest) returns (UserPrivateResponse) { 123 option (google.api.http) = { 124 // Route to this method from GET requests to /api/v1/restricted/user/{id} 125 get: "/api/v1/restricted/user/{id}" 126 }; 127 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 128 summary: "Get a user's restricted information" 129 description: "Get user profile from the server including private information." 130 tags: "Users" 131 }; 132 } 133 134 rpc DeleteUser(UserRequest) returns (Empty) { 135 option (google.api.http) = { 136 // Route to this method from DELETE requests to /api/v1/restricted/user/{id} 137 delete: "/api/v1/restricted/user/{id}" 138 }; 139 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 140 summary: "Delete user" 141 description: "Delete a user from the server." 142 tags: "Users" 143 }; 144 } 145 146 //ListUsers returns a list of all Users 147 rpc ListUsers(Empty) returns (UserListResponse) { 148 option (google.api.http) = { 149 // Route to this method from GET requests to /api/v1/users 150 get: "/api/v1/users" 151 }; 152 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 153 summary: "List users" 154 description: "List all users on the server." 155 tags: "Users" 156 }; 157 } 158 159 // UserGroups 160 161 //AddUserGroup adds a UserGroup based on provided attributes 162 rpc AddUserGroup(UserGroupCreateRequest) returns (UserRequest) { 163 option (google.api.http) = { 164 // Route to this method from POST requests to /api/v1/users/{id}/usergroup 165 post: "/api/v1/users/{id}/usergroup" 166 body: "*" 167 }; 168 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 169 summary: "Add a user group" 170 description: "Add a user group to the server to user resource with id: id." 171 tags: "Usergroups" 172 }; 173 } 174 175 //UpdateUserGroup updates an existing UserGroup 176 rpc UpdateUserGroup(UserGroupUpdateRequest) returns (Empty) { 177 option (google.api.http) = { 178 // Route to this method from PUT requests to /api/v1/user 179 patch: "/api/v1/usergroup/{id}" 180 body: "*" 181 }; 182 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 183 summary: "Update a user group" 184 description: "Update an existing user group record on the server." 185 tags: "Usergroups" 186 }; 187 } 188 189 //rpc UpdateUserRestricted(UpdateUserRestrictedRequest) returns (Empty) { 190 // rpc UpdateUserRestricted(UpdateUserRestrictedRequest) returns (Empty) { 191 // option (google.api.http) = { 192 // // Route to this method from PUT requests to /api/v1/user 193 // patch: "/api/v1/restricted/user/{id}" 194 // body: "*" 195 // }; 196 // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 197 // summary: "Update a user record for admins" 198 // description: "Update an existing user record on the server including restricted information." 199 // tags: "Users" 200 // }; 201 // } 202 203 //rpc ResetUserPassword(AddUserRequest) returns (Empty) { 204 // rpc ResetUserPassword(ResetUserPasswordRequest) returns (Empty) { 205 // option (google.api.http) = { 206 // // Route to this method from PUT requests to /api/v1/account 207 // put: "/api/v1/account/password" 208 // body: "*" 209 // }; 210 // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 211 // summary: "Update a user's password" 212 // description: "Update an existing user's password on the server." 213 // tags: "Users Password" 214 // }; 215 // } 216 217 //GetUserGroup provides a public level of information about a user group 218 rpc GetUserGroup(UserGroupRequest) returns (UserGroupPublicResponse) { 219 option (google.api.http) = { 220 // Route to this method from GET requests to /api/v1/usergroup/{id} 221 get: "/api/v1/usergroup/{id}" 222 }; 223 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 224 summary: "Get a user group" 225 description: "Get a usergroup from the server." 226 tags: "Usergroups" 227 }; 228 } 229 230 //GetUserRestricted provides private level of information about a user 231 // rpc GetUserRestricted(UserRequest) returns (UserPrivateResponse) { 232 // option (google.api.http) = { 233 // // Route to this method from GET requests to /api/v1/restricted/user/{id} 234 // get: "/api/v1/restricted/user/{id}" 235 // }; 236 // option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 237 // summary: "Get a user's restricted information" 238 // description: "Get user profile from the server including private information." 239 // tags: "Users" 240 // }; 241 // } 242 243 //DeleteUserGroup deletes a UserGroup 244 rpc DeleteUserGroup(UserGroupRequest) returns (Empty) { 245 option (google.api.http) = { 246 // Route to this method from DELETE requests to /api/v1/restricted/user/{id} 247 delete: "/api/v1/usergroup/{id}" 248 }; 249 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 250 summary: "Delete usergroup" 251 description: "Delete a usergroup from the server." 252 tags: "Usergroups" 253 }; 254 } 255 256 rpc ListUsersUserGroups(UserRequest) returns (UserGroupListResponse) { 257 option (google.api.http) = { 258 // Route to this method from GET requests to /api/v1/users/{id}/usergroups 259 get: "/api/v1/users/{id}/usergroups" 260 }; 261 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { 262 summary: "Get a list of users groups" 263 description: "Get a list of users groups owned by user from server" 264 tags: "Usergroups" 265 }; 266 } 267 268 // rpc CreateUserGroup(UserGroupCreateRequest) returns (UserGroupPrivateResponse); 269 // rpc GetUserGroup(UserGroupRequest) returns (UserGroupPublicResponse); 270 // // rpc GetUserGroupRestricted(UserGroupRequest) returns (UserGroupPrivateResponse); 271 // rpc UpdateUserGroup(UserGroupUpdateRequest) returns (UserGroupPrivateResponse); 272 // rpc DeleteUserGroup(UserGroupRequest) returns (Empty); 273 274 // rpc GetChildUserGroups(UserGroupRequest) returns (GroupedUserGroups); 275 // rpc GetParentUserGroups(UserGroupRequest) returns (GroupedUserGroups); 276 277 // rpc GetLabelUserGroups(UserGroupRequest) returns (GroupedUserGroups); 278 // rpc GetUserGroupTypes(Empty) returns (GroupTaxonomies); 279 280 // //rpc AddRecommended(UserGroupRecommended) returns (Empty); 281 // //rpc RemoveRecommended(UserGroupRecommended) returns (Empty); 282 283 // rpc AddMember(UserGroupMembershipRequest) returns (Empty); 284 // rpc DeleteMember(UserGroupMembershipRequest) returns (Empty); 285 286 // rpc SearchUserGroups(Query) returns (SearchResults); 287 } 288 289 290 291