Update relationship.rs types
This commit is contained in:
parent
bcc4069cea
commit
dfec24b8b8
|
@ -1,3 +1,4 @@
|
||||||
|
use chrono::{DateTime, Utc};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_repr::{Deserialize_repr, Serialize_repr};
|
use serde_repr::{Deserialize_repr, Serialize_repr};
|
||||||
|
|
||||||
|
@ -13,15 +14,19 @@ pub struct Relationship {
|
||||||
pub relationship_type: RelationshipType,
|
pub relationship_type: RelationshipType,
|
||||||
pub nickname: Option<String>,
|
pub nickname: Option<String>,
|
||||||
pub user: PublicUser,
|
pub user: PublicUser,
|
||||||
|
pub since: Option<DateTime<Utc>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize_repr, Deserialize_repr, Debug, Clone, Default)]
|
#[derive(Serialize_repr, Deserialize_repr, Debug, Clone, Default)]
|
||||||
#[repr(u8)]
|
#[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 {
|
pub enum RelationshipType {
|
||||||
|
Suggestion = 6,
|
||||||
|
Implicit = 5,
|
||||||
Outgoing = 4,
|
Outgoing = 4,
|
||||||
Incoming = 3,
|
Incoming = 3,
|
||||||
Blocked = 2,
|
Blocked = 2,
|
||||||
#[default]
|
#[default]
|
||||||
Friends = 1,
|
Friends = 1,
|
||||||
|
None = 0,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue