hyaenidae/profiles/src/actions/mod.rs

138 lines
2.4 KiB
Rust
Raw Normal View History

2021-01-04 17:34:31 +00:00
use crate::store::{OwnerSource, Visibility};
use chrono::{DateTime, Utc};
use url::Url;
use uuid::Uuid;
mod apub;
mod block;
mod comment;
mod follow;
mod follow_request;
mod profile;
mod react;
mod submission;
pub(super) use apub::ingest;
pub struct CreateReact {
apub_id: Url,
submission_id: Uuid,
profile_id: Uuid,
comment_id: Option<Uuid>,
react: String,
published: DateTime<Utc>,
}
pub struct DeleteReact {
pub react_id: Uuid,
}
pub struct CreateComment {
apub_id: Url,
submission_id: Uuid,
profile_id: Uuid,
comment_id: Option<Uuid>,
body: String,
published: DateTime<Utc>,
}
pub struct AnnounceComment;
pub struct UpdateComment {
comment_id: Uuid,
body: Option<String>,
}
pub struct DeleteComment {
comment_id: Uuid,
}
pub struct CreateSubmission {
apub_id: Url,
profile_id: Uuid,
title: String,
description: Option<String>,
files: Vec<Uuid>,
published: DateTime<Utc>,
visibility: Visibility,
}
pub struct AnnounceSubmission;
pub struct UpdateSubmission {
submission_id: Uuid,
title: Option<String>,
description: Option<String>,
files: Vec<Uuid>,
}
pub struct DeleteSubmission {
submission_id: Uuid,
}
pub struct CreateProfile {
apub_id: Url,
owner_source: OwnerSource,
handle: String,
domain: String,
display_name: Option<String>,
description: Option<String>,
login_required: bool,
icon: Option<Uuid>,
banner: Option<Uuid>,
public_key_id: Url,
public_key: String,
published: DateTime<Utc>,
}
pub struct UpdateProfile {
profile_id: Uuid,
display_name: Option<String>,
description: Option<String>,
login_required: bool,
icon: Option<Uuid>,
banner: Option<Uuid>,
public_key_id: Url,
public_key: String,
}
pub struct DeleteProfile {
profile_id: Uuid,
}
pub struct CreateFollowRequest {
apub_id: Url,
followed_profile: Uuid,
followed_by_profile: Uuid,
published: DateTime<Utc>,
}
pub struct AcceptFollowRequest {
apub_id: Url,
follow_request_id: Uuid,
published: DateTime<Utc>,
}
pub struct RejectFollowRequest {
follow_request_id: Uuid,
}
pub struct DeleteFollowRequest {
follow_request_id: Uuid,
}
pub struct CreateBlock {
apub_id: Url,
blocked_profile: Uuid,
blocked_by_profile: Uuid,
published: DateTime<Utc>,
}
pub struct DeleteBlock {
block_id: Uuid,
}
pub struct DeleteFollow {
follow_id: Uuid,
}