/*
* 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.522.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 a spent top-up, or when pay-per-use already in flight lands past zero. The next top-up covers it. New payout batches are refused while it is negative.
#[serde(rename = "availableCents", skip_serializing_if = "Option::is_none")]
pub available_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>>,
}
impl GetBalance200Response {
pub fn new() -> GetBalance200Response {
GetBalance200Response {
available_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,
}
}
}
///
#[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
}
}