pub struct Activity {
pub activity_id: u64,
pub app: String,
pub activity_type: String,
pub user: String,
pub subject: String,
pub message: Option<String>,
pub datetime: String,
pub link: Option<String>,
pub object_type: Option<String>,
pub object_id: Option<u64>,
pub object_name: Option<String>,
}Expand description
A Nextcloud activity entry in the activity stream.
Returned in the OCS data payload from GET /ocs/v2.php/apps/activity/api/v2/activity.
See the Nextcloud Activity API documentation and developer_manual source.
Fields§
§activity_id: u64Unique auto-incremented database ID for the activity event.
app: StringIdentifier of the application that generated this activity (e.g. "files").
activity_type: StringActivity type identifier (corresponds to the JSON type field, e.g. "file_created").
user: StringUser ID of the actor who performed the action (may be empty if generated by the system).
subject: StringTranslated plain-text summary describing the activity.
message: Option<String>Additional translated plain-text message or context, if available.
datetime: StringISO 8601 formatted timestamp when the activity took place.
link: Option<String>Full URL pointing to the resource or context associated with this activity.
object_type: Option<String>Category or type of the related target object (e.g. "files").
object_id: Option<u64>Numeric identifier of the related target object.
object_name: Option<String>Name or path of the related target object (e.g. "/test/hello.txt").
Implementations§
Source§impl Activity
impl Activity
Sourcepub fn new(
activity_id: u64,
app: impl Into<String>,
activity_type: impl Into<String>,
user: impl Into<String>,
subject: impl Into<String>,
datetime: impl Into<String>,
) -> Self
pub fn new( activity_id: u64, app: impl Into<String>, activity_type: impl Into<String>, user: impl Into<String>, subject: impl Into<String>, datetime: impl Into<String>, ) -> Self
Creates a new Activity with the required core fields.
Sourcepub const fn activity_id(&self) -> u64
pub const fn activity_id(&self) -> u64
Unique activity ID.
Sourcepub fn activity_type(&self) -> &str
pub fn activity_type(&self) -> &str
Activity type identifier.
Sourcepub fn object_type(&self) -> Option<&str>
pub fn object_type(&self) -> Option<&str>
Type of the related object, if set.
Sourcepub fn object_name(&self) -> Option<&str>
pub fn object_name(&self) -> Option<&str>
Name or path of the related object, if set.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Sets the optional message text.