pub struct EventsResource<'a> { /* private fields */ }Expand description
client.events()
Implementations§
Source§impl<'a> EventsResource<'a>
impl<'a> EventsResource<'a>
pub fn agenda(&self) -> EventsAgendaResource<'a>
pub fn event_services(&self) -> EventsEventServicesResource<'a>
pub fn facts(&self) -> EventsFactsResource<'a>
pub fn service_requests(&self) -> EventsServiceRequestsResource<'a>
pub fn services(&self) -> EventsServicesResource<'a>
Sourcepub fn chat(&self, event_id: impl Display, body: &EventChatUpdate) -> Result<()>
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)?;Sourcepub fn create_ical(
&self,
query: &PostEventsIcalQuery,
) -> Result<RosterICalSetting>
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);Sourcepub fn delete(&self, event_id: impl Display) -> Result<()>
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)?;Sourcepub fn delete_with(
&self,
event_id: impl Display,
query: &DeleteEventsIdQuery,
) -> Result<()>
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.
Sourcepub fn get(&self, event_id: impl Display) -> Result<EventReadWithServices>
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);Sourcepub fn get_ical(&self, query: &GetEventsIcalQuery) -> Result<RosterICalSetting>
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);Sourcepub fn list(&self) -> Result<Vec<Event>>
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);
}Sourcepub fn list_with(&self, query: &GetEventsQuery) -> Result<Vec<Event>>
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.
Sourcepub fn list_iter(&self, query: &GetEventsQuery) -> Items<Event> ⓘ
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.
Sourcepub fn list_possible_persons_for_service(
&self,
service_id: impl Display,
) -> Result<Vec<ServiceCandidate>>
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);
}Sourcepub fn send(&self, body: &EventMailCreate) -> Result<EventMailSendResult>
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);Sourcepub fn update(
&self,
event_id: impl Display,
body: &EventDetailsUpdate,
) -> Result<EventDetailsUpdateResult>
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);