late 0.0.1371

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.570.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CampaignSample : A free product sample a creator asked for.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CampaignSample {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "campaignId")]
    pub campaign_id: String,
    #[serde(rename = "participantId")]
    pub participant_id: String,
    #[serde(rename = "creator")]
    pub creator: Box<models::CreatorCampaignAdResultsSubmissionsInnerCreator>,
    /// The store the sample comes from.
    #[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 = "shippingAddress")]
    pub shipping_address: Box<models::CampaignSampleShippingAddress>,
    /// The creator's note.
    #[serde(rename = "note", deserialize_with = "Option::deserialize")]
    pub note: Option<String>,
    /// pending: waits for review. approved: a discount code was created. shipped: you recorded that you sent it. declined: final for this request.
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "declineReason", deserialize_with = "Option::deserialize")]
    pub decline_reason: Option<String>,
    /// The 100%-off, single-use code for the product, set on approval.
    #[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 = "approvedAt", deserialize_with = "Option::deserialize")]
    pub approved_at: Option<String>,
    #[serde(rename = "shippedAt", deserialize_with = "Option::deserialize")]
    pub shipped_at: Option<String>,
    #[serde(rename = "requestedAt")]
    pub requested_at: String,
    /// When a post is due: the approval plus the campaign's `sampleContentDueDays`. Null unless approved or shipped.
    #[serde(rename = "contentDueAt", deserialize_with = "Option::deserialize")]
    pub content_due_at: Option<String>,
    /// True past `contentDueAt` when the creator submitted no post since the approval.
    #[serde(rename = "contentOwed")]
    pub content_owed: bool,
}

impl CampaignSample {
    /// A free product sample a creator asked for.
    pub fn new(
        id: String,
        campaign_id: String,
        participant_id: String,
        creator: models::CreatorCampaignAdResultsSubmissionsInnerCreator,
        store_account_id: String,
        product_id: String,
        variant_id: Option<String>,
        product_title: String,
        variant_title: Option<String>,
        shipping_address: models::CampaignSampleShippingAddress,
        note: Option<String>,
        status: Status,
        decline_reason: Option<String>,
        discount_code: Option<String>,
        tracking_url: Option<String>,
        approved_at: Option<String>,
        shipped_at: Option<String>,
        requested_at: String,
        content_due_at: Option<String>,
        content_owed: bool,
    ) -> CampaignSample {
        CampaignSample {
            id,
            campaign_id,
            participant_id,
            creator: Box::new(creator),
            store_account_id,
            product_id,
            variant_id,
            product_title,
            variant_title,
            shipping_address: Box::new(shipping_address),
            note,
            status,
            decline_reason,
            discount_code,
            tracking_url,
            approved_at,
            shipped_at,
            requested_at,
            content_due_at,
            content_owed,
        }
    }
}
/// pending: waits for review. approved: a discount code was created. shipped: you recorded that you sent it. declined: final for this request.
#[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
    }
}