/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// WebhookPayloadAccountAdsInitialSyncCompletedSync : Summary of the initial ads sync backfill results.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookPayloadAccountAdsInitialSyncCompletedSync {
    /// Overall outcome of the initial sync.
    #[serde(rename = "status")]
    pub status: Status,
    /// Total number of ads discovered for backfill.
    #[serde(rename = "totalAds")]
    pub total_ads: i32,
    /// Number of ads successfully synced.
    #[serde(rename = "synced")]
    pub synced: i32,
    /// Number of ads that failed to sync.
    #[serde(rename = "failed")]
    pub failed: i32,
}

impl WebhookPayloadAccountAdsInitialSyncCompletedSync {
    /// Summary of the initial ads sync backfill results.
    pub fn new(
        status: Status,
        total_ads: i32,
        synced: i32,
        failed: i32,
    ) -> WebhookPayloadAccountAdsInitialSyncCompletedSync {
        WebhookPayloadAccountAdsInitialSyncCompletedSync {
            status,
            total_ads,
            synced,
            failed,
        }
    }
}
/// Overall outcome of the initial sync.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "success")]
    Success,
    #[serde(rename = "failure")]
    Failure,
}

impl Default for Status {
    fn default() -> Status {
        Self::Success
    }
}
