use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[non_exhaustive]
pub struct CustomerPortalTokenResponse {
pub api_url: String,
pub expires_at: chrono::DateTime<chrono::Utc>,
pub portal_link: String,
pub portal_url: String,
pub token: String,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl CustomerPortalTokenResponse {
#[must_use]
pub fn new(
api_url: impl Into<String>,
expires_at: chrono::DateTime<chrono::Utc>,
portal_link: impl Into<String>,
portal_url: impl Into<String>,
token: impl Into<String>,
) -> Self {
Self {
api_url: api_url.into(),
expires_at,
portal_link: portal_link.into(),
portal_url: portal_url.into(),
token: token.into(),
extra: serde_json::Map::new(),
}
}
}