use super::Client;
use crate::{
error::Result, requests::scene_collections::Request, responses::scene_collections as responses,
};
pub struct SceneCollections<'a> {
pub(super) client: &'a Client,
}
impl SceneCollections<'_> {
#[doc(alias = "GetSceneCollectionList")]
pub async fn list(&self) -> Result<responses::SceneCollections> {
self.client.send_message(Request::List).await
}
#[doc(alias = "GetSceneCollectionList")]
pub async fn current(&self) -> Result<String> {
self.client
.send_message::<_, responses::SceneCollections>(Request::List)
.await
.map(|sc| sc.current)
}
#[doc(alias = "SetCurrentSceneCollection")]
pub async fn set_current(&self, name: &str) -> Result<()> {
self.client.send_message(Request::SetCurrent { name }).await
}
#[doc(alias = "CreateSceneCollection")]
pub async fn create(&self, name: &str) -> Result<()> {
self.client.send_message(Request::Create { name }).await
}
}