pub struct GroupGroupTypesResource<'a> { /* private fields */ }Expand description
client.group().group_types()
Implementations§
Source§impl<'a> GroupGroupTypesResource<'a>
impl<'a> GroupGroupTypesResource<'a>
Sourcepub fn create(&self, body: &GroupTypeCreate) -> Result<GroupType>
pub fn create(&self, body: &GroupTypeCreate) -> Result<GroupType>
Create group type
POST /group/grouptypes
Creates a group type: shared configuration for groups such as small groups or ministry teams. This creates no groups or memberships. A participant role (the default) and a leader role are created automatically for the new type. Retrieve them with GET /group/roles?group_type_id={id} using the ID returned in data.id. Requires the churchgroup permission “edit masterdata”. Supply all required settings; the boolean fields do not have implicit request defaults. description is optional; omitted, null or blank descriptions are stored as null. Text fields are trimmed. Returns the created type with its generated ID, translated names and metadata.
§Example
let body = models::GroupTypeCreate {
available_for_new_person: false,
color: "blue".into(),
is_leader_necessary: false,
name: "Kleingruppe".into(),
name_plural: "Kleingruppen".into(),
permission_depth: 0,
posts_enabled: true,
shorty: "KG".into(),
sort_key: 2,
..Default::default()
};
let result = client.group().group_types().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, group_type_id: impl Display) -> Result<()>
pub fn delete(&self, group_type_id: impl Display) -> Result<()>
Delete grouptype
DELETE /group/grouptypes/{groupTypeId}
Deletes a group type, including its role definitions, when no groups still reference it. Requires the churchgroup permission “edit masterdata”. Existing groups block deletion; use a dry run to inspect references before making changes. dryRun=true performs the deletion checks without deleting anything and returns a 409 deletion report even when deletion would be possible. A successful actual deletion returns 204 with no response body.
Use Self::delete_with to pass query parameters.
§Example
client.group().group_types().delete(2)?;Sourcepub fn delete_with(
&self,
group_type_id: impl Display,
query: &DeleteGroupGrouptypesGroupTypeIdQuery,
) -> Result<()>
pub fn delete_with( &self, group_type_id: impl Display, query: &DeleteGroupGrouptypesGroupTypeIdQuery, ) -> Result<()>
Delete grouptype
Like Self::delete, with query parameters.
DELETE /group/grouptypes/{groupTypeId}
Deletes a group type, including its role definitions, when no groups still reference it. Requires the churchgroup permission “edit masterdata”. Existing groups block deletion; use a dry run to inspect references before making changes. dryRun=true performs the deletion checks without deleting anything and returns a 409 deletion report even when deletion would be possible. A successful actual deletion returns 204 with no response body.
Sourcepub fn get(&self, group_type_id: impl Display) -> Result<GroupType>
pub fn get(&self, group_type_id: impl Display) -> Result<GroupType>
Get grouptype
GET /group/grouptypes/{groupTypeId}
Returns one group type by its installation-specific ID from GET /group/grouptypes. The result describes shared settings, not a concrete group. Use GET /group/roles with group_type_id to retrieve the role definitions belonging to this type. Requires authentication, but no master-data editing permission. Returns 404 when the type does not exist.
§Example
let group_type = client.group().group_types().get(2)?;
println!("{}", group_type.name);Sourcepub fn list(&self) -> Result<Vec<GroupType>>
pub fn list(&self) -> Result<Vec<GroupType>>
Get all group types
GET /group/grouptypes
Returns all group types configured in this ChurchTools installation. Group types are shared configuration records (master data), for example “Small group” or “Ministry team”. A group is a concrete collection of people, such as “Tuesday evening small group”, and references one type through information.groupTypeId.
Each type defines common settings and has its own membership roles, such as leader or participant. Use GET /group/roles to retrieve role definitions and match their groupTypeId to the type’s id. Use GET /groups to retrieve actual groups; this endpoint does not return groups or their members.
Requires authentication. No master-data editing permission is required. The response is not paginated and accepts no filters. Results are ordered by sortKey ascending, then by the stored name ascending. meta.count is the number of group types returned. IDs and names are installation-specific; integrations should discover them instead of assuming fixed values.
§Example
for group_type in client.group().group_types().list()? {
println!("{}", group_type.name);
}Sourcepub fn update(
&self,
group_type_id: impl Display,
body: &GroupTypeCreate,
) -> Result<GroupType>
pub fn update( &self, group_type_id: impl Display, body: &GroupTypeCreate, ) -> Result<GroupType>
Update GroupType
PUT /group/grouptypes/{groupTypeId}
Updates the shared settings of a group type. Existing groups reference these settings; this endpoint does not create a group or change which type a group belongs to. Requires the churchgroup permission “edit masterdata”. Supply all required fields, including unchanged settings; this is not a partial update. The type ID comes from the URL, and no body id is required. Omitting description clears it to null rather than preserving the old text; null or blank text also clears it. Text fields are trimmed. Returns the updated type with translated names and metadata.
§Example
let body = models::GroupTypeCreate {
available_for_new_person: false,
color: "blue".into(),
is_leader_necessary: false,
name: "Kleingruppe".into(),
name_plural: "Kleingruppen".into(),
permission_depth: 0,
posts_enabled: true,
shorty: "KG".into(),
sort_key: 2,
..Default::default()
};
let result = client.group().group_types().update(2, &body)?;
println!("{}", result.name);