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", deserialize_with = "Option::deserialize")]
pub last_sync_at: Option<chrono::DateTime<chrono::FixedOffset>>,
#[serde(rename = "nextSyncAt", deserialize_with = "Option::deserialize")]
pub next_sync_at: Option<chrono::DateTime<chrono::FixedOffset>>,
#[serde(rename = "lastError", deserialize_with = "Option::deserialize")]
pub last_error: Option<String>,
#[serde(rename = "lastErrorAt", deserialize_with = "Option::deserialize")]
pub last_error_at: Option<chrono::DateTime<chrono::FixedOffset>>,
}
impl BlobStorageIntegrationStatusResponse {
pub fn new(
id: String,
project_id: String,
sync_status: models::BlobStorageSyncStatus,
enabled: bool,
last_sync_at: Option<chrono::DateTime<chrono::FixedOffset>>,
next_sync_at: Option<chrono::DateTime<chrono::FixedOffset>>,
last_error: Option<String>,
last_error_at: Option<chrono::DateTime<chrono::FixedOffset>>,
) -> BlobStorageIntegrationStatusResponse {
BlobStorageIntegrationStatusResponse {
id,
project_id,
sync_status,
enabled,
last_sync_at,
next_sync_at,
last_error,
last_error_at,
}
}
}