late 0.0.1369

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.5
 * 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 WebhookPayloadCampaignSampleSample {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "storeAccountId")]
    pub store_account_id: String,
    #[serde(rename = "productId")]
    pub product_id: String,
    #[serde(rename = "variantId", deserialize_with = "Option::deserialize")]
    pub variant_id: Option<String>,
    #[serde(rename = "productTitle")]
    pub product_title: String,
    #[serde(rename = "variantTitle", deserialize_with = "Option::deserialize")]
    pub variant_title: Option<String>,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "shippingAddress")]
    pub shipping_address: Box<models::CampaignSampleShippingAddress>,
    #[serde(rename = "note", deserialize_with = "Option::deserialize")]
    pub note: Option<String>,
    /// The 100%-off, single-use code, set from approval on.
    #[serde(rename = "discountCode", deserialize_with = "Option::deserialize")]
    pub discount_code: Option<String>,
    #[serde(rename = "trackingUrl", deserialize_with = "Option::deserialize")]
    pub tracking_url: Option<String>,
    #[serde(rename = "declineReason", deserialize_with = "Option::deserialize")]
    pub decline_reason: Option<String>,
}

impl WebhookPayloadCampaignSampleSample {
    pub fn new(
        id: String,
        store_account_id: String,
        product_id: String,
        variant_id: Option<String>,
        product_title: String,
        variant_title: Option<String>,
        status: Status,
        shipping_address: models::CampaignSampleShippingAddress,
        note: Option<String>,
        discount_code: Option<String>,
        tracking_url: Option<String>,
        decline_reason: Option<String>,
    ) -> WebhookPayloadCampaignSampleSample {
        WebhookPayloadCampaignSampleSample {
            id,
            store_account_id,
            product_id,
            variant_id,
            product_title,
            variant_title,
            status,
            shipping_address: Box::new(shipping_address),
            note,
            discount_code,
            tracking_url,
            decline_reason,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "approved")]
    Approved,
    #[serde(rename = "shipped")]
    Shipped,
    #[serde(rename = "declined")]
    Declined,
}

impl Default for Status {
    fn default() -> Status {
        Self::Pending
    }
}