azure_functions/send_grid/
sandbox_mode.rs

1use serde::{Deserialize, Serialize};
2
3/// Represents the ability to send a test email in a sandbox.
4///
5/// This setting allows you to send a test email to ensure that your request body is valid
6/// and formatted correctly.
7///
8/// For more information, please see the classroom documentation:
9/// https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/sandbox_mode.html
10#[derive(Debug, Default, Clone, Serialize, Deserialize)]
11pub struct SandboxMode {
12    /// The value indicating whether this setting is enabled.
13    pub enable: bool,
14}
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19    use serde_json::to_string;
20
21    #[test]
22    fn it_serializes_to_json() {
23        let json = to_string(&SandboxMode { enable: true }).unwrap();
24
25        assert_eq!(json, r#"{"enable":true}"#);
26    }
27}