Update relationship.rs types
This commit is contained in:
parent
2e84385007
commit
cefc522e2f
|
@ -1,3 +1,4 @@
|
|||
use chrono::{DateTime, Utc};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||
|
||||
|
@ -13,15 +14,19 @@ pub struct Relationship {
|
|||
pub relationship_type: RelationshipType,
|
||||
pub nickname: Option<String>,
|
||||
pub user: PublicUser,
|
||||
pub since: Option<DateTime<Utc>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize_repr, Deserialize_repr, Debug, Clone, Default)]
|
||||
#[repr(u8)]
|
||||
/// See https://github.com/spacebarchat/server/blob/60394d8c43904ff17935d6edbbfb09ecd479570a/src/util/entities/Relationship.ts#L30
|
||||
/// See https://discord-userdoccers.vercel.app/resources/user#relationship-type
|
||||
pub enum RelationshipType {
|
||||
Suggestion = 6,
|
||||
Implicit = 5,
|
||||
Outgoing = 4,
|
||||
Incoming = 3,
|
||||
Blocked = 2,
|
||||
#[default]
|
||||
Friends = 1,
|
||||
None = 0,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue