pub struct SongCategoriesResource<'a> { /* private fields */ }Expand description
client.song().categories()
Implementations§
Source§impl<'a> SongCategoriesResource<'a>
impl<'a> SongCategoriesResource<'a>
Sourcepub fn create(&self, body: &SongCategoryCreate) -> Result<SongCategory>
pub fn create(&self, body: &SongCategoryCreate) -> Result<SongCategory>
Create a song category
POST /song/categories
Creates a song category. Requires edit masterdata in churchservice. A supplied campus ID must exist.
§Example
let body = models::SongCategoryCreate {
name: "Worship".into(),
..Default::default()
};
let result = client.song().categories().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, song_category_id: impl Display) -> Result<()>
pub fn delete(&self, song_category_id: impl Display) -> Result<()>
Delete song category
DELETE /song/categories/{songCategoryId}
Deletes the song category. Requires edit masterdata in churchservice. Songs referencing this category prevent deletion.
§Example
client.song().categories().delete(1)?;Sourcepub fn get(&self, song_category_id: impl Display) -> Result<SongCategory>
pub fn get(&self, song_category_id: impl Display) -> Result<SongCategory>
Get a song category by ID
GET /song/categories/{songCategoryId}
Returns one song category without an additional record-level visibility check.
§Example
let category = client.song().categories().get(1)?;
println!("{}", category.name);Sourcepub fn list(&self) -> Result<Vec<SongCategory>>
pub fn list(&self) -> Result<Vec<SongCategory>>
Get all song categories
GET /song/categories
Returns all song categories ordered by sortKey ascending and then name ascending. The list is unpaginated and has no visibility or campus filter.
§Example
for category in client.song().categories().list()? {
println!("{}", category.name);
}Sourcepub fn update(
&self,
song_category_id: impl Display,
body: &SongCategoryUpdate,
) -> Result<SongCategory>
pub fn update( &self, song_category_id: impl Display, body: &SongCategoryUpdate, ) -> Result<SongCategory>
Update song category
PUT /song/categories/{songCategoryId}
Replaces the song category. Requires edit masterdata in churchservice. A supplied campus ID must exist.
§Example
let body = models::SongCategoryUpdate {
name: "Worship".into(),
..Default::default()
};
let result = client.song().categories().update(1, &body)?;
println!("{}", result.name);