diff --git a/client.go b/client.go index dcc3fe5e..6d2b4293 100644 --- a/client.go +++ b/client.go @@ -2729,6 +2729,13 @@ func (cli *Client) UnstableSetLockStatus(ctx context.Context, userID id.UserID, return } +// UnstableGetStorageUsage queries MSC4034 storage usage information for the current account. +func (cli *Client) UnstableGetStorageUsage(ctx context.Context) (resp *RespStorageUsage, err error) { + urlPath := cli.BuildClientURL("unstable", "org.matrix.msc4034", "usage") + _, err = cli.MakeRequest(ctx, http.MethodGet, urlPath, nil, &resp) + return +} + func (cli *Client) AppservicePing(ctx context.Context, id, txnID string) (resp *RespAppservicePing, err error) { _, err = cli.MakeFullRequest(ctx, FullRequest{ Method: http.MethodPost, diff --git a/responses.go b/responses.go index e7b6b75e..fda702a5 100644 --- a/responses.go +++ b/responses.go @@ -132,7 +132,15 @@ type RespRedactUserEvents struct { // RespMediaConfig is the JSON response for https://spec.matrix.org/v1.4/client-server-api/#get_matrixmediav3config type RespMediaConfig struct { - UploadSize int64 `json:"m.upload.size,omitempty"` + UploadSize int64 `json:"m.upload.size,omitempty"` + UnstableStorageSize *int64 `json:"org.matrix.msc4034.storage.size,omitempty"` + UnstableStorageFiles *int64 `json:"org.matrix.msc4034.storage.max_files,omitempty"` +} + +// RespStorageUsage is the JSON response for https://github.com/matrix-org/matrix-spec-proposals/pull/4034 +type RespStorageUsage struct { + Used *int64 `json:"org.matrix.msc4034.storage.used,omitempty"` + Files *int64 `json:"org.matrix.msc4034.storage.files,omitempty"` } // RespMediaUpload is the JSON response for https://spec.matrix.org/v1.2/client-server-api/#post_matrixmediav3upload