summaryrefslogtreecommitdiff
path: root/matrix-specification/Requests/ClientKeysUploadPostRequest.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-12-13 16:27:53 +0100
committerDaniel Weipert <git@mail.dweipert.de>2025-12-13 16:27:53 +0100
commit2386148b8f048ba40d9f26cc97898bdcdc778ea2 (patch)
tree48ca45de3dc6133cb0225eba8c5917f813082b2b /matrix-specification/Requests/ClientKeysUploadPostRequest.php
parentb19a8f63ad727a3633885d3f2b81edf8181a53b9 (diff)
matrix specification splitHEADmain
Diffstat (limited to 'matrix-specification/Requests/ClientKeysUploadPostRequest.php')
-rw-r--r--matrix-specification/Requests/ClientKeysUploadPostRequest.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/matrix-specification/Requests/ClientKeysUploadPostRequest.php b/matrix-specification/Requests/ClientKeysUploadPostRequest.php
index 40d9eae..05b2fde 100644
--- a/matrix-specification/Requests/ClientKeysUploadPostRequest.php
+++ b/matrix-specification/Requests/ClientKeysUploadPostRequest.php
@@ -4,8 +4,10 @@ namespace Matrix\Requests;
use Matrix\Data\DeviceKeys;
use Matrix\Data\KeyObject;
+use Matrix\Enums\ApiPathVersion;
+use Matrix\Request;
-class ClientKeysUploadPostRequest implements RateLimited, RequiresAuthentication, \JsonSerializable
+class ClientKeysUploadPostRequest extends Request implements RateLimited, RequiresAuthentication
{
/**
* @param array<string, string|KeyObject> $fallbackKeys
@@ -18,12 +20,22 @@ class ClientKeysUploadPostRequest implements RateLimited, RequiresAuthentication
)
{}
- public function jsonSerialize(): array
+ public function getUri(string $scheme, string $serverName, ApiPathVersion $version): string
+ {
+ return "{$scheme}://{$serverName}/_matrix/client/{$version}/keys/upload";
+ }
+
+ public function getQueryParameters(): array
+ {
+ return [];
+ }
+
+ public function getBody(): array
{
return array_filter([
"device_keys" => $this->deviceKeys,
"fallback_keys" => $this->fallbackKeys,
"one_time_keys" => $this->oneTimeKeys,
- ], "is_null");
+ ], fn ($value) => ! is_null($value));
}
}