pub struct CalendarsResource<'a> { /* private fields */ }Expand description
client.calendars()
Implementations§
Source§impl<'a> CalendarsResource<'a>
impl<'a> CalendarsResource<'a>
pub fn appointments(&self) -> CalendarsAppointmentsResource<'a>
pub fn meeting_request(&self) -> CalendarsMeetingRequestResource<'a>
Sourcepub fn create(&self, body: &CalendarCreate) -> Result<Calendar>
pub fn create(&self, body: &CalendarCreate) -> Result<Calendar>
Create a calendar
POST /calendars
Creates a calendar of the chosen type. church requires permission to administer church calendars; group and personal require permission to create or administer their respective category. The creator receives permission to edit appointments in the new calendar. Optional iCalSourceUrl starts an immediate external-feed import.
§Example
let body = models::CalendarCreate {
name: "Community events".into(),
sort_key: 10,
r#type: "church".into(),
..Default::default()
};
let result = client.calendars().create(&body)?;
println!("{}", result.name);Sourcepub fn delete(&self, calendar_id: impl Display) -> Result<()>
pub fn delete(&self, calendar_id: impl Display) -> Result<()>
Delete a calendar and its contents
DELETE /calendars/{calendarId}
Deletes the calendar and its appointment contents, and removes permissions attached to that calendar. Requires edit-category permission for the calendar or ownership as its creator. Deletion can be blocked by references, including agenda templates belonging to the calendar; 409 returns the blocking references.
§Example
client.calendars().delete(42)?;Sourcepub fn get(&self, calendar_id: impl Display) -> Result<Calendar>
pub fn get(&self, calendar_id: impl Display) -> Result<Calendar>
Get calendar settings
GET /calendars/{calendarId}
Returns one calendar’s settings. Reading is allowed with view-category or edit-category permission for the calendar, or for its creator. This creator check is additional to the permission filter used by GET /calendars. Use /calendars/{calendarId}/appointments to retrieve occurrences.
§Example
let calendar = client.calendars().get(42)?;
println!("{}", calendar.name);Sourcepub fn list(&self) -> Result<Vec<Calendar>>
pub fn list(&self) -> Result<Vec<Calendar>>
List calendars accessible through calendar permissions
GET /calendars
Returns calendars for which the current user has view-category or edit-category permission, ordered by sortKey ascending.
§Example
for calendar in client.calendars().list()? {
println!("{}", calendar.name);
}Sourcepub fn list_meeting_request_persons(
&self,
calendar_id: impl Display,
) -> Result<Vec<MeetingRequestCandidate>>
👎Deprecated: GET /calendars/{calendarId}/meetingrequestpersons is deprecated in the ChurchTools API.
pub fn list_meeting_request_persons( &self, calendar_id: impl Display, ) -> Result<Vec<MeetingRequestCandidate>>
GET /calendars/{calendarId}/meetingrequestpersons is deprecated in the ChurchTools API.
Get candidates for a meeting request (deprecated)
GET /calendars/{calendarId}/meetingrequestpersons
Deprecated alias for /calendars/{calendarId}/meetingrequest/candidates. Returns the same visible candidates.
Use Self::list_meeting_request_persons_with to pass query parameters.
§Example
for meeting_request_person in client.calendars().list_meeting_request_persons(42)? {
println!("{:?}", meeting_request_person.group_name);
}Sourcepub fn list_meeting_request_persons_with(
&self,
calendar_id: impl Display,
query: &GetCalendarsCalendarIdMeetingrequestpersonsQuery,
) -> Result<Vec<MeetingRequestCandidate>>
👎Deprecated: GET /calendars/{calendarId}/meetingrequestpersons is deprecated in the ChurchTools API.
pub fn list_meeting_request_persons_with( &self, calendar_id: impl Display, query: &GetCalendarsCalendarIdMeetingrequestpersonsQuery, ) -> Result<Vec<MeetingRequestCandidate>>
GET /calendars/{calendarId}/meetingrequestpersons is deprecated in the ChurchTools API.
Get candidates for a meeting request (deprecated)
Like Self::list_meeting_request_persons, with query parameters.
GET /calendars/{calendarId}/meetingrequestpersons
Deprecated alias for /calendars/{calendarId}/meetingrequest/candidates. Returns the same visible candidates.
Sourcepub fn update(
&self,
calendar_id: impl Display,
body: &CalendarUpdate,
) -> Result<Calendar>
pub fn update( &self, calendar_id: impl Display, body: &CalendarUpdate, ) -> Result<Calendar>
Update calendar settings
PUT /calendars/{calendarId}
Replaces editable calendar settings while preserving the calendar type. Requires administration permission for the calendar’s type or ownership as its creator; permission to edit appointments alone is not sufficient. iCalSourceUrl triggers an external calendar import.
§Example
let body = models::CalendarUpdate {
name: "Community events".into(),
sort_key: 10,
..Default::default()
};
let result = client.calendars().update(42, &body)?;
println!("{}", result.name);