Skip to main content

PublicGroupsResource

Struct PublicGroupsResource 

Source
pub struct PublicGroupsResource<'a> { /* private fields */ }
Expand description

client.public_groups()

Implementations§

Source§

impl<'a> PublicGroupsResource<'a>

Source

pub fn signup(&self) -> PublicGroupsSignupResource<'a>

Source

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);
Source

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.

Source

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);
Source

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);
Source

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);
Source

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.

Source

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);
Source

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);
Source

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)?;
Source

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);
Source

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);

Trait Implementations§

Source§

impl<'a> Clone for PublicGroupsResource<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for PublicGroupsResource<'a>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more