zkgroup/api/receipts/
receipt_credential.rs

1//
2// Copyright 2021 Signal Messenger, LLC.
3// SPDX-License-Identifier: AGPL-3.0-only
4//
5
6use partial_default::PartialDefault;
7use serde::{Deserialize, Serialize};
8
9use crate::common::serialization::ReservedByte;
10use crate::common::simple_types::*;
11use crate::crypto;
12
13#[derive(Copy, Clone, Serialize, Deserialize, PartialDefault)]
14pub struct ReceiptCredential {
15    pub(crate) reserved: ReservedByte,
16    pub(crate) credential: crypto::credentials::ReceiptCredential,
17    pub(crate) receipt_expiration_time: Timestamp,
18    pub(crate) receipt_level: ReceiptLevel,
19    pub(crate) receipt_serial_bytes: ReceiptSerialBytes,
20}
21
22impl ReceiptCredential {
23    pub fn get_receipt_expiration_time(&self) -> Timestamp {
24        self.receipt_expiration_time
25    }
26
27    pub fn get_receipt_level(&self) -> ReceiptLevel {
28        self.receipt_level
29    }
30}