use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct BlobStorageIntegrationStatusResponse {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "projectId")]
pub project_id: String,
#[serde(rename = "syncStatus")]
pub sync_status: models::BlobStorageSyncStatus,
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(
rename = "lastSyncAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_sync_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
#[serde(
rename = "nextSyncAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub next_sync_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
#[serde(
rename = "lastError",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_error: Option<Option<String>>,
#[serde(
rename = "lastErrorAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_error_at: Option<Option<chrono::DateTime<chrono::FixedOffset>>>,
}
impl BlobStorageIntegrationStatusResponse {
pub fn new(
id: String,
project_id: String,
sync_status: models::BlobStorageSyncStatus,
enabled: bool,
) -> BlobStorageIntegrationStatusResponse {
BlobStorageIntegrationStatusResponse {
id,
project_id,
sync_status,
enabled,
last_sync_at: None,
next_sync_at: None,
last_error: None,
last_error_at: None,
}
}
}