]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/GroupPermission.java
Implement setting group permissions
[signal-cli] / src / main / java / org / asamk / signal / GroupPermission.java
diff --git a/src/main/java/org/asamk/signal/GroupPermission.java b/src/main/java/org/asamk/signal/GroupPermission.java
new file mode 100644 (file)
index 0000000..0805628
--- /dev/null
@@ -0,0 +1,27 @@
+package org.asamk.signal;
+
+public enum GroupPermission {
+    EVERY_MEMBER {
+        @Override
+        public String toString() {
+            return "every-member";
+        }
+    },
+    ONLY_ADMINS {
+        @Override
+        public String toString() {
+            return "only-admins";
+        }
+    };
+
+    public org.asamk.signal.manager.groups.GroupPermission toManager() {
+        switch (this) {
+            case EVERY_MEMBER:
+                return org.asamk.signal.manager.groups.GroupPermission.EVERY_MEMBER;
+            case ONLY_ADMINS:
+                return org.asamk.signal.manager.groups.GroupPermission.ONLY_ADMINS;
+            default:
+                throw new AssertionError();
+        }
+    }
+}