/*
* 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.162.2
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CommerceCatalogSync : A store kept in sync with an ad-platform product catalog.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommerceCatalogSync {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// The store SocialAccount id.
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "catalogPlatform", skip_serializing_if = "Option::is_none")]
pub catalog_platform: Option<CatalogPlatform>,
/// The Meta login account whose token writes to the catalog.
#[serde(rename = "catalogAccountId", skip_serializing_if = "Option::is_none")]
pub catalog_account_id: Option<String>,
#[serde(rename = "catalogId", skip_serializing_if = "Option::is_none")]
pub catalog_id: Option<String>,
#[serde(rename = "runStatus", skip_serializing_if = "Option::is_none")]
pub run_status: Option<RunStatus>,
#[serde(
rename = "lastRunStartedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_run_started_at: Option<Option<String>>,
#[serde(
rename = "lastRunFinishedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_run_finished_at: Option<Option<String>>,
/// Why the last run failed, or how many items Meta rejected in a run that otherwise succeeded. Null after a clean run.
#[serde(
rename = "lastError",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_error: Option<Option<String>>,
/// Catalog items (one per variant) Meta accepted in the last full run.
#[serde(rename = "itemsSent", skip_serializing_if = "Option::is_none")]
pub items_sent: Option<i32>,
/// Products the last full run could not list: not published to the online store or without an image.
#[serde(rename = "itemsSkipped", skip_serializing_if = "Option::is_none")]
pub items_skipped: Option<i32>,
/// Items the last full run removed because the store no longer has them.
#[serde(rename = "itemsDeleted", skip_serializing_if = "Option::is_none")]
pub items_deleted: Option<i32>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
}
impl CommerceCatalogSync {
/// A store kept in sync with an ad-platform product catalog.
pub fn new() -> CommerceCatalogSync {
CommerceCatalogSync {
id: None,
account_id: None,
catalog_platform: None,
catalog_account_id: None,
catalog_id: None,
run_status: None,
last_run_started_at: None,
last_run_finished_at: None,
last_error: None,
items_sent: None,
items_skipped: None,
items_deleted: None,
created_at: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CatalogPlatform {
#[serde(rename = "meta")]
Meta,
}
impl Default for CatalogPlatform {
fn default() -> CatalogPlatform {
Self::Meta
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RunStatus {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "running")]
Running,
#[serde(rename = "succeeded")]
Succeeded,
#[serde(rename = "failed")]
Failed,
}
impl Default for RunStatus {
fn default() -> RunStatus {
Self::Pending
}
}