diff --git a/ruma-client-api/src/r0/membership/leave_room.rs b/ruma-client-api/src/r0/membership/leave_room.rs index 99a22b12..0ee583b7 100644 --- a/ruma-client-api/src/r0/membership/leave_room.rs +++ b/ruma-client-api/src/r0/membership/leave_room.rs @@ -16,10 +16,24 @@ ruma_api! { request: { /// The room to leave. #[ruma_api(path)] - pub room_id: RoomId, + pub room_id: &'a RoomId, } response: {} error: crate::Error } + +impl<'a> Request<'a> { + /// Creates a new `Request` with the given room id. + pub fn new(room_id: &'a RoomId) -> Self { + Self { room_id } + } +} + +impl Response { + /// Creates an empty `Response`. + pub fn new() -> Self { + Self + } +}