Skip to main content

RoutinesResource

Struct RoutinesResource 

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

client.routines()

Implementations§

Source§

impl<'a> RoutinesResource<'a>

Source

pub fn runs(&self) -> RoutinesRunsResource<'a>

Source

pub fn steps(&self) -> RoutinesStepsResource<'a>

Source

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

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

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

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

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

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.

Source

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

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.

Trait Implementations§

Source§

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

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for RoutinesResource<'a>

§

impl<'a> !UnwindSafe for RoutinesResource<'a>

§

impl<'a> Forget for RoutinesResource<'a>

§

impl<'a> Freeze for RoutinesResource<'a>

§

impl<'a> Move for RoutinesResource<'a>

§

impl<'a> Send for RoutinesResource<'a>

§

impl<'a> Sync for RoutinesResource<'a>

§

impl<'a> Unpin for RoutinesResource<'a>

§

impl<'a> UnsafeUnpin for RoutinesResource<'a>

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