late 0.0.1365

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.565.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AdsAlert {
    /// Stable for the same problem on the same entity. Pass it to POST /v1/ads/alerts/{alertId}/dismiss.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<Kind>,
    #[serde(rename = "severity", skip_serializing_if = "Option::is_none")]
    pub severity: Option<Severity>,
    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
    pub title: Option<String>,
    /// What happened, in plain words. For a rejection or delivery issue, the platform's own reason when it gave one.
    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
    #[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    #[serde(
        rename = "platformAdAccountId",
        skip_serializing_if = "Option::is_none"
    )]
    pub platform_ad_account_id: Option<String>,
    #[serde(rename = "entity", skip_serializing_if = "Option::is_none")]
    pub entity: Option<Box<models::AdsAlertEntity>>,
    /// The Zernio ad id when the entity is an ad, for GET /v1/ads/{adId}.
    #[serde(rename = "adId", skip_serializing_if = "Option::is_none")]
    pub ad_id: Option<String>,
    /// The Zernio ads connection, on connection_lost and sync_failing alerts.
    #[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
    pub account_id: Option<String>,
    #[serde(
        rename = "currency",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub currency: Option<Option<String>>,
    #[serde(rename = "detectedAt", skip_serializing_if = "Option::is_none")]
    pub detected_at: Option<String>,
    #[serde(rename = "fix", skip_serializing_if = "Option::is_none")]
    pub fix: Option<Box<models::AdsAlertFix>>,
    #[serde(rename = "dismissed", skip_serializing_if = "Option::is_none")]
    pub dismissed: Option<bool>,
}

impl AdsAlert {
    pub fn new() -> AdsAlert {
        AdsAlert {
            id: None,
            kind: None,
            severity: None,
            title: None,
            message: None,
            platform: None,
            platform_ad_account_id: None,
            entity: None,
            ad_id: None,
            account_id: None,
            currency: None,
            detected_at: None,
            fix: None,
            dismissed: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
    #[serde(rename = "ad_rejected")]
    AdRejected,
    #[serde(rename = "delivery_issue")]
    DeliveryIssue,
    #[serde(rename = "payment")]
    Payment,
    #[serde(rename = "budget_limited")]
    BudgetLimited,
    #[serde(rename = "spend_no_results")]
    SpendNoResults,
    #[serde(rename = "connection_lost")]
    ConnectionLost,
    #[serde(rename = "sync_failing")]
    SyncFailing,
}

impl Default for Kind {
    fn default() -> Kind {
        Self::AdRejected
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Severity {
    #[serde(rename = "error")]
    Error,
    #[serde(rename = "warning")]
    Warning,
    #[serde(rename = "info")]
    Info,
}

impl Default for Severity {
    fn default() -> Severity {
        Self::Error
    }
}