summaryrefslogtreecommitdiff
path: root/matrix-specification/Requests/ClientKeysUploadPostRequest.php
diff options
context:
space:
mode:
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));
}
}