pub struct WikiCategoriesResource<'a> { /* private fields */ }Expand description
client.wiki().categories()
Implementations§
Source§impl<'a> WikiCategoriesResource<'a>
impl<'a> WikiCategoriesResource<'a>
pub fn pages(&self) -> WikiCategoriesPagesResource<'a>
Sourcepub fn create(&self, body: &WikiCategoryCreate) -> Result<WikiCategory>
pub fn create(&self, body: &WikiCategoryCreate) -> Result<WikiCategory>
Create a new wiki category
POST /wiki/categories
Creates a wiki category and an initial page titled main (version 1, empty text, Markdown enabled). Requires churchwiki edit masterdata. The creator receives view category and edit category permissions for the new category if missing. A nonexistent campusId silently resolves to null. The returned category has an empty permissions object; use the list to obtain page-operation hints.
§Example
let body = models::WikiCategoryCreate {
file_access_without_permission: false,
in_menu: true,
name: "Dokumentation".into(),
sort_key: 10,
..Default::default()
};
let result = client.wiki().categories().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, wiki_category_id: impl Display) -> Result<()>
pub fn delete(&self, wiki_category_id: impl Display) -> Result<()>
Delete a wiki category
DELETE /wiki/categories/{wikiCategoryId}
Deletes the category, all its wiki page versions and category view/edit permission assignments. Requires churchwiki edit masterdata. Existing pages do not block this deletion, and no page-level protected-system-page check is made by this handler. A missing category normally succeeds with 204. No request body or dry-run parameter is consumed.
§Example
client.wiki().categories().delete(42)?;Sourcepub fn list(&self) -> Result<Vec<WikiCategory>>
pub fn list(&self) -> Result<Vec<WikiCategory>>
Get all wiki categories
GET /wiki/categories
Lists wiki categories for which the current user (including a guest) has churchwiki view category permission. Categories organize pages and define their access permissions. Results are sorted by sortKey, then stored name, without pagination. inMenu does not filter this catalog. Each category’s canEdit/canDelete flags describe page operations based on edit category, not permission to rename or delete the category itself. The top-level permissions.editMasterData flag controls category administration. meta.count counts visible categories.
§Example
for category in client.wiki().categories().list()? {
println!("{}", category.name);
}Sourcepub fn update(
&self,
wiki_category_id: impl Display,
body: &WikiCategoryUpdate,
) -> Result<WikiCategory>
pub fn update( &self, wiki_category_id: impl Display, body: &WikiCategoryUpdate, ) -> Result<WikiCategory>
Update a wiki category
PUT /wiki/categories/{wikiCategoryId}
Replaces the category’s name, sort order, menu flag, file-access flag and optional campus association. Requires churchwiki edit masterdata. name, sortKey, inMenu and fileAccessWithoutPermission are required; omitted/null or unknown campusId clears the association. Pages and their versions are retained. The response permissions object is normally empty.
§Example
let body = models::WikiCategoryUpdate {
file_access_without_permission: false,
in_menu: true,
name: "Dokumentation".into(),
sort_key: 10,
..Default::default()
};
let result = client.wiki().categories().update(42, &body)?;
println!("{}", result.name);