Skip to main content

hanzo_client/models/
invoice.rs

1/*
2 * Hanzo Cloud API
3 *
4 * 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/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Invoice {
16    /// AmountDueCents is what remains collectible.
17    #[serde(rename = "amountDueCents", skip_serializing_if = "Option::is_none")]
18    pub amount_due_cents: Option<i32>,
19    /// AmountPaidCents is what has been collected so far.
20    #[serde(rename = "amountPaidCents", skip_serializing_if = "Option::is_none")]
21    pub amount_paid_cents: Option<i32>,
22    /// CreatedAt is when the draft was raised, RFC3339.
23    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
24    pub created_at: Option<String>,
25    /// Currency is the ISO 4217 code.
26    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
27    pub currency: Option<String>,
28    /// CustomerEmail is where it is sent.
29    #[serde(rename = "customerEmail", skip_serializing_if = "Option::is_none")]
30    pub customer_email: Option<String>,
31    /// ID is the invoice id — what the issue, collect and void ops address.
32    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
33    pub id: Option<String>,
34    /// Lines are the charges on the invoice.
35    #[serde(rename = "lines", skip_serializing_if = "Option::is_none")]
36    pub lines: Option<Vec<models::InvoiceLine>>,
37    /// Number is the human-facing invoice number, e.g. \"INV-0042\". A draft has none; issuing assigns it.
38    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
39    pub number: Option<String>,
40    /// PaymentRef is the processor reference for the collection, once paid.
41    #[serde(rename = "paymentRef", skip_serializing_if = "Option::is_none")]
42    pub payment_ref: Option<String>,
43    /// Status is draft, open, paid, void or uncollectible. A draft is not collectible; issuing moves it to open.
44    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
45    pub status: Option<String>,
46    /// SubtotalCents is the sum of the lines.
47    #[serde(rename = "subtotalCents", skip_serializing_if = "Option::is_none")]
48    pub subtotal_cents: Option<i32>,
49    /// UserID is the customer billed.
50    #[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
51    pub user_id: Option<String>,
52}
53
54impl Invoice {
55    pub fn new() -> Invoice {
56        Invoice {
57            amount_due_cents: None,
58            amount_paid_cents: None,
59            created_at: None,
60            currency: None,
61            customer_email: None,
62            id: None,
63            lines: None,
64            number: None,
65            payment_ref: None,
66            status: None,
67            subtotal_cents: None,
68            user_id: None,
69        }
70    }
71}
72