Skip to content

Commit

Permalink
fixup! client: add key backup functions
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <sumner@beeper.com>
  • Loading branch information
sumnerevans committed Jan 11, 2024
1 parent 1c6e561 commit 2d07f92
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2050,10 +2050,10 @@ func (cli *Client) GetKeyBackupLatestVersion(ctx context.Context) (resp *RespRoo
return
}

// CreateBackupVersion creates a new key backup.
// CreateKeyBackupVersion creates a new key backup.
//
// See: https://spec.matrix.org/v1.9/client-server-api/#post_matrixclientv3room_keysversion
func (cli *Client) CreateBackupVersion(ctx context.Context, req *ReqRoomKeysVersionCreate) (resp *RespRoomKeysVersionCreate, err error) {
func (cli *Client) CreateKeyBackupVersion(ctx context.Context, req *ReqRoomKeysVersionCreate) (resp *RespRoomKeysVersionCreate, err error) {
urlPath := cli.BuildClientURL("v3", "room_keys", "version")
_, err = cli.MakeRequest(ctx, http.MethodPost, urlPath, req, &resp)
return
Expand All @@ -2068,22 +2068,22 @@ func (cli *Client) GetKeyBackupVersion(ctx context.Context, version string) (res
return
}

// UpdateRoomKeysVersion updates information about an existing key backup. Only
// UpdateKeyBackupVersion updates information about an existing key backup. Only
// the auth_data can be modified.
//
// See: https://spec.matrix.org/v1.9/client-server-api/#put_matrixclientv3room_keysversionversion
func (cli *Client) UpdateRoomKeysVersion(ctx context.Context, version string, req *ReqRoomKeysVersionUpdate) error {
func (cli *Client) UpdateKeyBackupVersion(ctx context.Context, version string, req *ReqRoomKeysVersionUpdate) error {
urlPath := cli.BuildClientURL("v3", "room_keys", "version", version)
_, err := cli.MakeRequest(ctx, http.MethodPut, urlPath, nil, nil)
return err
}

// DeleteRoomKeysVersion deletes an existing key backup. Both the information
// DeleteKeyBackupVersion deletes an existing key backup. Both the information
// about the backup, as well as all key data related to the backup will be
// deleted.
//
// See: https://spec.matrix.org/v1.1/client-server-api/#delete_matrixclientv3room_keysversionversion
func (cli *Client) DeleteRoomKeysVersion(ctx context.Context, version string) error {
func (cli *Client) DeleteKeyBackupVersion(ctx context.Context, version string) error {
urlPath := cli.BuildClientURL("v3", "room_keys", "version", version)
_, err := cli.MakeRequest(ctx, http.MethodDelete, urlPath, nil, nil)
return err
Expand Down

0 comments on commit 2d07f92

Please sign in to comment.