late 0.0.1341

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.523.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 TreasuryTransfer {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// 24-character payee id
    #[serde(rename = "payeeId", skip_serializing_if = "Option::is_none")]
    pub payee_id: Option<String>,
    /// The payee's name when Zernio knows it, for example a creator's display name in one of your creator campaigns; null otherwise
    #[serde(
        rename = "payeeName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub payee_name: Option<Option<String>>,
    #[serde(rename = "destinationType", skip_serializing_if = "Option::is_none")]
    pub destination_type: Option<DestinationType>,
    /// Amount the payee receives, in full
    #[serde(rename = "amountCents", skip_serializing_if = "Option::is_none")]
    pub amount_cents: Option<i32>,
    /// Zernio fee added on top, 4% with a 50 cent minimum
    #[serde(rename = "feeCents", skip_serializing_if = "Option::is_none")]
    pub fee_cents: Option<i32>,
    /// amountCents plus feeCents, both paid by the payout batch card charge
    #[serde(rename = "totalCents", skip_serializing_if = "Option::is_none")]
    pub total_cents: Option<i32>,
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    #[serde(rename = "reference", skip_serializing_if = "Option::is_none")]
    pub reference: Option<Box<models::TreasuryTransferReference>>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    #[serde(
        rename = "failureReason",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub failure_reason: Option<Option<String>>,
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
}

impl TreasuryTransfer {
    pub fn new() -> TreasuryTransfer {
        TreasuryTransfer {
            id: None,
            payee_id: None,
            payee_name: None,
            destination_type: None,
            amount_cents: None,
            fee_cents: None,
            total_cents: None,
            currency: None,
            reference: None,
            status: None,
            failure_reason: None,
            created_at: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DestinationType {
    #[serde(rename = "creator")]
    Creator,
    #[serde(rename = "ad_account")]
    AdAccount,
}

impl Default for DestinationType {
    fn default() -> DestinationType {
        Self::Creator
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "paid")]
    Paid,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "reversed")]
    Reversed,
}

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