avm99963 | 83f8f29 | 2021-08-24 18:26:52 +0200 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | |
| 3 | import "api_proto/common.proto"; |
| 4 | import "api_proto/kill_switch_objects.proto"; |
| 5 | |
| 6 | option go_package = "gomodules.avm99963.com/twpt-server/api_proto"; |
| 7 | |
| 8 | service KillSwitchService { |
| 9 | rpc GetKillSwitchStatus (GetKillSwitchStatusRequest) returns (GetKillSwitchStatusResponse) {} |
| 10 | rpc GetKillSwitchOverview (GetKillSwitchOverviewRequest) returns (GetKillSwitchOverviewResponse) {} |
| 11 | rpc ListFeatures (ListFeaturesRequest) returns (ListFeaturesResponse) {} |
| 12 | rpc SyncFeatures (SyncFeaturesRequest) returns (SyncFeaturesResponse) {} |
| 13 | rpc EnableKillSwitch (EnableKillSwitchRequest) returns (EnableKillSwitchResponse) {} |
| 14 | rpc DisableKillSwitch (DisableKillSwitchRequest) returns (DisableKillSwitchResponse) {} |
| 15 | rpc ListAuthorizedUsers (ListAuthorizedUsersRequest) returns (ListAuthorizedUsersResponse) {} |
| 16 | rpc AddAuthorizedUser (AddAuthorizedUserRequest) returns (AddAuthorizedUserResponse) {} |
| 17 | rpc UpdateAuthorizedUser (UpdateAuthorizedUserRequest) returns (UpdateAuthorizedUserResponse) {} |
| 18 | rpc DeleteAuthorizedUser (DeleteAuthorizedUserRequest) returns (DeleteAuthorizedUserResponse) {} |
| 19 | } |
| 20 | |
| 21 | // Retrieve kill switch status depending on the environment. |
| 22 | message GetKillSwitchStatusRequest { |
| 23 | Environment environment = 1; |
| 24 | } |
| 25 | |
| 26 | message GetKillSwitchStatusResponse { |
| 27 | repeated KillSwitch kill_switches = 1; |
| 28 | } |
| 29 | |
| 30 | message GetKillSwitchOverviewRequest { |
Adrià Vilanova Martínez | 8610314 | 2021-09-03 15:13:20 +0200 | [diff] [blame] | 31 | bool with_nonactive_kill_switches = 1; |
avm99963 | 83f8f29 | 2021-08-24 18:26:52 +0200 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | message GetKillSwitchOverviewResponse { |
| 35 | repeated KillSwitch kill_switches = 1; |
| 36 | } |
| 37 | |
| 38 | message ListFeaturesRequest { |
| 39 | bool with_deprecated_features = 1; |
| 40 | } |
| 41 | |
| 42 | message ListFeaturesResponse { |
| 43 | repeated Feature features = 1; |
| 44 | } |
| 45 | |
| 46 | message SyncFeaturesRequest { |
| 47 | repeated Feature features = 1; |
| 48 | } |
| 49 | |
| 50 | message SyncFeaturesResponse { |
| 51 | } |
| 52 | |
| 53 | message EnableKillSwitchRequest { |
| 54 | KillSwitch kill_switch = 1; |
| 55 | } |
| 56 | |
| 57 | message EnableKillSwitchResponse { |
| 58 | } |
| 59 | |
| 60 | message DisableKillSwitchRequest { |
| 61 | int32 kill_switch_id = 1; |
| 62 | } |
| 63 | |
| 64 | message DisableKillSwitchResponse { |
| 65 | } |
| 66 | |
| 67 | message ListAuthorizedUsersRequest { |
| 68 | } |
| 69 | |
| 70 | message ListAuthorizedUsersResponse { |
Adrià Vilanova Martínez | 25e1211 | 2021-08-25 13:48:06 +0200 | [diff] [blame] | 71 | repeated KillSwitchAuthorizedUser users = 1; |
avm99963 | 83f8f29 | 2021-08-24 18:26:52 +0200 | [diff] [blame] | 72 | } |
| 73 | |
| 74 | message AddAuthorizedUserRequest { |
| 75 | KillSwitchAuthorizedUser user = 1; |
| 76 | } |
| 77 | |
| 78 | message AddAuthorizedUserResponse { |
| 79 | } |
| 80 | |
| 81 | message UpdateAuthorizedUserRequest { |
| 82 | int32 user_id = 1; |
| 83 | KillSwitchAuthorizedUser user = 2; |
| 84 | } |
| 85 | |
| 86 | message UpdateAuthorizedUserResponse { |
| 87 | } |
| 88 | |
| 89 | message DeleteAuthorizedUserRequest { |
| 90 | int32 user_id = 1; |
| 91 | } |
| 92 | |
| 93 | message DeleteAuthorizedUserResponse { |
| 94 | } |