Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(api): don't serialize options #256

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions api/src/resources/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ use crate::{Email, ProjectName};

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct NewIntegration {
pub title: Title,
pub enabled: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<Title>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
pub configuration: Configuration,
}

Expand Down Expand Up @@ -66,6 +68,7 @@ pub enum DisabledReason {

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct Configuration {
#[serde(skip_serializing_if = "Option::is_none")]
pub connection: Option<Connection>,
pub mailboxes: Vec<Mailbox>,
}
Expand All @@ -74,7 +77,9 @@ pub struct Configuration {
pub struct Connection {
access: AccessType,
application: ApplicationType,
#[serde(skip_serializing_if = "Option::is_none")]
ews_endpoint: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
build_version: Option<String>,
}

Expand Down Expand Up @@ -103,15 +108,23 @@ pub struct CustomApplicationConfig {

#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
pub struct Mailbox {
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_reason: Option<DisabledReason>,
pub email: Email,
pub enabled: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub folder_allowlist: Option<Vec<Vec<String>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub folder_denylist: Option<Vec<Vec<String>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub participant_allowlist: Option<Vec<Email>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub participant_denylist: Option<Vec<Email>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub participant_domain_allowlist: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub participant_domain_denylist: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_timestamp: Option<DateTime<Utc>>,
pub bucket_specification: BucketSpecification,
}
Expand Down
Loading