termii_rust/common/token/
verify.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Deserialize, Serialize)]
4pub struct VerifyTokenRequest {
5    pub pin_id: String,
6    pub pin: String,
7    api_key: Option<String>,
8}
9
10impl VerifyTokenRequest {
11    pub fn new(pin_id: String, pin: String) -> VerifyTokenRequest {
12        VerifyTokenRequest {
13            pin_id,
14            pin,
15            api_key: None,
16        }
17    }
18
19    pub(crate) fn set_api_key(&mut self, api_key: &str) {
20        self.api_key = Some(api_key.to_string());
21    }
22}
23
24#[derive(Debug, Serialize, Deserialize)]
25pub struct VerifyTokenResponse {
26    #[serde(rename = "pinId")]
27    pub pin_id: String,
28    pub verified: bool,
29    pub msisdn: String,
30}