pub struct GroupGroupCategoriesResource<'a> { /* private fields */ }Expand description
client.group().group_categories()
Implementations§
Source§impl<'a> GroupGroupCategoriesResource<'a>
impl<'a> GroupGroupCategoriesResource<'a>
Sourcepub fn create(&self, body: &GroupCategoryCreate) -> Result<GroupCategory>
pub fn create(&self, body: &GroupCategoryCreate) -> Result<GroupCategory>
Create group category
POST /group/groupcategories
Creates a group category as shared master data. Categories organize groups by theme, for example worship services or community activities. A group references its category through information.groupCategoryId. Its group type separately defines shared settings and membership roles. Requires the churchgroup permission “edit masterdata”. Supply name, color and sortKey. description is optional; omitted, null or blank input is stored as null. Text fields are trimmed. Returns the created record with its generated ID and translated display name. Creating this record does not create or assign any groups.
§Example
let body = models::GroupCategoryCreate {
color: "blue".into(),
name: "Gottesdienst".into(),
sort_key: 5,
..Default::default()
};
let result = client.group().group_categories().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(
&self,
group_category_id: impl Display,
query: &DeleteGroupGroupcategoriesGroupCategoryIdQuery,
) -> Result<()>
pub fn delete( &self, group_category_id: impl Display, query: &DeleteGroupGroupcategoriesGroupCategoryIdQuery, ) -> Result<()>
Delete group category
DELETE /group/groupcategories/{groupCategoryId}
Deletes a group category. The deletion report includes groups that reference this category. Deleting a category does not delete these groups or their memberships. Requires the churchgroup permission “edit masterdata”. The dryRun query parameter is required: send false to delete or true to inspect the deletion report. A dry run changes no records and returns 409 with the report, even when deletion would be possible. An actual successful deletion returns 204 without a body.
§Example
let query = DeleteGroupGroupcategoriesGroupCategoryIdQuery {
dry_run: Some(true),
..Default::default()
};
client.group().group_categories().delete(2, &query)?;Sourcepub fn get(&self, group_category_id: impl Display) -> Result<GroupCategory>
pub fn get(&self, group_category_id: impl Display) -> Result<GroupCategory>
Get group category
GET /group/groupcategories/{groupCategoryId}
Returns one group category using its ID from GET /group/groupcategories. Categories organize groups by theme, for example worship services or community activities. A group references its category through information.groupCategoryId. Its group type separately defines shared settings and membership roles. Requires authentication, but no master-data editing permission. Returns a single object in data and no list metadata. Returns 404 when the record does not exist.
§Example
let group_category = client.group().group_categories().get(2)?;
println!("{}", group_category.name);Sourcepub fn list(&self) -> Result<Vec<GroupCategory>>
pub fn list(&self) -> Result<Vec<GroupCategory>>
Get all group categories
GET /group/groupcategories
Returns all group categories configured in this ChurchTools installation. Categories organize groups by theme, for example worship services or community activities. A group references its category through information.groupCategoryId. Its group type separately defines shared settings and membership roles. Requires authentication, but no master-data editing permission. There are no filter or pagination parameters. Results are ordered by sortKey ascending and then by the stored name ascending; meta.count is the number of returned records. IDs and labels are installation-specific; discover them before assigning them to groups.
§Example
for group_category in client.group().group_categories().list()? {
println!("{}", group_category.name);
}Sourcepub fn update(
&self,
group_category_id: impl Display,
body: &GroupCategoryCreate,
) -> Result<GroupCategory>
pub fn update( &self, group_category_id: impl Display, body: &GroupCategoryCreate, ) -> Result<GroupCategory>
Update group category
PUT /group/groupcategories/{groupCategoryId}
Updates the shared group category identified by groupCategoryId. Existing group assignments continue to reference the same record. This is a full update, not a partial update. Requires the churchgroup permission “edit masterdata”. Supply name, color and sortKey. description is optional; omitted, null or blank input is stored as null. Text fields are trimmed. The ID comes from the URL; no body id is required. Returns the updated record in data.
§Example
let body = models::GroupCategoryCreate {
color: "blue".into(),
name: "Gottesdienst".into(),
sort_key: 5,
..Default::default()
};
let result = client.group().group_categories().update(2, &body)?;
println!("{}", result.name);