pub struct EventsFactsResource<'a> { /* private fields */ }Expand description
client.events().facts()
Implementations§
Source§impl<'a> EventsFactsResource<'a>
impl<'a> EventsFactsResource<'a>
Sourcepub fn delete(
&self,
event_id: impl Display,
fact_id: impl Display,
) -> Result<()>
pub fn delete( &self, event_id: impl Display, fact_id: impl Display, ) -> Result<()>
Delete a recorded event fact
DELETE /events/{eventId}/facts/{factId}
Removes the stored value for this event and fact definition, preserving the reusable definition and the event. Requires access to the event and edit permission for the fact definition. Returns 204 even if no value was stored for the pair.
§Example
client.events().facts().delete(42, 1)?;Sourcepub fn export(&self, body: &EventFactExportCreate) -> Result<Vec<u8>>
pub fn export(&self, body: &EventFactExportCreate) -> Result<Vec<u8>>
Export event facts as a spreadsheet
POST /events/facts/export
Downloads a CSV or XLSX file with one row per visible service-planning event in the selected calendars, including events without recorded fact values. Requires permission to export facts (the “export facts” permission for the service planning domain). Events are filtered by event visibility, and fact columns are limited to definitions the user may view or edit. Rows are ordered by event start time, then event ID.
Use Self::export_with to pass query parameters.
§Example
let body = models::EventFactExportCreate {
calendar_ids: vec![42],
..Default::default()
};
let data = client.events().facts().export(&body)?;
std::fs::write("ergebnis.xlsx", &data)?;Sourcepub fn export_with(
&self,
query: &PostEventsFactsExportQuery,
body: &EventFactExportCreate,
) -> Result<Vec<u8>>
pub fn export_with( &self, query: &PostEventsFactsExportQuery, body: &EventFactExportCreate, ) -> Result<Vec<u8>>
Export event facts as a spreadsheet
Like Self::export, with query parameters.
POST /events/facts/export
Downloads a CSV or XLSX file with one row per visible service-planning event in the selected calendars, including events without recorded fact values. Requires permission to export facts (the “export facts” permission for the service planning domain). Events are filtered by event visibility, and fact columns are limited to definitions the user may view or edit. Rows are ordered by event start time, then event ID.
Sourcepub fn get(
&self,
event_id: impl Display,
fact_id: impl Display,
) -> Result<EventFact>
pub fn get( &self, event_id: impl Display, fact_id: impl Display, ) -> Result<EventFact>
Get a recorded event fact
GET /events/{eventId}/facts/{factId}
Returns the stored value for the event and fact definition identified by the path. Requires access to the event and view or edit permission for the fact definition. Returns 404 when no value has been recorded for this pair; this is distinct from a recorded numeric zero.
§Example
let fact = client.events().facts().get(42, 1)?;
println!("{}", fact.deprecated);Sourcepub fn list(&self, event_id: impl Display) -> Result<Vec<EventFact>>
pub fn list(&self, event_id: impl Display) -> Result<Vec<EventFact>>
List recorded facts for an event
GET /events/{eventId}/facts
Returns the event’s stored fact values whose definitions the user may view or edit. eventId identifies the service-planning event, while factId identifies a reusable definition from /facts. Requires access to the event and at least one fact definition.
§Example
for fact in client.events().facts().list(42)? {
println!("{}", fact.deprecated);
}Sourcepub fn list_all(&self) -> Result<Vec<EventFact>>
pub fn list_all(&self) -> Result<Vec<EventFact>>
List recorded event facts
GET /events/facts
A fact definition describes a metric or selection (for example attendance or service type). An event fact stores one value for that definition on a service-planning event. eventId identifies the event, not its calendar appointment; factId identifies the reusable definition from /facts. Returns recorded values ordered by event start date descending, with pagination.
Use Self::list_all_with to pass query parameters.
§Example
for all in client.events().facts().list_all()? {
println!("{}", all.deprecated);
}Sourcepub fn list_all_with(
&self,
query: &GetEventsFactsQuery,
) -> Result<Vec<EventFact>>
pub fn list_all_with( &self, query: &GetEventsFactsQuery, ) -> Result<Vec<EventFact>>
List recorded event facts
Like Self::list_all, with query parameters.
GET /events/facts
A fact definition describes a metric or selection (for example attendance or service type). An event fact stores one value for that definition on a service-planning event. eventId identifies the event, not its calendar appointment; factId identifies the reusable definition from /facts. Returns recorded values ordered by event start date descending, with pagination.
Sourcepub fn list_all_iter(&self, query: &GetEventsFactsQuery) -> Items<EventFact> ⓘ
pub fn list_all_iter(&self, query: &GetEventsFactsQuery) -> Items<EventFact> ⓘ
List recorded event facts
Like Self::list_all_with, but lazy: each page is fetched only when the iteration reaches it.
Breaking off early saves the remaining requests.
Sourcepub fn update(
&self,
event_id: impl Display,
fact_id: impl Display,
body: &EventFactUpdate,
) -> Result<EventFact>
pub fn update( &self, event_id: impl Display, fact_id: impl Display, body: &EventFactUpdate, ) -> Result<EventFact>
Create or replace an event fact
PUT /events/{eventId}/facts/{factId}
Stores one value for the event and fact definition identified by the path. Returns 200 for both insertion and replacement. Requires access to the event and edit permission for the fact definition. Numeric facts accept JSON numbers or numeric strings and return a JSON number; select facts accept an option configured in the definition.
§Example
let body = models::EventFactUpdate {
value: serde_json::json!(1.5),
..Default::default()
};
let result = client.events().facts().update(42, 1, &body)?;
println!("{}", result.deprecated);