/*
* 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.587.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 CommerceDraftOrder {
#[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 = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// The checkout link the buyer pays through.
#[serde(
rename = "invoiceUrl",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub invoice_url: Option<Option<String>>,
#[serde(
rename = "invoiceSentAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub invoice_sent_at: Option<Option<String>>,
#[serde(
rename = "email",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub email: Option<Option<String>>,
#[serde(
rename = "customerId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub customer_id: Option<Option<String>>,
#[serde(
rename = "note",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub note: Option<Option<String>>,
#[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
/// The currency the buyer pays in; every amount uses it.
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
#[serde(rename = "subtotal", skip_serializing_if = "Option::is_none")]
pub subtotal: Option<Box<models::CommerceMoney>>,
#[serde(rename = "discountTotal", skip_serializing_if = "Option::is_none")]
pub discount_total: Option<Box<models::CommerceMoney>>,
#[serde(rename = "shippingTotal", skip_serializing_if = "Option::is_none")]
pub shipping_total: Option<Box<models::CommerceMoney>>,
#[serde(rename = "taxTotal", skip_serializing_if = "Option::is_none")]
pub tax_total: Option<Box<models::CommerceMoney>>,
#[serde(rename = "total", skip_serializing_if = "Option::is_none")]
pub total: Option<Box<models::CommerceMoney>>,
#[serde(rename = "lineItems", skip_serializing_if = "Option::is_none")]
pub line_items: Option<Vec<models::CommerceDraftOrderLineItemsInner>>,
#[serde(
rename = "shippingAddress",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub shipping_address: Option<Option<Box<models::CommerceAddress>>>,
/// The order it became once completed.
#[serde(
rename = "orderId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub order_id: Option<Option<String>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
#[serde(
rename = "completedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub completed_at: Option<Option<String>>,
}
impl CommerceDraftOrder {
pub fn new() -> CommerceDraftOrder {
CommerceDraftOrder {
id: None,
account_id: None,
platform: None,
name: None,
status: None,
invoice_url: None,
invoice_sent_at: None,
email: None,
customer_id: None,
note: None,
tags: None,
currency: None,
subtotal: None,
discount_total: None,
shipping_total: None,
tax_total: None,
total: None,
line_items: None,
shipping_address: None,
order_id: None,
created_at: None,
updated_at: None,
completed_at: 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 Status {
#[serde(rename = "open")]
Open,
#[serde(rename = "invoice_sent")]
InvoiceSent,
#[serde(rename = "completed")]
Completed,
}
impl Default for Status {
fn default() -> Status {
Self::Open
}
}