diff options
Diffstat (limited to 'matrix-specification/Responses/ClientLoginPostResponse.php')
| -rw-r--r-- | matrix-specification/Responses/ClientLoginPostResponse.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/matrix-specification/Responses/ClientLoginPostResponse.php b/matrix-specification/Responses/ClientLoginPostResponse.php new file mode 100644 index 0000000..4bb893d --- /dev/null +++ b/matrix-specification/Responses/ClientLoginPostResponse.php @@ -0,0 +1,30 @@ +<?php + +namespace Matrix\Responses; + +use Matrix\Data\DiscoveryInformation; + +class ClientLoginPostResponse implements \JsonSerializable +{ + public function __construct( + private string $accessToken, + private string $deviceId, + private string $userId, + private ?int $expiresInMilliseconds = null, + private ?string $refreshToken = null, + private ?DiscoveryInformation $wellKnown = null, + ) + {} + + public function jsonSerialize(): array + { + return array_filter([ + "access_token" => $this->accessToken, + "device_id" => $this->deviceId, + "expires_in_ms" => $this->expiresInMilliseconds, + "refresh_token" => $this->refreshToken, + "user_id" => $this->userId, + "well_known" => $this->wellKnown, + ], "is_null"); + } +} |
