Skip to main content

GroupAgeGroupsResource

Struct GroupAgeGroupsResource 

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

client.group().age_groups()

Implementations§

Source§

impl<'a> GroupAgeGroupsResource<'a>

Source

pub fn create(&self, body: &AgeGroupCreate) -> Result<AgeGroup>

Create age range

POST /group/agegroups

Creates a age range as shared master data. An age range describes intended participant ages, such as ages 3 to 5. Groups can reference several ranges through information.ageGroupIds. These configured ranges are independent of the calculated ages of current members. Requires the churchgroup permission “edit masterdata”. Supply name, sortKey, start and end. Age boundaries are expressed in years. The name is trimmed. The endpoint validates integer boundaries but does not check that start is less than or equal to end; send a meaningful range. 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::AgeGroupCreate {
    end: 5,
    name: "3-5".into(),
    sort_key: 3,
    start: 3,
    ..Default::default()
};
let result = client.group().age_groups().create(&body)?;
println!("{}", result.name);
Source

pub fn delete( &self, age_group_id: impl Display, query: &DeleteGroupAgegroupsAgeGroupIdQuery, ) -> Result<()>

Delete age range

DELETE /group/agegroups/{ageGroupId}

Deletes a age range. Removing an age range also removes its ID from the ageGroupIds assignments of existing groups. The groups and their memberships remain. 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 = DeleteGroupAgegroupsAgeGroupIdQuery {
    dry_run: Some(true),
    ..Default::default()
};
client.group().age_groups().delete(2, &query)?;
Source

pub fn get(&self, age_group_id: impl Display) -> Result<AgeGroup>

Get age range

GET /group/agegroups/{ageGroupId}

Returns one age range using its ID from GET /group/agegroups. An age range describes intended participant ages, such as ages 3 to 5. Groups can reference several ranges through information.ageGroupIds. These configured ranges are independent of the calculated ages of current members. 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 age_group = client.group().age_groups().get(2)?;
println!("{}", age_group.name);
Source

pub fn list(&self) -> Result<Vec<AgeGroup>>

Get all age ranges

GET /group/agegroups

Returns all age ranges configured in this ChurchTools installation. An age range describes intended participant ages, such as ages 3 to 5. Groups can reference several ranges through information.ageGroupIds. These configured ranges are independent of the calculated ages of current members. 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 age_group in client.group().age_groups().list()? {
    println!("{}", age_group.name);
}
Source

pub fn update( &self, age_group_id: impl Display, body: &AgeGroupCreate, ) -> Result<()>

Update age range

PUT /group/agegroups/{ageGroupId}

Updates the shared age range identified by ageGroupId. 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, sortKey, start and end. Age boundaries are expressed in years. The name is trimmed. The endpoint validates integer boundaries but does not check that start is less than or equal to end; send a meaningful range. The ID comes from the URL; no body id is required. Returns 204 without a response body. Use GET /group/agegroups/{ageGroupId} to read the updated record.

§Example
let body = models::AgeGroupCreate {
    end: 5,
    name: "3-5".into(),
    sort_key: 3,
    start: 3,
    ..Default::default()
};
client.group().age_groups().update(2, &body)?;

Trait Implementations§

Source§

impl<'a> Clone for GroupAgeGroupsResource<'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 GroupAgeGroupsResource<'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