[][src]Struct octocrab::activity::notifications::NotificationsHandler

pub struct NotificationsHandler<'octo> { /* fields omitted */ }

Handler for GitHub's notifications API.

Created with ActivityHandler::notifications. Note: All of these methods require authentication using your GitHub Access Token with the right privileges.

Implementations

impl<'octo> NotificationsHandler<'octo>[src]

pub async fn get<'_>(&'_ self, id: impl Into<u64>) -> Result<Notification>[src]

Gets a notification by their id.

let thread = octocrab::instance()
    .activity()
    .notifications()
    .get(123u32)
    .await?;

pub async fn mark_as_read<'_>(&'_ self, id: impl Into<u64>) -> Result<()>[src]

Marks a single thread as read.

octocrab::instance()
    .activity()
    .notifications()
    .mark_as_read(123u32)
    .await?;

pub async fn mark_repo_as_read<'_>(
    &'_ self,
    owner: impl AsRef<str>,
    repo: impl AsRef<str>,
    last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
[src]

Marks all notifications in a repository as read.

octocrab::instance()
    .activity()
    .notifications()
    .mark_repo_as_read("XAMPPRocky", "octocrab", None)
    .await?;

pub async fn mark_all_as_read<'_>(
    &'_ self,
    last_read_at: impl Into<Option<DateTime<Utc>>>
) -> Result<()>
[src]

Marks all notifications as read.

If you provide a last_read_at parameter, anything updated since this time will not be marked as read.

octocrab::instance()
    .activity()
    .notifications()
    .mark_all_as_read(None)
    .await?;

pub async fn get_thread_subscription<'_>(
    &'_ self,
    thread: impl Into<u64>
) -> Result<ThreadSubscription>
[src]

This checks to see if the current user is subscribed to a thread.

let subscription = octocrab::instance()
    .activity()
    .notifications()
    .get_thread_subscription(123u32)
    .await?;

pub async fn set_thread_subscription<'_>(
    &'_ self,
    thread: impl Into<u64>,
    ignored: bool
) -> Result<ThreadSubscription>
[src]

Ignore or unignore a thread subscription, that is enabled by watching a repository.

let subscription = octocrab::instance()
    .activity()
    .notifications()
    .set_thread_subscription(123u32, true)
    .await?;

pub async fn delete_thread_subscription<'_>(
    &'_ self,
    thread: impl Into<u64>
) -> Result<()>
[src]

Mutes the whole thread conversation until you comment or get mentioned.

octocrab::instance()
    .activity()
    .notifications()
    .delete_thread_subscription(123u32)
    .await?;

pub fn list_for_repo(
    &self,
    owner: impl AsRef<str>,
    repo: impl AsRef<str>
) -> ListNotificationsBuilder<'octo>
[src]

List all notifications for the current user, that are in a given repository.

let notifications = octocrab::instance()
    .activity()
    .notifications()
    .list_for_repo("XAMPPRocky", "octocrab")
    // Also show notifications that are marked as read.
    .all(true)
    .send()
    .await?;

pub fn list(&self) -> ListNotificationsBuilder<'octo>[src]

List all notifications for the current user.

let notifications = octocrab::instance()
    .activity()
    .notifications()
    .list()
    .send()
    .await?;

Auto Trait Implementations

impl<'octo> !RefUnwindSafe for NotificationsHandler<'octo>[src]

impl<'octo> Send for NotificationsHandler<'octo>[src]

impl<'octo> Sync for NotificationsHandler<'octo>[src]

impl<'octo> Unpin for NotificationsHandler<'octo>[src]

impl<'octo> !UnwindSafe for NotificationsHandler<'octo>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.