late 0.0.1365

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.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 GetBalance200Response {
    /// Your balance. It goes negative after a dispute or refund of funds already spent, or when pay-per-use already in flight lands past zero. The next funds you add cover it. New payout batches are refused while it is negative.
    #[serde(rename = "availableCents", skip_serializing_if = "Option::is_none")]
    pub available_cents: Option<i32>,
    /// True when the account pays pay-per-use from this prepaid balance (new signups). Absent otherwise: that pay-per-use is on the monthly invoice.
    #[serde(rename = "balanceBilling", skip_serializing_if = "Option::is_none")]
    pub balance_billing: Option<bool>,
    /// Balance billing only (absent otherwise). What pay-per-use can still spend: availableCents plus promoCents, minus usage not yet posted. At 0 or below, new pay-per-use answers 402 `insufficient_balance`.
    #[serde(rename = "spendableCents", skip_serializing_if = "Option::is_none")]
    pub spendable_cents: Option<i32>,
    /// Balance billing only (absent otherwise). Promotional and support credit Zernio added to your balance. Pay-per-use spends it before availableCents. It is never paid out to payees and is not part of availableCents.
    #[serde(rename = "promoCents", skip_serializing_if = "Option::is_none")]
    pub promo_cents: Option<i32>,
    /// Always 0. The balance no longer pays creators, so none of it is locked from them.
    #[serde(rename = "payoutLockedCents", skip_serializing_if = "Option::is_none")]
    pub payout_locked_cents: Option<i32>,
    /// Always empty. The balance no longer pays creators.
    #[serde(rename = "payoutLocks", skip_serializing_if = "Option::is_none")]
    pub payout_locks: Option<Vec<models::GetBalance200ResponsePayoutLocksInner>>,
    /// Card top-ups paid before 2026-10-29 that were held and are moving to availableCents (within the hour). Always 0 after that.
    #[serde(rename = "pendingCents", skip_serializing_if = "Option::is_none")]
    pub pending_cents: Option<i32>,
    /// The held card top-ups behind pendingCents.
    #[serde(rename = "pendingReleases", skip_serializing_if = "Option::is_none")]
    pub pending_releases: Option<Vec<models::GetBalance200ResponsePendingReleasesInner>>,
    /// Top-ups started but not paid yet.
    #[serde(rename = "pendingTopupCents", skip_serializing_if = "Option::is_none")]
    pub pending_topup_cents: Option<i32>,
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<Currency>,
    #[serde(rename = "recentTopups", skip_serializing_if = "Option::is_none")]
    pub recent_topups: Option<Vec<models::TreasuryTopup>>,
    /// Balance billing only (absent otherwise). The 10 newest auto top-ups paid from the account credit you held when you moved to the balance, newest first. Nothing was charged to your card and there is no invoice. The amount was added to promoCents with the credit's own expiry.
    #[serde(
        rename = "recentCreditRecharges",
        skip_serializing_if = "Option::is_none"
    )]
    pub recent_credit_recharges:
        Option<Vec<models::GetBalance200ResponseRecentCreditRechargesInner>>,
}

impl GetBalance200Response {
    pub fn new() -> GetBalance200Response {
        GetBalance200Response {
            available_cents: None,
            balance_billing: None,
            spendable_cents: None,
            promo_cents: None,
            payout_locked_cents: None,
            payout_locks: None,
            pending_cents: None,
            pending_releases: None,
            pending_topup_cents: None,
            currency: None,
            recent_topups: None,
            recent_credit_recharges: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Currency {
    #[serde(rename = "usd")]
    Usd,
}

impl Default for Currency {
    fn default() -> Currency {
        Self::Usd
    }
}