diff options
Diffstat (limited to 'matrix-specification/Responses/ClientSyncGetResponse.php')
| -rw-r--r-- | matrix-specification/Responses/ClientSyncGetResponse.php | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/matrix-specification/Responses/ClientSyncGetResponse.php b/matrix-specification/Responses/ClientSyncGetResponse.php index 27464c1..ccdc5e6 100644 --- a/matrix-specification/Responses/ClientSyncGetResponse.php +++ b/matrix-specification/Responses/ClientSyncGetResponse.php @@ -2,7 +2,38 @@ namespace Matrix\Responses; -class ClientSyncGetResponse +use Matrix\Data\AccountData; +use Matrix\Data\DeviceLists; +use Matrix\Data\Presence; +use Matrix\Data\Room\Rooms; +use Matrix\Data\ToDevice; + +class ClientSyncGetResponse implements \JsonSerializable { - # TODO + /** + * @param array<string, int> $deviceOneTimeKeysCount + */ + public function __construct( + private string $nextBatch, + private ?AccountData $accountData = null, + private ?DeviceLists $deviceLists = null, + private ?array $deviceOneTimeKeysCount = null, + private ?Presence $presence = null, + private ?Rooms $rooms = null, + private ?ToDevice $toDevice = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "account_data" => $this->accountData, + "device_lists" => $this->deviceLists, + "device_one_time_keys_count" => $this->deviceOneTimeKeysCount, + "next_batch" => $this->nextBatch, + "presence" => $this->presence, + "rooms" => $this->rooms, + "to_device" => $this->toDevice, + ], "is_null"); + } } |
