| 1 | //! Permission-related types shared between the sharer and viewer protocols. |
| 2 | |
| 3 | use super::{Role, TeamAclData}; |
| 4 | use serde::{Deserialize, Serialize}; |
| 5 | |
| 6 | #[derive(Clone, Serialize, Deserialize, Debug)] |
| 7 | pub enum LinkAccessLevelUpdateResponse { |
| 8 | Ok { role: Option<Role> }, |
| 9 | Error, |
| 10 | } |
| 11 | |
| 12 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 13 | pub enum AddGuestsResponse { |
| 14 | Success, |
| 15 | Error(FailedToAddGuestsReason), |
| 16 | } |
| 17 | |
| 18 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 19 | pub enum FailedToAddGuestsReason { |
| 20 | /// Unexpected, something went wrong in the server. |
| 21 | Invalid, |
| 22 | /// One or more of the emails did not correspond with Warp users. |
| 23 | NotWarpUsers, |
| 24 | /// One or more of the guests has already been added to the session. |
| 25 | GuestAlreadyAdded, |
| 26 | } |
| 27 | |
| 28 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 29 | pub enum RemoveGuestResponse { |
| 30 | Success, |
| 31 | Error(FailedToRemoveGuestReason), |
| 32 | } |
| 33 | |
| 34 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 35 | pub enum FailedToRemoveGuestReason { |
| 36 | /// Unexpected, something went wrong in the server. |
| 37 | Invalid, |
| 38 | } |
| 39 | |
| 40 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 41 | pub enum UpdatePendingUserRoleResponse { |
| 42 | Success, |
| 43 | Error(FailedToUpdatePendingUserRoleReason), |
| 44 | } |
| 45 | |
| 46 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 47 | pub enum FailedToUpdatePendingUserRoleReason { |
| 48 | /// Unexpected, something went wrong in the server. |
| 49 | Invalid, |
| 50 | } |
| 51 | |
| 52 | #[derive(Serialize, Deserialize, Clone, Debug)] |
| 53 | pub enum TeamAccessLevelUpdateResponse { |
| 54 | Success { |
| 55 | team_uid: String, |
| 56 | team_acl: Option<TeamAclData>, |
| 57 | }, |
| 58 | Error(FailedToUpdateTeamAccessLevelReason), |
| 59 | } |
| 60 | |
| 61 | #[derive(Serialize, Deserialize, Clone, Copy, Debug)] |
| 62 | pub enum FailedToUpdateTeamAccessLevelReason { |
| 63 | /// Unexpected, something went wrong in the server. |
| 64 | Invalid, |
| 65 | } |