Skip to main content

EventsFactsResource

Struct EventsFactsResource 

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

client.events().facts()

Implementations§

Source§

impl<'a> EventsFactsResource<'a>

Source

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

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

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.

Source

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

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

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

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.

Source

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.

Source

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

Trait Implementations§

Source§

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

Auto Trait Implementations§

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