Skip to main content

EventsResource

Struct EventsResource 

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

client.events()

Implementations§

Source§

impl<'a> EventsResource<'a>

Source

pub fn agenda(&self) -> EventsAgendaResource<'a>

Source

pub fn event_services(&self) -> EventsEventServicesResource<'a>

Source

pub fn facts(&self) -> EventsFactsResource<'a>

Source

pub fn service_requests(&self) -> EventsServiceRequestsResource<'a>

Source

pub fn services(&self) -> EventsServicesResource<'a>

Source

pub fn chat(&self, event_id: impl Display, body: &EventChatUpdate) -> Result<()>

Start or stop an event chat

POST /events/{eventId}/chat

Starts, reactivates or stops the chat linked to this event. Requires access to the event, an active chat installation with event chats enabled, and permission to administer persons, start an event chat through event permissions, or administer this event. A new room is provisioned through the chat service; HTTP 200 does not guarantee that remote room setup is already complete. Stopping a chat that has never been created returns 404.

§Example
let body = models::EventChatUpdate {
    enabled: true,
    ..Default::default()
};
client.events().chat(42, &body)?;
Source

pub fn create_ical( &self, query: &PostEventsIcalQuery, ) -> Result<RosterICalSetting>

Create iCal roster link

POST /events/ical

Creates a new personal roster subscription secret and returns the link as JSON. Use meta.iCalUrl to fetch the actual iCalendar feed. A roster contains the person’s service assignments at events, including pending requests and confirmed assignments.

§Example
let query = PostEventsIcalQuery {
    person_id: Some(42),
    ..Default::default()
};
let result = client.events().create_ical(&query)?;
println!("{}", result.attribute);
Source

pub fn delete(&self, event_id: impl Display) -> Result<()>

Delete a single event

DELETE /events/{eventId}

Deletes the service-planning event through the dependency-aware deletion service. With dryRun=true, the deletion check returns a 409 report without deleting the event, but sendMail is processed before that check. Requires event administration access, the “edit events” permission for the event calendar, or a corresponding internal group permission.

Use Self::delete_with to pass query parameters.

§Example
client.events().delete(42)?;
Source

pub fn delete_with( &self, event_id: impl Display, query: &DeleteEventsIdQuery, ) -> Result<()>

Delete a single event

Like Self::delete, with query parameters.

DELETE /events/{eventId}

Deletes the service-planning event through the dependency-aware deletion service. With dryRun=true, the deletion check returns a 409 report without deleting the event, but sendMail is processed before that check. Requires event administration access, the “edit events” permission for the event calendar, or a corresponding internal group permission.

Source

pub fn get(&self, event_id: impl Display) -> Result<EventReadWithServices>

Get a single event

GET /events/{eventId}

Returns the event visible to the current user, including calendar, eventFiles and eventServices. Service assignments are filtered by service-group visibility or own assignment; persons can be concealed. The eventServices property is present even when empty. Cancelled events can also be read if visible.

§Example
let event = client.events().get(42)?;
println!("{}", event.name);
Source

pub fn get_ical(&self, query: &GetEventsIcalQuery) -> Result<RosterICalSetting>

Get iCal roster link

GET /events/ical

Returns the personal roster subscription as JSON. If no secret exists, this GET creates one; otherwise it preserves the existing link. Use meta.iCalUrl to fetch the actual iCalendar feed. A roster contains the person’s service assignments at events, including pending requests and confirmed assignments.

§Example
let query = GetEventsIcalQuery {
    person_id: Some(42),
    ..Default::default()
};
let ical = client.events().get_ical(&query)?;
println!("{}", ical.attribute);
Source

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

Get all events

GET /events

Returns events visible through calendar permissions or the current user’s valid service assignments. Date comparisons use midnight in the application time zone: to includes exactly midnight, not later events that day. Results from calendar access are merged with events where the user is assigned and deduplicated; this merged range list is not guaranteed to be globally sorted. With direction, selects one page relative to from and ignores to.

Use Self::list_with to pass query parameters.

§Example
for event in client.events().list()? {
    println!("{}", event.name);
}
Source

pub fn list_with(&self, query: &GetEventsQuery) -> Result<Vec<Event>>

Get all events

Like Self::list, with query parameters.

GET /events

Returns events visible through calendar permissions or the current user’s valid service assignments. Date comparisons use midnight in the application time zone: to includes exactly midnight, not later events that day. Results from calendar access are merged with events where the user is assigned and deduplicated; this merged range list is not guaranteed to be globally sorted. With direction, selects one page relative to from and ignores to.

Source

pub fn list_iter(&self, query: &GetEventsQuery) -> Items<Event> ⓘ

Get all events

Like Self::list_with, but lazy: each page is fetched only when the iteration reaches it. Breaking off early saves the remaining requests.

Source

pub fn list_possible_persons_for_service( &self, service_id: impl Display, ) -> Result<Vec<ServiceCandidate>>

Get all possible persons for a service

GET /events/{serviceId}/possiblepersonsforservice

Returns an unpaginated, deduplicated list of persons from active, non-hidden memberships in groups connected to the service. If connected tags exist, a matching tag is also required. Archived or deceased persons are excluded and hidden-person visibility is respected. With no connected groups, the result is empty.

§Example
for possible_persons_for_service in client.events().list_possible_persons_for_service(2)? {
    println!("{}", possible_persons_for_service.full_name);
}
Source

pub fn send(&self, body: &EventMailCreate) -> Result<EventMailSendResult>

Send an email to selected event recipients

POST /events/send

Sends an email to selected people in the context of one or more events. ChurchTools filters service participants by visible service groups and other selected recipients by person visibility. The response reports effective and rejected recipients. sendCopyToMe can add the sender. Optional agenda buttons require agenda visibility for each event; sending does not require an agenda or a shared agenda across events.

§Example
let body = models::EventMailCreate {
    body: "<p>Please review the updated agenda for Sunday.</p>".into(),
    event_ids: vec![31, 32],
    recipients: vec![40, 41],
    subject: "Updated Sunday agenda".into(),
    append_agenda_button: true,
    files: vec![42],
    ..Default::default()
};
let event = client.events().send(&body)?;
println!("{:?}", event);
Source

pub fn update( &self, event_id: impl Display, body: &EventDetailsUpdate, ) -> Result<EventDetailsUpdateResult>

Update event details

PUT /events/{eventId}

Updates the description, administrators and cancellation state for this service-planning event. It does not update service assignments or the calendar appointment. Changing the administrator set additionally requires the “edit masterdata” permission for the service planning domain; other changes require event administration access, the “edit events” permission for the event calendar, or a corresponding internal group permission.

§Example
let body = models::EventDetailsUpdate {
    description: Some(Some("Sound check starts 30 minutes before the gathering.".into())),
    ..Default::default()
};
let result = client.events().update(42, &body)?;
println!("{}", result.id);

Trait Implementations§

Source§

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

Auto Trait Implementations§

§

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

§

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

§

impl<'a> Freeze for EventsResource<'a>

§

impl<'a> Send for EventsResource<'a>

§

impl<'a> Sync for EventsResource<'a>

§

impl<'a> Unpin for EventsResource<'a>

§

impl<'a> UnsafeUnpin for EventsResource<'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