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 { |
| 31 | } |
| 32 | |
| 33 | message GetKillSwitchOverviewResponse { |
| 34 | repeated KillSwitch kill_switches = 1; |
| 35 | } |
| 36 | |
| 37 | message ListFeaturesRequest { |
| 38 | bool with_deprecated_features = 1; |
| 39 | } |
| 40 | |
| 41 | message ListFeaturesResponse { |
| 42 | repeated Feature features = 1; |
| 43 | } |
| 44 | |
| 45 | message SyncFeaturesRequest { |
| 46 | repeated Feature features = 1; |
| 47 | } |
| 48 | |
| 49 | message SyncFeaturesResponse { |
| 50 | } |
| 51 | |
| 52 | message EnableKillSwitchRequest { |
| 53 | KillSwitch kill_switch = 1; |
| 54 | } |
| 55 | |
| 56 | message EnableKillSwitchResponse { |
| 57 | } |
| 58 | |
| 59 | message DisableKillSwitchRequest { |
| 60 | int32 kill_switch_id = 1; |
| 61 | } |
| 62 | |
| 63 | message DisableKillSwitchResponse { |
| 64 | } |
| 65 | |
| 66 | message ListAuthorizedUsersRequest { |
| 67 | } |
| 68 | |
| 69 | message ListAuthorizedUsersResponse { |
Adrià Vilanova MartÃnez | 25e1211 | 2021-08-25 13:48:06 +0200 | [diff] [blame] | 70 | repeated KillSwitchAuthorizedUser users = 1; |
avm99963 | 83f8f29 | 2021-08-24 18:26:52 +0200 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | message AddAuthorizedUserRequest { |
| 74 | KillSwitchAuthorizedUser user = 1; |
| 75 | } |
| 76 | |
| 77 | message AddAuthorizedUserResponse { |
| 78 | } |
| 79 | |
| 80 | message UpdateAuthorizedUserRequest { |
| 81 | int32 user_id = 1; |
| 82 | KillSwitchAuthorizedUser user = 2; |
| 83 | } |
| 84 | |
| 85 | message UpdateAuthorizedUserResponse { |
| 86 | } |
| 87 | |
| 88 | message DeleteAuthorizedUserRequest { |
| 89 | int32 user_id = 1; |
| 90 | } |
| 91 | |
| 92 | message DeleteAuthorizedUserResponse { |
| 93 | } |