summaryrefslogtreecommitdiff
path: root/matrix-specification/Enums
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-09-19 17:03:47 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-09-19 17:03:47 +0200
commitb08047ba485f86038f33175162943c0a9878ab1a (patch)
tree49980e78eb3e641b04ddcc0817f74e89dc07f2b7 /matrix-specification/Enums
parent2ae0c2fa2a0bb5a7cd1fd9da1c6d2a6090126e67 (diff)
add separate matrix specification packageHEADmain
Diffstat (limited to 'matrix-specification/Enums')
-rw-r--r--matrix-specification/Enums/AuthenticationType.php19
-rw-r--r--matrix-specification/Enums/ErrorCode.php52
-rw-r--r--matrix-specification/Enums/EventType.php17
-rw-r--r--matrix-specification/Enums/LoginType.php14
-rw-r--r--matrix-specification/Enums/MembershipState.php17
-rw-r--r--matrix-specification/Enums/PresenceState.php15
-rw-r--r--matrix-specification/Enums/UserIdentifierType.php15
7 files changed, 149 insertions, 0 deletions
diff --git a/matrix-specification/Enums/AuthenticationType.php b/matrix-specification/Enums/AuthenticationType.php
new file mode 100644
index 0000000..e335eed
--- /dev/null
+++ b/matrix-specification/Enums/AuthenticationType.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum AuthenticationType: string implements \JsonSerializable
+{
+ case DUMMY = "m.login.dummy";
+ case EMAIL_IDENTITY = "m.login.email.identity";
+ case MSISDN = "m.login.msisdn";
+ case PASSWORD = "m.login.password";
+ case RECAPTCHA = "m.login.recaptcha";
+ case REGISTRATION_TOKEN = "m.login.registration_token";
+ case SSO = "m.login.sso";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/ErrorCode.php b/matrix-specification/Enums/ErrorCode.php
new file mode 100644
index 0000000..1a22f64
--- /dev/null
+++ b/matrix-specification/Enums/ErrorCode.php
@@ -0,0 +1,52 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum ErrorCode: string implements \JsonSerializable
+{
+ case FORBIDDEN = "M_FORBIDDEN";
+ case UNKNOWN_TOKEN = "M_UNKNOWN_TOKEN";
+ case MISSING_TOKEN = "M_MISSING_TOKEN";
+ case USER_LOCKED = "M_USER_LOCKED";
+ case USER_SUSPENDED = "M_USER_SUSPENDED";
+ case BAD_JSON = "M_BAD_JSON";
+ case NOT_JSON = "M_NOT_JSON";
+ case NOT_FOUND = "M_NOT_FOUND";
+ case LIMIT_EXCEEDED = "M_LIMIT_EXCEEDED";
+ case UNRECOGNIZED = "M_UNRECOGNIZED";
+ case UNKNOWN = "M_UNKNOWN";
+
+ case UNAUTHORIZED = "M_UNAUTHORIZED";
+ case USER_DEACTIVATED = "M_USER_DEACTIVATED";
+ case USER_IN_USE = "M_USER_IN_USE";
+ case INVALID_USERNAME = "M_INVALID_USERNAME";
+ case ROOM_IN_USE = "M_ROOM_IN_USE";
+ case INVALID_ROOM_STATE = "M_INVALID_ROOM_STATE";
+
+ case THREEPID_IN_USE = "M_THREEPID_IN_USE";
+ case THREEPID_NOT_FOUND = "M_THREEPID_NOT_FOUND";
+ case THREEPID_AUTH_FAILED = "M_THREEPID_AUTH_FAILED";
+ case THREEPID_DENIED = "M_THREEPID_DENIED";
+ case THREEPID_MEDIUM_NOT_SUPPORTED = "M_THREEPID_MEDIUM_NOT_SUPPORTED";
+
+ case SERVER_NOT_TRUSTED = "M_SERVER_NOT_TRUSTED";
+ case UNSUPPORTED_ROOM_VERSION = "M_UNSUPPORTED_ROOM_VERSION";
+ case INCOMPATIBLE_ROOM_VERSION = "M_INCOMPATIBLE_ROOM_VERSION";
+ case BAD_STATE = "M_BAD_STATE";
+ case GUEST_ACCESS_FORBIDDEN = "M_GUEST_ACCESS_FORBIDDEN";
+
+ case CAPTCHA_NEEDED = "M_CAPTCHA_NEEDED";
+ case CAPTCHA_INVALID = "M_CAPTCHA_INVALID";
+
+ case MISSING_PARAM = "M_MISSING_PARAM";
+ case INVALID_PARAM = "M_INVALID_PARAM";
+ case TOO_LARGE = "M_TOO_LARGE";
+ case EXCLUSIVE = "M_EXCLUSIVE";
+ case RESOURCE_LIMIT_EXCEEDED = "M_RESOURCE_LIMIT_EXCEEDED";
+ case CANNOT_LEAVE_SERVER_NOTICE_ROOM = "M_CANNOT_LEAVE_SERVER_NOTICE_ROOM";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/EventType.php b/matrix-specification/Enums/EventType.php
new file mode 100644
index 0000000..bf805b2
--- /dev/null
+++ b/matrix-specification/Enums/EventType.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum EventType: string implements \JsonSerializable
+{
+ case PRESENCE = "m.presence";
+
+ case ROOM_MEMBER = "m.room.member";
+ case ROOM_MESSAGE = "m.room.message";
+ case ROOM_NAME = "m.room.name";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/LoginType.php b/matrix-specification/Enums/LoginType.php
new file mode 100644
index 0000000..b268cf5
--- /dev/null
+++ b/matrix-specification/Enums/LoginType.php
@@ -0,0 +1,14 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum LoginType: string implements \JsonSerializable
+{
+ case PASSWORD = "m.login.password";
+ case TOKEN = "m.login.token";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/MembershipState.php b/matrix-specification/Enums/MembershipState.php
new file mode 100644
index 0000000..750f4c0
--- /dev/null
+++ b/matrix-specification/Enums/MembershipState.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum MembershipState: string implements \JsonSerializable
+{
+ case BAN = "ban";
+ case INVITE = "invite";
+ case JOIN = "join";
+ case KNOCK = "knock";
+ case LEAVE = "leave";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/PresenceState.php b/matrix-specification/Enums/PresenceState.php
new file mode 100644
index 0000000..bc97ae9
--- /dev/null
+++ b/matrix-specification/Enums/PresenceState.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum PresenceState: string implements \JsonSerializable
+{
+ case OFFLINE = "offline";
+ case ONLINE = "online";
+ case UNAVAILABLE = "unavailable";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}
diff --git a/matrix-specification/Enums/UserIdentifierType.php b/matrix-specification/Enums/UserIdentifierType.php
new file mode 100644
index 0000000..d4be36e
--- /dev/null
+++ b/matrix-specification/Enums/UserIdentifierType.php
@@ -0,0 +1,15 @@
+<?php
+
+namespace Matrix\Enums;
+
+enum UserIdentifierType: string implements \JsonSerializable
+{
+ case USER = "m.id.user";
+ case THIRDPARTY = "m.id.thirdparty";
+ case PHONE = "m.id.phone";
+
+ public function jsonSerialize(): string
+ {
+ return $this->value;
+ }
+}