Files
hyperswitch/crates/api_models/src/external_service_auth.rs
Uzair Khan 22633be55c feat(core): add hypersense integration api (#7218)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
2025-02-19 07:53:26 +00:00

36 lines
833 B
Rust

use common_utils::{id_type, pii};
use masking::Secret;
#[derive(Debug, serde::Serialize)]
pub struct ExternalTokenResponse {
pub token: Secret<String>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct ExternalVerifyTokenRequest {
pub token: Secret<String>,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct ExternalSignoutTokenRequest {
pub token: Secret<String>,
}
#[derive(serde::Serialize, Debug)]
#[serde(untagged)]
pub enum ExternalVerifyTokenResponse {
Hypersense {
user_id: String,
merchant_id: id_type::MerchantId,
name: Secret<String>,
email: pii::Email,
},
}
impl ExternalVerifyTokenResponse {
pub fn get_user_id(&self) -> &str {
match self {
Self::Hypersense { user_id, .. } => user_id,
}
}
}