hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * Hanzo Cloud API
 *
 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Invoice {
    /// AmountDueCents is what remains collectible.
    #[serde(rename = "amountDueCents", skip_serializing_if = "Option::is_none")]
    pub amount_due_cents: Option<i32>,
    /// AmountPaidCents is what has been collected so far.
    #[serde(rename = "amountPaidCents", skip_serializing_if = "Option::is_none")]
    pub amount_paid_cents: Option<i32>,
    /// CreatedAt is when the draft was raised, RFC3339.
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Currency is the ISO 4217 code.
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// CustomerEmail is where it is sent.
    #[serde(rename = "customerEmail", skip_serializing_if = "Option::is_none")]
    pub customer_email: Option<String>,
    /// ID is the invoice id — what the issue, collect and void ops address.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Lines are the charges on the invoice.
    #[serde(rename = "lines", skip_serializing_if = "Option::is_none")]
    pub lines: Option<Vec<models::InvoiceLine>>,
    /// Number is the human-facing invoice number, e.g. \"INV-0042\". A draft has none; issuing assigns it.
    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
    pub number: Option<String>,
    /// PaymentRef is the processor reference for the collection, once paid.
    #[serde(rename = "paymentRef", skip_serializing_if = "Option::is_none")]
    pub payment_ref: Option<String>,
    /// Status is draft, open, paid, void or uncollectible. A draft is not collectible; issuing moves it to open.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// SubtotalCents is the sum of the lines.
    #[serde(rename = "subtotalCents", skip_serializing_if = "Option::is_none")]
    pub subtotal_cents: Option<i32>,
    /// UserID is the customer billed.
    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<String>,
}

impl Invoice {
    pub fn new() -> Invoice {
        Invoice {
            amount_due_cents: None,
            amount_paid_cents: None,
            created_at: None,
            currency: None,
            customer_email: None,
            id: None,
            lines: None,
            number: None,
            payment_ref: None,
            status: None,
            subtotal_cents: None,
            user_id: None,
        }
    }
}