use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(test, derive(Default))]
pub struct OAuth2Microsoft {
#[serde(rename = "$id")]
pub id: String,
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "applicationId")]
pub application_id: String,
#[serde(rename = "applicationSecret")]
pub application_secret: String,
#[serde(rename = "tenant")]
pub tenant: String,
}
impl OAuth2Microsoft {
pub fn id(&self) -> &String {
&self.id
}
pub fn enabled(&self) -> &bool {
&self.enabled
}
pub fn application_id(&self) -> &String {
&self.application_id
}
pub fn application_secret(&self) -> &String {
&self.application_secret
}
pub fn tenant(&self) -> &String {
&self.tenant
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_o_auth2_microsoft_creation() {
let _model = <OAuth2Microsoft as Default>::default();
let _ = _model.id();
let _ = _model.enabled();
let _ = _model.application_id();
let _ = _model.application_secret();
let _ = _model.tenant();
}
#[test]
fn test_o_auth2_microsoft_serialization() {
let model = <OAuth2Microsoft as Default>::default();
let json = serde_json::to_string(&model);
assert!(json.is_ok());
let deserialized: Result<OAuth2Microsoft, _> = serde_json::from_str(&json.unwrap());
assert!(deserialized.is_ok());
}
}