pub struct PublicGroupsResource<'a> { /* private fields */ }Expand description
client.public_groups()
Implementations§
Source§impl<'a> PublicGroupsResource<'a>
impl<'a> PublicGroupsResource<'a>
pub fn signup(&self) -> PublicGroupsSignupResource<'a>
Sourcepub fn get(&self, group_id: impl Display) -> Result<PublicGroupDetail>
pub fn get(&self, group_id: impl Display) -> Result<PublicGroupDetail>
Get public group details
GET /publicgroups/{groupId}
Returns group details, signup conditions and eligible signUpPersons for the current user. Public access is supported, but normal group-view permission still applies. Optional hash restricts the lookup to an enabled group homepage. Without it, the group is loaded directly. Seat counts include membership/role rules and need not equal the number of persons. Image and leader fields depend on the homepage display settings; signUpConditions explains why a signup is currently available or unavailable.
Use Self::get_with to pass query parameters.
§Example
let public_group = client.public_groups().get(42)?;
println!("{}", public_group.name);Sourcepub fn get_with(
&self,
group_id: impl Display,
query: &GetPublicgroupsIdQuery,
) -> Result<PublicGroupDetail>
pub fn get_with( &self, group_id: impl Display, query: &GetPublicgroupsIdQuery, ) -> Result<PublicGroupDetail>
Get public group details
Like Self::get, with query parameters.
GET /publicgroups/{groupId}
Returns group details, signup conditions and eligible signUpPersons for the current user. Public access is supported, but normal group-view permission still applies. Optional hash restricts the lookup to an enabled group homepage. Without it, the group is loaded directly. Seat counts include membership/role rules and need not equal the number of persons. Image and leader fields depend on the homepage display settings; signUpConditions explains why a signup is currently available or unavailable.
Sourcepub fn get_form(
&self,
group_id: impl Display,
query: &GetPublicgroupsGroupIdFormQuery,
) -> Result<PublicGroupFormResult>
pub fn get_form( &self, group_id: impl Display, query: &GetPublicgroupsGroupIdFormQuery, ) -> Result<PublicGroupFormResult>
Get group signup form
GET /publicgroups/{groupId}/form
Loads the dynamic signup form for a token belonging to this group. Requires access to group signup. The response is wrapped in data. Each field is identified by type plus id; required fields and allowed options depend on group configuration and on the requester. Additional spouse/child/other forms are null when unavailable. Optional personId selects the requester and persists that choice on the token (this GET changes state). Use a person returned by possiblerequesters. Prefilled person values and privacy state are returned in signUpPersons.
§Example
let query = GetPublicgroupsGroupIdFormQuery {
token: Some("abc123".into()),
..Default::default()
};
let form = client.public_groups().get_form(42, &query)?;
println!("{:?}", form.email);Sourcepub fn get_possible_requesters(
&self,
group_id: impl Display,
query: &GetPublicgroupsGroupIdPossiblerequestersQuery,
) -> Result<PublicGroupPossibleRequesters>
pub fn get_possible_requesters( &self, group_id: impl Display, query: &GetPublicgroupsGroupIdPossiblerequestersQuery, ) -> Result<PublicGroupPossibleRequesters>
List possible signup requesters
GET /publicgroups/{groupId}/possiblerequesters
Returns a requester-selection object for a token belonging to this group. Requires access to group signup. An email token lists persons sharing that address, because email addresses are not unique in ChurchTools; a token without email uses its requesterId. Status distinguishes existing members, pending/waiting requests and persons not yet requested. Results are not paginated and the DTO has no meta.count.
§Example
let query = GetPublicgroupsGroupIdPossiblerequestersQuery {
token: Some("abc123".into()),
..Default::default()
};
let possible_requester = client.public_groups().get_possible_requesters(42, &query)?;
println!("{:?}", possible_requester.email);Sourcepub fn get_signout_data(
&self,
group_id: impl Display,
) -> Result<PublicGroupSignoutData>
pub fn get_signout_data( &self, group_id: impl Display, ) -> Result<PublicGroupSignoutData>
Get group withdrawal options
GET /publicgroups/{groupId}/signoutdata
Returns requester information and the persons whose group participation may be withdrawn directly or requires contacting leaders. A supplied signup token must belong to this group; without token the current user is used and signup access is required. For requesterId=-1 (no person created), requester and both person lists are null and noUserCreated=true is included. For a normal requester that flag is omitted. This GET does not withdraw anyone.
Use Self::get_signout_data_with to pass query parameters.
§Example
let signout_data = client.public_groups().get_signout_data(42)?;
println!("{}", signout_data.group_has_auto_accept);Sourcepub fn get_signout_data_with(
&self,
group_id: impl Display,
query: &GetPublicgroupsIdSignoutdataQuery,
) -> Result<PublicGroupSignoutData>
pub fn get_signout_data_with( &self, group_id: impl Display, query: &GetPublicgroupsIdSignoutdataQuery, ) -> Result<PublicGroupSignoutData>
Get group withdrawal options
Like Self::get_signout_data, with query parameters.
GET /publicgroups/{groupId}/signoutdata
Returns requester information and the persons whose group participation may be withdrawn directly or requires contacting leaders. A supplied signup token must belong to this group; without token the current user is used and signup access is required. For requesterId=-1 (no person created), requester and both person lists are null and noUserCreated=true is included. For a normal requester that flag is omitted. This GET does not withdraw anyone.
Sourcepub fn get_with_hash(
&self,
group_id: impl Display,
hash: impl Display,
) -> Result<PublicGroupDetail>
pub fn get_with_hash( &self, group_id: impl Display, hash: impl Display, ) -> Result<PublicGroupDetail>
Get public group details
GET /publicgroups/{groupId}/{hash}
Returns group details, signup conditions and eligible signUpPersons for the current user. Public access is supported, but normal group-view permission still applies. The hash identifies an enabled group homepage; the group must be included in that homepage. This endpoint returns one group, not the whole homepage. Seat counts include membership/role rules and need not equal the number of persons. Image and leader fields depend on the homepage display settings; signUpConditions explains why a signup is currently available or unavailable.
§Example
let with_hash = client.public_groups().get_with_hash(42, "abc123")?;
println!("{}", with_hash.name);Sourcepub fn mail_to_leaders(
&self,
group_id: impl Display,
body: &PublicGroupLeaderMailCreate,
) -> Result<PostPublicgroupsGroupIdMailToLeadersData>
pub fn mail_to_leaders( &self, group_id: impl Display, body: &PublicGroupLeaderMailCreate, ) -> Result<PostPublicgroupsGroupIdMailToLeadersData>
Contact public group leaders
POST /publicgroups/{groupId}/mailToLeaders
Sends the supplied message to group leaders with a default email address. Requires group signup access or a valid signup token for this group. The sender name/email are supplied by the caller. hideContactLeader is a display setting and is not checked here. No reachable leaders causes a server error; successful processing returns a message and does not create a membership.
§Example
let body = models::PublicGroupLeaderMailCreate {
email: "mara@example.org".into(),
message: "Hallo zusammen".into(),
name: "Hauskreis Nord".into(),
..Default::default()
};
let public_group = client.public_groups().mail_to_leaders(42, &body)?;
println!("{}", public_group.success);Sourcepub fn signout(
&self,
group_id: impl Display,
body: &PublicGroupSignOutRequest,
) -> Result<()>
pub fn signout( &self, group_id: impl Display, body: &PublicGroupSignOutRequest, ) -> Result<()>
Withdraw group registrations
POST /publicgroups/{groupId}/signout
Withdraws selected memberships for the requester or people registered by that requester. A group sign-up token identifies the requester without requiring a login; without a token the current user and group sign-up access are used. When registration is open, active, requested and waiting memberships are eligible. Otherwise the requester needs the group exit permission and only active memberships qualify. All person IDs are checked before changes begin. With automatic acceptance enabled, memberships are deleted; otherwise they are marked to_delete for approval and their role is cleared. The changes run in a transaction. An empty personIds list is a successful no-op. This signs people out of a group, not out of their ChurchTools session.
§Example
let body = models::PublicGroupSignOutRequest {
person_ids: vec![42, 43],
..Default::default()
};
client.public_groups().signout(42, &body)?;Sourcepub fn submit_signup(
&self,
group_id: impl Display,
body: &PublicGroupSignupCreate,
) -> Result<PostPublicgroupsGroupIdSignupResponse>
pub fn submit_signup( &self, group_id: impl Display, body: &PublicGroupSignupCreate, ) -> Result<PostPublicgroupsGroupIdSignupResponse>
Submit group signup forms
POST /publicgroups/{groupId}/signup
Submits one form per person using a signup token for this group. Copy field type/id from the dynamic form and use its mandatory/options rules. Existing person IDs must be eligible for this requester; new spouse/child/other forms are available only when allowed by group settings. Adding related/other persons requires hasAcceptedPrivacyForOther=true. A child must be younger than 16. Membership may be accepted immediately, requested from leaders or placed on a waiting list; capacity is checked for the entire submitted set. Depending on group configuration, a new applicant may produce a request email instead of a new person. The operation is transactional for database changes. Success returns a top-level nullable groupHomepageHash, without a data wrapper.
§Example
let body = models::PublicGroupSignupCreate {
forms: vec![models::PublicGroupSignupCreateFormsItem {
form: vec![models::PublicGroupSignupCreateFormsItemFormItem::default()],
..Default::default()
}],
token: "abc123".into(),
..Default::default()
};
let public_group = client.public_groups().submit_signup(42, &body)?;
println!("{:?}", public_group.group_homepage_hash);Sourcepub fn token(
&self,
group_id: impl Display,
body: &PublicGroupTokenCreate,
) -> Result<Value>
pub fn token( &self, group_id: impl Display, body: &PublicGroupTokenCreate, ) -> Result<Value>
Create group signup token
POST /publicgroups/{groupId}/token
Starts a group-membership signup, distinct from account self-registration. Requires access to this group’s signup and an open signup feature. In verification mode all, supply either the current logged-in personId for a token returned directly or an email address for a verification link. Another personId is forbidden, and personId and email are mutually exclusive. In modes existing and none, both may be omitted and a new-person token is returned directly; in mode existing, matching uses the email supplied later in the signup form. Email flow returns only a success message. Tokens can be used to load forms, select a requester and submit memberships; they have no stored expiry in the current implementation.
§Example
let body = models::PublicGroupTokenCreate {
email: Some("mara@example.org".into()),
..Default::default()
};
let result = client.public_groups().token(42, &body)?;
println!("{:?}", result);