Struct IamRespondingAPI

Source
pub struct IamRespondingAPI<C> { /* private fields */ }
Expand description

Main struct for interacting with the IAmResponding API.

Implementations§

Source§

impl<C> IamRespondingAPI<C>
where C: HttpClient + Send + Sync,

Source

pub fn new(client: C) -> Self

Source

pub async fn login( &mut self, agency: &str, user: &str, pass: &str, ) -> Result<(), ApiError>

Logs in to the IAmResponding API and stores token and member_id for future requests.

Source

pub async fn get_now_responding(&self) -> Result<Vec<NowResponding>, ApiError>

Fetches the currently responding members.

Source

pub async fn get_on_schedule(&self) -> Result<Vec<OnSchedule>, ApiError>

Fetches scheduled members.

Source

pub async fn list_dispatch_messages( &self, ) -> Result<Vec<DispatchMessage>, ApiError>

Fetches dispatch messages.

Source

pub async fn get_incident_info( &self, incident_id: i64, ) -> Result<IncidentInfoData, ApiError>

Fetches specific incident information.

Source

pub async fn get_latest_incidents( &self, ) -> Result<Vec<IncidentInfoData>, ApiError>

Source

pub async fn get_reminders_by_member( &self, ) -> Result<Vec<EventReminder>, ApiError>

Fetches reminders for scheduled events or meetings for a specific member.

Auto Trait Implementations§

§

impl<C> Freeze for IamRespondingAPI<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for IamRespondingAPI<C>
where C: RefUnwindSafe,

§

impl<C> Send for IamRespondingAPI<C>
where C: Send,

§

impl<C> Sync for IamRespondingAPI<C>
where C: Sync,

§

impl<C> Unpin for IamRespondingAPI<C>
where C: Unpin,

§

impl<C> UnwindSafe for IamRespondingAPI<C>
where C: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.