Skip to content

Commit

Permalink
Missing commands and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
novacrazy committed Dec 19, 2023
1 parent dfbf2b5 commit 7acdb6c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/api/commands/party.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ command! {
pub party_id: Snowflake,
}

+struct GetPartyMember -> PartyMember: GET("party" / party_id / "member" / member_id) {
pub party_id: Snowflake,
pub member_id: Snowflake,
}

+struct GetPartyRooms -> Vec<Room>: GET("party" / party_id / "rooms") {
pub party_id: Snowflake,
}
Expand All @@ -141,7 +146,7 @@ command! {
#[cfg_attr(feature = "builder", derive(typed_builder::TypedBuilder))]
struct UpdateMemberProfileBody {
#[serde(flatten)]
profile: user::UpdateUserProfileBody,
pub profile: user::UpdateUserProfileBody,
}
}

Expand Down
14 changes: 14 additions & 0 deletions src/api/commands/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ command! {
}
}

+struct DeleteMessage -> (): DELETE("room" / room_id / "messages" / msg_id) where READ_MESSAGE_HISTORY {
pub room_id: Snowflake,
pub msg_id: Snowflake,
}

+struct GetMessage -> Message: GET("room" / room_id / "messages" / msg_id) where READ_MESSAGE_HISTORY {
pub room_id: Snowflake,
pub msg_id: Snowflake,
Expand Down Expand Up @@ -173,12 +178,17 @@ command! {
}
}

+struct GetRoom -> FullRoom: GET("room" / room_id) {
pub room_id: Snowflake,
}

+struct PatchRoom -> FullRoom: PATCH[500 ms, 1]("room" / room_id) {
pub room_id: Snowflake,

;
/// `Nullable::Undefined` or `Option::None` fields indicate no change
#[cfg_attr(feature = "builder", derive(typed_builder::TypedBuilder))]
#[cfg_attr(feature = "rkyv", archive(compare(PartialEq)))]
#[derive(Default, PartialEq)]
struct PatchRoomForm {
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -212,4 +222,8 @@ command! {
pub nsfw: Option<bool>,
}
}

+struct DeleteRoom -> (): DELETE[500 ms, 1]("room" / room_id) {
pub room_id: Snowflake,
}
}
1 change: 1 addition & 0 deletions src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ common::enum_codes! {
Unimplemented = 50013,
BincodeError = 50014,
CborError = 50015,
RkyvEncodingError = 50016,

// Client errors
AlreadyExists = 40001,
Expand Down
2 changes: 1 addition & 1 deletion src/models/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const _: () = {
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "rkyv", derive(rkyv::Archive, rkyv::Serialize, rkyv::Deserialize))]
#[cfg_attr(feature = "rkyv", archive(check_bytes))]
#[cfg_attr(feature = "rkyv", archive(check_bytes, compare(PartialEq)))]
pub struct Overwrite {
/// Role or user ID
///
Expand Down

0 comments on commit 7acdb6c

Please sign in to comment.