1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use minicbor::{Decode, Encode};
use serde::{Deserialize, Serialize};

use super::{InvitationWithAccess, ReceivedInvitation, SentInvitation};

#[derive(Clone, Debug, Decode, Encode, Serialize)]
#[cbor(map)]
#[rustfmt::skip]
pub struct ListInvitations {
    #[n(1)] pub kind: InvitationListKind,
}

#[derive(Clone, Debug, PartialEq, Decode, Deserialize, Encode, Serialize)]
#[cbor(index_only)]
#[rustfmt::skip]
pub enum InvitationListKind {
    #[n(0)] All,
    #[n(1)] Sent,
    #[n(2)] Received,
    #[n(3)] Accepted,
}

#[derive(Clone, Debug, Decode, Encode, Serialize)]
#[cbor(map)]
#[rustfmt::skip]
pub struct InvitationList {
    #[n(1)] pub sent: Option<Vec<SentInvitation>>,
    #[n(2)] pub received: Option<Vec<ReceivedInvitation>>,
    #[n(3)] pub accepted: Option<Vec<InvitationWithAccess>>,
}