1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct Saml {
13 #[serde(rename = "status")]
14 pub status: Status,
15 #[serde(rename = "strategy")]
16 pub strategy: Strategy,
17 #[serde(rename = "external_verification_redirect_url", deserialize_with = "Option::deserialize")]
18 pub external_verification_redirect_url: Option<String>,
19 #[serde(
20 rename = "error",
21 default,
22 with = "::serde_with::rust::double_option",
23 skip_serializing_if = "Option::is_none"
24 )]
25 pub error: Option<Option<Box<crate::models::SamlError>>>,
26 #[serde(rename = "expire_at")]
27 pub expire_at: i64,
28 #[serde(
29 rename = "attempts",
30 default,
31 with = "::serde_with::rust::double_option",
32 skip_serializing_if = "Option::is_none"
33 )]
34 pub attempts: Option<Option<i64>>,
35}
36
37impl Saml {
38 pub fn new(status: Status, strategy: Strategy, external_verification_redirect_url: Option<String>, expire_at: i64) -> Saml {
39 Saml {
40 status,
41 strategy,
42 external_verification_redirect_url,
43 error: None,
44 expire_at,
45 attempts: None,
46 }
47 }
48}
49
50#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
52pub enum Status {
53 #[serde(rename = "unverified")]
54 Unverified,
55 #[serde(rename = "verified")]
56 Verified,
57 #[serde(rename = "failed")]
58 Failed,
59 #[serde(rename = "expired")]
60 Expired,
61 #[serde(rename = "transferable")]
62 Transferable,
63}
64
65impl Default for Status {
66 fn default() -> Status {
67 Self::Unverified
68 }
69}
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Strategy {
73 #[serde(rename = "saml")]
74 Saml,
75}
76
77impl Default for Strategy {
78 fn default() -> Strategy {
79 Self::Saml
80 }
81}