pub struct ActivityClient<'a, T: Transport, A: AuthProvider> { /* private fields */ }Expand description
Client for interacting with Nextcloud’s Activity API v2.
Wraps an OcsClient by reference and provides high-level typed calls for:
- Listing activities matching filter criteria (
/ocs/v2.php/apps/activity/api/v2/activity) - Querying activities for a specific object type and ID
See the Nextcloud Activity API documentation and developer_manual source.
Implementations§
Source§impl<'a, T: Transport, A: AuthProvider> ActivityClient<'a, T, A>
impl<'a, T: Transport, A: AuthProvider> ActivityClient<'a, T, A>
Sourcepub const fn new(ocs: &'a OcsClient<T, A>) -> Self
pub const fn new(ocs: &'a OcsClient<T, A>) -> Self
Binds an activity client to an underlying OcsClient.
Sourcepub async fn list(
&self,
filter: &ActivityFilter,
) -> Result<Vec<Activity>, Error>
pub async fn list( &self, filter: &ActivityFilter, ) -> Result<Vec<Activity>, Error>
Lists activities matching the provided ActivityFilter.
Sends GET /ocs/v2.php/apps/activity/api/v2/activity with query parameters.
See Endpoints and Parameters.
Sourcepub async fn list_for_object(
&self,
object_type: &str,
object_id: u64,
) -> Result<Vec<Activity>, Error>
pub async fn list_for_object( &self, object_type: &str, object_id: u64, ) -> Result<Vec<Activity>, Error>
Lists activities related to a specific object type and object ID.
Helper that constructs an ActivityFilter with object_type and object_id
and invokes Self::list.
Sends GET /ocs/v2.php/apps/activity/api/v2/activity?format=json&object_type=...&object_id=....
See Parameters.
Trait Implementations§
Source§impl<'a, T: Clone + Transport, A: Clone + AuthProvider> Clone for ActivityClient<'a, T, A>
impl<'a, T: Clone + Transport, A: Clone + AuthProvider> Clone for ActivityClient<'a, T, A>
impl<'a, T: Copy + Transport, A: Copy + AuthProvider> Copy for ActivityClient<'a, T, A>
Auto Trait Implementations§
impl<'a, T, A> Freeze for ActivityClient<'a, T, A>
impl<'a, T, A> RefUnwindSafe for ActivityClient<'a, T, A>where
&'a OcsClient<T, A>: RefUnwindSafe,
impl<'a, T, A> Send for ActivityClient<'a, T, A>
impl<'a, T, A> Sync for ActivityClient<'a, T, A>
impl<'a, T, A> Unpin for ActivityClient<'a, T, A>
impl<'a, T, A> UnsafeUnpin for ActivityClient<'a, T, A>where
&'a OcsClient<T, A>: UnsafeUnpin,
impl<'a, T, A> UnwindSafe for ActivityClient<'a, T, A>where
&'a OcsClient<T, A>: UnwindSafe,
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