Add documentation
This commit is contained in:
parent
f41312d430
commit
47f8b131a3
|
@ -9,6 +9,20 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
impl types::RoleObject {
|
impl types::RoleObject {
|
||||||
|
/// Retrieves all roles for a given guild.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `user` - A mutable reference to a [`UserMeta`] instance.
|
||||||
|
/// * `guild_id` - The ID of the guild to retrieve roles from.
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
///
|
||||||
|
/// An `Option` containing a `Vec` of [`RoleObject`]s if roles were found, or `None` if no roles were found.
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns a [`ChorusLibError`] if the request fails or if the response is invalid.
|
||||||
pub async fn get_all(
|
pub async fn get_all(
|
||||||
user: &mut UserMeta,
|
user: &mut UserMeta,
|
||||||
guild_id: &str,
|
guild_id: &str,
|
||||||
|
@ -38,6 +52,21 @@ impl types::RoleObject {
|
||||||
Ok(Some(roles))
|
Ok(Some(roles))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Creates a new role for a given guild.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `user` - A mutable reference to a [`UserMeta`] instance.
|
||||||
|
/// * `guild_id` - The ID of the guild to create the role in.
|
||||||
|
/// * `role_create_schema` - A [`RoleCreateModifySchema`] instance containing the properties of the role to be created.
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
///
|
||||||
|
/// A `Result` containing the newly created [`RoleObject`] if successful, or a [`ChorusLibError`] if the request fails or if the response is invalid.
|
||||||
|
///
|
||||||
|
/// # Errors
|
||||||
|
///
|
||||||
|
/// Returns a [`ChorusLibError`] if the request fails or if the response is invalid.
|
||||||
pub async fn create(
|
pub async fn create(
|
||||||
user: &mut UserMeta,
|
user: &mut UserMeta,
|
||||||
guild_id: &str,
|
guild_id: &str,
|
||||||
|
|
Loading…
Reference in New Issue