pub struct NotificationHandler { /* private fields */ }
Expand description
Handler for notification operations
Implementations§
Source§impl NotificationHandler
impl NotificationHandler
Sourcepub fn new(client: FilesClient) -> Self
pub fn new(client: FilesClient) -> Self
Create a new notification handler
Sourcepub async fn list(
&self,
cursor: Option<&str>,
per_page: Option<i64>,
path: Option<&str>,
group_id: Option<i64>,
) -> Result<(Vec<NotificationEntity>, PaginationInfo)>
pub async fn list( &self, cursor: Option<&str>, per_page: Option<i64>, path: Option<&str>, group_id: Option<i64>, ) -> Result<(Vec<NotificationEntity>, PaginationInfo)>
List notifications
§Arguments
cursor
- Pagination cursorper_page
- Results per pagepath
- Filter by pathgroup_id
- Filter by group ID
§Returns
Tuple of (notifications, pagination_info)
§Example
use files_sdk::{FilesClient, NotificationHandler};
let client = FilesClient::builder().api_key("key").build()?;
let handler = NotificationHandler::new(client);
let (notifications, _) = handler.list(None, None, None, None).await?;
Sourcepub async fn get(&self, id: i64) -> Result<NotificationEntity>
pub async fn get(&self, id: i64) -> Result<NotificationEntity>
Sourcepub async fn create(
&self,
path: Option<&str>,
group_id: Option<i64>,
notify_on_upload: Option<bool>,
notify_on_download: Option<bool>,
notify_on_delete: Option<bool>,
send_interval: Option<&str>,
recursive: Option<bool>,
message: Option<&str>,
) -> Result<NotificationEntity>
pub async fn create( &self, path: Option<&str>, group_id: Option<i64>, notify_on_upload: Option<bool>, notify_on_download: Option<bool>, notify_on_delete: Option<bool>, send_interval: Option<&str>, recursive: Option<bool>, message: Option<&str>, ) -> Result<NotificationEntity>
Create a new notification
§Arguments
path
- Folder path to monitorgroup_id
- Group to notifynotify_on_upload
- Trigger on uploadsnotify_on_download
- Trigger on downloadsnotify_on_delete
- Trigger on deletessend_interval
- Email frequencyrecursive
- Apply to subfolders
§Returns
The created notification
Auto Trait Implementations§
impl Freeze for NotificationHandler
impl !RefUnwindSafe for NotificationHandler
impl Send for NotificationHandler
impl Sync for NotificationHandler
impl Unpin for NotificationHandler
impl !UnwindSafe for NotificationHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more