/*
* 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.158.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// CommerceCollection : A product collection on a connected store.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommerceCollection {
/// Platform-native collection id.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "platform", skip_serializing_if = "Option::is_none")]
pub platform: Option<Platform>,
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(
rename = "handle",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub handle: Option<Option<String>>,
#[serde(
rename = "descriptionHtml",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub description_html: Option<Option<String>>,
#[serde(
rename = "image",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub image: Option<Option<Box<models::CommerceImage>>>,
#[serde(rename = "sortOrder", skip_serializing_if = "Option::is_none")]
pub sort_order: Option<SortOrder>,
/// Updates a few seconds after a membership change.
#[serde(
rename = "productCount",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub product_count: Option<Option<i32>>,
#[serde(rename = "seo", skip_serializing_if = "Option::is_none")]
pub seo: Option<Box<models::ProductSeo>>,
#[serde(
rename = "updatedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub updated_at: Option<Option<String>>,
#[serde(
rename = "platformData",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub platform_data: Option<Option<std::collections::HashMap<String, serde_json::Value>>>,
}
impl CommerceCollection {
/// A product collection on a connected store.
pub fn new() -> CommerceCollection {
CommerceCollection {
id: None,
account_id: None,
platform: None,
title: None,
handle: None,
description_html: None,
image: None,
sort_order: None,
product_count: None,
seo: None,
updated_at: None,
platform_data: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "shopify")]
Shopify,
#[serde(rename = "woocommerce")]
Woocommerce,
}
impl Default for Platform {
fn default() -> Platform {
Self::Shopify
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SortOrder {
#[serde(rename = "manual")]
Manual,
#[serde(rename = "best_selling")]
BestSelling,
#[serde(rename = "alpha_asc")]
AlphaAsc,
#[serde(rename = "alpha_desc")]
AlphaDesc,
#[serde(rename = "price_asc")]
PriceAsc,
#[serde(rename = "price_desc")]
PriceDesc,
#[serde(rename = "created")]
Created,
#[serde(rename = "created_desc")]
CreatedDesc,
#[serde(rename = "most_relevant")]
MostRelevant,
}
impl Default for SortOrder {
fn default() -> SortOrder {
Self::Manual
}
}