pub struct ProgramClient { /* private fields */ }Expand description
A client for interacting with the data in a specific program and the events contained in the program.
Implementations§
Source§impl ProgramClient
impl ProgramClient
Sourcepub fn created_date_time(&self) -> DateTime<Utc>
pub fn created_date_time(&self) -> DateTime<Utc>
Get the time the program was created on the VTN
Sourcepub fn modification_date_time(&self) -> DateTime<Utc>
pub fn modification_date_time(&self) -> DateTime<Utc>
Get the time the program was last modified on the VTN
Sourcepub fn content(&self) -> &ProgramContent
pub fn content(&self) -> &ProgramContent
Read the data of the program
Sourcepub fn content_mut(&mut self) -> &mut ProgramContent
pub fn content_mut(&mut self) -> &mut ProgramContent
Modify the data of the program.
Make sure to call update
after your modifications to store them on the VTN
Sourcepub async fn update(&mut self) -> Result<(), Error>
pub async fn update(&mut self) -> Result<(), Error>
Stores any modifications made to the program content at the server and refreshes the locally stored data with the returned VTN data
Sourcepub async fn create_event(
&self,
event_data: EventContent,
) -> Result<EventClient, Error>
pub async fn create_event( &self, event_data: EventContent, ) -> Result<EventClient, Error>
Create a new event on the VTN.
The content should be created with ProgramClient::new_event
to automatically insert the correct program ID
Sourcepub fn new_event(&self, intervals: Vec<EventInterval>) -> EventContent
pub fn new_event(&self, intervals: Vec<EventInterval>) -> EventContent
Create a new event object within the program
Sourcepub async fn get_events_request(
&self,
filter: Filter<'_, impl AsRef<str>>,
pagination: PaginationOptions,
) -> Result<Vec<EventClient>, Error>
pub async fn get_events_request( &self, filter: Filter<'_, impl AsRef<str>>, pagination: PaginationOptions, ) -> Result<Vec<EventClient>, Error>
Low-level operation that gets a list of events for this program from the VTN with the given query parameters.
To automatically iterate pages, use [self.get_event_list]
Sourcepub async fn get_event_list(
&self,
filter: Filter<'_, impl AsRef<str> + Clone>,
) -> Result<Vec<EventClient>, Error>
pub async fn get_event_list( &self, filter: Filter<'_, impl AsRef<str> + Clone>, ) -> Result<Vec<EventClient>, Error>
Get a list of events from the VTN with the given query parameters
Trait Implementations§
Source§impl Clone for ProgramClient
impl Clone for ProgramClient
Source§fn clone(&self) -> ProgramClient
fn clone(&self) -> ProgramClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more