late 0.0.1364

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.563.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 GetTopupReceipt200Response {
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "format")]
    pub format: Format,
    /// The invoice PDF; null when the payment made no invoice.
    #[serde(
        rename = "invoiceUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub invoice_url: Option<Option<String>>,
    /// Stripe's card receipt page for the charge.
    #[serde(
        rename = "receiptUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub receipt_url: Option<Option<String>>,
    /// As in the top-up list.
    #[serde(rename = "amountCents")]
    pub amount_cents: i32,
    /// Card fee paid, as in the top-up list.
    #[serde(rename = "feeCents", deserialize_with = "Option::deserialize")]
    pub fee_cents: Option<i32>,
    /// Tax charged on top of amountCents, as in the top-up list.
    #[serde(rename = "taxCents", skip_serializing_if = "Option::is_none")]
    pub tax_cents: Option<i32>,
    /// What the card was charged, tax included: the total on the receipt.
    #[serde(rename = "chargedCents")]
    pub charged_cents: i32,
}

impl GetTopupReceipt200Response {
    pub fn new(
        url: String,
        format: Format,
        amount_cents: i32,
        fee_cents: Option<i32>,
        charged_cents: i32,
    ) -> GetTopupReceipt200Response {
        GetTopupReceipt200Response {
            url,
            format,
            invoice_url: None,
            receipt_url: None,
            amount_cents,
            fee_cents,
            tax_cents: None,
            charged_cents,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Format {
    #[serde(rename = "pdf")]
    Pdf,
    #[serde(rename = "page")]
    Page,
}

impl Default for Format {
    fn default() -> Format {
        Self::Pdf
    }
}