Struct SyncGotify

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

Synchronous interface to the Gotify API.

Implementations§

Source§

impl<'a> SyncGotify<'a>

Source

pub fn new( base_url: &'a str, app_token: Option<&'a str>, client_token: Option<&'a str>, ) -> Self

Source

pub fn from(gotify: Gotify<'a>) -> Self

Source

pub fn applications(&self) -> Result<Vec<Application>>

Source

pub fn create_application( &self, name: String, description: String, ) -> Result<Application>

Source

pub fn update_application( &self, id: i32, name: String, description: Option<String>, ) -> Result<Application>

Source

pub fn delete_application(&self, id: i32) -> Result<()>

Source

pub fn upload_application_image( &self, id: i32, image: File, ) -> Result<Application>

Source

pub fn get_messages( &self, app_id: Option<i32>, limit: Option<i32>, since: Option<i32>, ) -> Result<PagedMessages>

Source

pub fn create_message( &self, message: String, priority: Option<i32>, title: Option<String>, ) -> Result<Message>

Source

pub fn delete_messages(&self, app_id: Option<i32>) -> Result<()>

Source

pub fn delete_message(&self, msg_id: i32) -> Result<()>

Source

pub fn get_clients(&self) -> Result<Vec<Client>>

Source

pub fn create_client(&self, name: String) -> Result<Client>

Source

pub fn update_client(&self, id: i32, name: String) -> Result<Client>

Source

pub fn delete_client(&self, id: i32) -> Result<()>

Source

pub fn get_current_user(&self) -> Result<User>

Source

pub fn set_password(&self, passwd: String) -> Result<()>

Source

pub fn get_users(&self) -> Result<Vec<User>>

Source

pub fn create_user( &self, name: String, passwd: String, admin: Option<bool>, ) -> Result<User>

Source

pub fn get_user(&self, id: i32) -> Result<User>

Source

pub fn update_user( &self, id: i32, name: Option<String>, passwd: Option<String>, admin: Option<bool>, ) -> Result<User>

Source

pub fn delete_user(&self, id: i32) -> Result<()>

Source

pub fn get_health(&self) -> Result<Health>

Source

pub fn get_plugins(&self) -> Result<Vec<PluginConf>>

Source

pub fn get_plugin_config(&self, id: i32) -> Result<PluginConf>

Source

pub fn disable_plugin(&self, id: i32) -> Result<()>

TODO(ethanhs): Figure out what this looks like

Source

pub fn get_plugin_display(&self, id: i32) -> Result<String>

Source

pub fn enable_plugin(&self, id: i32) -> Result<()>

Source

pub fn get_version(&self) -> Result<VersionInfo>

Auto Trait Implementations§

§

impl<'a> Freeze for SyncGotify<'a>

§

impl<'a> !RefUnwindSafe for SyncGotify<'a>

§

impl<'a> Send for SyncGotify<'a>

§

impl<'a> Sync for SyncGotify<'a>

§

impl<'a> Unpin for SyncGotify<'a>

§

impl<'a> !UnwindSafe for SyncGotify<'a>

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> 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, 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.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,