/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
 *
 * The version of the OpenAPI document: 1.0.4
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// UsageMeteringTax : Estimated tax on the window's net `totals.total`, computed with Stripe Tax against the billing address (the same engine the real invoice uses; invoices apply exclusive tax, so the card is charged total + tax). Null when the account has no billing address on file, the total is zero or negative, or the estimate failed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UsageMeteringTax {
    /// Estimated tax in USD
    #[serde(rename = "taxUsd", skip_serializing_if = "Option::is_none")]
    pub tax_usd: Option<f64>,
    /// Combined rate percentage
    #[serde(
        rename = "ratePercent",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub rate_percent: Option<Option<f64>>,
    /// Human jurisdiction label
    #[serde(
        rename = "jurisdictionLabel",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub jurisdiction_label: Option<Option<String>>,
    /// True for EU/UK B2B reverse charge (0 tax added by design).
    #[serde(rename = "reverseCharge", skip_serializing_if = "Option::is_none")]
    pub reverse_charge: Option<bool>,
}

impl UsageMeteringTax {
    /// Estimated tax on the window's net `totals.total`, computed with Stripe Tax against the billing address (the same engine the real invoice uses; invoices apply exclusive tax, so the card is charged total + tax). Null when the account has no billing address on file, the total is zero or negative, or the estimate failed.
    pub fn new() -> UsageMeteringTax {
        UsageMeteringTax {
            tax_usd: None,
            rate_percent: None,
            jurisdiction_label: None,
            reverse_charge: None,
        }
    }
}
