/*
* 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.432.1
* 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 PayoutBatchItem {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "participantId")]
pub participant_id: String,
#[serde(rename = "creator")]
pub creator: Box<models::PayoutBatchItemCreator>,
/// What the creator receives, in full.
#[serde(rename = "amountCents")]
pub amount_cents: i32,
/// Zernio fee on top: 4% with a 50 cent minimum.
#[serde(rename = "feeCents")]
pub fee_cents: i32,
/// amountCents plus feeCents.
#[serde(rename = "totalCents")]
pub total_cents: i32,
/// `skipped`: not paid because payout setup was not finished, or the card payment never completed; the amount is payable again. `failed`: Stripe refused the transfer; the amount is payable again.
#[serde(rename = "status")]
pub status: Status,
/// Why the item was not paid, in plain words.
#[serde(rename = "failureReason", deserialize_with = "Option::deserialize")]
pub failure_reason: Option<String>,
/// The treasury transfer that paid this item.
#[serde(rename = "transferId", deserialize_with = "Option::deserialize")]
pub transfer_id: Option<String>,
}
impl PayoutBatchItem {
pub fn new(
id: String,
participant_id: String,
creator: models::PayoutBatchItemCreator,
amount_cents: i32,
fee_cents: i32,
total_cents: i32,
status: Status,
failure_reason: Option<String>,
transfer_id: Option<String>,
) -> PayoutBatchItem {
PayoutBatchItem {
id,
participant_id,
creator: Box::new(creator),
amount_cents,
fee_cents,
total_cents,
status,
failure_reason,
transfer_id,
}
}
}
/// `skipped`: not paid because payout setup was not finished, or the card payment never completed; the amount is payable again. `failed`: Stripe refused the transfer; the amount is payable again.
#[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 = "skipped")]
Skipped,
}
impl Default for Status {
fn default() -> Status {
Self::Pending
}
}