/*
* 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};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpsertCommerceMarketingActivityRequest {
#[serde(rename = "accountId")]
pub account_id: String,
#[serde(rename = "remoteId")]
pub remote_id: String,
#[serde(rename = "title")]
pub title: String,
#[serde(rename = "url")]
pub url: String,
#[serde(rename = "previewImageUrl", skip_serializing_if = "Option::is_none")]
pub preview_image_url: Option<String>,
#[serde(rename = "utm", skip_serializing_if = "Option::is_none")]
pub utm: Option<Box<models::UpsertCommerceMarketingActivityRequestUtm>>,
#[serde(rename = "tactic")]
pub tactic: Tactic,
#[serde(rename = "channel")]
pub channel: Channel,
#[serde(rename = "status")]
pub status: Status,
#[serde(rename = "budget", skip_serializing_if = "Option::is_none")]
pub budget: Option<Box<models::UpsertCommerceMarketingActivityRequestBudget>>,
/// Decimal in the store currency.
#[serde(rename = "adSpend", skip_serializing_if = "Option::is_none")]
pub ad_spend: Option<String>,
#[serde(rename = "startedAt", skip_serializing_if = "Option::is_none")]
pub started_at: Option<String>,
#[serde(rename = "endedAt", skip_serializing_if = "Option::is_none")]
pub ended_at: Option<String>,
}
impl UpsertCommerceMarketingActivityRequest {
pub fn new(
account_id: String,
remote_id: String,
title: String,
url: String,
tactic: Tactic,
channel: Channel,
status: Status,
) -> UpsertCommerceMarketingActivityRequest {
UpsertCommerceMarketingActivityRequest {
account_id,
remote_id,
title,
url,
preview_image_url: None,
utm: None,
tactic,
channel,
status,
budget: None,
ad_spend: None,
started_at: None,
ended_at: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Tactic {
#[serde(rename = "ad")]
Ad,
#[serde(rename = "post")]
Post,
#[serde(rename = "message")]
Message,
#[serde(rename = "newsletter")]
Newsletter,
#[serde(rename = "link")]
Link,
#[serde(rename = "affiliate")]
Affiliate,
#[serde(rename = "retargeting")]
Retargeting,
#[serde(rename = "loyalty")]
Loyalty,
#[serde(rename = "seo")]
Seo,
}
impl Default for Tactic {
fn default() -> Tactic {
Self::Ad
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Channel {
#[serde(rename = "social")]
Social,
#[serde(rename = "search")]
Search,
#[serde(rename = "display")]
Display,
#[serde(rename = "email")]
Email,
#[serde(rename = "referral")]
Referral,
}
impl Default for Channel {
fn default() -> Channel {
Self::Social
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "active")]
Active,
#[serde(rename = "inactive")]
Inactive,
#[serde(rename = "paused")]
Paused,
#[serde(rename = "scheduled")]
Scheduled,
}
impl Default for Status {
fn default() -> Status {
Self::Active
}
}