Move role schemas to own file
This commit is contained in:
parent
6ed9eaf2fc
commit
2d828f2fdb
|
@ -14,27 +14,3 @@ pub struct GuildCreateSchema {
|
|||
pub system_channel_id: Option<String>,
|
||||
pub rules_channel_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
/// Represents the schema which needs to be sent to create or modify a Role.
|
||||
/// See: [https://docs.spacebar.chat/routes/#cmp--schemas-rolemodifyschema](https://docs.spacebar.chat/routes/#cmp--schemas-rolemodifyschema)
|
||||
pub struct RoleCreateModifySchema {
|
||||
pub name: Option<String>,
|
||||
pub permissions: Option<String>,
|
||||
pub color: Option<u32>,
|
||||
pub hoist: Option<bool>,
|
||||
pub icon: Option<Vec<u8>>,
|
||||
pub unicode_emoji: Option<String>,
|
||||
pub mentionable: Option<bool>,
|
||||
pub position: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
/// Represents the schema which needs to be sent to update a roles' position.
|
||||
/// See: [https://docs.spacebar.chat/routes/#cmp--schemas-rolepositionupdateschema](https://docs.spacebar.chat/routes/#cmp--schemas-rolepositionupdateschema)
|
||||
pub struct RolePositionUpdateSchema {
|
||||
pub id: Snowflake,
|
||||
pub position: i32,
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ mod auth;
|
|||
mod channel;
|
||||
mod guild;
|
||||
mod message;
|
||||
mod role;
|
||||
mod user;
|
||||
|
||||
pub use apierror::*;
|
||||
|
@ -10,6 +11,7 @@ pub use auth::*;
|
|||
pub use channel::*;
|
||||
pub use guild::*;
|
||||
pub use message::*;
|
||||
pub use role::*;
|
||||
pub use user::*;
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
use crate::types::Snowflake;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
/// Represents the schema which needs to be sent to create or modify a Role.
|
||||
/// See: [https://docs.spacebar.chat/routes/#cmp--schemas-rolemodifyschema](https://docs.spacebar.chat/routes/#cmp--schemas-rolemodifyschema)
|
||||
pub struct RoleCreateModifySchema {
|
||||
pub name: Option<String>,
|
||||
pub permissions: Option<String>,
|
||||
pub color: Option<u32>,
|
||||
pub hoist: Option<bool>,
|
||||
pub icon: Option<Vec<u8>>,
|
||||
pub unicode_emoji: Option<String>,
|
||||
pub mentionable: Option<bool>,
|
||||
pub position: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
/// Represents the schema which needs to be sent to update a roles' position.
|
||||
/// See: [https://docs.spacebar.chat/routes/#cmp--schemas-rolepositionupdateschema](https://docs.spacebar.chat/routes/#cmp--schemas-rolepositionupdateschema)
|
||||
pub struct RolePositionUpdateSchema {
|
||||
pub id: Snowflake,
|
||||
pub position: i32,
|
||||
}
|
Loading…
Reference in New Issue