pub struct RoutinesResource<'a> { /* private fields */ }Expand description
client.routines()
Implementations§
Source§impl<'a> RoutinesResource<'a>
impl<'a> RoutinesResource<'a>
pub fn runs(&self) -> RoutinesRunsResource<'a>
pub fn steps(&self) -> RoutinesStepsResource<'a>
Sourcepub fn create(&self, body: &RoutineCreate) -> Result<Routine>
pub fn create(&self, body: &RoutineCreate) -> Result<Routine>
Create group-membership automation
POST /routines
Creates a routine and attaches it to a group, role and optional membership status. Currently domainType must be group_membership. Requires routine administration for the context group. The new definition has no steps; use PATCH to add the complete step tree. isEnabled defaults to false and priority to 0. Creation alone does not explicitly start the worker.
§Example
let body = models::RoutineCreate {
domain_context: models::RoutineCreateDomainContext {
group_id: 42,
group_type_role_id: 42,
..Default::default()
},
domain_type: "group_membership".into(),
name: "Welcome new members".into(),
..Default::default()
};
let result = client.routines().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, routine_id: impl Display) -> Result<()>
pub fn delete(&self, routine_id: impl Display) -> Result<()>
Delete automation definition
DELETE /routines/{routineId}
Requires routine administration for every associated group. Deletes the routine, its steps and associated action definitions through action cleanup handlers. A missing routine returns 404. This endpoint has no dry-run. Effects already produced by previous runs, such as sent mail or person changes, are not reversed.
§Example
client.routines().delete(9)?;Sourcepub fn execute(&self) -> Result<()>
pub fn execute(&self) -> Result<()>
Process pending automation runs
POST /routines/execute
Triggers the shared routine worker for pending ready runs of enabled routines. Requires authentication; this controller has no additional routine/group authorization check. Processes batches of up to 25 runs and schedules another worker when a batch is full. A recent worker marker or ongoing bulk processing can skip execution while still returning 204. This is a global processing trigger, not a request to execute one selected routine or a completion report.
§Example
client.routines().execute()?;Sourcepub fn get(&self, routine_id: impl Display) -> Result<Routine>
pub fn get(&self, routine_id: impl Display) -> Result<Routine>
Get automation definition
GET /routines/{routineId}
Requires routine administration for every associated group. Returns the definition and nested step tree, including disabled steps. A routine with no associated domain context is not visible through this endpoint. Action data is expanded for clients, including stored email/follow-up definitions. Run progress is available separately from /runs.
§Example
let routine = client.routines().get(9)?;
println!("{}", routine.name);Sourcepub fn list(&self) -> Result<Vec<Routine>>
pub fn list(&self) -> Result<Vec<Routine>>
List visible automation definitions
GET /routines
A routine is an automation definition attached to a domain context (currently a group membership role/status). Each matching membership can have its own run and progress. Lists only routines with at least one domain attachment for which the caller can administer routines in every associated group. Includes enabled and disabled definitions with nested step trees; no pagination or explicit sort order. meta.count counts the returned routines.
Use Self::list_with to pass query parameters.
§Example
for routine in client.routines().list()? {
println!("{}", routine.name);
}Sourcepub fn list_with(&self, query: &GetRoutinesQuery) -> Result<Vec<Routine>>
pub fn list_with(&self, query: &GetRoutinesQuery) -> Result<Vec<Routine>>
List visible automation definitions
Like Self::list, with query parameters.
GET /routines
A routine is an automation definition attached to a domain context (currently a group membership role/status). Each matching membership can have its own run and progress. Lists only routines with at least one domain attachment for which the caller can administer routines in every associated group. Includes enabled and disabled definitions with nested step trees; no pagination or explicit sort order. meta.count counts the returned routines.
Sourcepub fn patch(
&self,
routine_id: impl Display,
body: &RoutineUpdate,
) -> Result<Option<Routine>>
pub fn patch( &self, routine_id: impl Display, body: &RoutineUpdate, ) -> Result<Option<Routine>>
Update automation and reposition runs
PATCH /routines/{routineId}
Requires routine administration for every associated group. Partially updates definition fields. Supplied steps replaces the entire step tree: keep id to update an existing step, omit id to create one; an existing step’s actionKey cannot change. Omitted steps are deleted, but affected runs must be repositioned or the operation returns 422. restart/finish and per-step reposition accept source step IDs or not-started/started/finished run buckets. Repeat loops may occur only at root level, must contain a waiting action, and an unbounded loop must be last. Destructive membership actions must be last. dry_run=true validates input and permissions, returns 204 and skips persistence; persistence-only consistency checks can still fail on the real update. Enabling, changing steps or repositioning runs can immediately trigger pending execution beyond this routine.
Use Self::patch_with to pass query parameters.
§Example
let body = models::RoutineUpdate {
name: Some("Welcome new members".into()),
..Default::default()
};
let result = client.routines().patch(9, &body)?;
println!("{:?}", result);Sourcepub fn patch_with(
&self,
routine_id: impl Display,
query: &PatchRoutinesRoutineIdQuery,
body: &RoutineUpdate,
) -> Result<Option<Routine>>
pub fn patch_with( &self, routine_id: impl Display, query: &PatchRoutinesRoutineIdQuery, body: &RoutineUpdate, ) -> Result<Option<Routine>>
Update automation and reposition runs
Like Self::patch, with query parameters.
PATCH /routines/{routineId}
Requires routine administration for every associated group. Partially updates definition fields. Supplied steps replaces the entire step tree: keep id to update an existing step, omit id to create one; an existing step’s actionKey cannot change. Omitted steps are deleted, but affected runs must be repositioned or the operation returns 422. restart/finish and per-step reposition accept source step IDs or not-started/started/finished run buckets. Repeat loops may occur only at root level, must contain a waiting action, and an unbounded loop must be last. Destructive membership actions must be last. dry_run=true validates input and permissions, returns 204 and skips persistence; persistence-only consistency checks can still fail on the real update. Enabling, changing steps or repositioning runs can immediately trigger pending execution beyond this routine.