pub struct PersonGrowPathsResource<'a> { /* private fields */ }Expand description
client.person().grow_paths()
Implementations§
Source§impl<'a> PersonGrowPathsResource<'a>
impl<'a> PersonGrowPathsResource<'a>
Sourcepub fn create(&self, body: &GrowPathCreate) -> Result<GrowPath>
pub fn create(&self, body: &GrowPathCreate) -> Result<GrowPath>
Create a growth-path stage
POST /person/growpaths
Creates a stage in the growth-path catalog. Requires edit masterdata in churchdb. name is trimmed to 1–100 characters and need not be unique. color must be one of the accepted CTColor keys. sortKey is optional and defaults to 0; it controls both display ordering and precedence when deriving a person’s stage. The new stage is not automatically assigned to a role or person. Returns 201 with the generated ID, translated name and metadata.
§Example
let body = models::GrowPathCreate {
color: serde_json::json!("accent"),
name: "New Believer".into(),
..Default::default()
};
let result = client.person().grow_paths().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, id: impl Display) -> Result<()>
pub fn delete(&self, id: impl Display) -> Result<()>
Delete a growth-path stage
DELETE /person/growpaths/{id}
Deletes an unused growth-path stage. Requires edit masterdata in churchdb. References from group-type roles and concrete group roles block deletion with 409. Use dryRun=true to inspect deletion dependencies without deleting anything; the report also uses 409 when there are no blockers. The snake_case dry_run parameter used by other endpoints is not the flag read here. The stage is not loaded before deletion, so an unknown ID can return 204 without removing a row.
Use Self::delete_with to pass query parameters.
§Example
client.person().grow_paths().delete(1)?;Sourcepub fn delete_with(
&self,
id: impl Display,
query: &DeletePersonGrowpathsIdQuery,
) -> Result<()>
pub fn delete_with( &self, id: impl Display, query: &DeletePersonGrowpathsIdQuery, ) -> Result<()>
Delete a growth-path stage
Like Self::delete, with query parameters.
DELETE /person/growpaths/{id}
Deletes an unused growth-path stage. Requires edit masterdata in churchdb. References from group-type roles and concrete group roles block deletion with 409. Use dryRun=true to inspect deletion dependencies without deleting anything; the report also uses 409 when there are no blockers. The snake_case dry_run parameter used by other endpoints is not the flag read here. The stage is not loaded before deletion, so an unknown ID can return 204 without removing a row.
Sourcepub fn get(&self, id: impl Display) -> Result<GrowPath>
pub fn get(&self, id: impl Display) -> Result<GrowPath>
Get a growth-path stage
GET /person/growpaths/{id}
Returns one configured growth-path stage, including translated name, display color, ordering/priority and metadata. Requires view in churchdb. The ID identifies a stage referenced by group roles and person growPathId values; this is not the history or progression of a particular person. Unknown IDs return 404.
§Example
let grow_path = client.person().grow_paths().get(1)?;
println!("{}", grow_path.name);Sourcepub fn list(&self) -> Result<Vec<GrowPath>>
pub fn list(&self) -> Result<Vec<GrowPath>>
List growth-path stages
GET /person/growpaths
Lists the configured growth-path stages, ordered by sortKey and stored name ascending. Requires view in churchdb. Stages are assigned to group-type roles or concrete group roles; ChurchTools derives a person’s stage from active memberships in active or finished groups, using the highest matching stage sortKey. A concrete group-role stage overrides the group-type-role stage for that membership. This endpoint returns the complete unpaginated stage catalog, not people or their progress history. Each stage includes translated display text, color and creation/modification metadata.
§Example
for grow_path in client.person().grow_paths().list()? {
println!("{}", grow_path.name);
}Sourcepub fn update(
&self,
id: impl Display,
body: &GrowPathUpdate,
) -> Result<GrowPath>
pub fn update( &self, id: impl Display, body: &GrowPathUpdate, ) -> Result<GrowPath>
Update a growth-path stage
PUT /person/growpaths/{id}
Updates a stage’s name, color and ordering/priority. Requires edit masterdata in churchdb. ID comes from the path; name and color are required. sortKey is optional but defaults to 0 on every update, so send its current value to retain it. This differs from comment-viewer updates, which preserve an omitted sort key. sortKey affects both display order and which stage wins when calculating a person’s growth path. This handler only persists the stage; it does not trigger recalculation of all already stored person growPathId values. Equal priorities have no explicit tie-breaker in person calculation. Unknown IDs return 404.
§Example
let body = models::GrowPathUpdate {
color: serde_json::json!("accent"),
name: "New Believer".into(),
..Default::default()
};
let result = client.person().grow_paths().update(1, &body)?;
println!("{}", result.name);